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
fd7e3ccc
Commit
fd7e3ccc
authored
Feb 28, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: fix navigation menu rebuilding
Close #6219
parent
3f5029f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+12
-9
modules/gui/qt4/menus.hpp
modules/gui/qt4/menus.hpp
+2
-1
No files found.
modules/gui/qt4/menus.cpp
View file @
fd7e3ccc
...
...
@@ -707,7 +707,6 @@ QMenu *VLCMenuBar::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
QMenu
*
VLCMenuBar
::
RebuildNavigMenu
(
intf_thread_t
*
p_intf
,
QMenu
*
menu
,
bool
b_keep
)
{
/* */
input_thread_t
*
p_object
;
QVector
<
vlc_object_t
*>
objects
;
...
...
@@ -724,20 +723,22 @@ QMenu *VLCMenuBar::RebuildNavigMenu( intf_thread_t *p_intf, QMenu *menu, bool b_
PUSH_VAR
(
"prev-chapter"
);
PUSH_VAR
(
"next-chapter"
);
/* */
EnableStaticEntries
(
menu
,
(
p_object
!=
NULL
)
);
Populate
(
p_intf
,
menu
,
varnames
,
objects
);
/* Remove playback actions to recreate them */
if
(
!
b_keep
)
{
QList
<
QAction
*
>
actions
=
menu
->
actions
();
if
(
actions
.
count
()
>
4
)
for
(
int
i
=
actions
.
count
()
-
1
;
i
>=
actions
.
count
()
-
1
-
4
;
--
i
)
for
(
int
i
=
0
;
i
<
actions
.
count
();
i
++
)
if
(
actions
[
i
]
->
data
().
toInt
()
&
ACTION_DELETE_ON_REBUILD
)
delete
actions
[
i
];
}
PopupMenuPlaylistEntries
(
menu
,
p_intf
,
p_object
);
/* */
EnableStaticEntries
(
menu
,
(
p_object
!=
NULL
)
);
return
Populate
(
p_intf
,
menu
,
varnames
,
objects
);
return
menu
;
}
/**
...
...
@@ -792,28 +793,30 @@ void VLCMenuBar::PopupMenuPlaylistEntries( QMenu *menu,
}
else
{
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pause"
),
a
ction
=
a
ddMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pause"
),
":/menu/pause"
,
SLOT
(
togglePlayPause
()
)
);
}
action
->
setData
(
ACTION_DELETE_ON_REBUILD
);
/* Stop */
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"&Stop"
),
":/menu/stop"
,
SLOT
(
stop
()
),
true
);
if
(
!
p_input
)
action
->
setEnabled
(
false
);
action
->
setData
(
ACTION_DELETE_ON_REBUILD
);
/* Next / Previous */
bool
bPlaylistEmpty
=
THEMIM
->
hasEmptyPlaylist
();
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pre&vious"
),
":/menu/previous"
,
SLOT
(
prev
()
),
true
);
action
->
setEnabled
(
!
bPlaylistEmpty
);
action
->
setData
(
ACTION_NO_CLEANUP
);
action
->
setData
(
ACTION_NO_CLEANUP
+
ACTION_DELETE_ON_REBUILD
);
CONNECT
(
THEMIM
,
playlistNotEmpty
(
bool
),
action
,
setEnabled
(
bool
)
);
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Ne&xt"
),
":/menu/next"
,
SLOT
(
next
()
),
true
);
action
->
setEnabled
(
!
bPlaylistEmpty
);
action
->
setData
(
ACTION_NO_CLEANUP
);
action
->
setData
(
ACTION_NO_CLEANUP
+
ACTION_DELETE_ON_REBUILD
);
CONNECT
(
THEMIM
,
playlistNotEmpty
(
bool
),
action
,
setEnabled
(
bool
)
);
menu
->
addSeparator
();
...
...
modules/gui/qt4/menus.hpp
View file @
fd7e3ccc
...
...
@@ -94,7 +94,8 @@ public:
ACTION_ALWAYS_ENABLED
=
0x1
,
ACTION_MANAGED
=
0x2
,
/* managed using EnableStatic(bool)? */
ACTION_NO_CLEANUP
=
0x4
,
ACTION_STATIC
=
0x6
/* legacy shortcut */
ACTION_STATIC
=
0x6
,
/* legacy shortcut */
ACTION_DELETE_ON_REBUILD
=
0x8
};
Q_DECLARE_FLAGS
(
actionflags
,
actionflag
)
...
...
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