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
9c035e4d
Commit
9c035e4d
authored
May 19, 2014
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: put simple preferences section at the top
Close #10763 #7909, #9624
parent
13bb59c7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
43 deletions
+29
-43
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+13
-22
modules/gui/qt4/components/simple_preferences.hpp
modules/gui/qt4/components/simple_preferences.hpp
+2
-2
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+13
-12
modules/gui/qt4/dialogs/preferences.hpp
modules/gui/qt4/dialogs/preferences.hpp
+1
-2
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+0
-4
modules/gui/qt4/qt4.hpp
modules/gui/qt4/qt4.hpp
+0
-1
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
9c035e4d
...
...
@@ -46,7 +46,7 @@
#include <QDir>
#include <math.h>
#define ICON_HEIGHT
64
#define ICON_HEIGHT
48
#ifdef _WIN32
# include <vlc_windows_interfaces.h>
...
...
@@ -239,10 +239,10 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
/*********************************************************************
* The List of categories
*********************************************************************/
SPrefsCatList
::
SPrefsCatList
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
bool
small
)
:
SPrefsCatList
::
SPrefsCatList
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
Q
VBoxLayout
*
layout
=
new
QV
BoxLayout
();
Q
HBoxLayout
*
layout
=
new
QH
BoxLayout
();
/* Use autoExclusive buttons and a mapper as QButtonGroup can't
set focus (keys) when it manages the buttons's exclusivity.
...
...
@@ -250,7 +250,7 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma
QSignalMapper
*
mapper
=
new
QSignalMapper
(
layout
);
CONNECT
(
mapper
,
mapped
(
int
),
this
,
switchPanel
(
int
)
);
short
icon_height
=
small
?
ICON_HEIGHT
/
2
:
ICON_HEIGHT
;
short
icon_height
=
ICON_HEIGHT
;
#define ADD_CATEGORY( button, label, ltooltip, icon, numb ) \
QToolButton * button = new QToolButton( this ); \
...
...
@@ -260,7 +260,7 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma
button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); \
button->setIconSize( QSize( icon_height, icon_height ) ); \
button->resize( icon_height + 6 , icon_height + 6 ); \
button->setSizePolicy(QSizePolicy::
Expanding,QSizePolicy::Expanding) ;
\
button->setSizePolicy(QSizePolicy::
MinimumExpanding, QSizePolicy::Preferred );
\
button->setAutoRaise( true ); \
button->setCheckable( true ); \
button->setAutoExclusive( true ); \
...
...
@@ -287,10 +287,9 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma
layout
->
setMargin
(
0
);
layout
->
setSpacing
(
1
);
set
MinimumWidth
(
140
);
set
SizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
set
SizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Preferred
);
set
MinimumWidth
(
ICON_HEIGHT
*
6
+
10
);
setLayout
(
layout
);
}
void
SPrefsCatList
::
switchPanel
(
int
i
)
...
...
@@ -302,7 +301,7 @@ void SPrefsCatList::switchPanel( int i )
* The Panels
*********************************************************************/
SPrefsPanel
::
SPrefsPanel
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
,
int
_number
,
bool
small
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
int
_number
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
module_config_t
*
p_config
;
ConfigControl
*
control
;
...
...
@@ -930,19 +929,11 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
panel_layout
->
addWidget
(
panel_label
);
panel_layout
->
addWidget
(
title_line
);
if
(
small
)
{
QScrollArea
*
scroller
=
new
QScrollArea
;
scroller
->
setWidget
(
panel
);
scroller
->
setWidgetResizable
(
true
);
scroller
->
setFrameStyle
(
QFrame
::
NoFrame
);
panel_layout
->
addWidget
(
scroller
);
}
else
{
panel_layout
->
addWidget
(
panel
);
if
(
number
!=
SPrefsHotkeys
)
panel_layout
->
addStretch
(
2
);
}
QScrollArea
*
scroller
=
new
QScrollArea
;
scroller
->
setWidget
(
panel
);
scroller
->
setWidgetResizable
(
true
);
scroller
->
setFrameStyle
(
QFrame
::
NoFrame
);
panel_layout
->
addWidget
(
scroller
);
setLayout
(
panel_layout
);
...
...
modules/gui/qt4/components/simple_preferences.hpp
View file @
9c035e4d
...
...
@@ -78,7 +78,7 @@ class SPrefsCatList : public QWidget
{
Q_OBJECT
public:
SPrefsCatList
(
intf_thread_t
*
,
QWidget
*
,
bool
);
SPrefsCatList
(
intf_thread_t
*
,
QWidget
*
);
virtual
~
SPrefsCatList
()
{};
private:
intf_thread_t
*
p_intf
;
...
...
@@ -92,7 +92,7 @@ class SPrefsPanel : public QWidget
{
Q_OBJECT
public:
SPrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
int
,
bool
);
SPrefsPanel
(
intf_thread_t
*
,
QWidget
*
,
int
);
virtual
~
SPrefsPanel
();
void
apply
();
void
clean
();
...
...
modules/gui/qt4/dialogs/preferences.cpp
View file @
9c035e4d
...
...
@@ -33,6 +33,7 @@
#include "components/complete_preferences.hpp"
#include "components/simple_preferences.hpp"
#include "util/searchlineedit.hpp"
#include "util/qvlcframe.hpp"
#include "main_interface.hpp"
#include <QHBoxLayout>
...
...
@@ -44,6 +45,7 @@
#include <QStackedWidget>
#include <QSplitter>
#include <QShortcut>
#include <QScrollArea>
PrefsDialog
::
PrefsDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QVLCDialog
(
parent
,
_p_intf
)
...
...
@@ -96,12 +98,10 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
buttonsBox
->
addButton
(
cancel
,
QDialogButtonBox
::
RejectRole
);
buttonsBox
->
addButton
(
reset
,
QDialogButtonBox
::
ResetRole
);
simple_split_widget
=
new
QWidget
();
simple_split_widget
->
setLayout
(
new
Q
H
BoxLayout
);
simple_split_widget
->
setLayout
(
new
Q
V
BoxLayout
);
advanced_split_widget
=
new
QSplitter
();
advanced_split_widget
->
setLayout
(
new
QHBoxLayout
);
stack
=
new
QStackedWidget
();
stack
->
insertWidget
(
SIMPLE
,
simple_split_widget
);
...
...
@@ -111,9 +111,8 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
simple_split_widget
->
layout
()
->
addWidget
(
simple_panels_stack
);
simple_split_widget
->
layout
()
->
setMargin
(
0
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_tree_panel
);
advanced_split_widget
->
layout
()
->
addWidget
(
advanced_panels_stack
);
advanced_split_widget
->
layout
()
->
setMargin
(
0
);
advanced_split_widget
->
addWidget
(
advanced_tree_panel
);
advanced_split_widget
->
addWidget
(
advanced_panels_stack
);
/* Layout */
main_layout
->
addWidget
(
stack
,
0
,
0
,
3
,
3
);
...
...
@@ -127,9 +126,6 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
simple_tree_panel
->
layout
()
->
setMargin
(
1
);
simple_panels_stack
->
layout
()
->
setContentsMargins
(
6
,
0
,
0
,
3
);
b_small
=
(
p_intf
->
p_sys
->
i_screenHeight
<
750
);
if
(
b_small
)
msg_Dbg
(
p_intf
,
"Small Resolution"
);
setMaximumHeight
(
p_intf
->
p_sys
->
i_screenHeight
);
for
(
int
i
=
0
;
i
<
SPrefsMax
;
i
++
)
simple_panels
[
i
]
=
NULL
;
if
(
var_InheritBool
(
p_intf
,
"qt-advanced-pref"
)
...
...
@@ -145,7 +141,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
BUTTONACT
(
simple
,
setSimple
()
);
BUTTONACT
(
all
,
setAdvanced
()
);
resize
(
780
,
sizeHint
().
height
(
)
);
QVLCTools
::
restoreWidgetPosition
(
p_intf
,
"Preferences"
,
this
,
QSize
(
800
,
700
)
);
}
void
PrefsDialog
::
setAdvanced
()
...
...
@@ -206,7 +202,7 @@ void PrefsDialog::setSimple()
/* If no simple_tree, create one, connect it */
if
(
!
simple_tree
)
{
simple_tree
=
new
SPrefsCatList
(
p_intf
,
simple_tree_panel
,
b_small
);
simple_tree
=
new
SPrefsCatList
(
p_intf
,
simple_tree_panel
);
CONNECT
(
simple_tree
,
currentItemChanged
(
int
),
this
,
changeSimplePanel
(
int
)
);
...
...
@@ -227,7 +223,7 @@ void PrefsDialog::changeSimplePanel( int number )
{
if
(
!
simple_panels
[
number
]
)
{
SPrefsPanel
*
insert
=
new
SPrefsPanel
(
p_intf
,
simple_panels_stack
,
number
,
b_small
)
;
SPrefsPanel
*
insert
=
new
SPrefsPanel
(
p_intf
,
simple_panels_stack
,
number
)
;
simple_panels_stack
->
insertWidget
(
number
,
insert
);
simple_panels
[
number
]
=
insert
;
}
...
...
@@ -310,11 +306,16 @@ void PrefsDialog::save()
if
(
p_intf
->
p_sys
->
p_mi
)
p_intf
->
p_sys
->
p_mi
->
reloadPrefs
();
accept
();
QVLCTools
::
saveWidgetPosition
(
p_intf
,
"Preferences"
,
this
);
}
/* Clean the preferences, dunno if it does something really */
void
PrefsDialog
::
cancel
()
{
QVLCTools
::
saveWidgetPosition
(
p_intf
,
"Preferences"
,
this
);
reject
();
}
...
...
modules/gui/qt4/dialogs/preferences.hpp
View file @
9c035e4d
...
...
@@ -41,6 +41,7 @@ class QLabel;
class
SearchLineEdit
;
class
QStackedWidget
;
class
QSplitter
;
class
QScrollArea
;
class
PrefsDialog
:
public
QVLCDialog
{
...
...
@@ -75,8 +76,6 @@ private:
QGroupBox
*
types
;
QRadioButton
*
simple
,
*
all
;
bool
b_small
;
private
slots
:
void
setAdvanced
();
void
setSimple
();
...
...
modules/gui/qt4/qt4.cpp
View file @
9c035e4d
...
...
@@ -490,10 +490,6 @@ static void *Thread( void *obj )
/* Initialize timers and the Dialog Provider */
DialogsProvider
::
getInstance
(
p_intf
);
/* Detect screensize for small screens like TV or Netbooks */
p_intf
->
p_sys
->
i_screenHeight
=
app
.
QApplication
::
desktop
()
->
availableGeometry
().
height
();
#ifdef UPDATE_CHECK
/* Checking for VLC updates */
if
(
var_InheritBool
(
p_intf
,
"qt-updates-notif"
)
&&
...
...
modules/gui/qt4/qt4.hpp
View file @
9c035e4d
...
...
@@ -75,7 +75,6 @@ struct intf_sys_t
QString
filepath
;
/* Last path used in dialogs */
int
i_screenHeight
;
/* Detection of Small screens */
unsigned
voutWindowType
;
/* Type of vout_window_t provided */
bool
b_isDialogProvider
;
/* Qt mode or Skins mode */
playlist_t
*
p_playlist
;
/* playlist */
...
...
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