mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 09:26:18 -05:00
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
This commit is contained in:
parent
030874ca41
commit
ef57cd44b3
@ -62,6 +62,9 @@
|
|||||||
#define SS_TEXT_COL 0
|
#define SS_TEXT_COL 0
|
||||||
#define SS_COUNT_COL 1
|
#define SS_COUNT_COL 1
|
||||||
#define SS_SEARCH_ID_COL 2
|
#define SS_SEARCH_ID_COL 2
|
||||||
|
#define SS_DATA_COL SS_TEXT_COL
|
||||||
|
|
||||||
|
#define ROLE_ADVANCED Qt::UserRole
|
||||||
|
|
||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||||
|
|
||||||
@ -428,10 +431,18 @@ void SearchDialog::searchtableWidget2CostumPopupMenu( QPoint /*point*/ )
|
|||||||
|
|
||||||
QMenu contextMnu(this);
|
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"), this, SLOT(searchRemove()));
|
||||||
contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove All"), this, SLOT(searchRemoveAll()));
|
contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove All"), this, SLOT(searchRemoveAll()));
|
||||||
contextMnu.addSeparator();
|
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());
|
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.
|
// 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) ;
|
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_COUNT_COL, QString::number(0));
|
||||||
item2->setText(SS_SEARCH_ID_COL, sid_hexa);
|
item2->setText(SS_SEARCH_ID_COL, sid_hexa);
|
||||||
|
|
||||||
|
item2->setData(SS_DATA_COL, ROLE_ADVANCED, advanced);
|
||||||
|
|
||||||
ui.searchSummaryWidget->addTopLevelItem(item2);
|
ui.searchSummaryWidget->addTopLevelItem(item2);
|
||||||
ui.searchSummaryWidget->setCurrentItem(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.
|
// 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.
|
// 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);
|
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());
|
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)
|
void SearchDialog::searchKeywords(const QString& keywords)
|
||||||
{
|
{
|
||||||
std::string txt = keywords.toUtf8().constData();
|
std::string txt = keywords.toUtf8().constData();
|
||||||
@ -637,7 +663,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
|
|||||||
else
|
else
|
||||||
req_id = ((((uint32_t)rand()) << 16)^0x1e2fd5e4) + (((uint32_t)rand())^0x1b19acfe) ; // generate a random 32 bits request id
|
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())
|
if(ui._friendListsearch_SB->isChecked() || ui._ownFiles_CB->isChecked())
|
||||||
{
|
{
|
||||||
|
@ -64,6 +64,7 @@ private slots:
|
|||||||
void copyResultLink();
|
void copyResultLink();
|
||||||
void copySearchLink();
|
void copySearchLink();
|
||||||
|
|
||||||
|
void searchAgain();
|
||||||
void searchRemove();
|
void searchRemove();
|
||||||
void searchRemoveAll();
|
void searchRemoveAll();
|
||||||
void searchKeywords();
|
void searchKeywords();
|
||||||
@ -96,7 +97,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/** render the results to the tree widget display */
|
/** 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<DirDetails>&);
|
void resultsToTree(std::string,qulonglong searchId, const std::list<DirDetails>&);
|
||||||
void insertFile(const std::string& txt,qulonglong searchId, const FileDetail& file, int searchType = ANONYMOUS_SEARCH) ;
|
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);
|
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item);
|
||||||
|
Binary file not shown.
@ -9829,7 +9829,7 @@ Lockdatei:
|
|||||||
<translation type="obsolete">Der Empfänger der Nachricht ist unbekannt.</translation>
|
<translation type="obsolete">Der Empfänger der Nachricht ist unbekannt.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/RetroShareLink.cpp" line="+676"/>
|
<location filename="../gui/RetroShareLink.cpp" line="+688"/>
|
||||||
<source>Add file</source>
|
<source>Add file</source>
|
||||||
<translation>Datei hinzufügen</translation>
|
<translation>Datei hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10590,17 +10590,17 @@ p, li { white-space: pre-wrap; }
|
|||||||
<context>
|
<context>
|
||||||
<name>RsCollectionFile</name>
|
<name>RsCollectionFile</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/common/RsCollectionFile.cpp" line="+12"/>
|
<location filename="../gui/common/RsCollectionFile.cpp" line="+13"/>
|
||||||
<source>Cannot open file %1</source>
|
<source>Cannot open file %1</source>
|
||||||
<translation>Kann Datei %1 nicht öffnen</translation>
|
<translation>Kann Datei %1 nicht öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+10"/>
|
<location line="+12"/>
|
||||||
<source>Error parsing xml file</source>
|
<source>Error parsing xml file</source>
|
||||||
<translation>Fehler beim Parsen des XML</translation>
|
<translation>Fehler beim Parsen des XML</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+9"/>
|
<location line="+10"/>
|
||||||
<source>Open collection file</source>
|
<source>Open collection file</source>
|
||||||
<translation>Öffne Kollektion</translation>
|
<translation>Öffne Kollektion</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10749,7 +10749,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+319"/>
|
<location line="+319"/>
|
||||||
<location filename="../gui/SearchDialog.cpp" line="+293"/>
|
<location filename="../gui/SearchDialog.cpp" line="+296"/>
|
||||||
<source>Download</source>
|
<source>Download</source>
|
||||||
<translation>Herunterladen</translation>
|
<translation>Herunterladen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10760,17 +10760,22 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+188"/>
|
<location line="+188"/>
|
||||||
<location line="+139"/>
|
<location line="+143"/>
|
||||||
<source>Copy RetroShare Link</source>
|
<source>Copy RetroShare Link</source>
|
||||||
<translation>Kopiere RetroShare Link</translation>
|
<translation>Kopiere RetroShare Link</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-138"/>
|
<location line="-142"/>
|
||||||
<source>Send RetroShare Link</source>
|
<source>Send RetroShare Link</source>
|
||||||
<translation>Sende RetroShare Link</translation>
|
<translation>Sende RetroShare Link</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+135"/>
|
<location line="+137"/>
|
||||||
|
<source>Search again</source>
|
||||||
|
<translation>Erneut suchen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
<source>Remove</source>
|
<source>Remove</source>
|
||||||
<translation>Entfernen</translation>
|
<translation>Entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -10780,7 +10785,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Alle entfernen</translation>
|
<translation>Alle entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+379"/>
|
<location line="+394"/>
|
||||||
<location line="+68"/>
|
<location line="+68"/>
|
||||||
<source>Folder</source>
|
<source>Folder</source>
|
||||||
<translation>Ordner</translation>
|
<translation>Ordner</translation>
|
||||||
@ -10841,7 +10846,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Such ID</translation>
|
<translation>Such ID</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/SearchDialog.cpp" line="-921"/>
|
<location filename="../gui/SearchDialog.cpp" line="-940"/>
|
||||||
<source>Download Notice</source>
|
<source>Download Notice</source>
|
||||||
<translation>Download</translation>
|
<translation>Download</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -12707,12 +12712,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Du kannst diesen Text kopieren und an deinen Freund per Email senden oder über einen anderen Weg zukommen lassen</translation>
|
<translation>Du kannst diesen Text kopieren und an deinen Freund per Email senden oder über einen anderen Weg zukommen lassen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+11"/>
|
<location line="+13"/>
|
||||||
<source>RetroShare</source>
|
<source>RetroShare</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-202"/>
|
<location line="-204"/>
|
||||||
<source>Text certificate</source>
|
<source>Text certificate</source>
|
||||||
<translation>Text-Zertifikat</translation>
|
<translation>Text-Zertifikat</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -12737,12 +12742,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Das Zertifikat konnte nicht geladen werden</translation>
|
<translation>Das Zertifikat konnte nicht geladen werden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-77"/>
|
<location line="-75"/>
|
||||||
<source>Your Cert is copied to Clipboard, paste and send it to your friend via email or some other way</source>
|
<source>Your Cert is copied to Clipboard, paste and send it to your friend via email or some other way</source>
|
||||||
<translation>Dein Zertiifkat ist in in die Zwischenablage kopiert worden</translation>
|
<translation>Dein Zertiifkat ist in in die Zwischenablage kopiert worden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-57"/>
|
<location line="-59"/>
|
||||||
<source>RetroShare Invite</source>
|
<source>RetroShare Invite</source>
|
||||||
<translation>RetroShare Einladung</translation>
|
<translation>RetroShare Einladung</translation>
|
||||||
</message>
|
</message>
|
||||||
|
Loading…
Reference in New Issue
Block a user