Arrange for the preview window title to be the search string for simple searches
This commit is contained in:
parent
3161d1db15
commit
0abf14b7a5
@ -474,6 +474,7 @@ void AdvSearch::runSearch()
|
|||||||
}
|
}
|
||||||
saveCnf();
|
saveCnf();
|
||||||
g_advshistory && g_advshistory->push(sdata);
|
g_advshistory && g_advshistory->push(sdata);
|
||||||
|
emit setDescription("");
|
||||||
emit startSearch(sdata, false);
|
emit startSearch(sdata, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,8 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
|
void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
|
||||||
|
void setDescription(QString);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
std::vector<SearchClauseW *> m_clauseWins;
|
std::vector<SearchClauseW *> m_clauseWins;
|
||||||
|
|||||||
@ -51,6 +51,8 @@ void RclMain::showAdvSearchDialog()
|
|||||||
connect(asearchform,
|
connect(asearchform,
|
||||||
SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
||||||
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
||||||
|
connect(asearchform, SIGNAL(setDescription(QString)),
|
||||||
|
this, SLOT(onSetDescription(QString)));
|
||||||
asearchform->show();
|
asearchform->show();
|
||||||
} else {
|
} else {
|
||||||
// Close and reopen, in hope that makes us visible...
|
// Close and reopen, in hope that makes us visible...
|
||||||
|
|||||||
@ -297,6 +297,8 @@ void RclMain::init()
|
|||||||
connect(sSearch,
|
connect(sSearch,
|
||||||
SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
||||||
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
||||||
|
connect(sSearch, SIGNAL(setDescription(QString)),
|
||||||
|
this, SLOT(onSetDescription(QString)));
|
||||||
connect(sSearch, SIGNAL(clearSearch()),
|
connect(sSearch, SIGNAL(clearSearch()),
|
||||||
this, SLOT(resetSearch()));
|
this, SLOT(resetSearch()));
|
||||||
connect(preferencesMenu, SIGNAL(triggered(QAction*)),
|
connect(preferencesMenu, SIGNAL(triggered(QAction*)),
|
||||||
@ -1085,11 +1087,17 @@ void RclMain::enablePrevPage(bool yesno)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RclMain::onSetDescription(QString desc)
|
||||||
|
{
|
||||||
|
m_queryDescription = desc;
|
||||||
|
}
|
||||||
|
|
||||||
QString RclMain::getQueryDescription()
|
QString RclMain::getQueryDescription()
|
||||||
{
|
{
|
||||||
if (!m_source)
|
if (!m_source)
|
||||||
return "";
|
return "";
|
||||||
return QString::fromUtf8(m_source->getDescription().c_str());
|
return m_queryDescription.isEmpty() ?
|
||||||
|
u8s2qs(m_source->getDescription()) : m_queryDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set filter, action style
|
// Set filter, action style
|
||||||
|
|||||||
@ -160,7 +160,8 @@ public slots:
|
|||||||
virtual void applyStyleSheet();
|
virtual void applyStyleSheet();
|
||||||
virtual void setFilterCtlStyle(int stl);
|
virtual void setFilterCtlStyle(int stl);
|
||||||
virtual void showTrayMessage(const QString& text);
|
virtual void showTrayMessage(const QString& text);
|
||||||
|
virtual void onSetDescription(QString);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
virtual void updateIdxStatus();
|
virtual void updateIdxStatus();
|
||||||
virtual void onWebcacheDestroyed(QObject *);
|
virtual void onWebcacheDestroyed(QObject *);
|
||||||
@ -216,7 +217,11 @@ private:
|
|||||||
bool m_queryActive{false};
|
bool m_queryActive{false};
|
||||||
bool m_firstIndexing{false};
|
bool m_firstIndexing{false};
|
||||||
// Last search was started from simple
|
// Last search was started from simple
|
||||||
bool m_searchIsSimple{false};
|
bool m_searchIsSimple{false};
|
||||||
|
// This is set to the query string by ssearch, and to empty by
|
||||||
|
// advsearch, and used for the Preview window title. If empty, we
|
||||||
|
// use the Xapian Query string.
|
||||||
|
QString m_queryDescription;
|
||||||
// If set on init, will be displayed either through ext app, or
|
// If set on init, will be displayed either through ext app, or
|
||||||
// preview (if no ext app set)
|
// preview (if no ext app set)
|
||||||
QString m_urltoview;
|
QString m_urltoview;
|
||||||
|
|||||||
@ -426,6 +426,7 @@ bool SSearch::startSimpleSearch(const string& u8, int maxexp)
|
|||||||
LOGDEB("SSearch::startSimpleSearch:xml:[" << m_xml << "]\n");
|
LOGDEB("SSearch::startSimpleSearch:xml:[" << m_xml << "]\n");
|
||||||
|
|
||||||
std::shared_ptr<Rcl::SearchData> rsdata(sdata);
|
std::shared_ptr<Rcl::SearchData> rsdata(sdata);
|
||||||
|
emit setDescription(u8s2qs(u8));
|
||||||
emit startSearch(rsdata, true);
|
emit startSearch(rsdata, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,6 +100,7 @@ private slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
|
void startSearch(std::shared_ptr<Rcl::SearchData>, bool);
|
||||||
|
void setDescription(QString);
|
||||||
void clearSearch();
|
void clearSearch();
|
||||||
void partialWord(int, const QString& text, const QString &partial);
|
void partialWord(int, const QString& text, const QString &partial);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user