Commit 0a9edd28 authored by Rohit Yadav's avatar Rohit Yadav

Bugfix: Fixes #146, saving settings handled by saveSettings()

evoked on close event and on quit triggered.
parent c1f74d0a
......@@ -570,10 +570,10 @@ void
MainWindow::checkFolders()
{
QDir dirUtil;
if( !dirUtil.exists( VLMC_GET_STRING( "general/DefaultProjectLocation" ) ) )
if ( !dirUtil.exists( VLMC_GET_STRING( "general/DefaultProjectLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/DefaultProjectLocation" ) );
if( !dirUtil.exists( VLMC_GET_STRING( "general/TempFolderLocation" ) ) )
if ( !dirUtil.exists( VLMC_GET_STRING( "general/TempFolderLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/TempFolderLocation" ) );
}
......@@ -583,6 +583,7 @@ MainWindow::checkFolders()
void
MainWindow::on_actionQuit_triggered()
{
saveSettings();
QApplication::quit();
}
......@@ -754,24 +755,31 @@ MainWindow::on_actionProject_Preferences_triggered()
m_projectPreferences->show();
}
void
MainWindow::closeEvent( QCloseEvent* e )
bool
MainWindow::saveSettings()
{
GUIProjectManager *pm = GUIProjectManager::getInstance();
if ( pm->askForSaveIfModified() )
{
QSettings s;
// Save the current geometry
s.setValue( "MainWindowGeometry", saveGeometry() );
// Save the current layout
s.setValue( "MainWindowState", saveState() );
s.setValue( "CleanQuit", true );
s.sync();
return true;
}
return false;
}
void
MainWindow::closeEvent( QCloseEvent* e )
{
if ( saveSettings() )
e->accept();
else
{
e->ignore();
return ;
}
QSettings s;
// Save the current geometry
s.setValue( "MainWindowGeometry", saveGeometry() );
// Save the current layout
s.setValue( "MainWindowState", saveState() );
s.setValue( "CleanQuit", true );
s.sync();
}
void
......
......@@ -72,6 +72,7 @@ private:
void loadVlmcPreferences( const QString& subPart );
void loadGlobalProxySettings();
void initToolbar();
bool saveSettings();
void setupLibrary();
void setupClipPreview();
void setupProjectPreview();
......
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