Skip to content
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

Merged
merged 3 commits into from
Sep 11, 2016

Conversation

KitsuneRal
Copy link
Member

Closes #55.
Also, menu creation has been moved out to a separate method and invoked before showing the window, not afterwards.

@AppVeyorBot
Copy link

@@ -210,7 +232,7 @@ void MainWindow::connectionError(QString error)
void MainWindow::closeEvent(QCloseEvent* event)
{
setConnection(nullptr);

saveSettings();
Copy link
Contributor

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?

Copy link
Member Author

@KitsuneRal KitsuneRal Sep 9, 2016

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()).

@AppVeyorBot
Copy link

@Fxrh
Copy link
Contributor

Fxrh commented Sep 9, 2016

Hmm, now I have the problem again that Quaternion does not correctly close... Does it for you?

@KitsuneRal
Copy link
Member Author

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.

@AppVeyorBot
Copy link

@Fxrh
Copy link
Contributor

Fxrh commented Sep 11, 2016

This should be fixed by c39e1f6, see issue #31. Feel free to merge :)

@KitsuneRal KitsuneRal merged commit be73028 into quotient-im:master Sep 11, 2016
@KitsuneRal KitsuneRal deleted the save-window-state branch September 11, 2016 22:56
nicolasfella pushed a commit to nicolasfella/Quaternion that referenced this pull request Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants