summaryrefslogtreecommitdiff
path: root/src/baseguiplus.cpp
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2012-02-16 11:06:56 +0100
committerAlessio Treglia <alessio@debian.org>2012-02-16 11:06:56 +0100
commit1d323e54ee434609cf035598486075c9a918a2d3 (patch)
tree929ad92f19dfbb5492471449f1a6a918ea99c6b8 /src/baseguiplus.cpp
parent99b53d44a60e3e934fc664152c115ae0d6e19920 (diff)
Imported Upstream version 0.6.10
Diffstat (limited to 'src/baseguiplus.cpp')
-rw-r--r--src/baseguiplus.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/baseguiplus.cpp b/src/baseguiplus.cpp
index 40f71a1..1a9c9e7 100644
--- a/src/baseguiplus.cpp
+++ b/src/baseguiplus.cpp
@@ -1,5 +1,5 @@
/* smplayer, GUI front-end for mplayer.
- Copyright (C) 2006-2010 Ricardo Villalba <rvm@escomposlinux.org>
+ Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -76,7 +76,14 @@ BaseGuiPlus::BaseGuiPlus( QWidget * parent, Qt::WindowFlags flags )
showTrayAct->setCheckable(true);
connect( showTrayAct, SIGNAL(toggled(bool)),
tray, SLOT(setVisible(bool)) );
+
+#ifndef Q_OS_OS2
optionsMenu->addAction(showTrayAct);
+#else
+ trayAvailable();
+ connect( optionsMenu, SIGNAL(aboutToShow()),
+ this, SLOT(trayAvailable()) );
+#endif
showAllAct = new MyAction(this, "restore/hide");
connect( showAllAct, SIGNAL(triggered()),
@@ -148,7 +155,7 @@ BaseGuiPlus::~BaseGuiPlus() {
}
bool BaseGuiPlus::startHidden() {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
return false;
#else
if ( (!showTrayAct->isChecked()) || (mainwindow_visible) )
@@ -606,4 +613,16 @@ VolumeSliderAction * BaseGuiPlus::createVolumeSliderAction(QWidget * parent) {
return volumeslider_action;
}
+#ifdef Q_OS_OS2
+// we test if xcenter is available at all. if not disable the tray action. this is possible when xcenter is not opened or crashed
+void BaseGuiPlus::trayAvailable() {
+ if (!tray->isSystemTrayAvailable()) {
+ optionsMenu->removeAction(showTrayAct);
+ }
+ else {
+ optionsMenu->addAction(showTrayAct);
+ }
+}
+#endif
+
#include "moc_baseguiplus.cpp"