Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
0a9edd28
Commit
0a9edd28
authored
Oct 25, 2010
by
Rohit Yadav
Browse files
Bugfix: Fixes #146, saving settings handled by saveSettings()
evoked on close event and on quit triggered.
parent
c1f74d0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Gui/MainWindow.cpp
View file @
0a9edd28
...
...
@@ -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
...
...
src/Gui/MainWindow.h
View file @
0a9edd28
...
...
@@ -72,6 +72,7 @@ private:
void
loadVlmcPreferences
(
const
QString
&
subPart
);
void
loadGlobalProxySettings
();
void
initToolbar
();
bool
saveSettings
();
void
setupLibrary
();
void
setupClipPreview
();
void
setupProjectPreview
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment