add preference to hide the toolbars
This commit is contained in:
parent
0445302350
commit
a244983b3a
@ -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.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);
|
||||||
SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false);
|
SETTING_RW(prefs.trayMessages, "/Recoll/prefs/trayMessages", Bool, false);
|
||||||
|
|||||||
@ -140,6 +140,7 @@ class PrefsPack {
|
|||||||
// Suppress all noises
|
// Suppress all noises
|
||||||
bool noBeeps;
|
bool noBeeps;
|
||||||
|
|
||||||
|
bool noToolbars{false};
|
||||||
bool showTrayIcon{false};
|
bool showTrayIcon{false};
|
||||||
bool closeToTray{false};
|
bool closeToTray{false};
|
||||||
bool trayMessages{false};
|
bool trayMessages{false};
|
||||||
|
|||||||
@ -198,21 +198,7 @@ void RclMain::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
curid->setChecked(true);
|
curid->setChecked(true);
|
||||||
|
setupToolbars();
|
||||||
m_toolsTB = new QToolBar(tr("Tools"), this);
|
|
||||||
m_toolsTB->setObjectName(QString::fromUtf8("m_toolsTB"));
|
|
||||||
m_toolsTB->addAction(toolsAdvanced_SearchAction);
|
|
||||||
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
|
||||||
m_toolsTB->addAction(toolsSpellAction);
|
|
||||||
m_toolsTB->addAction(actionQuery_Fragments);
|
|
||||||
QSettings settings;
|
|
||||||
int val = settings.value(settingskey_toolarea).toInt();
|
|
||||||
this->addToolBar(int2area(val), m_toolsTB);
|
|
||||||
|
|
||||||
m_resTB = new QToolBar(tr("Results"), this);
|
|
||||||
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
|
||||||
val = settings.value(settingskey_resarea).toInt();
|
|
||||||
this->addToolBar(int2area(val), m_resTB);
|
|
||||||
|
|
||||||
// Document filter buttons and combobox
|
// Document filter buttons and combobox
|
||||||
// Combobox version of the document filter control
|
// Combobox version of the document filter control
|
||||||
@ -452,6 +438,7 @@ void RclMain::init()
|
|||||||
onSortDataChanged(m_sortspec);
|
onSortDataChanged(m_sortspec);
|
||||||
emit sortDataChanged(m_sortspec);
|
emit sortDataChanged(m_sortspec);
|
||||||
}
|
}
|
||||||
|
QSettings settings;
|
||||||
restoreGeometry(settings.value("/Recoll/geometry/maingeom").toByteArray());
|
restoreGeometry(settings.value("/Recoll/geometry/maingeom").toByteArray());
|
||||||
|
|
||||||
enableTrayIcon(prefs.showTrayIcon);
|
enableTrayIcon(prefs.showTrayIcon);
|
||||||
@ -464,6 +451,38 @@ void RclMain::init()
|
|||||||
periodictimer->start(1000);
|
periodictimer->start(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RclMain::setupToolbars()
|
||||||
|
{
|
||||||
|
if (nullptr == m_toolsTB) {
|
||||||
|
m_toolsTB = new QToolBar(tr("Tools"), this);
|
||||||
|
m_toolsTB->setObjectName(QString::fromUtf8("m_toolsTB"));
|
||||||
|
m_toolsTB->addAction(toolsAdvanced_SearchAction);
|
||||||
|
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
||||||
|
m_toolsTB->addAction(toolsSpellAction);
|
||||||
|
m_toolsTB->addAction(actionQuery_Fragments);
|
||||||
|
}
|
||||||
|
QSettings settings;
|
||||||
|
int val;
|
||||||
|
if (!prefs.noToolbars) {
|
||||||
|
val = settings.value(settingskey_toolarea).toInt();
|
||||||
|
this->addToolBar(int2area(val), m_toolsTB);
|
||||||
|
m_toolsTB->show();
|
||||||
|
} else {
|
||||||
|
m_toolsTB->hide();
|
||||||
|
}
|
||||||
|
if (nullptr == m_resTB) {
|
||||||
|
m_resTB = new QToolBar(tr("Results"), this);
|
||||||
|
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
||||||
|
}
|
||||||
|
if (!prefs.noToolbars) {
|
||||||
|
val = settings.value(settingskey_resarea).toInt();
|
||||||
|
this->addToolBar(int2area(val), m_resTB);
|
||||||
|
m_resTB->show();
|
||||||
|
} else {
|
||||||
|
m_resTB->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RclMain::enableTrayIcon(bool on)
|
void RclMain::enableTrayIcon(bool on)
|
||||||
{
|
{
|
||||||
on = on && QSystemTrayIcon::isSystemTrayAvailable();
|
on = on && QSystemTrayIcon::isSystemTrayAvailable();
|
||||||
@ -750,8 +769,10 @@ void RclMain::fileExit()
|
|||||||
if (!isMaximized()) {
|
if (!isMaximized()) {
|
||||||
settings.setValue("/Recoll/geometry/maingeom", saveGeometry());
|
settings.setValue("/Recoll/geometry/maingeom", saveGeometry());
|
||||||
}
|
}
|
||||||
settings.setValue(settingskey_toolarea, toolBarArea(m_toolsTB));
|
if (!prefs.noToolbars) {
|
||||||
settings.setValue(settingskey_resarea, toolBarArea(m_resTB));
|
settings.setValue(settingskey_toolarea, toolBarArea(m_toolsTB));
|
||||||
|
settings.setValue(settingskey_resarea, toolBarArea(m_resTB));
|
||||||
|
}
|
||||||
restable->saveColState();
|
restable->saveColState();
|
||||||
|
|
||||||
if (prefs.ssearchTypSav) {
|
if (prefs.ssearchTypSav) {
|
||||||
|
|||||||
@ -89,7 +89,8 @@ public:
|
|||||||
}
|
}
|
||||||
void enableTrayIcon(bool onoff);
|
void enableTrayIcon(bool onoff);
|
||||||
QString readDarkCSS();
|
QString readDarkCSS();
|
||||||
|
void setupToolbars();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void fileExit();
|
virtual void fileExit();
|
||||||
virtual void periodic100();
|
virtual void periodic100();
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line1">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -163,12 +163,12 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showTempFileWarningCB">
|
<widget class="QCheckBox" name="noToolbarsCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show warning when opening temporary file.</string>
|
<string>Hide toolbars.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -212,6 +212,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="showTempFileWarningCB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show warning when opening temporary file.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="ssNoCompleteCB">
|
<widget class="QCheckBox" name="ssNoCompleteCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -233,7 +243,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -346,7 +356,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line">
|
<widget class="Line" name="line4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -732,7 +742,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="lineX">
|
<widget class="Line" name="line5">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::HLine</enum>
|
<enum>QFrame::HLine</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -789,7 +799,7 @@ The default value is 2 (percent). </string>
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line2">
|
<widget class="Line" name="line6">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::HLine</enum>
|
<enum>QFrame::HLine</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -895,7 +905,7 @@ May be slow for big documents.</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line3">
|
<widget class="Line" name="line7">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::HLine</enum>
|
<enum>QFrame::HLine</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -945,7 +955,7 @@ May be slow for big documents.</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line31">
|
<widget class="Line" name="line8">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::HLine</enum>
|
<enum>QFrame::HLine</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -1064,7 +1074,7 @@ May be slow for big documents.</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line2_2">
|
<widget class="Line" name="line9">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::HLine</enum>
|
<enum>QFrame::HLine</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@ -144,6 +144,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
|
|
||||||
keepSortCB->setChecked(prefs.keepSort);
|
keepSortCB->setChecked(prefs.keepSort);
|
||||||
|
|
||||||
|
noToolbarsCB->setChecked(prefs.noToolbars);
|
||||||
showTrayIconCB->setChecked(prefs.showTrayIcon);
|
showTrayIconCB->setChecked(prefs.showTrayIcon);
|
||||||
if (!prefs.showTrayIcon) {
|
if (!prefs.showTrayIcon) {
|
||||||
prefs.closeToTray = false;
|
prefs.closeToTray = false;
|
||||||
@ -347,6 +348,8 @@ void UIPrefsDialog::accept()
|
|||||||
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
||||||
|
|
||||||
prefs.keepSort = keepSortCB->isChecked();
|
prefs.keepSort = keepSortCB->isChecked();
|
||||||
|
prefs.noToolbars = noToolbarsCB->isChecked();
|
||||||
|
m_mainWindow->setupToolbars();
|
||||||
prefs.showTrayIcon = showTrayIconCB->isChecked();
|
prefs.showTrayIcon = showTrayIconCB->isChecked();
|
||||||
m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
|
m_mainWindow->enableTrayIcon(prefs.showTrayIcon);
|
||||||
prefs.closeToTray = closeToTrayCB->isChecked();
|
prefs.closeToTray = closeToTrayCB->isChecked();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user