Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
56107241
Commit
56107241
authored
Sep 07, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt sprefs: save lang in registry
Close #9329
parent
7f4ef985
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
387 additions
and
173 deletions
+387
-173
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+182
-1
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+7
-0
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+4
-0
modules/gui/qt4/ui/sprefs_interface.ui
modules/gui/qt4/ui/sprefs_interface.ui
+194
-172
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
56107241
...
...
@@ -51,9 +51,138 @@
#ifdef _WIN32
# include <vlc_windows_interfaces.h>
# include <vlc_charset.h>
#endif
#include <vlc_modules.h>
static
const
char
*
const
ppsz_language
[]
=
{
"auto"
,
"en"
,
"ar"
,
"bn"
,
"pt_BR"
,
"en_GB"
,
"el"
,
"bg"
,
"ca"
,
"zh_TW"
,
"cs"
,
"da"
,
"nl"
,
"fi"
,
"et"
,
"eu"
,
"fr"
,
"ga"
,
"gd"
,
"gl"
,
"ka"
,
"de"
,
"he"
,
"hr"
,
"hu"
,
"hy"
,
"is"
,
"id"
,
"it"
,
"ja"
,
"ko"
,
"lt"
,
"mn"
,
"ms"
,
"nb"
,
"nn"
,
"kk"
,
"km"
,
"ne"
,
"oc"
,
"fa"
,
"pl"
,
"pt_PT"
,
"pa"
,
"ro"
,
"ru"
,
"zh_CN"
,
"si"
,
"sr"
,
"sk"
,
"sl"
,
"ckb"
,
"es"
,
"sv"
,
"te"
,
"tr"
,
"uk"
,
"vi"
,
"wa"
,
NULL
,
};
static
const
char
*
const
ppsz_language_text
[]
=
{
N_
(
"Auto"
),
"American English"
,
"ﻉﺮﺒﻳ"
,
"বাংলা"
,
"Português Brasileiro"
,
"British English"
,
"Νέα Ελληνικά"
,
"български език"
,
"Català"
,
"正體中文"
,
"Čeština"
,
"Dansk"
,
"Nederlands"
,
"Suomi"
,
"eesti keel"
,
"Euskara"
,
"Français"
,
"Gaeilge"
,
"Gàidhlig"
,
"Galego"
,
"ქართული"
,
"Deutsch"
,
"עברית"
,
"hrvatski"
,
"Magyar"
,
"հայերեն"
,
"íslenska"
,
"Bahasa Indonesia"
,
"Italiano"
,
"日本語"
,
"한국어"
,
"lietuvių"
,
"Монгол хэл"
,
"Melayu"
,
"Bokmål"
,
"Nynorsk"
,
"Қазақ тілі"
,
"ភាសាខ្មែរ"
,
"नेपाली"
,
"Occitan"
,
"ﻑﺍﺮﺳی"
,
"Polski"
,
"Português"
,
"ਪੰਜਾਬੀ"
,
"Română"
,
"Русский"
,
"简体中文"
,
"සිංහල"
,
"српски"
,
"Slovensky"
,
"slovenščina"
,
"کوردیی سۆرانی"
,
"Español"
,
"Svenska"
,
"తెలుగు"
,
"Türkçe"
,
"украї́нська мо́ва"
,
"tiếng Việt"
,
"Walon"
,
};
/*********************************************************************
* The List of categories
*********************************************************************/
...
...
@@ -125,6 +254,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
module_config_t
*
p_config
;
ConfigControl
*
control
;
number
=
_number
;
lang
=
NULL
;
#define CONFIG_GENERIC( option, type, label, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
...
...
@@ -556,6 +686,29 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
* Interface Panel *
*******************/
START_SPREFS_CAT
(
Interface
,
qtr
(
"Interface Settings"
)
);
#ifndef _WIN32
ui
.
langBox
->
hide
();
#else
for
(
int
i
=
0
;
ppsz_language
[
i
]
!=
NULL
;
i
++
)
ui
.
langCombo
->
addItem
(
qfu
(
ppsz_language_text
[
i
]),
ppsz_language
[
i
]);
CONNECT
(
ui
.
langCombo
,
currentIndexChanged
(
int
),
this
,
langChanged
(
int
)
);
HKEY
h_key
;
char
*
langReg
=
NULL
;
if
(
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
TEXT
(
"Software
\\
VideoLAN
\\
VLC
\\
"
),
0
,
KEY_READ
,
&
h_key
)
==
ERROR_SUCCESS
)
{
TCHAR
szData
[
256
];
DWORD
len
=
256
;
if
(
RegQueryValueEx
(
h_key
,
TEXT
(
"Lang"
),
NULL
,
NULL
,
(
LPBYTE
)
&
szData
,
&
len
)
==
ERROR_SUCCESS
)
{
langReg
=
FromWide
(
szData
);
ui
.
langCombo
->
setCurrentIndex
(
ui
.
langCombo
->
findData
(
langReg
)
);
}
}
free
(
langReg
);
#endif
// ui.defaultLabel->setFont( italicFont );
ui
.
skinsLabel
->
setText
(
qtr
(
"This is VLC's skinnable interface. You can download other skins at"
)
...
...
@@ -874,7 +1027,9 @@ void SPrefsPanel::apply()
if
(
qobject_cast
<
QComboBox
*>
(
optionWidgets
[
"styleCB"
])
)
getSettings
()
->
setValue
(
"MainWindow/QtStyle"
,
qobject_cast
<
QComboBox
*>
(
optionWidgets
[
"styleCB"
])
->
currentText
()
);
#ifdef _WIN32
saveLang
();
#endif
break
;
}
...
...
@@ -984,6 +1139,11 @@ void SPrefsPanel::changeStyle( QString s_style )
};
}
void
SPrefsPanel
::
langChanged
(
int
i
)
{
lang
=
strdup
(
ppsz_language
[
i
]
);
}
void
SPrefsPanel
::
configML
()
{
#ifdef SQL_MEDIA_LIBRARY
...
...
@@ -997,6 +1157,27 @@ void SPrefsPanel::configML()
#include <QDialogButtonBox>
#include "util/registry.hpp"
void
SPrefsPanel
::
cleanLang
()
{
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CURRENT_USER
);
qvReg
->
DeleteValue
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
);
qvReg
->
DeleteKey
(
"Software
\\
VideoLAN
\\
"
,
"VLC"
);
qvReg
->
DeleteKey
(
"Software
\\
"
,
"VideoLAN"
);
delete
qvReg
;
}
void
SPrefsPanel
::
saveLang
()
{
if
(
!
lang
)
return
;
if
(
!
strncmp
(
lang
,
"auto"
,
4
)
)
{
cleanLang
();
}
else
{
QVLCRegistry
*
qvReg
=
new
QVLCRegistry
(
HKEY_CURRENT_USER
);
qvReg
->
WriteRegistryString
(
"Software
\\
VideoLAN
\\
VLC
\\
"
,
"Lang"
,
lang
);
}
}
bool
SPrefsPanel
::
addType
(
const
char
*
psz_ext
,
QTreeWidgetItem
*
current
,
QTreeWidgetItem
*
parent
,
QVLCRegistry
*
qvReg
)
{
...
...
modules/gui/qt4/components/simple_preferences.hpp
View file @
56107241
...
...
@@ -96,6 +96,9 @@ public:
virtual
~
SPrefsPanel
();
void
apply
();
void
clean
();
#ifdef _WIN32
void
cleanLang
();
#endif
private:
intf_thread_t
*
p_intf
;
...
...
@@ -107,9 +110,12 @@ private:
QStringList
qs_filter
;
QButtonGroup
*
radioGroup
;
char
*
lang
;
#ifdef _WIN32
QList
<
QTreeWidgetItem
*>
listAsso
;
bool
addType
(
const
char
*
psz_ext
,
QTreeWidgetItem
*
,
QTreeWidgetItem
*
,
QVLCRegistry
*
);
void
saveLang
();
#endif
/* Display only the options for the selected audio output */
...
...
@@ -117,6 +123,7 @@ private slots:
void
lastfm_Changed
(
int
);
void
updateAudioOptions
(
int
);
void
updateAudioVolume
(
int
);
void
langChanged
(
int
);
#ifdef _WIN32
void
assoDialog
();
void
saveAsso
();
...
...
modules/gui/qt4/dialogs/preferences.cpp
View file @
56107241
...
...
@@ -334,6 +334,10 @@ void PrefsDialog::reset()
config_SaveConfigFile
(
p_intf
);
getSettings
()
->
clear
();
#ifdef _WIN32
simple_panels
[
0
]
->
cleanLang
();
#endif
accept
();
}
}
...
...
modules/gui/qt4/ui/sprefs_interface.ui
View file @
56107241
This diff is collapsed.
Click to expand it.
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