mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
* Rolled back Modifications to SearchDialog and PopupChatDialog.
- unable to get windows to compile with PopupChat on windows. - not happy with new SearchDialog. Not an improvement on old dialog + uses Qt4.4 * updated version numbers... * added a couple of windows scripts. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1200 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
705a51ac1f
commit
65e02ba4de
46
build_scripts/Windows/make_installer.sh
Executable file
46
build_scripts/Windows/make_installer.sh
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
###
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
QTGUI_DIR=../devel/retroshare-package-v0.4.09b/src/svn-retroshare/retroshare-gui/src
|
||||||
|
INST_DIR=../devel/retroshare-package-v0.4.09b/src/svn-retroshare/build_scripts/Windows/
|
||||||
|
EXEC=release/Retroshare.exe
|
||||||
|
|
||||||
|
BIN_DIR=./release
|
||||||
|
NSIS_EXE="/cygdrive/c/Program\ Files/NSIS/makensis.exe"
|
||||||
|
|
||||||
|
cp $QTGUI_DIR/$EXEC $BIN_DIR
|
||||||
|
echo cp $QTGUI_DIR/$EXEC $BIN_DIR
|
||||||
|
|
||||||
|
# copy skin files.
|
||||||
|
cp -r $QTGUI_DIR/qss/* $BIN_DIR/qss
|
||||||
|
echo 'cp -r $QTGUI_DIR/qss/* $BIN_DIR/qss'
|
||||||
|
#
|
||||||
|
cp -r $QTGUI_DIR/skin/* $BIN_DIR/skin
|
||||||
|
echo 'cp $QTGUI_DIR/skin/* $BIN_DIR/skin'
|
||||||
|
#
|
||||||
|
cp -r $QTGUI_DIR/emoticons/* $BIN_DIR/emoticons/
|
||||||
|
echo cp -r $QTGUI_DIR/emoticons/* $BIN_DIR/emoticons/
|
||||||
|
|
||||||
|
cp -r $QTGUI_DIR/style/* $BIN_DIR/style
|
||||||
|
echo 'cp -r $QTGUI_DIR/style/* $BIN_DIR/style'
|
||||||
|
|
||||||
|
./stripSVN.sh release
|
||||||
|
echo ./stripSVN.sh release
|
||||||
|
|
||||||
|
cp $INST_DIR/retroshare.nsi ./
|
||||||
|
echo cp $QTGUI_DIR/retroshare.nsi ./
|
||||||
|
|
||||||
|
cp $QTGUI_DIR/license/* ./license/
|
||||||
|
echo cp $QTGUI_DIR/license/* ./license/
|
||||||
|
|
||||||
|
cp $QTGUI_DIR/gui/images/splash.bmp ./gui/images/
|
||||||
|
echo cp $QTGUI_DIR/gui/images/splash.bmp ./gui/images/
|
||||||
|
|
||||||
|
#cp $QTGUI_DIR/release/changelog.txt ./release/changelog.txt
|
||||||
|
#echo cp $QTGUI_DIR/release/changelog.txt ./release/changelog.txt
|
||||||
|
|
||||||
|
"/cygdrive/c/Program Files/NSIS/makensis.exe" retroshare.nsi
|
||||||
|
#$NSIS_EXE retroshare.nsi
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
; Define your application name
|
; Define your application name
|
||||||
!define APPNAME "RetroShare"
|
!define APPNAME "RetroShare"
|
||||||
!define VERSION "0.4.12a"
|
!define VERSION "0.4.13a"
|
||||||
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
||||||
|
|
||||||
; Main Install settings
|
; Main Install settings
|
||||||
@ -40,7 +40,7 @@ SetCompressor LZMA
|
|||||||
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
|
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
|
||||||
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
|
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
|
||||||
|
|
||||||
; !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of RetroShare. \r\n\r\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without havinf to reboot your computer. \r\n\r\nIMPORTANT: Ensure that RetroShare is NOT RUNNING before continuing (you can exit from the taskbar menu), otherwise the installer cannot update the executables, and the installation will fail. \r\n\r\nClick Next to continue. "
|
; !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of RetroShare. \r\n\r\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer. \r\n\r\nIMPORTANT: Ensure that RetroShare is NOT RUNNING before continuing (you can exit from the taskbar menu), otherwise the installer cannot update the executables, and the installation will fail. \r\n\r\nClick Next to continue. "
|
||||||
|
|
||||||
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of RetroShare. \r\n\r\nIMPORTANT: Ensure that RetroShare is NOT RUNNING before continuing (you can exit from the taskbar menu), otherwise the installer cannot update the executables, and the installation will fail. \r\n\r\nClick Next to continue. "
|
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of RetroShare. \r\n\r\nIMPORTANT: Ensure that RetroShare is NOT RUNNING before continuing (you can exit from the taskbar menu), otherwise the installer cannot update the executables, and the installation will fail. \r\n\r\nClick Next to continue. "
|
||||||
|
|
||||||
@ -144,14 +144,21 @@ Section $(sec_main) sec_main
|
|||||||
; Set Section Files and Shortcuts
|
; Set Section Files and Shortcuts
|
||||||
SetOutPath "$INSTDIR\"
|
SetOutPath "$INSTDIR\"
|
||||||
File /r "release\RetroShare.exe"
|
File /r "release\RetroShare.exe"
|
||||||
File /r "D:\MinGW\bin\mingwm10.dll"
|
File /r "release\mingwm10.dll"
|
||||||
File /r "pthreadGCE2.dll"
|
File /r "release\changelog.txt"
|
||||||
File /r "D:\Qt\4.4.3\bin\QtCore4.dll"
|
|
||||||
File /r "D:\Qt\4.4.3\bin\QtGui4.dll"
|
; Two Comments here:
|
||||||
File /r "D:\Qt\4.4.3\bin\QtNetwork4.dll"
|
; 1) Please use relative directorys ( like I have changed it to)
|
||||||
File /r "D:\Qt\4.4.3\bin\QtXml4.dll"
|
; As it prevents use from needing to continually change the file.
|
||||||
File /r "D:\Qt\4.4.3\bin\QtScript4.dll"
|
; 2) Better To Build as standalone exec.
|
||||||
File /r "changelog.txt"
|
;
|
||||||
|
; File /r "D:\MinGW\bin\mingwm10.dll"
|
||||||
|
; File /r "pthreadGCE2.dll"
|
||||||
|
; File /r "D:\Qt\4.4.3\bin\QtCore4.dll"
|
||||||
|
; File /r "D:\Qt\4.4.3\bin\QtGui4.dll"
|
||||||
|
; File /r "D:\Qt\4.4.3\bin\QtNetwork4.dll"
|
||||||
|
; File /r "D:\Qt\4.4.3\bin\QtXml4.dll"
|
||||||
|
; File /r "D:\Qt\4.4.3\bin\QtScript4.dll"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -169,19 +176,19 @@ Section $(sec_data) sec_data
|
|||||||
; We're not ready for external skins...
|
; We're not ready for external skins...
|
||||||
; Set Section qss need to remove svn path
|
; Set Section qss need to remove svn path
|
||||||
SetOutPath "$INSTDIR\qss\"
|
SetOutPath "$INSTDIR\qss\"
|
||||||
File /r qss\*.*
|
File /r release\qss\*.*
|
||||||
|
|
||||||
; Set Section skin
|
; Set Section skin
|
||||||
; SetOutPath "$INSTDIR\skin\"
|
; SetOutPath "$INSTDIR\skin\"
|
||||||
; File /r release\skin\*.*
|
; File /r skin\*.*
|
||||||
|
|
||||||
; Add emoticons
|
; Add emoticons
|
||||||
SetOutPath "$INSTDIR\emoticons\"
|
SetOutPath "$INSTDIR\emoticons\"
|
||||||
File /r emoticons\*.*
|
File /r release\emoticons\*.*
|
||||||
|
|
||||||
; Add Chat Style
|
; Add Chat Style
|
||||||
SetOutPath "$INSTDIR\style\"
|
SetOutPath "$INSTDIR\style\"
|
||||||
File /r style\*.*
|
File /r release\style\*.*
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
12
build_scripts/Windows/stripSVN.sh
Executable file
12
build_scripts/Windows/stripSVN.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
if [ $# -le 0 ]
|
||||||
|
then
|
||||||
|
echo usage $0 directory
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo find $1 -name .svn
|
||||||
|
rm -vrf `find $1 -name .svn`
|
||||||
|
|
@ -315,8 +315,8 @@ void p3ChatService::setOwnAvatarJpegData(const unsigned char *data,int size)
|
|||||||
for(std::map<std::string,AvatarInfo *>::iterator it(_avatars.begin());it!=_avatars.end();++it)
|
for(std::map<std::string,AvatarInfo *>::iterator it(_avatars.begin());it!=_avatars.end();++it)
|
||||||
it->second->_own_is_new = true ;
|
it->second->_own_is_new = true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
IndicateConfigChanged();
|
IndicateConfigChanged();
|
||||||
|
std::cerr << "p3chatservice:setOwnAvatarJpegData() done." << std::endl ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3ChatService::receiveAvatarJpegData(RsChatMsgItem *ci)
|
void p3ChatService::receiveAvatarJpegData(RsChatMsgItem *ci)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CONFIG += qt gui uic qrc resources uitools pluginmgr debug
|
CONFIG += qt gui uic qrc resources uitools release # pluginmgr debug
|
||||||
QT += network xml script
|
QT += network xml script
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = RetroShare
|
TARGET = RetroShare
|
||||||
@ -53,10 +53,8 @@ win32-x-g++ {
|
|||||||
#################################### Windows #####################################
|
#################################### Windows #####################################
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
OBJECTS_DIR = temp/obj
|
|
||||||
RCC_DIR = temp/qrc
|
OBJECTS_DIR = temp/obj
|
||||||
UI_DIR = temp/ui
|
|
||||||
MOC_DIR = temp/moc
|
|
||||||
|
|
||||||
LIBS += -L"../../../../lib" -lretroshare -lssl -lcrypto -lpthreadGC2d -lminiupnpc -lz
|
LIBS += -L"../../../../lib" -lretroshare -lssl -lcrypto -lpthreadGC2d -lminiupnpc -lz
|
||||||
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32
|
||||||
@ -67,6 +65,7 @@ win32 {
|
|||||||
## ENABLE THIS OPTION for release Version.
|
## ENABLE THIS OPTION for release Version.
|
||||||
#DEFINES += RS_RELEASE_VERSION
|
#DEFINES += RS_RELEASE_VERSION
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##################################### MacOS ######################################
|
##################################### MacOS ######################################
|
||||||
|
@ -230,6 +230,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||||||
ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
|
ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
|
||||||
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Create the toolbar */
|
/* Create the toolbar */
|
||||||
ui.toolBar->addActions(grp->actions());
|
ui.toolBar->addActions(grp->actions());
|
||||||
ui.toolBar->addSeparator();
|
ui.toolBar->addSeparator();
|
||||||
|
@ -91,26 +91,23 @@ SearchDialog::SearchDialog(QWidget *parent)
|
|||||||
/* initialise the filetypes mapping */
|
/* initialise the filetypes mapping */
|
||||||
if (!SearchDialog::initialised)
|
if (!SearchDialog::initialised)
|
||||||
{
|
{
|
||||||
initialiseFileTypeMappings();
|
initialiseFileTypeMappings();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advanced search panel specifica */
|
/* Advanced search panel specifica */
|
||||||
RshareSettings rsharesettings;
|
RshareSettings rsharesettings;
|
||||||
QString key (UI_PREF_ADVANCED_SEARCH);
|
QString key (UI_PREF_ADVANCED_SEARCH);
|
||||||
bool useAdvanced = rsharesettings.value(key, QVariant(false)).toBool();
|
bool useAdvanced = rsharesettings.value(key, QVariant(false)).toBool();
|
||||||
/*if (useAdvanced)
|
if (useAdvanced)
|
||||||
{
|
{
|
||||||
ui.toggleAdvancedSearchBtn->setChecked(true);
|
ui.toggleAdvancedSearchBtn->setChecked(true);
|
||||||
ui.SimpleSearchPanel->hide();
|
ui.SimpleSearchPanel->hide();
|
||||||
} else {
|
} else {
|
||||||
ui.AdvancedSearchPanel->hide();
|
ui.AdvancedSearchPanel->hide();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
//connect(ui.toggleAdvancedSearchBtn, SIGNAL(toggled(bool)), this, SLOT(toggleAdvancedSearchDialog(bool)));
|
connect(ui.toggleAdvancedSearchBtn, SIGNAL(toggled(bool)), this, SLOT(toggleAdvancedSearchDialog(bool)));
|
||||||
//connect(ui.focusAdvSearchDialogBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
connect(ui.focusAdvSearchDialogBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
||||||
connect(ui.toggleAdvancedSearchBtn, SIGNAL(clicked()), this, SLOT(showAdvSearchDialog()));
|
|
||||||
connect(ui.cloaseallsearchresultsButton, SIGNAL(clicked()), this, SLOT(searchRemoveAll()));
|
|
||||||
connect(ui.resetButton, SIGNAL(clicked()), this, SLOT(clearKeyword()));
|
|
||||||
|
|
||||||
/* End Advanced Search Panel specifics */
|
/* End Advanced Search Panel specifics */
|
||||||
|
|
||||||
@ -126,8 +123,6 @@ SearchDialog::SearchDialog(QWidget *parent)
|
|||||||
|
|
||||||
connect ( ui.searchSummaryWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem * ) ),
|
connect ( ui.searchSummaryWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem * ) ),
|
||||||
this, SLOT( selectSearchResults( void ) ) );
|
this, SLOT( selectSearchResults( void ) ) );
|
||||||
|
|
||||||
connect( ui.searchResultWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(download()));
|
|
||||||
|
|
||||||
|
|
||||||
/* hide the Tree +/- */
|
/* hide the Tree +/- */
|
||||||
@ -149,8 +144,8 @@ SearchDialog::SearchDialog(QWidget *parent)
|
|||||||
_smheader->setResizeMode (2, QHeaderView::Interactive);
|
_smheader->setResizeMode (2, QHeaderView::Interactive);
|
||||||
|
|
||||||
_smheader->resizeSection ( 0, 80 );
|
_smheader->resizeSection ( 0, 80 );
|
||||||
_smheader->resizeSection ( 1, 60 );
|
_smheader->resizeSection ( 1, 75 );
|
||||||
_smheader->resizeSection ( 2, 30 );
|
_smheader->resizeSection ( 2, 75 );
|
||||||
|
|
||||||
ui.searchResultWidget->setColumnCount(6);
|
ui.searchResultWidget->setColumnCount(6);
|
||||||
_smheader = ui.searchResultWidget->header () ;
|
_smheader = ui.searchResultWidget->header () ;
|
||||||
@ -168,11 +163,11 @@ SearchDialog::SearchDialog(QWidget *parent)
|
|||||||
|
|
||||||
|
|
||||||
// set header text aligment
|
// set header text aligment
|
||||||
QTreeWidgetItem * headerItem = ui.searchResultWidget->headerItem();
|
QTreeWidgetItem * headerItem = ui.searchResultWidget->headerItem();
|
||||||
headerItem->setTextAlignment(2, Qt::AlignRight | Qt::AlignRight);
|
headerItem->setTextAlignment(2, Qt::AlignRight | Qt::AlignRight);
|
||||||
headerItem->setTextAlignment(3, Qt::AlignRight | Qt::AlignRight);
|
headerItem->setTextAlignment(3, Qt::AlignRight | Qt::AlignRight);
|
||||||
|
|
||||||
ui.searchResultWidget->sortItems(SR_NAME_COL, Qt::AscendingOrder);
|
ui.searchResultWidget->sortItems(SR_NAME_COL, Qt::AscendingOrder);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -226,9 +221,9 @@ void SearchDialog::searchtableWidgetCostumPopupMenu( QPoint point )
|
|||||||
|
|
||||||
contextMnu->clear();
|
contextMnu->clear();
|
||||||
contextMnu->addAction( downloadAct);
|
contextMnu->addAction( downloadAct);
|
||||||
//contextMnu->addSeparator();
|
contextMnu->addSeparator();
|
||||||
//contextMnu->addAction( broadcastonchannelAct);
|
contextMnu->addAction( broadcastonchannelAct);
|
||||||
//contextMnu->addAction( recommendtofriendsAct);
|
contextMnu->addAction( recommendtofriendsAct);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point,
|
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point,
|
||||||
@ -367,13 +362,6 @@ void SearchDialog::searchRemoveAll()
|
|||||||
nextSearchId = 1;
|
nextSearchId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** clear keywords **/
|
|
||||||
void SearchDialog::clearKeyword()
|
|
||||||
{
|
|
||||||
ui.lineEdit->clear();
|
|
||||||
ui.FileTypeComboBox->setCurrentIndex(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* *****************************************************************
|
/* *****************************************************************
|
||||||
Advanced search implementation
|
Advanced search implementation
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
@ -66,9 +66,6 @@ private slots:
|
|||||||
void searchRemoveAll();
|
void searchRemoveAll();
|
||||||
|
|
||||||
void searchKeywords();
|
void searchKeywords();
|
||||||
|
|
||||||
void clearKeyword();
|
|
||||||
|
|
||||||
|
|
||||||
/** management of the adv search dialog object when switching search modes */
|
/** management of the adv search dialog object when switching search modes */
|
||||||
void toggleAdvancedSearchDialog(bool);
|
void toggleAdvancedSearchDialog(bool);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -33,13 +33,9 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QHashIterator>
|
#include <QHashIterator>
|
||||||
#include <QDesktopServices>
|
|
||||||
|
|
||||||
#include "rsiface/rspeers.h"
|
#include "rsiface/rspeers.h"
|
||||||
#include "rsiface/rsmsgs.h"
|
#include "rsiface/rsmsgs.h"
|
||||||
#include "rsiface/rsfiles.h"
|
|
||||||
|
|
||||||
#include "gui/feeds/SubFileItem.h"
|
|
||||||
|
|
||||||
#define appDir QApplication::applicationDirPath()
|
#define appDir QApplication::applicationDirPath()
|
||||||
|
|
||||||
@ -80,8 +76,7 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
|||||||
connect(ui.chattextEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
|
connect(ui.chattextEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
|
||||||
|
|
||||||
connect(ui.sendButton, SIGNAL(clicked( ) ), this, SLOT(sendChat( ) ));
|
connect(ui.sendButton, SIGNAL(clicked( ) ), this, SLOT(sendChat( ) ));
|
||||||
connect(ui.addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
|
||||||
|
|
||||||
connect(ui.textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
connect(ui.textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||||
connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||||
connect(ui.textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
connect(ui.textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||||
@ -90,13 +85,10 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
|||||||
connect(ui.emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
|
connect(ui.emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
|
||||||
connect(ui.styleButton, SIGNAL(clicked()), SLOT(changeStyle()));
|
connect(ui.styleButton, SIGNAL(clicked()), SLOT(changeStyle()));
|
||||||
|
|
||||||
connect(ui.textBrowser, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
|
||||||
|
|
||||||
// Create the status bar
|
// Create the status bar
|
||||||
resetStatusBar() ;
|
resetStatusBar() ;
|
||||||
|
|
||||||
ui.textBrowser->setOpenExternalLinks ( false );
|
ui.textBrowser->setOpenExternalLinks ( false );
|
||||||
ui.textBrowser->setOpenLinks ( false );
|
|
||||||
|
|
||||||
QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ;
|
QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ;
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
@ -139,7 +131,7 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
|||||||
|
|
||||||
void PopupChatDialog::resetStatusBar()
|
void PopupChatDialog::resetStatusBar()
|
||||||
{
|
{
|
||||||
statusBar()->showMessage(tr("Chatting with ") + QString::fromStdString(dialogName) + " (" +QString::fromStdString(dialogId)+ ")") ;
|
statusBar()->showMessage(QString("Chatting with ") + QString::fromStdString(dialogName) + " (" +QString::fromStdString(dialogId)+ ")") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::updateStatusTyping()
|
void PopupChatDialog::updateStatusTyping()
|
||||||
@ -251,19 +243,6 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci)
|
|||||||
QString name = QString::fromStdString(ci ->name);
|
QString name = QString::fromStdString(ci ->name);
|
||||||
QString message = QString::fromStdWString(ci -> msg);
|
QString message = QString::fromStdWString(ci -> msg);
|
||||||
|
|
||||||
//replace url by a link
|
|
||||||
//first, avoid DTD link taht stands at the beginning of the string
|
|
||||||
QString messageSubString = message.mid(110, -1);
|
|
||||||
//replace http:// and www. with <a href> links
|
|
||||||
messageSubString.replace(QRegExp("(http://[^ <]*)|(www\\.[^ <]*)"), "<a href=\"\\1\\2\">\\1\\2</a>");
|
|
||||||
//rebuild the full message
|
|
||||||
message = message.left(109) + messageSubString;
|
|
||||||
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cout << "PopupChatDialog:addChatMsg message : " << message.toStdString() << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*QHashIterator<QString, QString> i(smileys);
|
/*QHashIterator<QString, QString> i(smileys);
|
||||||
while(i.hasNext())
|
while(i.hasNext())
|
||||||
{
|
{
|
||||||
@ -315,7 +294,7 @@ void PopupChatDialog::checkChat()
|
|||||||
|
|
||||||
void PopupChatDialog::sendChat()
|
void PopupChatDialog::sendChat()
|
||||||
{
|
{
|
||||||
QTextEdit *chatWidget = ui.chattextEdit;
|
QTextEdit *chatWidget = ui.chattextEdit;
|
||||||
|
|
||||||
ChatInfo ci;
|
ChatInfo ci;
|
||||||
|
|
||||||
@ -699,123 +678,3 @@ void PopupChatDialog::getAvatar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::addExtraFile()
|
|
||||||
{
|
|
||||||
// select a file
|
|
||||||
QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
|
|
||||||
QFileDialog::DontResolveSymlinks);
|
|
||||||
std::string filePath = qfile.toStdString();
|
|
||||||
if (filePath != "")
|
|
||||||
{
|
|
||||||
/* add a SubFileItem to the attachment section */
|
|
||||||
std::cerr << "PopupChatDialog::addExtraFile() hashing file.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* add widget in for new destination */
|
|
||||||
SubFileItem *file = new SubFileItem(filePath);
|
|
||||||
//file->
|
|
||||||
|
|
||||||
ui.vboxLayout->addWidget(file, 1, 0);
|
|
||||||
|
|
||||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
|
|
||||||
if (file->getState() == SFI_STATE_LOCAL) {
|
|
||||||
fileHashingFinished(file);
|
|
||||||
} else {
|
|
||||||
QObject::connect(file,SIGNAL(fileFinished(SubFileItem *)), SLOT(fileHashingFinished(SubFileItem *))) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupChatDialog::fileHashingFinished(SubFileItem* file) {
|
|
||||||
std::cerr << "PopupChatDialog::fileHashingFinished() started.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
ChatInfo ci;
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
rsiface->lockData(); /* Lock Interface */
|
|
||||||
const RsConfig &conf = rsiface->getConfig();
|
|
||||||
|
|
||||||
ci.rsid = conf.ownId;
|
|
||||||
ci.name = conf.ownName;
|
|
||||||
|
|
||||||
rsiface->unlockData(); /* Unlock Interface */
|
|
||||||
}
|
|
||||||
|
|
||||||
//convert fileSize from uint_64 to string for html link
|
|
||||||
char fileSizeChar [100];
|
|
||||||
sprintf(fileSizeChar, "%lld", file->FileSize());
|
|
||||||
std::string fileSize = *(&fileSizeChar);
|
|
||||||
|
|
||||||
std::string mesgString = "<a href='file:?fileHash=" + (file->FileHash()) + "&fileName=" + (file->FileName()) + "&fileSize=" + fileSize + "'>" + (file->FileName()) + "</a>";
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "PopupChatDialog::anchorClicked mesgString : " << mesgString << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char * messageString = mesgString.c_str ();
|
|
||||||
|
|
||||||
//convert char massageString to w_char
|
|
||||||
wchar_t* message;
|
|
||||||
int requiredSize = mbstowcs(NULL, messageString, 0); // C4996
|
|
||||||
/* Add one to leave room for the NULL terminator */
|
|
||||||
message = (wchar_t *)malloc( (requiredSize + 1) * sizeof( wchar_t ));
|
|
||||||
if (! message)
|
|
||||||
{
|
|
||||||
std::cerr << ("Memory allocation failure.\n");
|
|
||||||
}
|
|
||||||
int size = mbstowcs( message, messageString, requiredSize + 1); // C4996
|
|
||||||
if (size == (size_t) (-1))
|
|
||||||
{
|
|
||||||
printf("Couldn't convert string--invalid multibyte character.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
ci.msg = message;
|
|
||||||
ci.chatflags = RS_CHAT_PRIVATE;
|
|
||||||
|
|
||||||
addChatMsg(&ci);
|
|
||||||
|
|
||||||
/* put proper destination */
|
|
||||||
ci.rsid = dialogId;
|
|
||||||
ci.name = dialogName;
|
|
||||||
|
|
||||||
rsMsgs -> ChatSend(ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupChatDialog::anchorClicked (const QUrl& link ) {
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "PopupChatDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
|
|
||||||
#endif
|
|
||||||
if (link.scheme() == "file") {
|
|
||||||
std::string fileName = link.queryItemValue(QString("fileName")).toStdString();
|
|
||||||
std::string fileHash = link.queryItemValue(QString("fileHash")).toStdString();
|
|
||||||
uint32_t fileSize = link.queryItemValue(QString("fileSize")).toInt();
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "PopupChatDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize;
|
|
||||||
std::cerr << ". source id : " << dialogId << std::endl;
|
|
||||||
#endif
|
|
||||||
if (fileName != "" &&
|
|
||||||
fileHash != "") {
|
|
||||||
std::list<std::string> srcIds;
|
|
||||||
srcIds.push_front(dialogId);
|
|
||||||
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
|
|
||||||
|
|
||||||
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
|
||||||
mb.setButtonText( QMessageBox::Ok, "OK" );
|
|
||||||
mb.exec();
|
|
||||||
} else {
|
|
||||||
QMessageBox mb(tr("File Request Error"), tr("The file link is malformed."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
|
||||||
mb.setButtonText( QMessageBox::Ok, "OK" );
|
|
||||||
mb.exec();
|
|
||||||
}
|
|
||||||
} else if (link.scheme() == "http") {
|
|
||||||
QDesktopServices::openUrl(link);
|
|
||||||
} else if (link.scheme() == "") {
|
|
||||||
//it's probably a web adress, let's add http:// at the beginning of the link
|
|
||||||
QString newAddress = link.toString();
|
|
||||||
newAddress.prepend("http://");
|
|
||||||
QDesktopServices::openUrl(QUrl(newAddress));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <gui/Preferences/rsharesettings.h>
|
#include <gui/Preferences/rsharesettings.h>
|
||||||
|
|
||||||
#include "rsiface/rsiface.h"
|
#include "rsiface/rsiface.h"
|
||||||
#include "gui/feeds/SubFileItem.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -75,19 +74,15 @@ public slots:
|
|||||||
void addSmiley();
|
void addSmiley();
|
||||||
|
|
||||||
void changeStyle();
|
void changeStyle();
|
||||||
void fileHashingFinished(SubFileItem* file);
|
|
||||||
|
|
||||||
void resetStatusBar() ;
|
void resetStatusBar() ;
|
||||||
void updateStatusTyping() ;
|
void updateStatusTyping() ;
|
||||||
void updateStatusString(const QString&) ;
|
void updateStatusString(const QString&) ;
|
||||||
void anchorClicked (const QUrl &);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addExtraFile();
|
|
||||||
void showAvatarFrame(bool show);
|
void showAvatarFrame(bool show);
|
||||||
|
|
||||||
void setColor();
|
void setColor();
|
||||||
@ -100,6 +95,7 @@ private slots:
|
|||||||
void getAvatar();
|
void getAvatar();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void colorChanged(const QColor &c);
|
void colorChanged(const QColor &c);
|
||||||
@ -124,9 +120,10 @@ private:
|
|||||||
QStringList history;
|
QStringList history;
|
||||||
QString wholeChat;
|
QString wholeChat;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PopupChatDialog ui;
|
Ui::PopupChatDialog ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>484</width>
|
<width>484</width>
|
||||||
<height>439</height>
|
<height>437</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -446,7 +446,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" >
|
<item row="3" column="0" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="leftMargin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -456,30 +456,23 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="bottomMargin" >
|
<property name="bottomMargin" >
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<property name="horizontalSpacing" >
|
||||||
<widget class="QPushButton" name="addFileButton" >
|
<number>6</number>
|
||||||
<property name="text" >
|
</property>
|
||||||
<string/>
|
<item row="0" column="0" >
|
||||||
</property>
|
|
||||||
<property name="icon" >
|
|
||||||
<iconset resource="../images.qrc" >:/images/add-share24.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" >
|
||||||
<size>
|
<size>
|
||||||
<width>331</width>
|
<width>351</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1" >
|
||||||
<widget class="QPushButton" name="sendButton" >
|
<widget class="QPushButton" name="sendButton" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Send</string>
|
<string>Send</string>
|
||||||
@ -488,9 +481,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" >
|
|
||||||
<layout class="QVBoxLayout" />
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar" />
|
<widget class="QStatusBar" name="statusbar" />
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
//#define USE_SVN_VERSIONS 1
|
//#define USE_SVN_VERSIONS 1
|
||||||
|
|
||||||
#define VERSION "0.4.12d"
|
#define VERSION "0.4.13a"
|
||||||
|
|
||||||
#if USE_SVN_VERSIONS
|
#if USE_SVN_VERSIONS
|
||||||
#include "svn_revision.h"
|
#include "svn_revision.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user