Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
d04744ad
Commit
d04744ad
authored
Mar 06, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Preferences and SPrefs. Add the necessary handler for CONFIG_FILE_ITEMs.
parent
c6ea1279
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
6 deletions
+85
-6
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+57
-1
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+23
-0
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+5
-5
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
d04744ad
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include <QGridLayout>
#include <QGridLayout>
#include <QPushButton>
#include <QPushButton>
#include <QSlider>
#include <QSlider>
#include <QFileDialog>
#include <vlc_keys.h>
#include <vlc_keys.h>
...
@@ -101,7 +102,8 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
...
@@ -101,7 +102,8 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
l
,
line
);
l
,
line
);
break
;
break
;
case
CONFIG_ITEM_FILE
:
case
CONFIG_ITEM_FILE
:
fprintf
(
stderr
,
"Todo (CONFIG_ITEM_FILE)
\n
"
);
p_control
=
new
FileConfigControl
(
p_this
,
p_item
,
parent
,
l
,
line
,
false
);
break
;
break
;
case
CONFIG_ITEM_DIRECTORY
:
case
CONFIG_ITEM_DIRECTORY
:
fprintf
(
stderr
,
"Todo (CONFIG_ITEM_DIRECTORY)
\n
"
);
fprintf
(
stderr
,
"Todo (CONFIG_ITEM_DIRECTORY)
\n
"
);
...
@@ -207,6 +209,60 @@ void StringConfigControl::finish()
...
@@ -207,6 +209,60 @@ void StringConfigControl::finish()
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
}
}
/*********** File **************/
FileConfigControl
::
FileConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
QGridLayout
*
l
,
int
&
line
,
bool
pwd
)
:
VStringConfigControl
(
_p_this
,
_p_item
,
_parent
)
{
label
=
new
QLabel
(
qfu
(
p_item
->
psz_text
)
);
text
=
new
QLineEdit
(
qfu
(
p_item
->
value
.
psz
)
);
browse
=
new
QPushButton
(
qtr
(
"Browse"
)
);
BUTTONACT
(
browse
,
updateField
()
);
finish
();
if
(
!
l
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
layout
->
addWidget
(
label
,
0
);
layout
->
addWidget
(
text
,
1
);
layout
->
addWidget
(
browse
,
2
);
widget
->
setLayout
(
layout
);
}
else
{
l
->
addWidget
(
label
,
line
,
0
);
l
->
addWidget
(
text
,
line
,
1
);
l
->
addWidget
(
browse
,
line
,
2
);
}
}
FileConfigControl
::
FileConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QLabel
*
_label
,
QLineEdit
*
_text
,
bool
pwd
)
:
VStringConfigControl
(
_p_this
,
_p_item
)
{
text
=
_text
;
label
=
_label
;
finish
(
);
}
void
FileConfigControl
::
updateField
()
{
text
->
setText
(
QFileDialog
::
getOpenFileName
(
NULL
,
qtr
(
"Select File"
),
qfu
(
p_this
->
p_libvlc
->
psz_homedir
)
)
);
}
void
FileConfigControl
::
finish
()
{
text
->
setText
(
qfu
(
p_item
->
value
.
psz
)
);
text
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
if
(
label
)
label
->
setToolTip
(
qfu
(
p_item
->
psz_longtext
)
);
}
/********* String / choice list **********/
/********* String / choice list **********/
StringListConfigControl
::
StringListConfigControl
(
vlc_object_t
*
_p_this
,
StringListConfigControl
::
StringListConfigControl
(
vlc_object_t
*
_p_this
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
bool
bycat
,
module_config_t
*
_p_item
,
QWidget
*
_parent
,
bool
bycat
,
...
...
modules/gui/qt4/components/preferences_widgets.hpp
View file @
d04744ad
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <QVector>
#include <QVector>
#include <QDialog>
#include <QDialog>
#include <QLabel>
#include <QLabel>
#include <QFile>
#include "qt4.hpp"
#include "qt4.hpp"
#include <assert.h>
#include <assert.h>
...
@@ -251,6 +252,28 @@ private:
...
@@ -251,6 +252,28 @@ private:
QLabel
*
label
;
QLabel
*
label
;
};
};
class
FileConfigControl
:
public
VStringConfigControl
{
Q_OBJECT
;
public:
FileConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QWidget
*
,
QGridLayout
*
,
int
&
,
bool
pwd
);
FileConfigControl
(
vlc_object_t
*
,
module_config_t
*
,
QLabel
*
,
QLineEdit
*
,
bool
pwd
);
virtual
~
FileConfigControl
()
{};
virtual
QString
getValue
()
{
return
text
->
text
();
};
virtual
void
show
()
{
text
->
show
();
label
->
show
();
}
virtual
void
hide
()
{
text
->
hide
();
label
->
hide
();
}
public
slots
:
void
updateField
();
private:
void
finish
();
QLineEdit
*
text
;
QLabel
*
label
;
QPushButton
*
browse
;
};
class
ModuleConfigControl
:
public
VStringConfigControl
class
ModuleConfigControl
:
public
VStringConfigControl
{
{
public:
public:
...
...
modules/gui/qt4/components/simple_preferences.cpp
View file @
d04744ad
...
@@ -157,7 +157,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -157,7 +157,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
dXdisplayDevice
);
dXdisplayDevice
);
#endif
#endif
CONFIG_GENERIC
(
"snapshot-path"
,
String
,
NULL
,
CONFIG_GENERIC
(
"snapshot-path"
,
File
,
NULL
,
snapshotsDirectory
);
/* FIXME -> use file instead of string */
snapshotsDirectory
);
/* FIXME -> use file instead of string */
CONFIG_GENERIC
(
"snapshot-prefix"
,
String
,
NULL
,
snapshotsPrefix
);
CONFIG_GENERIC
(
"snapshot-prefix"
,
String
,
NULL
,
snapshotsPrefix
);
CONFIG_GENERIC
(
"snapshot-sequential"
,
Bool
,
NULL
,
CONFIG_GENERIC
(
"snapshot-sequential"
,
Bool
,
NULL
,
...
@@ -191,13 +191,13 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -191,13 +191,13 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC
(
"aout"
,
Module
,
NULL
,
outputModule
);
CONFIG_GENERIC
(
"aout"
,
Module
,
NULL
,
outputModule
);
#ifndef WIN32
#ifndef WIN32
CONFIG_GENERIC
(
"alsadev"
,
StringList
,
NULL
,
alsaDevice
);
CONFIG_GENERIC
(
"alsadev"
,
StringList
,
NULL
,
alsaDevice
);
CONFIG_GENERIC
(
"dspdev"
,
String
,
NULL
,
OSSDevice
);
CONFIG_GENERIC
(
"dspdev"
,
File
,
NULL
,
OSSDevice
);
//FIXME File
//FIXME File
#else
#else
CONFIG_GENERIC
(
"directx-audio-device"
,
IntegerList
,
NULL
,
CONFIG_GENERIC
(
"directx-audio-device"
,
IntegerList
,
NULL
,
DirectXDevice
);
DirectXDevice
);
#endif
#endif
CONFIG_GENERIC
(
"audiofile-file"
,
String
,
NULL
,
FileName
);
CONFIG_GENERIC
(
"audiofile-file"
,
File
,
NULL
,
FileName
);
//Fixme File
//Fixme File
CONFIG_GENERIC
(
"headphone-dolby"
,
Bool
,
NULL
,
headphoneEffect
);
CONFIG_GENERIC
(
"headphone-dolby"
,
Bool
,
NULL
,
headphoneEffect
);
...
@@ -242,7 +242,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -242,7 +242,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
ui.skins->setChecked( true );*/
ui.skins->setChecked( true );*/
/* CONFIG_GENERIC( "intf", Module, NULL, ??? ); */
//FIXME interface choice
/* CONFIG_GENERIC( "intf", Module, NULL, ??? ); */
//FIXME interface choice
CONFIG_GENERIC
(
"qt-always-video"
,
Bool
,
NULL
,
qtAlwaysVideo
);
CONFIG_GENERIC
(
"qt-always-video"
,
Bool
,
NULL
,
qtAlwaysVideo
);
CONFIG_GENERIC
(
"skins2-last"
,
String
,
NULL
,
fileSkin
);
CONFIG_GENERIC
(
"skins2-last"
,
File
,
NULL
,
fileSkin
);
//FIXME File
//FIXME File
#if defined( WIN32 ) || defined(HAVE_DBUS_3)
#if defined( WIN32 ) || defined(HAVE_DBUS_3)
CONFIG_GENERIC
(
"one-instance"
,
Bool
,
NULL
,
OneInterfaceMode
);
CONFIG_GENERIC
(
"one-instance"
,
Bool
,
NULL
,
OneInterfaceMode
);
...
@@ -257,7 +257,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
...
@@ -257,7 +257,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC
(
"subsdec-encoding"
,
StringList
,
NULL
,
encoding
);
CONFIG_GENERIC
(
"subsdec-encoding"
,
StringList
,
NULL
,
encoding
);
CONFIG_GENERIC
(
"sub-language"
,
String
,
NULL
,
preferredLanguage
);
CONFIG_GENERIC
(
"sub-language"
,
String
,
NULL
,
preferredLanguage
);
CONFIG_GENERIC
(
"freetype-font"
,
String
,
NULL
,
font
);
CONFIG_GENERIC
(
"freetype-font"
,
File
,
NULL
,
font
);
/* FIXME -> use file instead of string */
/* FIXME -> use file instead of string */
CONFIG_GENERIC
(
"freetype-color"
,
IntegerList
,
NULL
,
fontColor
);
CONFIG_GENERIC
(
"freetype-color"
,
IntegerList
,
NULL
,
fontColor
);
CONFIG_GENERIC
(
"freetype-rel-fontsize"
,
IntegerList
,
NULL
,
CONFIG_GENERIC
(
"freetype-rel-fontsize"
,
IntegerList
,
NULL
,
...
...
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