remember toolbar areas directly through qsettings
This commit is contained in:
parent
dec9968bc5
commit
cf2a1258f6
@ -102,8 +102,6 @@ void rwSettings(bool writing)
|
|||||||
SETTING_RW(prefs.showmode, "/Recoll/geometry/showmode", Int, 0);
|
SETTING_RW(prefs.showmode, "/Recoll/geometry/showmode", Int, 0);
|
||||||
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0);
|
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0);
|
||||||
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
|
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
|
||||||
SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0);
|
|
||||||
SETTING_RW(prefs.resArea, "/Recoll/geometry/resArea", Int, 0);
|
|
||||||
SETTING_RW(prefs.ssearchTypSav, "/Recoll/prefs/ssearchTypSav", Bool, 0);
|
SETTING_RW(prefs.ssearchTypSav, "/Recoll/prefs/ssearchTypSav", Bool, 0);
|
||||||
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
|
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
|
||||||
SETTING_RW(prefs.startWithAdvSearchOpen,
|
SETTING_RW(prefs.startWithAdvSearchOpen,
|
||||||
|
|||||||
@ -69,8 +69,6 @@ class PrefsPack {
|
|||||||
int showmode{SHOW_NORMAL};
|
int showmode{SHOW_NORMAL};
|
||||||
int pvwidth; // Preview window geom
|
int pvwidth; // Preview window geom
|
||||||
int pvheight;
|
int pvheight;
|
||||||
int toolArea; // Area for "tools" toolbar
|
|
||||||
int resArea; // Area for "results" toolbar
|
|
||||||
bool ssearchTypSav; // Remember last search mode (else always
|
bool ssearchTypSav; // Remember last search mode (else always
|
||||||
// start with same)
|
// start with same)
|
||||||
int ssearchTyp{0};
|
int ssearchTyp{0};
|
||||||
|
|||||||
@ -74,7 +74,8 @@
|
|||||||
using std::pair;
|
using std::pair;
|
||||||
|
|
||||||
QString g_stringAllStem, g_stringNoStem;
|
QString g_stringAllStem, g_stringNoStem;
|
||||||
|
static const char *settingskey_toolarea="/Recoll/geometry/toolArea";
|
||||||
|
static const char *settingskey_resarea="/Recoll/geometry/resArea";
|
||||||
static Qt::ToolBarArea int2area(int in)
|
static Qt::ToolBarArea int2area(int in)
|
||||||
{
|
{
|
||||||
switch (in) {
|
switch (in) {
|
||||||
@ -204,11 +205,14 @@ void RclMain::init()
|
|||||||
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
||||||
m_toolsTB->addAction(toolsSpellAction);
|
m_toolsTB->addAction(toolsSpellAction);
|
||||||
m_toolsTB->addAction(actionQuery_Fragments);
|
m_toolsTB->addAction(actionQuery_Fragments);
|
||||||
this->addToolBar(int2area(prefs.toolArea), m_toolsTB);
|
QSettings settings;
|
||||||
|
int val = settings.value(settingskey_toolarea).toInt();
|
||||||
|
this->addToolBar(int2area(val), m_toolsTB);
|
||||||
|
|
||||||
m_resTB = new QToolBar(tr("Results"), this);
|
m_resTB = new QToolBar(tr("Results"), this);
|
||||||
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
||||||
this->addToolBar(int2area(prefs.resArea), 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
|
||||||
@ -448,7 +452,6 @@ 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);
|
||||||
@ -732,13 +735,12 @@ void RclMain::fileExit()
|
|||||||
|
|
||||||
// Don't save geometry if we're currently maximized. At least under X11
|
// Don't save geometry if we're currently maximized. At least under X11
|
||||||
// this saves the maximized size. otoh isFullscreen() does not seem needed
|
// this saves the maximized size. otoh isFullscreen() does not seem needed
|
||||||
|
QSettings settings;
|
||||||
if (!isMaximized()) {
|
if (!isMaximized()) {
|
||||||
QSettings settings;
|
|
||||||
settings.setValue("/Recoll/geometry/maingeom", saveGeometry());
|
settings.setValue("/Recoll/geometry/maingeom", saveGeometry());
|
||||||
}
|
}
|
||||||
|
settings.setValue(settingskey_toolarea, toolBarArea(m_toolsTB));
|
||||||
prefs.toolArea = toolBarArea(m_toolsTB);
|
settings.setValue(settingskey_resarea, toolBarArea(m_resTB));
|
||||||
prefs.resArea = toolBarArea(m_resTB);
|
|
||||||
restable->saveColState();
|
restable->saveColState();
|
||||||
|
|
||||||
if (prefs.ssearchTypSav) {
|
if (prefs.ssearchTypSav) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user