Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
d0570b53
Commit
d0570b53
authored
Feb 21, 2010
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preferences are now loaded on starting
parent
15348a09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
+31
-12
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+21
-5
src/Gui/MainWindow.h
src/Gui/MainWindow.h
+1
-0
src/Gui/settings/Settings.cpp
src/Gui/settings/Settings.cpp
+7
-5
src/Gui/settings/Settings.h
src/Gui/settings/Settings.h
+2
-2
No files found.
src/Gui/MainWindow.cpp
View file @
d0570b53
...
...
@@ -76,12 +76,12 @@ MainWindow::MainWindow( QWidget *parent ) :
//VLC Instance:
LibVLCpp
::
Instance
::
getInstance
(
this
);
//Preferences
initVlmcPreferences
();
//Creating the project manager first (so it can create all the project variables)
ProjectManager
::
getInstance
();
//Preferences
initVlmcPreferences
();
// GUI
DockWidgetManager
::
instance
(
this
)
->
setMainWindow
(
this
);
createGlobalPreferences
();
...
...
@@ -191,6 +191,22 @@ MainWindow::initVlmcPreferences()
CREATE_MENU_SHORTCUT
(
"keyboard/renderproject"
,
"Ctrl+R"
,
"Render the project"
,
"Render the project to a file"
,
actionRender
);
VLMC_CREATE_PREFERENCE_LANGUAGE
(
"general/VLMCLang"
,
"en_US"
,
"Langage"
,
"The VLMC's UI language"
);
//Load saved preferences :
loadVlmcPreferences
(
"keyboard"
);
loadVlmcPreferences
(
"general"
);
}
void
MainWindow
::
loadVlmcPreferences
(
const
QString
&
subPart
)
{
QSettings
s
;
s
.
beginGroup
(
subPart
);
foreach
(
QString
key
,
s
.
allKeys
()
)
{
SettingsManager
::
getInstance
()
->
setValue
(
subPart
+
"/"
+
key
,
s
.
value
(
key
),
SettingsManager
::
Vlmc
);
}
}
#undef CREATE_MENU_SHORTCUT
...
...
@@ -343,7 +359,7 @@ void MainWindow::initializeDockWidgets( void )
void
MainWindow
::
createGlobalPreferences
()
{
m_globalPreferences
=
new
Settings
(
this
);
m_globalPreferences
=
new
Settings
(
SettingsManager
::
Vlmc
,
this
);
m_globalPreferences
->
addCategorie
(
"general"
,
SettingsManager
::
Vlmc
,
QIcon
(
":/images/images/vlmc.png"
),
tr
(
"VLMC settings"
)
);
...
...
@@ -354,7 +370,7 @@ void MainWindow::createGlobalPreferences()
void
MainWindow
::
createProjectPreferences
()
{
m_projectPreferences
=
new
Settings
(
this
);
m_projectPreferences
=
new
Settings
(
SettingsManager
::
Project
,
this
);
m_projectPreferences
->
addCategorie
(
"general"
,
SettingsManager
::
Project
,
QIcon
(
":/images/images/vlmc.png"
),
tr
(
"Project settings"
)
);
...
...
src/Gui/MainWindow.h
View file @
d0570b53
...
...
@@ -66,6 +66,7 @@ private:
void
createGlobalPreferences
();
void
createProjectPreferences
();
void
initVlmcPreferences
();
void
loadVlmcPreferences
(
const
QString
&
subPart
);
#ifdef WITH_CRASHBUTTON
void
setupCrashTester
();
#endif
...
...
src/Gui/settings/Settings.cpp
View file @
d0570b53
...
...
@@ -38,10 +38,10 @@
Settings
::
Settings
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QDialog
(
parent
,
f
),
m_
currentWidget
(
NULL
)
Settings
::
Settings
(
SettingsManager
::
Type
type
,
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QDialog
(
parent
,
f
)
,
m_currentWidget
(
NULL
),
m_
type
(
type
)
{
setMinimumHeight
(
400
);
setMinimumWidth
(
600
);
...
...
@@ -150,7 +150,9 @@ void Settings::buttonClicked( QAbstractButton* button )
// Ask each widget to save their state
for
(
int
i
=
0
;
i
<
m_pWidgets
.
count
();
++
i
)
m_pWidgets
.
at
(
i
)
->
save
();
//If we're handling vlmc preferences, save the value in the QSettings
if
(
m_type
==
SettingsManager
::
Vlmc
)
SettingsManager
::
getInstance
()
->
save
();
}
if
(
hide
==
true
)
setVisible
(
false
);
...
...
src/Gui/settings/Settings.h
View file @
d0570b53
...
...
@@ -45,8 +45,7 @@ class Settings : public QDialog
Q_DISABLE_COPY
(
Settings
)
public:
Settings
(
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
f
=
0
);
Settings
(
SettingsManager
::
Type
type
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
f
=
0
);
virtual
~
Settings
();
void
addCategorie
(
const
QString
&
name
,
...
...
@@ -65,6 +64,7 @@ class Settings : public QDialog
Panel
*
m_panel
;
QLabel
*
m_title
;
QScrollArea
*
m_configPanel
;
SettingsManager
::
Type
m_type
;
public
slots
:
void
switchWidget
(
int
index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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