]> git.sesse.net Git - vlc/commitdiff
Qt4: don't trust toggle for systray, do what we say (fix #4248)
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 14 Oct 2010 16:01:34 +0000 (19:01 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 14 Oct 2010 16:01:34 +0000 (19:01 +0300)
If the menu item says hide, really always hide.

modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/menus.cpp

index 300bea7ad843d086a0aee1a9a8dc50d313d12abe..fc14bae0e3e6c71aa67880ad248a5e65b5ab9526 100644 (file)
@@ -989,6 +989,23 @@ void MainInterface::toggleUpdateSystrayMenu()
     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(
                                     QSystemTrayIcon::ActivationReason reason )
 {
index a675d87cfd5132c022894e79b7119428bd5a52b9..5b55e76a0f311a1968962f04e4ad3279a70fff8e 100644 (file)
@@ -182,6 +182,8 @@ public slots:
     void togglePlaylist();
 #ifndef HAVE_MAEMO
     void toggleUpdateSystrayMenu();
+    void showUpdateSystrayMenu();
+    void hideUpdateSystrayMenu();
 #endif
     void toggleAdvancedButtons();
     void toggleInterfaceFullScreen();
index 3e682e081984791198296b4e508e1bcaec1d7ba2..2e5d085134b3d6087845a690752af3f5d5395d41 100644 (file)
@@ -1086,13 +1086,13 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
     {
         sysMenu->addAction( QIcon( ":/logo/vlc16.png" ),
                             qtr( "Hide VLC media player in taskbar" ), mi,
-                            SLOT( toggleUpdateSystrayMenu() ) );
+                            SLOT( hideUpdateSystrayMenu() ) );
     }
     else
     {
         sysMenu->addAction( QIcon( ":/logo/vlc16.png" ),
                             qtr( "Show VLC media player" ), mi,
-                            SLOT( toggleUpdateSystrayMenu() ) );
+                            SLOT( showUpdateSystrayMenu() ) );
     }
     sysMenu->addSeparator();
 #endif