Fix minimize at startup and decouple various tray and minimization options (#109)

* Hide window on startup when configured to start minimized, fixes #105
* Decouple different systray and minimization options, fixes #64
* Commit missing changes in main.cpp to minimize at startup

* Remove obsolete code
This commit is contained in:
Janek Bevendorff
2016-11-24 00:15:51 +01:00
committed by Jonathan White
parent 02d2ac904d
commit 19a960856c
7 changed files with 22 additions and 60 deletions

View File

@@ -86,11 +86,11 @@ int main(int argc, char** argv)
#endif
MainWindow mainWindow;
mainWindow.show();
app.setMainWindow(&mainWindow);
mainWindow.show();
QObject::connect(&app, SIGNAL(openFile(QString)), &mainWindow, SLOT(openDatabase(QString)));
for (int ii=0; ii < args.length(); ii++) {
QString filename = args[ii];
if (!filename.isEmpty() && QFile::exists(filename)) {
@@ -111,6 +111,11 @@ int main(int argc, char** argv)
}
}
}
// start minimized if configured
if (config()->get("GUI/MinimizeOnStartup").toBool()) {
mainWindow.minimizeWindow();
}
return app.exec();
}