Commit ec343dbe authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Qt only versions: store position of window

parent 872e8a21
......@@ -955,6 +955,8 @@ void Kid3App::saveOptions()
m_fileOpenRecent->saveEntries(m_config, "Recent Files");
#endif
#else
s_miscCfg.m_windowX = x();
s_miscCfg.m_windowY = y();
s_miscCfg.m_windowWidth = size().width();
s_miscCfg.m_windowHeight = size().height();
#endif
......@@ -1039,6 +1041,9 @@ void Kid3App::readOptions()
if (s_miscCfg.m_windowWidth != -1 && s_miscCfg.m_windowHeight != -1) {
resize(s_miscCfg.m_windowWidth, s_miscCfg.m_windowHeight);
}
if (s_miscCfg.m_windowX != -1 && s_miscCfg.m_windowY != -1) {
move(s_miscCfg.m_windowX, s_miscCfg.m_windowY);
}
#endif
m_view->readConfig();
}
......
......@@ -118,7 +118,8 @@ MiscConfig::MiscConfig(const QString& group) :
m_useProxy(false),
m_onlyCustomGenres(false)
#ifndef CONFIG_USE_KDE
, m_windowWidth(-1), m_windowHeight(-1), m_useFont(false), m_fontSize(-1)
, m_windowX(-1), m_windowY(-1), m_windowWidth(-1), m_windowHeight(-1),
m_useFont(false), m_fontSize(-1)
#endif
{
}
......@@ -228,6 +229,8 @@ void MiscConfig::writeToConfig(
config->QCM_writeEntry("/Proxy", m_proxy);
config->QCM_writeEntry("/Browser", m_browser);
config->QCM_writeEntry("/OnlyCustomGenres", m_onlyCustomGenres);
config->QCM_writeEntry("/WindowX", m_windowX);
config->QCM_writeEntry("/WindowY", m_windowY);
config->QCM_writeEntry("/WindowWidth", m_windowWidth);
config->QCM_writeEntry("/WindowHeight", m_windowHeight);
config->QCM_writeEntry("/UseFont", m_useFont);
......@@ -371,6 +374,8 @@ void MiscConfig::readFromConfig(
m_browser = config->QCM_readEntry("/Browser", s_defaultBrowser);
#endif
m_onlyCustomGenres = config->QCM_readBoolEntry("/OnlyCustomGenres", m_onlyCustomGenres);
m_windowX = config->QCM_readNumEntry("/WindowX", -1);
m_windowY = config->QCM_readNumEntry("/WindowY", -1);
m_windowWidth = config->QCM_readNumEntry("/WindowWidth", -1);
m_windowHeight = config->QCM_readNumEntry("/WindowHeight", -1);
m_useFont = config->QCM_readBoolEntry("/UseFont", m_useFont);
......
......@@ -220,6 +220,10 @@ public:
/** true to show only custom genres in combo boxes */
bool m_onlyCustomGenres;
#ifndef CONFIG_USE_KDE
/** mainwindow x-position */
int m_windowX;
/** mainwindow y-position */
int m_windowY;
/** mainwindow width */
int m_windowWidth;
/** mainwindow height */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment