Settings are now saved before window has closed.

This enables us to check if toolbar is visible or not. Earlier
we saved settings after the window was closed and checking for
toolbar visibility was not feasible anymore.
This commit is contained in:
Vesa Pikki 2009-07-04 11:06:29 +03:00
parent e76b9b974c
commit e656c951e5
1 changed files with 4 additions and 3 deletions

View File

@ -96,7 +96,6 @@ MainWindow::MainWindow() :
MainWindow::~MainWindow()
{
SaveSettings();
}
void MainWindow::CreateLanguageMenuItems()
@ -184,7 +183,7 @@ void MainWindow::SaveSettings()
mSettings->setValue(SETTINGS_SHOW_SECURITY, mUI.mActionShowSecurity->isChecked());
mSettings->setValue(SETTINGS_SHOW_STYLE, mUI.mActionShowStyle->isChecked());
mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mActionToolbar->isChecked());
mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mToolBar->isVisible());
mApplications->SaveSettings(mSettings);
@ -440,8 +439,10 @@ void MainWindow::UncheckAll()
void MainWindow::closeEvent(QCloseEvent *event)
{
// Check that we aren't checking files
if (!mThread->IsChecking())
if (!mThread->IsChecking()) {
SaveSettings();
event->accept();
}
else
{
QString text(tr("Cannot exit while checking.\n\n" \