remember toolbar placement area between sessions
This commit is contained in:
parent
bd46735d9c
commit
ba9543ac3c
@ -72,6 +72,8 @@ void rwSettings(bool writing)
|
|||||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Int, 0);
|
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", 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.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
|
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3);
|
||||||
SETTING_RW(prefs.startWithAdvSearchOpen,
|
SETTING_RW(prefs.startWithAdvSearchOpen,
|
||||||
"/Recoll/prefs/startWithAdvSearchOpen", Bool, false);
|
"/Recoll/prefs/startWithAdvSearchOpen", Bool, false);
|
||||||
|
|||||||
@ -68,6 +68,8 @@ class PrefsPack {
|
|||||||
int mainheight;
|
int mainheight;
|
||||||
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
|
||||||
int ssearchTyp;
|
int ssearchTyp;
|
||||||
// Use single app (default: xdg-open), instead of per-mime settings
|
// Use single app (default: xdg-open), instead of per-mime settings
|
||||||
bool useDesktopOpen;
|
bool useDesktopOpen;
|
||||||
|
|||||||
@ -94,6 +94,18 @@ QString g_stringAllStem, g_stringNoStem;
|
|||||||
static const QKeySequence quitKeySeq("Ctrl+q");
|
static const QKeySequence quitKeySeq("Ctrl+q");
|
||||||
static const QKeySequence closeKeySeq("Ctrl+w");
|
static const QKeySequence closeKeySeq("Ctrl+w");
|
||||||
|
|
||||||
|
static Qt::ToolBarArea int2area(int in)
|
||||||
|
{
|
||||||
|
switch (in) {
|
||||||
|
case Qt::LeftToolBarArea: return Qt::LeftToolBarArea;
|
||||||
|
case Qt::RightToolBarArea: return Qt::RightToolBarArea;
|
||||||
|
case Qt::BottomToolBarArea: return Qt::BottomToolBarArea;
|
||||||
|
case Qt::TopToolBarArea:
|
||||||
|
default:
|
||||||
|
return Qt::TopToolBarArea;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RclMain::init()
|
void RclMain::init()
|
||||||
{
|
{
|
||||||
// This is just to get the common catg strings into the message file
|
// This is just to get the common catg strings into the message file
|
||||||
@ -162,11 +174,11 @@ void RclMain::init()
|
|||||||
m_toolsTB->addAction(toolsAdvanced_SearchAction);
|
m_toolsTB->addAction(toolsAdvanced_SearchAction);
|
||||||
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
m_toolsTB->addAction(toolsDoc_HistoryAction);
|
||||||
m_toolsTB->addAction(toolsSpellAction);
|
m_toolsTB->addAction(toolsSpellAction);
|
||||||
this->addToolBar(Qt::TopToolBarArea, m_toolsTB);
|
this->addToolBar(int2area(prefs.toolArea), m_toolsTB);
|
||||||
|
|
||||||
m_resTB = new QToolBar(this);
|
m_resTB = new QToolBar(this);
|
||||||
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
m_resTB->setObjectName(QString::fromUtf8("m_resTB"));
|
||||||
this->addToolBar(Qt::TopToolBarArea, m_resTB);
|
this->addToolBar(int2area(prefs.resArea), 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
|
||||||
@ -630,6 +642,8 @@ void RclMain::fileExit()
|
|||||||
prefs.mainwidth = width();
|
prefs.mainwidth = width();
|
||||||
prefs.mainheight = height();
|
prefs.mainheight = height();
|
||||||
}
|
}
|
||||||
|
prefs.toolArea = toolBarArea(m_toolsTB);
|
||||||
|
prefs.resArea = toolBarArea(m_resTB);
|
||||||
restable->saveColState();
|
restable->saveColState();
|
||||||
|
|
||||||
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();
|
prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user