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
d78f7d70
Commit
d78f7d70
authored
Dec 20, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added automatic backup and automatic backup interval to the GUI
parent
6422aa6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
14 deletions
+97
-14
src/Configuration/VLMCSettingsDefault.cpp
src/Configuration/VLMCSettingsDefault.cpp
+4
-4
src/GUI/settings/VLMCPreferences.cpp
src/GUI/settings/VLMCPreferences.cpp
+28
-4
src/GUI/settings/VLMCPreferences.h
src/GUI/settings/VLMCPreferences.h
+7
-1
src/GUI/settings/ui/VLMCPreferences.ui
src/GUI/settings/ui/VLMCPreferences.ui
+58
-5
No files found.
src/Configuration/VLMCSettingsDefault.cpp
View file @
d78f7d70
...
...
@@ -39,17 +39,17 @@ void VLMCSettingsDefault::load( const QString& part )
void
VLMCSettingsDefault
::
loadVLMCDefaults
(
const
QString
&
part
)
{
SettingsManager
*
settingsMan
=
SettingsManager
::
getInstance
();
QVariant
defaultOutputPFS
=
"30"
;
QVariant
defaultTrackNb
=
"64"
;
settingsMan
->
setValue
(
part
,
"VLMCOutPutFPS"
,
defaultOutputPFS
);
"VLMCOutPutFPS"
,
"30"
);
settingsMan
->
setValue
(
part
,
"VLMCTracksNb"
,
defaultTrackNb
);
"64"
);
settingsMan
->
setValue
(
part
,
"VLMCWorkspace"
,
QDir
::
homePath
()
);
settingsMan
->
setValue
(
part
,
"AutomaticBackup"
,
true
);
settingsMan
->
setValue
(
part
,
"AutomaticBackupInterval"
,
5
);
return
;
}
...
...
src/GUI/settings/VLMCPreferences.cpp
View file @
d78f7d70
...
...
@@ -29,21 +29,41 @@ VLMCPreferences::VLMCPreferences( QWidget *parent )
:
PreferenceWidget
(
parent
)
{
m_ui
.
setupUi
(
this
);
setAutomaticSaveLabelVisiblity
(
m_ui
.
automaticSave
->
isChecked
()
);
connect
(
m_ui
.
automaticSave
,
SIGNAL
(
stateChanged
(
int
)
),
this
,
SLOT
(
setAutomaticSaveLabelVisiblity
(
int
)
)
);
}
VLMCPreferences
::~
VLMCPreferences
()
{
}
VLMCPreferences
::~
VLMCPreferences
()
{
}
void
VLMCPreferences
::
setAutomaticSaveLabelVisiblity
(
int
visible
)
{
setAutomaticSaveLabelVisiblity
(
visible
!=
0
);
}
void
VLMCPreferences
::
setAutomaticSaveLabelVisiblity
(
bool
visible
)
{
m_ui
.
automaticSaveInterval
->
setVisible
(
visible
);
m_ui
.
automaticSaveIntervalLabel
->
setVisible
(
visible
);
m_ui
.
minutesLabel
->
setVisible
(
visible
);
}
void
VLMCPreferences
::
load
()
{
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
const
QString
&
part
=
m_defaults
?
"default"
:
m_settName
;
QString
outputFPS
=
settMan
->
getValue
(
part
,
"VLMCOutPutFPS"
)
->
get
().
toString
();
QString
tracksNb
=
settMan
->
getValue
(
part
,
"VLMCTracksNb"
)
->
get
().
toString
();
QString
outputFPS
=
settMan
->
getValue
(
part
,
"VLMCOutPutFPS"
)
->
get
().
toString
();
QString
tracksNb
=
settMan
->
getValue
(
part
,
"VLMCTracksNb"
)
->
get
().
toString
();
bool
autoSave
=
settMan
->
getValue
(
part
,
"AutomaticBackup"
)
->
get
().
toBool
();
QString
autoSaveInterval
=
settMan
->
getValue
(
part
,
"AutomaticBackupInterval"
)
->
get
().
toString
();
m_ui
.
outputFPS
->
setText
(
outputFPS
);
m_ui
.
tracksNb
->
setText
(
tracksNb
);
m_ui
.
automaticSave
->
setChecked
(
autoSave
);
m_ui
.
automaticSaveInterval
->
setText
(
autoSaveInterval
);
setAutomaticSaveLabelVisiblity
(
autoSave
);
}
void
VLMCPreferences
::
save
()
...
...
@@ -51,7 +71,11 @@ void VLMCPreferences::save()
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
QVariant
outputFPS
(
m_ui
.
outputFPS
->
text
()
);
QVariant
tracksNb
(
m_ui
.
tracksNb
->
text
()
);
QVariant
autoSave
(
m_ui
.
automaticSave
->
isChecked
()
);
QVariant
autoSaveInterval
(
m_ui
.
automaticSaveInterval
->
text
()
);
settMan
->
setValue
(
m_settName
,
"VLMCOutPutFPS"
,
outputFPS
);
settMan
->
setValue
(
m_settName
,
"VLMCTracksNb"
,
tracksNb
);
settMan
->
setValue
(
m_settName
,
"AutomaticBackup"
,
autoSave
);
settMan
->
setValue
(
m_settName
,
"AutomaticBackupInterval"
,
autoSaveInterval
);
}
src/GUI/settings/VLMCPreferences.h
View file @
d78f7d70
...
...
@@ -30,12 +30,18 @@
class
VLMCPreferences
:
public
PreferenceWidget
{
//Q_OBJECT
Q_OBJECT
public:
VLMCPreferences
(
QWidget
*
parent
=
0
);
~
VLMCPreferences
();
void
load
();
void
save
();
private
slots
:
void
setAutomaticSaveLabelVisiblity
(
bool
visible
);
void
setAutomaticSaveLabelVisiblity
(
int
visible
);
private:
Ui
::
VLMCPreferences
m_ui
;
};
...
...
src/GUI/settings/ui/VLMCPreferences.ui
View file @
d78f7d70
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
4
00
</width>
<height>
140
</height>
<width>
4
15
</width>
<height>
304
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -21,7 +21,7 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"
1
"
>
<item
row=
"0"
column=
"
2
"
>
<widget
class=
"QLineEdit"
name=
"outputFPS"
>
<property
name=
"text"
>
<string>
25
</string>
...
...
@@ -38,7 +38,7 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"
1
"
>
<item
row=
"1"
column=
"
2
"
>
<widget
class=
"QLineEdit"
name=
"tracksNb"
>
<property
name=
"text"
>
<string>
64
</string>
...
...
@@ -48,7 +48,7 @@
</property>
</widget>
</item>
<item
row=
"
2
"
column=
"0"
>
<item
row=
"
6
"
column=
"0"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -61,6 +61,59 @@
</property>
</spacer>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"automaticSaveLabell"
>
<property
name=
"text"
>
<string>
Automatic save
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
>
<widget
class=
"QCheckBox"
name=
"automaticSave"
>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"automaticSaveIntervalLabel"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Maximum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Automatic save interval
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"saveIntervalLabel"
>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::SetDefaultConstraint
</enum>
</property>
<item>
<widget
class=
"QLineEdit"
name=
"automaticSaveInterval"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"minutesLabel"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Maximum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
minutes
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
...
...
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