Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLMC
Commits
8593ed1f
Commit
8593ed1f
authored
Apr 02, 2014
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Settings: Remove unnecessary layer to watch setting changes
parent
ca7d6a8e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
56 deletions
+33
-56
src/Commands/KeyboardShortcutHelper.cpp
src/Commands/KeyboardShortcutHelper.cpp
+6
-8
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+4
-4
src/Project/AutomaticBackup.cpp
src/Project/AutomaticBackup.cpp
+11
-11
src/Project/Project.cpp
src/Project/Project.cpp
+5
-5
src/Project/RecentProjects.cpp
src/Project/RecentProjects.cpp
+2
-3
src/Settings/Settings.cpp
src/Settings/Settings.cpp
+0
-14
src/Settings/Settings.h
src/Settings/Settings.h
+0
-1
src/Tools/VlmcLogger.cpp
src/Tools/VlmcLogger.cpp
+5
-10
No files found.
src/Commands/KeyboardShortcutHelper.cpp
View file @
8593ed1f
...
...
@@ -31,10 +31,9 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* pa
m_name
(
name
),
m_action
(
NULL
)
{
QString
set
=
VLMC_GET_STRING
(
name
);
setKey
(
QKeySequence
(
set
)
);
Core
::
getInstance
()
->
settings
()
->
watchValue
(
name
,
this
,
SLOT
(
shortcutUpdated
(
const
QVariant
&
)
)
);
SettingValue
*
setting
=
Core
::
getInstance
()
->
settings
()
->
value
(
name
);
setKey
(
QKeySequence
(
setting
->
get
().
toString
()
)
);
connect
(
setting
,
SIGNAL
(
changed
(
QVariant
)
),
this
,
SLOT
(
shortcutUpdated
(
const
QVariant
&
)
)
);
}
KeyboardShortcutHelper
::
KeyboardShortcutHelper
(
const
QString
&
name
,
QAction
*
action
,
...
...
@@ -43,10 +42,9 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QAction *ac
m_name
(
name
),
m_action
(
action
)
{
QString
set
=
VLMC_GET_STRING
(
name
);
action
->
setShortcut
(
set
);
Core
::
getInstance
()
->
settings
()
->
watchValue
(
name
,
this
,
SLOT
(
shortcutUpdated
(
const
QVariant
&
)
)
);
SettingValue
*
setting
=
Core
::
getInstance
()
->
settings
()
->
value
(
name
);
action
->
setShortcut
(
setting
->
get
().
toString
()
);
connect
(
setting
,
SIGNAL
(
changed
(
QVariant
)
),
this
,
SLOT
(
shortcutUpdated
(
const
QVariant
&
)
)
);
}
void
...
...
src/Gui/MainWindow.cpp
View file @
8593ed1f
...
...
@@ -251,13 +251,13 @@ MainWindow::initVlmcPreferences()
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Select the cut/razor tool in the timeline"
),
actionCut_mode
);
//Setup VLMC Lang. Preferences...
VLMC_CREATE_PREFERENCE_LANGUAGE
(
"vlmc/VLMCLang"
,
"default"
,
SettingValue
*
lang
=
VLMC_CREATE_PREFERENCE_LANGUAGE
(
"vlmc/VLMCLang"
,
"default"
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Language"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"The VLMC's UI language"
)
);
Core
::
getInstance
()
->
settings
()
->
watchValue
(
"vlmc/VLMCLang"
,
LanguageHelper
::
getInstance
(),
SLOT
(
languageChanged
(
const
QVariant
&
)
)
);
connect
(
lang
,
SIGNAL
(
changed
(
QVariant
)
)
,
LanguageHelper
::
getInstance
(),
SLOT
(
languageChanged
(
const
QVariant
&
)
)
);
//Setup VLMC General Preferences...
VLMC_CREATE_PREFERENCE_BOOL
(
"vlmc/ConfirmDeletion"
,
true
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Confirm clip deletion"
),
...
...
src/Project/AutomaticBackup.cpp
View file @
8593ed1f
...
...
@@ -31,18 +31,18 @@ AutomaticBackup::AutomaticBackup( Settings* vlmcSettings, QObject *parent )
,
m_vlmcSettings
(
vlmcSettings
)
{
m_timer
=
new
QTimer
(
this
);
m_vlmcSettings
->
createVar
(
SettingValue
::
Bool
,
"vlmc/AutomaticBackup"
,
false
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Automatic save"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"When this option is activated,"
"VLMC will automatically save your project "
"at a specified interval"
),
SettingValue
::
Nothing
);
m_vlmcSettings
->
createVar
(
SettingValue
::
Int
,
"vlmc/AutomaticBackupInterval"
,
5
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Automatic save interval"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"This is the interval that VLMC will wait "
"between two automatic save"
),
SettingValue
::
Nothing
);
SettingValue
*
autoBackup
=
m_vlmcSettings
->
createVar
(
SettingValue
::
Bool
,
"vlmc/AutomaticBackup"
,
false
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Automatic save"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"When this option is activated,"
"VLMC will automatically save your project "
"at a specified interval"
),
SettingValue
::
Nothing
);
SettingValue
*
interval
=
m_vlmcSettings
->
createVar
(
SettingValue
::
Int
,
"vlmc/AutomaticBackupInterval"
,
5
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Automatic save interval"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"This is the interval that VLMC will wait "
"between two automatic save"
),
SettingValue
::
Nothing
);
vlmcSettings
->
watchValue
(
"vlmc/AutomaticBackup"
,
this
,
SLOT
(
automaticSaveEnabledChanged
(
QVariant
)
)
);
vlmcSettings
->
watchValue
(
"vlmc/AutomaticBackupInterval"
,
this
,
SLOT
(
automaticSaveIntervalChanged
(
QVariant
)
)
);
connect
(
autoBackup
,
SIGNAL
(
changed
(
QVariant
)
)
,
this
,
SLOT
(
automaticSaveEnabledChanged
(
QVariant
)
)
);
connect
(
interval
,
SIGNAL
(
changed
(
QVariant
)
)
,
this
,
SLOT
(
automaticSaveIntervalChanged
(
QVariant
)
)
);
}
AutomaticBackup
::~
AutomaticBackup
()
...
...
src/Project/Project.cpp
View file @
8593ed1f
...
...
@@ -307,11 +307,11 @@ Project::initSettings()
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Number of audio channels"
),
SettingValue
::
Clamped
);
audioChannel
->
setLimits
(
2
,
2
);
m_settings
->
createVar
(
SettingValue
::
String
,
"vlmc/ProjectName"
,
unNamedProject
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Project name"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"The project name"
),
SettingValue
::
NotEmpty
);
m_settings
->
watchValue
(
"vlmc/ProjectName"
,
this
,
SLOT
(
projectNameChanged
(
QVariant
)
)
);
SettingValue
*
pName
=
m_settings
->
createVar
(
SettingValue
::
String
,
"vlmc/ProjectName"
,
unNamedProject
,
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"Project name"
),
QT_TRANSLATE_NOOP
(
"PreferenceWidget"
,
"The project name"
),
SettingValue
::
NotEmpty
);
connect
(
pName
,
SIGNAL
(
changed
(
QVariant
)
)
,
this
,
SLOT
(
projectNameChanged
(
QVariant
)
)
);
}
QString
...
...
src/Project/RecentProjects.cpp
View file @
8593ed1f
...
...
@@ -33,11 +33,10 @@ RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
,
m_settings
(
vlmcSettings
)
,
m_project
(
NULL
)
{
vlmcSettings
->
createVar
(
SettingValue
::
String
,
"private/RecentsProjects"
,
""
,
SettingValue
*
recentProjects
=
vlmcSettings
->
createVar
(
SettingValue
::
String
,
"private/RecentsProjects"
,
""
,
""
,
""
,
SettingValue
::
Private
);
vlmcSettings
->
watchValue
(
"private/RecentsProjects"
,
this
,
SLOT
(
loadRecentProjects
(
QVariant
)
)
);
connect
(
recentProjects
,
SIGNAL
(
changed
(
QVariant
)
),
this
,
SLOT
(
loadRecentProjects
(
QVariant
)
)
);
}
void
...
...
src/Settings/Settings.cpp
View file @
8593ed1f
...
...
@@ -47,20 +47,6 @@ Settings::~Settings()
delete
m_settingsFile
;
}
bool
Settings
::
watchValue
(
const
QString
&
key
,
QObject
*
receiver
,
const
char
*
method
,
Qt
::
ConnectionType
cType
)
{
SettingValue
*
s
=
value
(
key
);
if
(
s
!=
NULL
)
{
QObject
::
connect
(
s
,
SIGNAL
(
changed
(
const
QVariant
&
)
),
receiver
,
method
,
cType
);
return
true
;
}
Q_ASSERT_X
(
false
,
__FILE__
,
"watching value without a created variable"
);
return
false
;
}
void
Settings
::
setSettingsFile
(
const
QString
&
settingsFile
)
{
...
...
src/Settings/Settings.h
View file @
8593ed1f
...
...
@@ -124,7 +124,6 @@ class Settings : public ILoadSave
bool
load
();
bool
save
();
bool
save
(
QXmlStreamWriter
&
project
);
bool
watchValue
(
const
QString
&
key
,
QObject
*
receiver
,
const
char
*
method
,
Qt
::
ConnectionType
cType
=
Qt
::
AutoConnection
);
void
setSettingsFile
(
const
QString
&
settingsFile
);
private:
...
...
src/Tools/VlmcLogger.cpp
View file @
8593ed1f
...
...
@@ -46,13 +46,9 @@ void
VlmcLogger
::
setup
()
{
//setup log level :
{
SettingValue
*
logLevel
=
VLMC_CREATE_PREFERENCE
(
SettingValue
::
Int
,
"private/LogLevel"
,
(
int
)
VlmcLogger
::
Quiet
,
""
,
""
,
SettingValue
::
Private
|
SettingValue
::
Clamped
|
SettingValue
::
Runtime
);
logLevel
->
setLimits
((
int
)
Debug
,
(
int
)
Verbose
);
// Purposedly destroying the setting value, as we need to use the manager for other operations.
//FIXME: Actually I'm not sure for setting the value since this is a private variable.
}
SettingValue
*
logLevel
=
VLMC_CREATE_PREFERENCE
(
SettingValue
::
Int
,
"private/LogLevel"
,
(
int
)
VlmcLogger
::
Quiet
,
""
,
""
,
SettingValue
::
Private
|
SettingValue
::
Clamped
|
SettingValue
::
Runtime
);
logLevel
->
setLimits
((
int
)
Debug
,
(
int
)
Verbose
);
QStringList
args
=
qApp
->
arguments
();
if
(
args
.
indexOf
(
QRegExp
(
"-vv+"
)
)
>=
0
)
m_currentLogLevel
=
VlmcLogger
::
Debug
;
...
...
@@ -60,9 +56,8 @@ VlmcLogger::setup()
m_currentLogLevel
=
VlmcLogger
::
Verbose
;
else
m_currentLogLevel
=
VlmcLogger
::
Quiet
;
Settings
*
settings
=
Core
::
getInstance
()
->
settings
();
settings
->
setValue
(
"private/LogLevel"
,
m_currentLogLevel
);
settings
->
watchValue
(
"private/LogLevel"
,
this
,
SLOT
(
logLevelChanged
(
const
QVariant
&
)),
Qt
::
DirectConnection
);
logLevel
->
set
(
m_currentLogLevel
);
connect
(
logLevel
,
SIGNAL
(
changed
(
QVariant
)
),
this
,
SLOT
(
logLevelChanged
(
QVariant
)
)
);
int
pos
=
args
.
indexOf
(
QRegExp
(
"--logfile=.*"
)
);
if
(
pos
>
0
)
...
...
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