Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
7b0d97e2
Commit
7b0d97e2
authored
Dec 09, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Qt] Save the values saved during Toolbar edition.
parent
539075e7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
10 deletions
+74
-10
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+1
-1
modules/gui/qt4/dialogs/toolbar.cpp
modules/gui/qt4/dialogs/toolbar.cpp
+59
-9
modules/gui/qt4/dialogs/toolbar.hpp
modules/gui/qt4/dialogs/toolbar.hpp
+14
-0
No files found.
modules/gui/qt4/components/controller.cpp
View file @
7b0d97e2
...
@@ -102,7 +102,7 @@ void AbstractController::setupButton( QAbstractButton *aButton )
...
@@ -102,7 +102,7 @@ void AbstractController::setupButton( QAbstractButton *aButton )
void
AbstractController
::
parseAndCreate
(
QString
config
,
void
AbstractController
::
parseAndCreate
(
QString
config
,
QBoxLayout
*
controlLayout
)
QBoxLayout
*
controlLayout
)
{
{
QStringList
list
=
config
.
split
(
";"
)
;
QStringList
list
=
config
.
split
(
";"
,
QString
::
SkipEmptyParts
)
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
{
QStringList
list2
=
list
.
at
(
i
).
split
(
"-"
);
QStringList
list2
=
list
.
at
(
i
).
split
(
"-"
);
...
...
modules/gui/qt4/dialogs/toolbar.cpp
View file @
7b0d97e2
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include <QListWidget>
#include <QListWidget>
#include <QDragEnterEvent>
#include <QDragEnterEvent>
#include <QDialogButtonBox>
ToolbarEditDialog
*
ToolbarEditDialog
::
instance
=
NULL
;
ToolbarEditDialog
*
ToolbarEditDialog
::
instance
=
NULL
;
...
@@ -74,22 +75,22 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
...
@@ -74,22 +75,22 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
mainTboxLayout
->
addWidget
(
label
,
0
,
0
,
1
,
2
);
mainTboxLayout
->
addWidget
(
label
,
0
,
0
,
1
,
2
);
QComboBox
*
positionCombo
=
new
QComboBox
;
QComboBox
*
positionCombo
=
new
QComboBox
;
positionCombo
->
addItems
(
QStringList
()
<<
"
Over
the Video"
positionCombo
->
addItems
(
QStringList
()
<<
"
Above
the Video"
<<
"Under the Video"
);
<<
"Under the Video"
);
mainTboxLayout
->
addWidget
(
positionCombo
,
0
,
2
,
1
,
1
);
mainTboxLayout
->
addWidget
(
positionCombo
,
0
,
2
,
1
,
1
);
QLabel
*
line1Label
=
new
QLabel
(
"Line 1:"
);
QLabel
*
line1Label
=
new
QLabel
(
"Line 1:"
);
QString
line1
=
getSettings
()
->
value
(
"MainWindow/Controls1"
,
QString
line1
=
getSettings
()
->
value
(
"MainWindow/Controls1"
,
"64;36;37;38;65"
).
toString
();
"64;36;37;38;65"
).
toString
();
DroppingController
*
controller1
=
new
DroppingController
(
p_intf
,
line1
,
controller1
=
new
DroppingController
(
p_intf
,
line1
,
this
);
this
);
mainTboxLayout
->
addWidget
(
line1Label
,
1
,
0
,
1
,
1
);
mainTboxLayout
->
addWidget
(
line1Label
,
1
,
0
,
1
,
1
);
mainTboxLayout
->
addWidget
(
controller1
,
1
,
1
,
1
,
2
);
mainTboxLayout
->
addWidget
(
controller1
,
1
,
1
,
1
,
2
);
QLabel
*
line2Label
=
new
QLabel
(
"Line 2:"
);
QLabel
*
line2Label
=
new
QLabel
(
"Line 2:"
);
QString
line2
=
getSettings
()
->
value
(
"MainWindow/Controls2"
,
QString
line2
=
getSettings
()
->
value
(
"MainWindow/Controls2"
,
"0-2;64;3;1;4;64;7;10;9;65;34-4"
).
toString
();
"0-2;64;3;1;4;64;7;10;9;65;34-4
;
"
).
toString
();
DroppingController
*
controller2
=
new
DroppingController
(
p_intf
,
line2
,
controller2
=
new
DroppingController
(
p_intf
,
line2
,
this
);
this
);
mainTboxLayout
->
addWidget
(
line2Label
,
2
,
0
,
1
,
1
);
mainTboxLayout
->
addWidget
(
line2Label
,
2
,
0
,
1
,
1
);
mainTboxLayout
->
addWidget
(
controller2
,
2
,
1
,
1
,
2
);
mainTboxLayout
->
addWidget
(
controller2
,
2
,
1
,
1
,
2
);
...
@@ -98,7 +99,7 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
...
@@ -98,7 +99,7 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
QLabel
*
advLabel
=
new
QLabel
(
"Advanced Widget toolbar:"
);
QLabel
*
advLabel
=
new
QLabel
(
"Advanced Widget toolbar:"
);
QString
lineA
=
getSettings
()
->
value
(
"MainWindow/AdvControl"
,
QString
lineA
=
getSettings
()
->
value
(
"MainWindow/AdvControl"
,
"12;11;13;14"
).
toString
();
"12;11;13;14"
).
toString
();
DroppingController
*
controllerA
=
new
DroppingController
(
p_intf
,
lineA
,
controllerA
=
new
DroppingController
(
p_intf
,
lineA
,
this
);
this
);
mainTboxLayout
->
addWidget
(
advLabel
,
3
,
0
,
1
,
2
);
mainTboxLayout
->
addWidget
(
advLabel
,
3
,
0
,
1
,
2
);
mainTboxLayout
->
addWidget
(
controllerA
,
3
,
2
,
1
,
1
);
mainTboxLayout
->
addWidget
(
controllerA
,
3
,
2
,
1
,
1
);
...
@@ -109,9 +110,9 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
...
@@ -109,9 +110,9 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
QGroupBox
*
timeToolbarBox
=
new
QGroupBox
(
"Time Toolbar"
,
this
);
QGroupBox
*
timeToolbarBox
=
new
QGroupBox
(
"Time Toolbar"
,
this
);
QGridLayout
*
timeTboxLayout
=
new
QGridLayout
(
timeToolbarBox
);
QGridLayout
*
timeTboxLayout
=
new
QGridLayout
(
timeToolbarBox
);
QString
line
=
getSettings
()
->
value
(
"
time
Window/InputControl"
,
QString
line
=
getSettings
()
->
value
(
"
Main
Window/InputControl"
,
"5-1;33;6-1"
).
toString
();
"5-1;33;6-1"
).
toString
();
DroppingController
*
controller
=
new
DroppingController
(
p_intf
,
line
,
controller
=
new
DroppingController
(
p_intf
,
line
,
this
);
this
);
timeTboxLayout
->
addWidget
(
controller
,
0
,
0
,
1
,
-
1
);
timeTboxLayout
->
addWidget
(
controller
,
0
,
0
,
1
,
-
1
);
...
@@ -123,13 +124,22 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
...
@@ -123,13 +124,22 @@ ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
QString
lineFSC
=
getSettings
()
->
value
(
"MainWindow/FSCline"
,
QString
lineFSC
=
getSettings
()
->
value
(
"MainWindow/FSCline"
,
"0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34"
).
toString
();
"0-2;64;3;1;4;64;36;64;37;64;8;65;35-4;34"
).
toString
();
DroppingController
*
controllerFSC
=
new
DroppingController
(
p_intf
,
controllerFSC
=
new
DroppingController
(
p_intf
,
lineFSC
,
this
);
lineFSC
,
this
);
FSCTboxLayout
->
addWidget
(
controllerFSC
,
0
,
0
,
1
,
-
1
);
FSCTboxLayout
->
addWidget
(
controllerFSC
,
0
,
0
,
1
,
-
1
);
mainLayout
->
addWidget
(
FSCToolbarBox
,
3
,
0
,
1
,
-
1
);
mainLayout
->
addWidget
(
FSCToolbarBox
,
3
,
0
,
1
,
-
1
);
/* Buttons */
QDialogButtonBox
*
okCancel
=
new
QDialogButtonBox
;
QPushButton
*
okButton
=
new
QPushButton
(
qtr
(
"Cl&ose"
),
this
);
QPushButton
*
cancelButton
=
new
QPushButton
(
qtr
(
"&Cancel"
),
this
);
okCancel
->
addButton
(
okButton
,
QDialogButtonBox
::
AcceptRole
);
okCancel
->
addButton
(
cancelButton
,
QDialogButtonBox
::
RejectRole
);
BUTTONACT
(
okButton
,
close
()
);
BUTTONACT
(
cancelButton
,
cancel
()
);
mainLayout
->
addWidget
(
okCancel
,
4
,
2
);
}
}
...
@@ -137,6 +147,22 @@ ToolbarEditDialog::~ToolbarEditDialog()
...
@@ -137,6 +147,22 @@ ToolbarEditDialog::~ToolbarEditDialog()
{
{
}
}
void
ToolbarEditDialog
::
close
()
{
msg_Dbg
(
p_intf
,
"Close and save"
);
hide
();
getSettings
()
->
setValue
(
"MainWindow/Controls1"
,
controller1
->
getValue
()
);
getSettings
()
->
setValue
(
"MainWindow/Controls2"
,
controller2
->
getValue
()
);
getSettings
()
->
setValue
(
"MainWindow/AdcControl"
,
controllerA
->
getValue
()
);
getSettings
()
->
setValue
(
"MainWindow/InputControl"
,
controller
->
getValue
()
);
getSettings
()
->
setValue
(
"MainWindow/FSCline"
,
controllerFSC
->
getValue
()
);
}
void
ToolbarEditDialog
::
cancel
()
{
hide
();
}
WidgetListing
::
WidgetListing
(
intf_thread_t
*
p_intf
,
QWidget
*
_parent
)
WidgetListing
::
WidgetListing
(
intf_thread_t
*
p_intf
,
QWidget
*
_parent
)
:
QListWidget
(
_parent
)
:
QListWidget
(
_parent
)
{
{
...
@@ -332,6 +358,10 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout,
...
@@ -332,6 +358,10 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout,
buttonType_e
i_type
,
buttonType_e
i_type
,
int
i_option
)
int
i_option
)
{
{
doubleInt
*
value
=
new
doubleInt
;
value
->
i_type
=
i_type
;
value
->
i_option
=
i_option
;
/* Special case for SPACERS, who aren't QWidgets */
/* Special case for SPACERS, who aren't QWidgets */
if
(
i_type
==
WIDGET_SPACER
||
i_type
==
WIDGET_SPACER_EXTEND
)
if
(
i_type
==
WIDGET_SPACER
||
i_type
==
WIDGET_SPACER_EXTEND
)
{
{
...
@@ -359,6 +389,26 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout,
...
@@ -359,6 +389,26 @@ void DroppingController::createAndAddWidget( QBoxLayout *controlLayout,
widg
->
show
();
widg
->
show
();
controlLayout
->
insertWidget
(
i_index
,
widg
);
controlLayout
->
insertWidget
(
i_index
,
widg
);
}
}
/* QList and QBoxLayout don't act the same with insert() */
if
(
i_index
<
0
)
i_index
=
controlLayout
->
count
()
-
1
;
widgetList
.
insert
(
i_index
,
value
);
}
QString
DroppingController
::
getValue
()
{
QString
qs
=
""
;
for
(
int
i
=
0
;
i
<
controlLayout
->
count
();
i
++
)
{
doubleInt
*
dI
=
widgetList
.
at
(
i
);
assert
(
dI
);
qs
.
append
(
QString
::
number
(
dI
->
i_type
)
);
if
(
dI
->
i_option
)
qs
.
append
(
"-"
+
QString
::
number
(
dI
->
i_option
)
);
qs
.
append
(
';'
);
}
return
qs
;
}
}
void
DroppingController
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
void
DroppingController
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
...
...
modules/gui/qt4/dialogs/toolbar.hpp
View file @
7b0d97e2
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <QListWidget>
#include <QListWidget>
class
ToolbarEditDialog
;
class
ToolbarEditDialog
;
class
DroppingController
;
class
WidgetListing
:
public
QListWidget
class
WidgetListing
:
public
QListWidget
{
{
...
@@ -64,6 +65,12 @@ private:
...
@@ -64,6 +65,12 @@ private:
QCheckBox
*
flatBox
,
*
bigBox
,
*
shinyBox
;
QCheckBox
*
flatBox
,
*
bigBox
,
*
shinyBox
;
WidgetListing
*
widgetListing
;
WidgetListing
*
widgetListing
;
DroppingController
*
controller1
,
*
controller2
,
*
controllerA
;
DroppingController
*
controllerFSC
,
*
controller
;
private
slots
:
void
cancel
();
void
close
();
};
};
class
DroppingController
:
public
AbstractController
class
DroppingController
:
public
AbstractController
...
@@ -71,6 +78,7 @@ class DroppingController: public AbstractController
...
@@ -71,6 +78,7 @@ class DroppingController: public AbstractController
Q_OBJECT
;
Q_OBJECT
;
public:
public:
DroppingController
(
intf_thread_t
*
,
QString
line
,
QWidget
*
parent
=
0
);
DroppingController
(
intf_thread_t
*
,
QString
line
,
QWidget
*
parent
=
0
);
QString
getValue
();
protected:
protected:
virtual
void
createAndAddWidget
(
QBoxLayout
*
controlLayout
,
int
i_index
,
virtual
void
createAndAddWidget
(
QBoxLayout
*
controlLayout
,
int
i_index
,
...
@@ -82,7 +90,13 @@ protected:
...
@@ -82,7 +90,13 @@ protected:
virtual
void
doAction
(
int
);
virtual
void
doAction
(
int
);
private:
private:
struct
doubleInt
{
int
i_type
;
int
i_option
;
};
QRubberBand
*
rubberband
;
QRubberBand
*
rubberband
;
QList
<
doubleInt
*>
widgetList
;
int
getParentPosInLayout
(
QPoint
point
);
int
getParentPosInLayout
(
QPoint
point
);
...
...
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