From ef57cd44b37772cd6c1696f8248a4e5dcaaa9420 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 10 Dec 2011 23:41:58 +0000 Subject: [PATCH] Added a new menu item "Search again" to the SearchDialog. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4724 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/SearchDialog.cpp | 34 ++++++++++++++++++++--- retroshare-gui/src/gui/SearchDialog.h | 3 +- retroshare-gui/src/lang/retroshare_de.qm | Bin 329546 -> 329625 bytes retroshare-gui/src/lang/retroshare_de.ts | 33 ++++++++++++---------- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/retroshare-gui/src/gui/SearchDialog.cpp b/retroshare-gui/src/gui/SearchDialog.cpp index 579957a9d..b5945b15a 100644 --- a/retroshare-gui/src/gui/SearchDialog.cpp +++ b/retroshare-gui/src/gui/SearchDialog.cpp @@ -62,6 +62,9 @@ #define SS_TEXT_COL 0 #define SS_COUNT_COL 1 #define SS_SEARCH_ID_COL 2 +#define SS_DATA_COL SS_TEXT_COL + +#define ROLE_ADVANCED Qt::UserRole #define IMAGE_COPYLINK ":/images/copyrslink.png" @@ -428,10 +431,18 @@ void SearchDialog::searchtableWidget2CostumPopupMenu( QPoint /*point*/ ) QMenu contextMnu(this); + QTreeWidgetItem* ci = ui.searchSummaryWidget->currentItem(); + QAction* action = contextMnu.addAction(tr("Search again"), this, SLOT(searchAgain())); + if (!ci || ci->data(SS_DATA_COL, ROLE_ADVANCED).toBool()) { + action->setDisabled(true); + } contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove"), this, SLOT(searchRemove())); contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove All"), this, SLOT(searchRemoveAll())); contextMnu.addSeparator(); - contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copySearchLink())); + action = contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copySearchLink())); + if (!ci || ci->data(SS_DATA_COL, ROLE_ADVANCED).toBool()) { + action->setDisabled(true); + } contextMnu.exec(QCursor::pos()); } @@ -554,7 +565,7 @@ void SearchDialog::showAdvSearchDialog(bool show) // Creates a new entry in the search summary, not to leave it blank whatever happens. // -void SearchDialog::initSearchResult(const std::string& txt,qulonglong searchId) +void SearchDialog::initSearchResult(const std::string& txt,qulonglong searchId, bool advanced) { QString sid_hexa = QString::number(searchId,16) ; @@ -563,6 +574,8 @@ void SearchDialog::initSearchResult(const std::string& txt,qulonglong searchId) item2->setText(SS_COUNT_COL, QString::number(0)); item2->setText(SS_SEARCH_ID_COL, sid_hexa); + item2->setData(SS_DATA_COL, ROLE_ADVANCED, advanced); + ui.searchSummaryWidget->addTopLevelItem(item2); ui.searchSummaryWidget->setCurrentItem(item2); } @@ -582,7 +595,7 @@ void SearchDialog::advancedSearch(Expression* expression) // This will act before turtle results come to the interface, thanks to the signals scheduling policy. // The text "bool exp" should be replaced by an appropriate text describing the actual search. - initSearchResult(std::string("bool exp"),req_id) ; + initSearchResult(std::string("bool exp"),req_id, true) ; rsFiles -> SearchBoolExp(expression, results, DIR_FLAGS_REMOTE | DIR_FLAGS_NETWORK_WIDE | DIR_FLAGS_BROWSABLE); @@ -601,6 +614,19 @@ void SearchDialog::searchKeywords() searchKeywords(ui.lineEdit->text()); } +void SearchDialog::searchAgain() +{ + /* get the current search text from the summary window */ + QTreeWidgetItem* ci = ui.searchSummaryWidget->currentItem(); + if (!ci || ci->data(SS_DATA_COL, ROLE_ADVANCED).toBool()) + return; + + /* get the search text */ + QString txt = ci->text(SS_TEXT_COL); + searchRemove(); + searchKeywords(txt); +} + void SearchDialog::searchKeywords(const QString& keywords) { std::string txt = keywords.toUtf8().constData(); @@ -637,7 +663,7 @@ void SearchDialog::searchKeywords(const QString& keywords) else req_id = ((((uint32_t)rand()) << 16)^0x1e2fd5e4) + (((uint32_t)rand())^0x1b19acfe) ; // generate a random 32 bits request id - initSearchResult(txt,req_id) ; // this will act before turtle results come to the interface, thanks to the signals scheduling policy. + initSearchResult(txt,req_id, false) ; // this will act before turtle results come to the interface, thanks to the signals scheduling policy. if(ui._friendListsearch_SB->isChecked() || ui._ownFiles_CB->isChecked()) { diff --git a/retroshare-gui/src/gui/SearchDialog.h b/retroshare-gui/src/gui/SearchDialog.h index 6e42acb0b..8daa984c7 100644 --- a/retroshare-gui/src/gui/SearchDialog.h +++ b/retroshare-gui/src/gui/SearchDialog.h @@ -64,6 +64,7 @@ private slots: void copyResultLink(); void copySearchLink(); + void searchAgain(); void searchRemove(); void searchRemoveAll(); void searchKeywords(); @@ -96,7 +97,7 @@ private slots: private: /** render the results to the tree widget display */ - void initSearchResult(const std::string& txt,qulonglong searchId) ; + void initSearchResult(const std::string& txt,qulonglong searchId, bool advanced) ; void resultsToTree(std::string,qulonglong searchId, const std::list&); void insertFile(const std::string& txt,qulonglong searchId, const FileDetail& file, int searchType = ANONYMOUS_SEARCH) ; void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item); diff --git a/retroshare-gui/src/lang/retroshare_de.qm b/retroshare-gui/src/lang/retroshare_de.qm index fe2c2fb48a65ef9c6f1d1ec4ebed3556ff3be67c..75d554c8c2b5c63a6e94c92372e86214e9bb5e0b 100644 GIT binary patch delta 4233 zcmXY!d0bOR_r}l6olABwKuCi^ScC{70R$o<1dv56h#R6<#0?cIpy1NlsSvTLeI3`2WeWEN^Z6f3x!BI?fbeC#Q1m1se9dmDw*jPXRk9U@9??IXH`GNgSv<_ACIXoxg?bWIUF$c;{R3z}|!aIqV7SA1@#qH(1E>MQmeb_B&J{ z4&hHNaRPBv39uazSS}g@4}+M`Hz{nrg{<_TmAjsSIDG{#-Z~IV8Bon53)#tY*eYse zl_0MDw4R%&vN4mFm~4}#z60V$5!l|dRvsRYwKk!?OQLzLvH+qlSSU1I1o7NnfRceA zK3W89$=6`hHimCaENUbv1Tjl8hooYQ#6&Kli?l-b0{miIK)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oXp*}-q96=znpMJZ#@aX%HBHrblZDd zHUTa9+4jlphx~Ef!lvF^?I+uLOdJ6)^paiovub{L^02f|2wiju8~S)_jdmFi_5sa% zZa3z_34m8O?XrjSk?Qy-6r*;_GVJhB5g**mSQiyZZyiT-ltxx;x3%?WJ|-E^rEer% z`WvS8{gM;2`?}I8FR`Mpx7Rwmcb;27Fe&ZcT@L0$XtLe=V!p@Wk#-;D$p8zx@Zvo^ r0(H?&+H%d>2#!(2o30z)+6KeW~mEnNC{Z9gYA=+*xL&S^iU diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index fc0589bbe..5508d8078 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -9829,7 +9829,7 @@ Lockdatei: Der Empfänger der Nachricht ist unbekannt. - + Add file Datei hinzufügen @@ -10590,17 +10590,17 @@ p, li { white-space: pre-wrap; } RsCollectionFile - + Cannot open file %1 Kann Datei %1 nicht öffnen - + Error parsing xml file Fehler beim Parsen des XML - + Open collection file Öffne Kollektion @@ -10749,7 +10749,7 @@ p, li { white-space: pre-wrap; } - + Download Herunterladen @@ -10760,17 +10760,22 @@ p, li { white-space: pre-wrap; } - + Copy RetroShare Link Kopiere RetroShare Link - + Send RetroShare Link Sende RetroShare Link - + + Search again + Erneut suchen + + + Remove Entfernen @@ -10780,7 +10785,7 @@ p, li { white-space: pre-wrap; } Alle entfernen - + Folder Ordner @@ -10841,7 +10846,7 @@ p, li { white-space: pre-wrap; } Such ID - + Download Notice Download @@ -12707,12 +12712,12 @@ p, li { white-space: pre-wrap; } Du kannst diesen Text kopieren und an deinen Freund per Email senden oder über einen anderen Weg zukommen lassen - + RetroShare - + Text certificate Text-Zertifikat @@ -12737,12 +12742,12 @@ p, li { white-space: pre-wrap; } Das Zertifikat konnte nicht geladen werden - + Your Cert is copied to Clipboard, paste and send it to your friend via email or some other way Dein Zertiifkat ist in in die Zwischenablage kopiert worden - + RetroShare Invite RetroShare Einladung