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
895c05d7
Commit
895c05d7
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 menus: enable/disable correctly static entries
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
33aa26b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+35
-10
No files found.
modules/gui/qt4/menus.cpp
View file @
895c05d7
...
@@ -63,20 +63,23 @@ void addDPStaticEntry( QMenu *menu,
...
@@ -63,20 +63,23 @@ void addDPStaticEntry( QMenu *menu,
const
char
*
member
,
const
char
*
member
,
const
char
*
shortcut
)
const
char
*
shortcut
)
{
{
QAction
*
action
=
NULL
;
if
(
!
EMPTY_STR
(
icon
)
>
0
)
if
(
!
EMPTY_STR
(
icon
)
>
0
)
{
{
if
(
!
EMPTY_STR
(
shortcut
)
>
0
)
if
(
!
EMPTY_STR
(
shortcut
)
>
0
)
menu
->
addAction
(
QIcon
(
icon
),
text
,
THEDP
,
member
,
qtr
(
shortcut
)
);
action
=
menu
->
addAction
(
QIcon
(
icon
),
text
,
THEDP
,
member
,
qtr
(
shortcut
)
);
else
else
menu
->
addAction
(
QIcon
(
icon
),
text
,
THEDP
,
member
);
action
=
menu
->
addAction
(
QIcon
(
icon
),
text
,
THEDP
,
member
);
}
}
else
else
{
{
if
(
!
EMPTY_STR
(
shortcut
)
>
0
)
if
(
!
EMPTY_STR
(
shortcut
)
>
0
)
menu
->
addAction
(
text
,
THEDP
,
member
,
qtr
(
shortcut
)
);
action
=
menu
->
addAction
(
text
,
THEDP
,
member
,
qtr
(
shortcut
)
);
else
else
menu
->
addAction
(
text
,
THEDP
,
member
);
action
=
menu
->
addAction
(
text
,
THEDP
,
member
);
}
}
action
->
setData
(
"_static_"
);
}
}
void
addMIMStaticEntry
(
intf_thread_t
*
p_intf
,
void
addMIMStaticEntry
(
intf_thread_t
*
p_intf
,
...
@@ -97,6 +100,19 @@ void addMIMStaticEntry( intf_thread_t *p_intf,
...
@@ -97,6 +100,19 @@ void addMIMStaticEntry( intf_thread_t *p_intf,
}
}
}
}
void
EnableDPStaticEntries
(
QMenu
*
menu
,
bool
enable
=
true
)
{
if
(
!
menu
)
return
;
QAction
*
action
;
Q_FOREACH
(
action
,
menu
->
actions
()
)
{
if
(
action
->
data
().
toString
()
==
"_static_"
)
action
->
setEnabled
(
enable
);
}
}
/*****************************************************************************
/*****************************************************************************
* Definitions of variables for the dynamic menus
* Definitions of variables for the dynamic menus
*****************************************************************************/
*****************************************************************************/
...
@@ -476,6 +492,14 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
...
@@ -476,6 +492,14 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
vector
<
int
>
objects
;
vector
<
int
>
objects
;
vector
<
const
char
*>
varnames
;
vector
<
const
char
*>
varnames
;
if
(
!
menu
)
{
menu
=
new
QMenu
();
addDPStaticEntry
(
menu
,
qtr
(
I_MENU_GOTOTIME
),
""
,
""
,
SLOT
(
gotoTimeDialog
()
),
"Ctrl+T"
);
menu
->
addSeparator
();
}
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
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
InputAutoMenuBuilder
(
p_object
,
objects
,
varnames
);
InputAutoMenuBuilder
(
p_object
,
objects
,
varnames
);
...
@@ -483,13 +507,12 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
...
@@ -483,13 +507,12 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
PUSH_VAR
(
"next-title"
);
PUSH_VAR
(
"next-title"
);
PUSH_VAR
(
"prev-chapter"
);
PUSH_VAR
(
"prev-chapter"
);
PUSH_VAR
(
"next-chapter"
);
PUSH_VAR
(
"next-chapter"
);
EnableDPStaticEntries
(
menu
,
(
p_object
!=
NULL
)
);
if
(
p_object
)
if
(
p_object
)
{
vlc_object_release
(
p_object
);
vlc_object_release
(
p_object
);
QMenu
*
navMenu
=
new
QMenu
(
menu
);
}
addDPStaticEntry
(
navMenu
,
qtr
(
I_MENU_GOTOTIME
),
""
,
""
,
return
Populate
(
p_intf
,
menu
,
varnames
,
objects
,
true
);
SLOT
(
gotoTimeDialog
()
),
"Ctrl+T"
);
navMenu
->
addSeparator
();
return
Populate
(
p_intf
,
navMenu
,
varnames
,
objects
,
true
);
}
}
/**
/**
...
@@ -792,9 +815,11 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
...
@@ -792,9 +815,11 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf,
if
(
!
menu
)
if
(
!
menu
)
menu
=
new
QMenu
();
menu
=
new
QMenu
();
/* Disable all non static entries */
QAction
*
p_action
;
QAction
*
p_action
;
Q_FOREACH
(
p_action
,
menu
->
actions
()
)
Q_FOREACH
(
p_action
,
menu
->
actions
()
)
{
{
if
(
p_action
->
data
().
toString
()
!=
"_static_"
)
p_action
->
setEnabled
(
false
);
p_action
->
setEnabled
(
false
);
}
}
...
...
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