-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save geometry of the main window and state of dock widgets #58
Conversation
✅ Build Quaternion 0.0.49 completed (commit 85f16705f3 by @KitsuneRal) |
@@ -210,7 +232,7 @@ void MainWindow::connectionError(QString error) | |||
void MainWindow::closeEvent(QCloseEvent* event) | |||
{ | |||
setConnection(nullptr); | |||
|
|||
saveSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think MainWindow::closeEvent is not invoked when closed via the "Quit" action. Maybe we should use MainWindow::close there instead of QApplication::quit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. In fact, I thought that saving the state just on exit might fall short in, e.g., a case of a sudden crash after two days of working in a row - then upon restart Quaternion opens in a two-days-old configuration. Probably it makes sense to save state upon every resize or move - or its it too much of hustle?
At any rate, you're right: using QApplication::quit()
for finishing is definitely incorrect, now that I read Qt docs (it essentially kills the event queue at once - very quick but very harsh). QApplication::closeAllWindows()
seems to be most proper (it's a bit more universal than QMainWindow::close()
).
✅ Build Quaternion 0.0.52 completed (commit e5e52224fc by @KitsuneRal) |
Hmm, now I have the problem again that Quaternion does not correctly close... Does it for you? |
Don't have any (just tested several times, by various means including Connection->Quit, and from various states - before login, after opening a timeline etc.). Might be specific to Linux. |
✅ Build Quaternion 0.0.62 completed (commit 9bbf01b507 by @KitsuneRal) |
You've got the point. Merged this.
Closes #55.
Also, menu creation has been moved out to a separate method and invoked before showing the window, not afterwards.