Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
61fc0c2f
Commit
61fc0c2f
authored
Jan 19, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Prepare the work for file association from the interface.
Ref #763.
parent
78109a20
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
192 additions
and
5 deletions
+192
-5
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+8
-0
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+1
-0
modules/gui/qt4/ui/sprefs_interface.ui
modules/gui/qt4/ui/sprefs_interface.ui
+25
-5
modules/gui/qt4/util/registry.cpp
modules/gui/qt4/util/registry.cpp
+128
-0
modules/gui/qt4/util/registry.hpp
modules/gui/qt4/util/registry.hpp
+30
-0
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
61fc0c2f
...
...
@@ -396,9 +396,12 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#if defined( WIN32 ) || defined (__APPLE__)
CONFIG_GENERIC
(
"language"
,
StringList
,
NULL
,
language
);
BUTTONACT
(
ui
.
assoButton
,
assoDialog
);
#else
ui
.
language
->
hide
();
ui
.
languageLabel
->
hide
();
ui
.
assoName
->
hide
();
ui
.
assoButton
->
hide
();
#endif
/* interface */
...
...
@@ -621,3 +624,8 @@ void SPrefsPanel::lastfm_Changed( int i_state )
else
if
(
i_state
==
Qt
::
Unchecked
)
config_RemoveIntf
(
VLC_OBJECT
(
p_intf
),
"audioscrobbler"
);
}
void
SPrefsPanel
::
assoDialog
()
{
}
modules/gui/qt4/components/simple_preferences.hpp
View file @
61fc0c2f
...
...
@@ -100,6 +100,7 @@ private:
private
slots
:
void
lastfm_Changed
(
int
);
void
updateAudioOptions
(
int
);
void
assoDialog
();
};
#endif
modules/gui/qt4/ui/sprefs_interface.ui
View file @
61fc0c2f
...
...
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>4
4
5</width>
<height>5
35
</height>
<width>4
8
5</width>
<height>5
78
</height>
</rect>
</property>
<property name="windowTitle" >
...
...
@@ -136,21 +136,41 @@
<property name="title" >
<string>_("Instances")</string>
</property>
<layout class="Q
VBox
Layout" >
<item>
<layout class="Q
Grid
Layout" >
<item
row="0" column="0" colspan="2"
>
<widget class="QCheckBox" name="OneInterfaceMode" >
<property name="text" >
<string>_("Allow only one instance")</string>
</property>
</widget>
</item>
<item>
<item
row="1" column="0" colspan="2"
>
<widget class="QCheckBox" name="EnqueueOneInterfaceMode" >
<property name="text" >
<string>_("Enqueue files in playlist when in one instance mode")</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="assoName" >
<property name="text" >
<string>_("File associations:")</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="assoButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>_("Association Setup")</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
modules/gui/qt4/util/registry.cpp
0 → 100644
View file @
61fc0c2f
// License GPLv2+
#include "registry.hpp"
QVLCRegistry
::
QVLCRegistry
(
HKEY
rootKey
)
{
this
->
m_RootKey
=
rootKey
;
}
QVLCRegistry
::~
QVLCRegistry
(
void
)
{
}
int
QVLCRegistry
::
RegistryKeyExists
(
char
*
path
)
{
HKEY
keyHandle
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
RegCloseKey
(
keyHandle
);
return
1
;
}
return
0
;
}
int
QVLCRegistry
::
RegistryValueExists
(
char
*
path
,
char
*
valueName
)
{
HKEY
keyHandle
;
int
temp
=
0
;
DWORD
size1
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
temp
=
1
;
}
RegCloseKey
(
keyHandle
);
}
return
temp
;
}
void
QVLCRegistry
::
WriteRegistryInt
(
char
*
path
,
char
*
valueName
,
int
value
)
{
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_DWORD
,(
LPBYTE
)
&
value
,
sizeof
(
int
));
RegCloseKey
(
keyHandle
);
}
}
void
QVLCRegistry
::
WriteRegistryString
(
char
*
path
,
char
*
valueName
,
char
*
value
)
{
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_SZ
,(
LPBYTE
)
value
,(
DWORD
)(
strlen
(
value
)
+
1
));
RegCloseKey
(
keyHandle
);
}
}
void
QVLCRegistry
::
WriteRegistryDouble
(
char
*
path
,
char
*
valueName
,
double
value
)
{
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_BINARY
,(
LPBYTE
)
&
value
,
sizeof
(
double
));
RegCloseKey
(
keyHandle
);
}
}
int
QVLCRegistry
::
ReadRegistryInt
(
char
*
path
,
char
*
valueName
,
int
default_value
)
{
HKEY
keyHandle
;
int
tempValue
;
DWORD
size1
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
if
(
valueType
==
REG_DWORD
)
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
default_value
=
tempValue
;
};
}
}
RegCloseKey
(
keyHandle
);
}
return
default_value
;
}
char
*
QVLCRegistry
::
ReadRegistryString
(
char
*
path
,
char
*
valueName
,
char
*
default_value
)
{
HKEY
keyHandle
;
char
*
tempValue
=
NULL
;
DWORD
size1
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
if
(
valueType
==
REG_SZ
)
{
// free
tempValue
=
(
char
*
)
malloc
(
size1
+
1
);
// +1 fr NullByte`?
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
default_value
=
tempValue
;
};
}
}
RegCloseKey
(
keyHandle
);
}
if
(
tempValue
==
NULL
)
{
// wenn tempValue nicht aus registry gelesen wurde dafr sorgen das ein neuer String mit der Kopie von DefaultValue
// geliefert wird - das macht das Handling des Rckgabewertes der Funktion einfacher - immer schn mit free freigeben!
default_value
=
strdup
(
default_value
);
}
return
default_value
;
}
double
QVLCRegistry
::
ReadRegistryDouble
(
char
*
path
,
char
*
valueName
,
double
default_value
)
{
HKEY
keyHandle
;
double
tempValue
;
DWORD
size1
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
if
((
valueType
==
REG_BINARY
)
&&
(
size1
==
sizeof
(
double
)))
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
default_value
=
tempValue
;
};
}
}
RegCloseKey
(
keyHandle
);
}
return
default_value
;
}
modules/gui/qt4/util/registry.hpp
0 → 100644
View file @
61fc0c2f
// License GPLv2 or later
// Code from ATMO
#ifndef QVLC_REGISTRY_H
#define QVLC_REGISTRY_H
#include <windows.h>
class
QVLCRegistry
{
private:
HKEY
m_RootKey
;
char
m_pathBuffer
[
256
];
public:
QVLCRegistry
(
HKEY
rootKey
);
~
QVLCRegistry
(
void
);
void
WriteRegistryInt
(
char
*
path
,
char
*
valueName
,
int
value
);
void
WriteRegistryString
(
char
*
path
,
char
*
valueName
,
char
*
value
);
void
WriteRegistryDouble
(
char
*
path
,
char
*
valueName
,
double
value
);
int
ReadRegistryInt
(
char
*
path
,
char
*
valueName
,
int
default_value
);
char
*
ReadRegistryString
(
char
*
path
,
char
*
valueName
,
char
*
default_value
);
double
ReadRegistryDouble
(
char
*
path
,
char
*
valueName
,
double
default_value
);
int
RegistryKeyExists
(
char
*
path
);
int
RegistryValueExists
(
char
*
path
,
char
*
valueName
);
};
#endif
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