add option to hide the "Clear" and "Search" buttons
This commit is contained in:
parent
a244983b3a
commit
a24759c4dd
@ -293,6 +293,7 @@ void rwSettings(bool writing)
|
|||||||
|
|
||||||
SETTING_RW(prefs.fileTypesByCats, "/Recoll/prefs/query/asearchFilTypByCat",
|
SETTING_RW(prefs.fileTypesByCats, "/Recoll/prefs/query/asearchFilTypByCat",
|
||||||
Bool, false);
|
Bool, false);
|
||||||
|
SETTING_RW(prefs.noClearSearch, "/Recoll/prefs/noClearSearch", Bool, false);
|
||||||
SETTING_RW(prefs.noToolbars, "/Recoll/prefs/noToolbars", Bool, false);
|
SETTING_RW(prefs.noToolbars, "/Recoll/prefs/noToolbars", Bool, false);
|
||||||
SETTING_RW(prefs.showTrayIcon, "/Recoll/prefs/showTrayIcon", Bool, false);
|
SETTING_RW(prefs.showTrayIcon, "/Recoll/prefs/showTrayIcon", Bool, false);
|
||||||
SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false);
|
SETTING_RW(prefs.closeToTray, "/Recoll/prefs/closeToTray", Bool, false);
|
||||||
|
|||||||
@ -141,6 +141,7 @@ class PrefsPack {
|
|||||||
bool noBeeps;
|
bool noBeeps;
|
||||||
|
|
||||||
bool noToolbars{false};
|
bool noToolbars{false};
|
||||||
|
bool noClearSearch{false};
|
||||||
bool showTrayIcon{false};
|
bool showTrayIcon{false};
|
||||||
bool closeToTray{false};
|
bool closeToTray{false};
|
||||||
bool trayMessages{false};
|
bool trayMessages{false};
|
||||||
|
|||||||
@ -187,6 +187,20 @@ void SSearch::init()
|
|||||||
connect(m_completer, SIGNAL(activated(const QString&)), this,
|
connect(m_completer, SIGNAL(activated(const QString&)), this,
|
||||||
SLOT(onCompletionActivated(const QString&)));
|
SLOT(onCompletionActivated(const QString&)));
|
||||||
connect(historyPB, SIGNAL(clicked()), this, SLOT(onHistoryClicked()));
|
connect(historyPB, SIGNAL(clicked()), this, SLOT(onHistoryClicked()));
|
||||||
|
setupButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SSearch::setupButtons()
|
||||||
|
{
|
||||||
|
if (prefs.noClearSearch) {
|
||||||
|
clearqPB->hide();
|
||||||
|
searchPB->hide();
|
||||||
|
queryText->setClearButtonEnabled(true);
|
||||||
|
} else {
|
||||||
|
clearqPB->show();
|
||||||
|
searchPB->show();
|
||||||
|
queryText->setClearButtonEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSearch::takeFocus()
|
void SSearch::takeFocus()
|
||||||
|
|||||||
@ -84,6 +84,7 @@ public:
|
|||||||
virtual bool fromXML(const SSearchDef& fxml);
|
virtual bool fromXML(const SSearchDef& fxml);
|
||||||
virtual QString currentText();
|
virtual QString currentText();
|
||||||
virtual bool eventFilter(QObject *target, QEvent *event);
|
virtual bool eventFilter(QObject *target, QEvent *event);
|
||||||
|
virtual void setupButtons();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void onSearchTypeChanged(int);
|
virtual void onSearchTypeChanged(int);
|
||||||
|
|||||||
@ -172,6 +172,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="noClearSearchCB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide Clear and Search buttons.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showTrayIconCB">
|
<widget class="QCheckBox" name="showTrayIconCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@ -145,6 +145,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
keepSortCB->setChecked(prefs.keepSort);
|
keepSortCB->setChecked(prefs.keepSort);
|
||||||
|
|
||||||
noToolbarsCB->setChecked(prefs.noToolbars);
|
noToolbarsCB->setChecked(prefs.noToolbars);
|
||||||
|
noClearSearchCB->setChecked(prefs.noClearSearch);
|
||||||
showTrayIconCB->setChecked(prefs.showTrayIcon);
|
showTrayIconCB->setChecked(prefs.showTrayIcon);
|
||||||
if (!prefs.showTrayIcon) {
|
if (!prefs.showTrayIcon) {
|
||||||
prefs.closeToTray = false;
|
prefs.closeToTray = false;
|
||||||
@ -349,6 +350,8 @@ void UIPrefsDialog::accept()
|
|||||||
|
|
||||||
prefs.keepSort = keepSortCB->isChecked();
|
prefs.keepSort = keepSortCB->isChecked();
|
||||||
prefs.noToolbars = noToolbarsCB->isChecked();
|
prefs.noToolbars = noToolbarsCB->isChecked();
|
||||||
|
prefs.noClearSearch = noClearSearchCB->isChecked();
|
||||||
|
m_mainWindow->sSearch->setupButtons();
|
||||||
m_mainWindow->setupToolbars();
|
m_mainWindow->setupToolbars();
|
||||||
prefs.showTrayIcon = showTrayIconCB->isChecked();
|
prefs.showTrayIcon = showTrayIconCB->isChecked();
|
||||||
m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
|
m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user