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
68b2161a
Commit
68b2161a
authored
Jun 16, 2008
by
Jean-Philippe Andre
Committed by
Jean-Baptiste Kempf
Jun 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt menu: fix navigation, delete non static entries
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
4dc4a8d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
16 deletions
+49
-16
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+49
-16
No files found.
modules/gui/qt4/menus.cpp
View file @
68b2161a
...
@@ -113,6 +113,24 @@ void EnableDPStaticEntries( QMenu *menu, bool enable = true )
...
@@ -113,6 +113,24 @@ void EnableDPStaticEntries( QMenu *menu, bool enable = true )
}
}
}
}
/**
* \return Number of static entries
*/
int
DeleteNonStaticEntries
(
QMenu
*
menu
)
{
int
i_ret
=
0
;
QAction
*
action
;
if
(
!
menu
)
return
VLC_EGENERIC
;
Q_FOREACH
(
action
,
menu
->
actions
()
)
{
if
(
action
->
data
().
toString
()
!=
"_static_"
)
delete
action
;
else
i_ret
++
;
}
}
/*****************************************************************************
/*****************************************************************************
* Definitions of variables for the dynamic menus
* Definitions of variables for the dynamic menus
*****************************************************************************/
*****************************************************************************/
...
@@ -460,8 +478,9 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
...
@@ -460,8 +478,9 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
QMenu
*
submenu
=
new
QMenu
(
qtr
(
"&Subtitles Track"
),
current
);
QMenu
*
submenu
=
new
QMenu
(
qtr
(
"&Subtitles Track"
),
current
);
action
=
current
->
addMenu
(
submenu
);
action
=
current
->
addMenu
(
submenu
);
action
->
setData
(
"spu-es"
);
action
->
setData
(
"spu-es"
);
submenu
->
addAction
(
qfu
(
"Load File..."
),
THEDP
,
action
=
submenu
->
addAction
(
qfu
(
"Load File..."
),
THEDP
,
SLOT
(
loadSubtitlesFile
()
)
);
SLOT
(
loadSubtitlesFile
()
)
);
action
->
setData
(
"_static_"
);
ACT_ADD
(
current
,
"fullscreen"
,
qtr
(
"&Fullscreen"
)
);
ACT_ADD
(
current
,
"fullscreen"
,
qtr
(
"&Fullscreen"
)
);
ACT_ADD
(
current
,
"zoom"
,
qtr
(
"&Zoom"
)
);
ACT_ADD
(
current
,
"zoom"
,
qtr
(
"&Zoom"
)
);
...
@@ -503,9 +522,19 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
...
@@ -503,9 +522,19 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
if
(
!
menu
)
if
(
!
menu
)
{
{
menu
=
new
QMenu
();
menu
=
new
QMenu
();
}
if
(
menu
->
isEmpty
()
)
{
addDPStaticEntry
(
menu
,
qtr
(
I_MENU_GOTOTIME
),
""
,
""
,
addDPStaticEntry
(
menu
,
qtr
(
I_MENU_GOTOTIME
),
""
,
""
,
SLOT
(
gotoTimeDialog
()
),
"Ctrl+T"
);
SLOT
(
gotoTimeDialog
()
),
"Ctrl+T"
);
menu
->
addSeparator
();
menu
->
addSeparator
();
ACT_ADD
(
menu
,
"bookmark"
,
qtr
(
"&Bookmarks"
)
);
ACT_ADD
(
menu
,
"title"
,
qtr
(
"&Title"
)
);
ACT_ADD
(
menu
,
"chapter"
,
qtr
(
"&Chapter"
)
);
ACT_ADD
(
menu
,
"program"
,
qtr
(
"&Program"
)
);
ACT_ADD
(
menu
,
"navigation"
,
qtr
(
"&Navigation"
)
);
}
}
p_object
=
(
vlc_object_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
p_object
=
(
vlc_object_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
...
@@ -858,15 +887,6 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
...
@@ -858,15 +887,6 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
}
}
}
}
/* Some specific stuff */
if
(
p_object
&&
!
strcmp
(
varnames
[
i
],
"spu-es"
)
)
{
vlc_object_t
*
p_vout
=
(
vlc_object_t
*
)(
vlc_object_find
(
p_object
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
)
);
if
(
!
p_vout
)
continue
;
}
/* Ugly specific stuff */
/* Ugly specific stuff */
if
(
strstr
(
varnames
[
i
],
"intf-add"
)
)
if
(
strstr
(
varnames
[
i
],
"intf-add"
)
)
UpdateItem
(
p_intf
,
menu
,
varnames
[
i
],
p_object
,
false
);
UpdateItem
(
p_intf
,
menu
,
varnames
[
i
],
p_object
,
false
);
...
@@ -934,11 +954,12 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
...
@@ -934,11 +954,12 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
vlc_value_t
val
,
text
;
vlc_value_t
val
,
text
;
int
i_type
;
int
i_type
;
QAction
*
action
=
FindActionWithVar
(
menu
,
psz_var
);
if
(
action
)
DeleteNonStaticEntries
(
action
->
menu
()
);
if
(
!
p_object
)
if
(
!
p_object
)
{
/* Nothing to do */
return
;
return
;
}
/* Check the type of the object variable */
/* Check the type of the object variable */
if
(
!
strcmp
(
psz_var
,
"audio-es"
)
if
(
!
strcmp
(
psz_var
,
"audio-es"
)
...
@@ -972,7 +993,6 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
...
@@ -972,7 +993,6 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
text
.
psz_string
=
NULL
;
text
.
psz_string
=
NULL
;
}
}
QAction
*
action
=
FindActionWithVar
(
menu
,
psz_var
);
if
(
!
action
)
if
(
!
action
)
{
{
action
=
new
QAction
(
TEXT_OR_VAR
,
menu
);
action
=
new
QAction
(
TEXT_OR_VAR
,
menu
);
...
@@ -980,6 +1000,17 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
...
@@ -980,6 +1000,17 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
action
->
setData
(
psz_var
);
action
->
setData
(
psz_var
);
}
}
/* Some specific stuff */
bool
forceDisabled
=
false
;
if
(
!
strcmp
(
psz_var
,
"spu-es"
)
)
{
vlc_object_t
*
p_vout
=
(
vlc_object_t
*
)(
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
)
);
forceDisabled
=
(
p_vout
==
NULL
);
if
(
p_vout
)
vlc_object_release
(
p_vout
);
}
if
(
i_type
&
VLC_VAR_HASCHOICE
)
if
(
i_type
&
VLC_VAR_HASCHOICE
)
{
{
/* Append choices menu */
/* Append choices menu */
...
@@ -994,7 +1025,9 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
...
@@ -994,7 +1025,9 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
}
}
action
->
setEnabled
(
action
->
setEnabled
(
CreateChoicesMenu
(
submenu
,
psz_var
,
p_object
,
true
)
==
0
);
CreateChoicesMenu
(
submenu
,
psz_var
,
p_object
,
true
)
==
0
);
if
(
forceDisabled
)
action
->
setEnabled
(
false
);
}
}
else
else
CreateChoicesMenu
(
menu
,
psz_var
,
p_object
,
true
);
CreateChoicesMenu
(
menu
,
psz_var
,
p_object
,
true
);
...
...
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