[vlc-commits] commit: Qt4: don't trust toggle for systray, do what we say (fix #4248) ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Thu Oct 14 18:02:31 CEST 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 14 19:01:34 2010 +0300| [9ef380927163e60c2ba52485963b0e6232c80159] | committer: Rémi Denis-Courmont
Qt4: don't trust toggle for systray, do what we say (fix #4248)
If the menu item says hide, really always hide.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ef380927163e60c2ba52485963b0e6232c80159
---
modules/gui/qt4/main_interface.cpp | 17 +++++++++++++++++
modules/gui/qt4/main_interface.hpp | 2 ++
modules/gui/qt4/menus.cpp | 4 ++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 300bea7..fc14bae 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -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 )
{
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index a675d87..5b55e76 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -182,6 +182,8 @@ public slots:
void togglePlaylist();
#ifndef HAVE_MAEMO
void toggleUpdateSystrayMenu();
+ void showUpdateSystrayMenu();
+ void hideUpdateSystrayMenu();
#endif
void toggleAdvancedButtons();
void toggleInterfaceFullScreen();
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 3e682e0..2e5d085 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -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
More information about the vlc-commits
mailing list