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
4c2466aa
Commit
4c2466aa
authored
May 02, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4 - Systray Menu - Add hide/show handling, open dialog, help menu, and some click handling.
parent
1f180231
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
8 deletions
+37
-8
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+23
-4
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+1
-0
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+11
-3
modules/gui/qt4/menus.hpp
modules/gui/qt4/menus.hpp
+2
-1
No files found.
modules/gui/qt4/main_interface.cpp
View file @
4c2466aa
...
@@ -129,11 +129,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
...
@@ -129,11 +129,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
slider
,
setPosition
(
float
,
int
,
int
)
);
slider
,
setPosition
(
float
,
int
,
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
positionUpdated
(
float
,
int
,
int
),
CONNECT
(
THEMIM
->
getIM
(),
positionUpdated
(
float
,
int
,
int
),
this
,
setDisplay
(
float
,
int
,
int
)
);
this
,
setDisplay
(
float
,
int
,
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
nameChanged
(
QString
),
this
,
setName
(
QString
)
);
CONNECT
(
THEMIM
->
getIM
(),
nameChanged
(
QString
),
this
,
setName
(
QString
)
);
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
setStatus
(
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
setStatus
(
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
updateSystrayMenu
(
int
)
);
updateSystrayMenu
(
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
navigationChanged
(
int
),
CONNECT
(
THEMIM
->
getIM
(),
navigationChanged
(
int
),
this
,
setNavigation
(
int
)
);
this
,
setNavigation
(
int
)
);
CONNECT
(
slider
,
sliderDragged
(
float
),
CONNECT
(
slider
,
sliderDragged
(
float
),
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
...
@@ -273,10 +274,14 @@ void MainInterface::handleMainUi( QSettings *settings )
...
@@ -273,10 +274,14 @@ void MainInterface::handleMainUi( QSettings *settings )
void
MainInterface
::
createSystrayMenu
()
void
MainInterface
::
createSystrayMenu
()
{
{
sysTray
=
new
QSystemTrayIcon
(
QIcon
(
QPixmap
(
":/vlc128.png"
)
)
);
QIcon
iconVLC
=
QIcon
(
QPixmap
(
":/vlc128.png"
)
);
sysTray
=
new
QSystemTrayIcon
(
iconVLC
);
systrayMenu
=
new
QMenu
(
qtr
(
"VLC media player"
),
this
);
systrayMenu
=
new
QMenu
(
qtr
(
"VLC media player"
),
this
);
QVLCMenu
::
updateSystrayMenu
(
this
,
p_intf
);
systrayMenu
->
setIcon
(
iconVLC
);
QVLCMenu
::
updateSystrayMenu
(
this
,
p_intf
,
true
);
sysTray
->
show
();
sysTray
->
show
();
CONNECT
(
sysTray
,
activated
(
QSystemTrayIcon
::
ActivationReason
),
this
,
handleSystrayClick
(
QSystemTrayIcon
::
ActivationReason
)
);
}
}
void
MainInterface
::
updateSystrayMenu
(
int
status
)
void
MainInterface
::
updateSystrayMenu
(
int
status
)
...
@@ -284,6 +289,20 @@ void MainInterface::updateSystrayMenu( int status )
...
@@ -284,6 +289,20 @@ void MainInterface::updateSystrayMenu( int status )
QVLCMenu
::
updateSystrayMenu
(
this
,
p_intf
)
;
QVLCMenu
::
updateSystrayMenu
(
this
,
p_intf
)
;
}
}
void
MainInterface
::
handleSystrayClick
(
QSystemTrayIcon
::
ActivationReason
reason
)
{
switch
(
reason
)
{
case
QSystemTrayIcon
:
:
Trigger
:
this
->
show
();
break
;
case
QSystemTrayIcon
:
:
MiddleClick
:
sysTray
->
showMessage
(
qtr
(
"VLC media player"
),
qtr
(
"Control menu for the player"
),
QSystemTrayIcon
::
Information
,
4000
);
break
;
}
}
/**********************************************************************
/**********************************************************************
* Handling of the components
* Handling of the components
**********************************************************************/
**********************************************************************/
...
...
modules/gui/qt4/main_interface.hpp
View file @
4c2466aa
...
@@ -131,6 +131,7 @@ private slots:
...
@@ -131,6 +131,7 @@ private slots:
void
advanced
();
void
advanced
();
void
updateVolume
(
int
sliderVolume
);
void
updateVolume
(
int
sliderVolume
);
void
updateSystrayMenu
(
int
);
void
updateSystrayMenu
(
int
);
void
handleSystrayClick
(
QSystemTrayIcon
::
ActivationReason
);
};
};
...
...
modules/gui/qt4/menus.cpp
View file @
4c2466aa
...
@@ -591,8 +591,8 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
...
@@ -591,8 +591,8 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
* Systray Menu *
* Systray Menu *
************************************************************************/
************************************************************************/
void
QVLCMenu
::
updateSystrayMenu
(
MainInterface
*
mi
,
intf_thread_t
*
p_intf
void
QVLCMenu
::
updateSystrayMenu
(
MainInterface
*
mi
,
intf_thread_t
*
p_intf
,
)
bool
b_force_visible
)
{
{
POPUP_BOILERPLATE
;
POPUP_BOILERPLATE
;
QMenu
*
sysMenu
=
mi
->
getSysTrayMenu
();
QMenu
*
sysMenu
=
mi
->
getSysTrayMenu
();
...
@@ -600,7 +600,15 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf
...
@@ -600,7 +600,15 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf
POPUP_PLAY_ENTRIES
(
sysMenu
);
POPUP_PLAY_ENTRIES
(
sysMenu
);
sysMenu
->
addSeparator
();
sysMenu
->
addSeparator
();
/* FIXME DP_SADD( menu, qtr("&Hide/show") , "", "", quit(), "" );*/
if
(
mi
->
isVisible
()
||
b_force_visible
)
{
sysMenu
->
addAction
(
qtr
(
"Hide Interface"
),
mi
,
SLOT
(
hide
()
)
);
}
else
{
sysMenu
->
addAction
(
qtr
(
"Show Interface"
),
mi
,
SLOT
(
show
()
)
);
}
DP_SADD
(
sysMenu
,
qtr
(
"&Open"
),
""
,
""
,
openFileDialog
(),
""
);
DP_SADD
(
sysMenu
,
qtr
(
"&Quit"
)
,
""
,
""
,
quit
(),
""
);
DP_SADD
(
sysMenu
,
qtr
(
"&Quit"
)
,
""
,
""
,
quit
(),
""
);
mi
->
getSysTray
()
->
setContextMenu
(
sysMenu
);
mi
->
getSysTray
()
->
setContextMenu
(
sysMenu
);
...
...
modules/gui/qt4/menus.hpp
View file @
4c2466aa
...
@@ -84,7 +84,8 @@ public:
...
@@ -84,7 +84,8 @@ public:
static
void
PopupMenu
(
intf_thread_t
*
,
bool
);
static
void
PopupMenu
(
intf_thread_t
*
,
bool
);
/* Systray */
/* Systray */
static
void
updateSystrayMenu
(
MainInterface
*
,
intf_thread_t
*
);
static
void
updateSystrayMenu
(
MainInterface
*
,
intf_thread_t
*
,
bool
b_force_visible
=
false
);
/* Actions */
/* Actions */
static
void
DoAction
(
intf_thread_t
*
,
QObject
*
);
static
void
DoAction
(
intf_thread_t
*
,
QObject
*
);
...
...
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