Commit 9ef38092 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Qt4: don't trust toggle for systray, do what we say (fix #4248)

If the menu item says hide, really always hide.
parent 4a2819e1
...@@ -989,6 +989,23 @@ void MainInterface::toggleUpdateSystrayMenu() ...@@ -989,6 +989,23 @@ void MainInterface::toggleUpdateSystrayMenu()
QVLCMenu::updateSystrayMenu( this, p_intf ); QVLCMenu::updateSystrayMenu( this, p_intf );
} }
void MainInterface::showUpdateSystrayMenu()
{
if( isHidden() )
show();
if( isMinimized() )
showNormal();
activateWindow();
QVLCMenu::updateSystrayMenu( this, p_intf );
}
void MainInterface::hideUpdateSystrayMenu()
{
hide();
QVLCMenu::updateSystrayMenu( this, p_intf );
}
void MainInterface::handleSystrayClick( void MainInterface::handleSystrayClick(
QSystemTrayIcon::ActivationReason reason ) QSystemTrayIcon::ActivationReason reason )
{ {
......
...@@ -182,6 +182,8 @@ public slots: ...@@ -182,6 +182,8 @@ public slots:
void togglePlaylist(); void togglePlaylist();
#ifndef HAVE_MAEMO #ifndef HAVE_MAEMO
void toggleUpdateSystrayMenu(); void toggleUpdateSystrayMenu();
void showUpdateSystrayMenu();
void hideUpdateSystrayMenu();
#endif #endif
void toggleAdvancedButtons(); void toggleAdvancedButtons();
void toggleInterfaceFullScreen(); void toggleInterfaceFullScreen();
......
...@@ -1086,13 +1086,13 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, ...@@ -1086,13 +1086,13 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
{ {
sysMenu->addAction( QIcon( ":/logo/vlc16.png" ), sysMenu->addAction( QIcon( ":/logo/vlc16.png" ),
qtr( "Hide VLC media player in taskbar" ), mi, qtr( "Hide VLC media player in taskbar" ), mi,
SLOT( toggleUpdateSystrayMenu() ) ); SLOT( hideUpdateSystrayMenu() ) );
} }
else else
{ {
sysMenu->addAction( QIcon( ":/logo/vlc16.png" ), sysMenu->addAction( QIcon( ":/logo/vlc16.png" ),
qtr( "Show VLC media player" ), mi, qtr( "Show VLC media player" ), mi,
SLOT( toggleUpdateSystrayMenu() ) ); SLOT( showUpdateSystrayMenu() ) );
} }
sysMenu->addSeparator(); sysMenu->addSeparator();
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment