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
3f5029f8
Commit
3f5029f8
authored
Feb 28, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: menu simplification
parent
e837f1cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
41 deletions
+32
-41
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+29
-38
modules/gui/qt4/menus.hpp
modules/gui/qt4/menus.hpp
+3
-3
No files found.
modules/gui/qt4/menus.cpp
View file @
3f5029f8
...
...
@@ -733,8 +733,7 @@ QMenu *VLCMenuBar::RebuildNavigMenu( intf_thread_t *p_intf, QMenu *menu, bool b_
delete
actions
[
i
];
}
PopupPlayEntries
(
menu
,
p_intf
,
p_object
);
PopupMenuPlaylistControlEntries
(
menu
,
p_intf
);
PopupMenuPlaylistEntries
(
menu
,
p_intf
,
p_object
);
/* */
EnableStaticEntries
(
menu
,
(
p_object
!=
NULL
)
);
...
...
@@ -776,7 +775,7 @@ QMenu *VLCMenuBar::HelpMenu( QWidget *parent )
Populate( p_intf, menu, varnames, objects ); \
menu->popup( QCursor::pos() ); \
void
VLCMenuBar
::
Popup
Play
Entries
(
QMenu
*
menu
,
void
VLCMenuBar
::
Popup
MenuPlaylist
Entries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
)
{
...
...
@@ -793,9 +792,31 @@ void VLCMenuBar::PopupPlayEntries( QMenu *menu,
}
else
{
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pause"
),
":/menu/pause"
,
SLOT
(
togglePlayPause
()
)
);
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pause"
),
":/menu/pause"
,
SLOT
(
togglePlayPause
()
)
);
}
/* Stop */
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"&Stop"
),
":/menu/stop"
,
SLOT
(
stop
()
),
true
);
if
(
!
p_input
)
action
->
setEnabled
(
false
);
/* 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
);
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
);
CONNECT
(
THEMIM
,
playlistNotEmpty
(
bool
),
action
,
setEnabled
(
bool
)
);
menu
->
addSeparator
();
}
void
VLCMenuBar
::
PopupMenuControlEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
...
...
@@ -863,33 +884,6 @@ void VLCMenuBar::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf,
menu
->
addSeparator
();
}
void
VLCMenuBar
::
PopupMenuPlaylistControlEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
)
{
bool
bEnable
=
THEMIM
->
getInput
()
!=
NULL
;
bool
bPlaylistEmpty
=
THEMIM
->
hasEmptyPlaylist
();
QAction
*
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"&Stop"
),
":/menu/stop"
,
SLOT
(
stop
()
),
true
);
/* Disable Stop in the right-click popup menu */
if
(
!
bEnable
)
action
->
setEnabled
(
false
);
/* Next / Previous */
action
=
addMIMStaticEntry
(
p_intf
,
menu
,
qtr
(
"Pre&vious"
),
":/menu/previous"
,
SLOT
(
prev
()
),
true
);
action
->
setEnabled
(
!
bPlaylistEmpty
);
action
->
setData
(
ACTION_NO_CLEANUP
);
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
);
CONNECT
(
THEMIM
,
playlistNotEmpty
(
bool
),
action
,
setEnabled
(
bool
)
);
menu
->
addSeparator
();
}
void
VLCMenuBar
::
PopupMenuStaticEntries
(
QMenu
*
menu
)
{
QMenu
*
openmenu
=
new
QMenu
(
qtr
(
"Open Media"
),
menu
);
...
...
@@ -962,8 +956,7 @@ void VLCMenuBar::MiscPopupMenu( intf_thread_t *p_intf, bool show )
Populate
(
p_intf
,
menu
,
varnames
,
objects
);
menu
->
addSeparator
();
PopupPlayEntries
(
menu
,
p_intf
,
p_input
);
PopupMenuPlaylistControlEntries
(
menu
,
p_intf
);
PopupMenuPlaylistEntries
(
menu
,
p_intf
,
p_input
);
menu
->
addSeparator
();
PopupMenuControlEntries
(
menu
,
p_intf
);
...
...
@@ -985,8 +978,7 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
bool
b_isFullscreen
=
false
;
MainInterface
*
mi
=
p_intf
->
p_sys
->
p_mi
;
PopupPlayEntries
(
menu
,
p_intf
,
p_input
);
PopupMenuPlaylistControlEntries
(
menu
,
p_intf
);
PopupMenuPlaylistEntries
(
menu
,
p_intf
,
p_input
);
menu
->
addSeparator
();
if
(
p_input
)
...
...
@@ -1130,8 +1122,7 @@ void VLCMenuBar::updateSystrayMenu( MainInterface *mi,
sysMenu
->
addSeparator
();
#endif
PopupPlayEntries
(
sysMenu
,
p_intf
,
p_input
);
PopupMenuPlaylistControlEntries
(
sysMenu
,
p_intf
);
PopupMenuPlaylistEntries
(
sysMenu
,
p_intf
,
p_input
);
PopupMenuControlEntries
(
sysMenu
,
p_intf
,
false
);
VolumeEntries
(
p_intf
,
sysMenu
);
...
...
modules/gui/qt4/menus.hpp
View file @
3f5029f8
...
...
@@ -131,10 +131,10 @@ private:
/* Popups Menus */
static
void
PopupMenuStaticEntries
(
QMenu
*
menu
);
static
void
PopupPlayEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
);
static
void
PopupMenuControlEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
bool
b
=
true
);
static
void
PopupMenuPlaylistEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
input_thread_t
*
p_input
);
static
void
PopupMenuPlaylistControlEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
);
static
void
PopupMenuControlEntries
(
QMenu
*
menu
,
intf_thread_t
*
p_intf
,
bool
b
=
true
);
/* Generic automenu methods */
static
QMenu
*
Populate
(
intf_thread_t
*
,
QMenu
*
current
,
...
...
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