summaryrefslogtreecommitdiffstats
path: root/noatun/modules/systray
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/systray
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/systray')
-rw-r--r--noatun/modules/systray/Makefile.am16
-rw-r--r--noatun/modules/systray/cmodule.cpp192
-rw-r--r--noatun/modules/systray/cmodule.h55
-rw-r--r--noatun/modules/systray/kitsystemtray.cpp131
-rw-r--r--noatun/modules/systray/kitsystemtray.h54
-rw-r--r--noatun/modules/systray/noatunui.cpp9
-rw-r--r--noatun/modules/systray/systray.cpp467
-rw-r--r--noatun/modules/systray/systray.h80
-rw-r--r--noatun/modules/systray/systray.plugin100
-rw-r--r--noatun/modules/systray/systrayui.rc20
-rw-r--r--noatun/modules/systray/yhconfig.kcfg81
-rw-r--r--noatun/modules/systray/yhconfig.kcfgc7
-rw-r--r--noatun/modules/systray/yhconfigwidget.ui333
13 files changed, 1545 insertions, 0 deletions
diff --git a/noatun/modules/systray/Makefile.am b/noatun/modules/systray/Makefile.am
new file mode 100644
index 00000000..1dcfdd25
--- /dev/null
+++ b/noatun/modules/systray/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES= -I$(top_srcdir)/noatun/library $(all_includes)
+kde_module_LTLIBRARIES = noatun_systray.la
+
+noatun_systray_la_SOURCES = systray.cpp noatunui.cpp kitsystemtray.cpp cmodule.cpp \
+ yhconfig.kcfgc yhconfigwidget.ui
+
+
+noatun_systray_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
+noatun_systray_la_LIBADD = $(LIB_KFILE) $(top_builddir)/noatun/library/libnoatun.la
+
+noatun_systray_la_METASOURCES = AUTO
+
+noinst_HEADERS = systray.h kitsystemtray.h cmodule.h
+
+noatun_modules_systray_DATA = systray.plugin systrayui.rc yhconfig.kcfg
+noatun_modules_systraydir = $(kde_datadir)/noatun
diff --git a/noatun/modules/systray/cmodule.cpp b/noatun/modules/systray/cmodule.cpp
new file mode 100644
index 00000000..4adf7e44
--- /dev/null
+++ b/noatun/modules/systray/cmodule.cpp
@@ -0,0 +1,192 @@
+// cmodule.cpp
+//
+// Copyright (C) 2001 Neil Stevens <multivac@fcmail.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#include "cmodule.h"
+#include "yhconfig.h"
+#include "yhconfigwidget.h"
+
+#include <kdebug.h>
+//#include <kglobal.h>
+#include <klocale.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+#include <qspinbox.h>
+
+#include <noatun/app.h>
+#include <noatun/pluginloader.h>
+
+#include <fixx11h.h>
+
+YHModule::YHModule(QObject *_parent)
+ : CModule(i18n("System Tray Icon"), i18n("Configure System Tray Icon"),
+ "bottom", _parent)
+{
+ QVBoxLayout *top = new QVBoxLayout(this);
+ mWidget = new YHConfigWidget(this);
+ top->addWidget(mWidget);
+
+ mWidget->cmbModifier->insertItem(i18n("None"), YHConfig::None);
+ mWidget->cmbModifier->insertItem(i18n("Shift"), YHConfig::Shift);
+ mWidget->cmbModifier->insertItem(i18n("Alt"), YHConfig::Alt);
+ mWidget->cmbModifier->insertItem(i18n("Ctrl"), YHConfig::Ctrl);
+ mWidget->cmbModifier->setCurrentItem(YHConfig::None);
+
+ connect(mWidget->chkUsePopup, SIGNAL(toggled(bool)), this, SLOT(slotUsePopupToggled(bool)));
+ connect(mWidget->cmbModifier, SIGNAL(activated(int)), this, SLOT(slotModifierActivated(int)));
+ connect(mWidget->grpMwheel, SIGNAL(clicked(int)), this, SLOT(slotMwheelClicked(int)));
+
+ reopen();
+}
+
+
+void YHModule::reopen()
+{
+ kdDebug(66666) << k_funcinfo << endl;
+ YHConfig *c = YHConfig::self();
+
+ /** General TAB **/
+
+ mWidget->chkUseTooltip->setChecked(c->tip());
+ mWidget->chkUseCovers->setChecked(c->passivePopupCovers());
+
+ mWidget->chkUsePopup->setChecked(c->passivePopup());
+ mWidget->spinPopupTimeout->setValue(c->passivePopupTimeout());
+ mWidget->chkPopupButtons->setChecked(c->passivePopupButtons());
+
+ switch(c->stateIconDisplay())
+ {
+ case (YHConfig::Animation):
+ mWidget->rbStateAnim->setChecked(true);
+ break;
+ case (YHConfig::FlashingIcon):
+ mWidget->rbStateFlashing->setChecked(true);
+ break;
+ case (YHConfig::StaticIcon):
+ mWidget->rbStateStatic->setChecked(true);
+ break;
+ case (YHConfig::NoIcon):
+ mWidget->rbStateNone->setChecked(true);
+ break;
+ }
+
+ /** Advanced TAB **/
+
+ if (c->middleMouseAction() == YHConfig::PlayPause)
+ mWidget->rbPlayPause->setChecked(true);
+ else
+ mWidget->rbHideShowPlaylist->setChecked(true);
+
+ mActionMap[YHConfig::None] = YHConfig::self()->mouseWheelAction(YHConfig::None);
+ mActionMap[YHConfig::Shift] = YHConfig::self()->mouseWheelAction(YHConfig::Shift);
+ mActionMap[YHConfig::Alt] = YHConfig::self()->mouseWheelAction(YHConfig::Alt);
+ mActionMap[YHConfig::Ctrl] = YHConfig::self()->mouseWheelAction(YHConfig::Ctrl);
+
+ slotModifierActivated(mWidget->cmbModifier->currentItem());
+}
+
+
+void YHModule::save()
+{
+ kdDebug(66666) << k_funcinfo << endl;
+
+ YHConfig *c = YHConfig::self();
+
+ /** General TAB **/
+
+ c->setTip(mWidget->chkUseTooltip->isChecked());
+ c->setPassivePopupCovers(mWidget->chkUseCovers->isChecked());
+
+ c->setPassivePopup(mWidget->chkUsePopup->isChecked());
+ c->setPassivePopupTimeout(mWidget->spinPopupTimeout->value());
+ c->setPassivePopupButtons(mWidget->chkPopupButtons->isChecked());
+
+ if (mWidget->rbStateAnim->isChecked())
+ c->setStateIconDisplay(YHConfig::Animation);
+ else if (mWidget->rbStateFlashing->isChecked())
+ c->setStateIconDisplay(YHConfig::FlashingIcon);
+ else if (mWidget->rbStateStatic->isChecked())
+ c->setStateIconDisplay(YHConfig::StaticIcon);
+ else
+ c->setStateIconDisplay(YHConfig::NoIcon);
+
+ /** Advanced TAB **/
+
+ if (mWidget->rbPlayPause->isChecked())
+ c->setMiddleMouseAction(YHConfig::PlayPause);
+ else
+ c->setMiddleMouseAction(YHConfig::HideShowPlaylist);
+
+ c->setMouseWheelAction(YHConfig::None, mActionMap[YHConfig::None]);
+ c->setMouseWheelAction(YHConfig::Shift, mActionMap[YHConfig::Shift]);
+ c->setMouseWheelAction(YHConfig::Alt, mActionMap[YHConfig::Alt]);
+ c->setMouseWheelAction(YHConfig::Ctrl, mActionMap[YHConfig::Ctrl]);
+
+ c->writeConfig();
+ emit saved();
+}
+
+
+void YHModule::slotUsePopupToggled(bool on)
+{
+ mWidget->lblPopupTimeout->setEnabled(on);
+ mWidget->spinPopupTimeout->setEnabled(on);
+ mWidget->chkPopupButtons->setEnabled(on);
+}
+
+
+void YHModule::slotModifierActivated(int index)
+{
+ kdDebug(66666) << k_funcinfo << endl;
+ switch(mActionMap[index])
+ {
+ case (YHConfig::Nothing):
+ mWidget->rbActNothing->setChecked(true);
+ break;
+ case (YHConfig::ChangeVolume):
+ mWidget->rbActVolume->setChecked(true);
+ break;
+ case (YHConfig::ChangeTrack):
+ mWidget->rbActTrack->setChecked(true);
+ break;
+ }
+}
+
+void YHModule::slotMwheelClicked(int index)
+{
+ kdDebug(66666) << k_funcinfo << endl;
+ if (index == 0)
+ mActionMap[mWidget->cmbModifier->currentItem()] = YHConfig::Nothing;
+ else if (index == 1)
+ mActionMap[mWidget->cmbModifier->currentItem()] = YHConfig::ChangeVolume;
+ else
+ mActionMap[mWidget->cmbModifier->currentItem()] = YHConfig::ChangeTrack;
+}
+
+#include "cmodule.moc"
diff --git a/noatun/modules/systray/cmodule.h b/noatun/modules/systray/cmodule.h
new file mode 100644
index 00000000..fecc70e3
--- /dev/null
+++ b/noatun/modules/systray/cmodule.h
@@ -0,0 +1,55 @@
+// cmodule.h
+//
+// Copyright (C) 2001 Neil Stevens <multivac@fcmail.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#ifndef CMODULE_H
+#define CMODULE_H
+
+#include <qmap.h>
+#include <noatun/pref.h>
+
+class YHConfigWidget;
+
+class YHModule : public CModule
+{
+Q_OBJECT
+ public:
+ YHModule(QObject *_parent);
+ virtual void save();
+ virtual void reopen();
+
+ signals:
+ void saved();
+
+ private:
+ YHConfigWidget *mWidget;
+ QMap<int, int> mActionMap;
+
+ private slots:
+ void slotUsePopupToggled(bool on);
+ void slotModifierActivated(int index);
+ void slotMwheelClicked(int index);
+};
+
+#endif
diff --git a/noatun/modules/systray/kitsystemtray.cpp b/noatun/modules/systray/kitsystemtray.cpp
new file mode 100644
index 00000000..5847d7da
--- /dev/null
+++ b/noatun/modules/systray/kitsystemtray.cpp
@@ -0,0 +1,131 @@
+// $Id$
+//
+// Kit
+//
+// Copyright (C) 1999 Neil Stevens <multivac@fcmail.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "yhconfig.h"
+
+#include <noatun/app.h>
+#include <noatun/player.h>
+#include <qdragobject.h>
+
+#include "kitsystemtray.h"
+#include <kmainwindow.h>
+#include <kpopupmenu.h>
+#include <kxmlguifactory.h>
+#include <kiconloader.h>
+#include <kurldrag.h>
+
+#include <fixx11h.h>
+
+KitSystemTray::KitSystemTray(const QString &contextMenu, KMainWindow *parent, const char *name)
+ : KSystemTray(parent, name)
+{
+ setAlignment(AlignHCenter | AlignVCenter);
+ menu = (KPopupMenu *)parent->guiFactory()->container(contextMenu, parent);
+ menu->insertTitle(SmallIcon("noatun"), QString::null, 0, 0);
+ setAcceptDrops(true);
+}
+
+void KitSystemTray::changeTitle(const QPixmap &pixmap, const QString &title)
+{
+ menu->changeTitle(0, pixmap, title);
+}
+
+void KitSystemTray::showEvent(QShowEvent *)
+{
+ // empty
+}
+
+void KitSystemTray::mousePressEvent(QMouseEvent *event)
+{
+ switch(event->button())
+ {
+ case LeftButton:
+ napp->toggleInterfaces();
+ break;
+ case MidButton:
+ if (YHConfig::self()->middleMouseAction() == YHConfig::HideShowPlaylist)
+ napp->playlist()->toggleList();
+ else // play or pause
+ napp->player()->playpause();
+ break;
+ default:
+ menu->popup(event->globalPos());
+ break;
+ }
+}
+
+void KitSystemTray::dragEnterEvent(QDragEnterEvent * event)
+{
+ event->accept(KURLDrag::canDecode(event)); // accept uri drops only
+}
+
+void KitSystemTray::dropEvent(QDropEvent * event)
+{
+ KURL::List uris;
+ if (KURLDrag::decode(event, uris))
+ {
+ KURL::List::ConstIterator it;
+ for (it = uris.begin(); it != uris.end(); ++it)
+ napp->player()->openFile(*it, false);
+ }
+}
+
+void KitSystemTray::wheelEvent(QWheelEvent *event)
+{
+ YHConfig *c = YHConfig::self();
+
+ int action = 0;
+ if (event->state() & Qt::ShiftButton)
+ action = c->mouseWheelAction(YHConfig::Shift);
+ else if (event->state() & Qt::ControlButton)
+ action = c->mouseWheelAction(YHConfig::Ctrl);
+ else if (event->state() & Qt::AltButton)
+ action = c->mouseWheelAction(YHConfig::Alt);
+ else
+ action = c->mouseWheelAction(YHConfig::None);
+
+ switch(action)
+ {
+ case (YHConfig::ChangeVolume):
+ napp->player()->setVolume(napp->player()->volume()+event->delta()/24);
+ break;
+ case (YHConfig::ChangeTrack):
+ if (event->delta() > 0)
+ napp->player()->forward(true);
+ else
+ napp->player()->back();
+ break;
+ default:
+ break;
+ }
+}
+
+#include "kitsystemtray.moc"
diff --git a/noatun/modules/systray/kitsystemtray.h b/noatun/modules/systray/kitsystemtray.h
new file mode 100644
index 00000000..2f640adb
--- /dev/null
+++ b/noatun/modules/systray/kitsystemtray.h
@@ -0,0 +1,54 @@
+// $Id$
+//
+// Kit
+//
+// Copyright (C) 1999 Neil Stevens <multivac@fcmail.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#ifndef KITSYSTEMTRAY_H
+#define KITSYSTEMTRAY_H
+
+#include <ksystemtray.h>
+
+class KPopupMenu;
+class KMainWindow;
+class QPixmap;
+
+class KitSystemTray : public KSystemTray
+{
+Q_OBJECT
+
+public:
+ KitSystemTray(const QString &contextMenu, KMainWindow *parent, const char *name = 0);
+ void changeTitle(const QPixmap &, const QString &);
+protected:
+ virtual void showEvent(QShowEvent *);
+ virtual void mousePressEvent(QMouseEvent *);
+ virtual void dragEnterEvent(QDragEnterEvent *);
+ virtual void dropEvent(QDropEvent *);
+ virtual void wheelEvent(QWheelEvent *e);
+
+ KPopupMenu *menu;
+};
+
+#endif
diff --git a/noatun/modules/systray/noatunui.cpp b/noatun/modules/systray/noatunui.cpp
new file mode 100644
index 00000000..76f9af25
--- /dev/null
+++ b/noatun/modules/systray/noatunui.cpp
@@ -0,0 +1,9 @@
+#include "systray.h"
+
+extern "C"
+{
+ KDE_EXPORT Plugin *create_plugin()
+ {
+ return new NoatunSystray();
+ }
+}
diff --git a/noatun/modules/systray/systray.cpp b/noatun/modules/systray/systray.cpp
new file mode 100644
index 00000000..c93080ca
--- /dev/null
+++ b/noatun/modules/systray/systray.cpp
@@ -0,0 +1,467 @@
+// systray.h
+//
+// Copyright (C) 2000 Neil Stevens <multivac@fcmail.com>
+// Copyright (C) 1999 Charles Samuels <charles@kde.org>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "systray.h"
+#include "kitsystemtray.h"
+#include "cmodule.h"
+#include "yhconfig.h"
+
+#include <noatun/app.h>
+#include <noatun/pref.h>
+#include <noatun/player.h>
+#include <noatun/stdaction.h>
+
+#include <kaction.h>
+#include <kconfig.h>
+#include <qfile.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpassivepopup.h>
+#include <kpixmapeffect.h>
+#include <kstdaction.h>
+#include <qbitmap.h>
+#include <qhbox.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qtooltip.h>
+#include <qvbox.h>
+
+#include <qimage.h>
+#include <kurl.h>
+#include <kio/netaccess.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+
+#include <netwm.h>
+#include <kglobalsettings.h>
+
+// TODO: Maybe make this value configurable?
+const int COVER_MAXW = 128;
+const int COVER_MAXH = 128;
+#define BASEICON "noatun"
+
+// From JuK
+class PassivePopup : public KPassivePopup
+{
+public:
+ PassivePopup(QWidget *parent = 0, const char *name = 0) : KPassivePopup(parent, name) {}
+
+protected:
+ virtual void enterEvent(QEvent *)
+ {
+ setTimeout(3000000); // Make timeout damn near infinite
+ }
+
+ virtual void leaveEvent(QEvent *)
+ {
+ setTimeout(250); // Close quickly
+ }
+};
+
+
+//NoatunSystray *NoatunSystray::self = 0;
+
+
+NoatunSystray::NoatunSystray() : KMainWindow(0, "NoatunSystray"), Plugin(),
+ mTray(0), trayStatus(0), trayBase(0), mPassivePopup(0L)
+{
+ //self = this;
+ hide();
+
+ tmpCoverPath = locateLocal("tmp", "youngHickoryCover.png");
+
+ removeCover(); // make sure any old temp cover is gone
+
+ KStdAction::quit(napp, SLOT(quit()), actionCollection());
+ KStdAction::open(napp, SLOT(fileOpen()), actionCollection());
+ KStdAction::preferences(napp, SLOT(preferences()), actionCollection());
+ NoatunStdAction::back(actionCollection(), "back");
+ NoatunStdAction::stop(actionCollection(), "stop");
+ NoatunStdAction::playpause(actionCollection(), "play");
+ NoatunStdAction::forward(actionCollection(), "forward");
+ NoatunStdAction::playlist(actionCollection(), "show_playlist");
+ NoatunStdAction::loop(actionCollection(), "loop_style");
+ NoatunStdAction::effects(actionCollection(), "effects");
+ NoatunStdAction::equalizer(actionCollection(), "equalizer");
+
+ createGUI("systrayui.rc");
+
+ mTray = new KitSystemTray("tray", this);
+ mTray->show();
+
+ trayBase = renderIcon(BASEICON, QString::null);
+ trayStatus = renderIcon(BASEICON, "player_stop");
+
+ mTray->changeTitle(*trayBase, i18n("Noatun"));
+ showingTrayStatus = false;
+
+ mBlinkTimer = new QTimer(this);
+ connect(mBlinkTimer, SIGNAL(timeout()), this, SLOT(slotBlinkTimer()));
+
+ connect(napp->player(), SIGNAL(playing()), this, SLOT(slotPlayPause()));
+ connect(napp->player(), SIGNAL(paused()), this, SLOT(slotPlayPause()));
+ connect(napp->player(), SIGNAL(stopped()), this, SLOT(slotStopped()));
+ //napp->player()->handleButtons();
+}
+
+
+NoatunSystray::~NoatunSystray()
+{
+ //kdDebug(66666) << k_funcinfo << "Called." << endl;
+ removeCover();
+ delete trayBase;
+ delete trayStatus;
+ napp->showInterfaces();
+}
+
+
+void NoatunSystray::init()
+{
+ YHModule *cmod = new YHModule(this);
+ connect(cmod, SIGNAL(saved()), this, SLOT(slotLoadSettings()));
+ slotLoadSettings();
+}
+
+
+void NoatunSystray::slotLoadSettings()
+{
+ kdDebug(66666) << k_funcinfo << endl;
+
+ YHConfig *c = YHConfig::self();
+
+ if(c->stateIconDisplay() == YHConfig::FlashingIcon)
+ mBlinkTimer->start(1000);
+ else
+ mBlinkTimer->stop();
+ slotBlinkTimer();
+
+
+ if(c->tip())
+ QToolTip::add(mTray, tipText);
+ else
+ QToolTip::remove(mTray);
+
+ if (!c->passivePopupCovers())
+ removeCover();
+
+ if(c->passivePopup())
+ {
+ mPassivePopup = new PassivePopup(mTray, "NoatunPassivePopup");
+ }
+ else
+ {
+ delete mPassivePopup;
+ mPassivePopup = 0L;
+ }
+}
+
+
+void NoatunSystray::closeEvent(QCloseEvent*)
+{
+ //kdDebug(66666) << k_funcinfo << "Called." << endl;
+ disconnect(napp->player(), 0, 0, 0);
+ unload();
+}
+
+
+void NoatunSystray::slotPlayPause()
+{
+ QString status;
+
+ if(napp->player()->isPaused())
+ {
+ changeTray("player_pause");
+ status = i18n("Noatun - Paused");
+ }
+ else
+ {
+ changeTray("player_play");
+ status = i18n("Noatun - Playing");
+ }
+
+ const PlaylistItem item = napp->player()->current();
+ QString s;
+
+ if(!item.isProperty("title"))
+ {
+ // No metadata
+ s = QString("<nobr>%1</nobr>").arg(item.title());
+ }
+ else
+ {
+ s = QString("<h2><nobr>%1</nobr></h2>").arg(item.property("title"));
+
+ if(item.isProperty("author"))
+ s += QString("<nobr>%1</nobr><br>").arg(item.property("author"));
+
+ if(item.isProperty("album"))
+ {
+ if(item.isProperty("date"))
+ s += QString("<nobr>%1 (%2)</nobr><br>").arg(item.property("album")).arg(item.property("date"));
+ else
+ s += QString("<nobr>%1</nobr><br>").arg(item.property("album"));
+ }
+ }
+
+ // prepare cover image for display
+ if (YHConfig::self()->passivePopupCovers())
+ updateCover();
+
+ if(YHConfig::self()->passivePopupCovers() && QFile::exists(tmpCoverPath))
+ {
+ // QT always adds an empty line after the table so we add en empty line before the
+ // table to get equal spacing on top and bottom
+ setTipText(QString("<qt><br><table cellspacing=0 cellpadding=0><tr>" \
+ "<td align=center valign=center><h4><nobr>%1</nobr></h4>%2</td>" \
+ "<td valign=center><img src='%3'></td>" \
+ "</qt></tr></table>").arg(status).arg(s).arg(tmpCoverPath));
+ }
+ else
+ {
+ setTipText(QString("<qt><center><h4><nobr>%1</nobr></h4>%2</center></qt>").arg(status).arg(s));
+ }
+}
+
+
+void NoatunSystray::slotStopped()
+{
+ if(!napp->player()->current())
+ return;
+ changeTray("player_stop");
+ setTipText(QString("<qt><nobr><h4>%1</h4></nobr></qt>").arg(i18n("Noatun - Stopped")));
+}
+
+
+
+void NoatunSystray::changeTray(const QString &pm)
+{
+ delete trayStatus;
+ trayStatus = renderIcon(BASEICON, pm);
+ if(showingTrayStatus)
+ slotBlinkTimer();
+}
+
+
+void NoatunSystray::slotBlinkTimer()
+{
+ switch(YHConfig::self()->stateIconDisplay())
+ {
+ case (YHConfig::FlashingIcon):
+ showingTrayStatus ^= true;
+ break;
+ case (YHConfig::StaticIcon):
+ showingTrayStatus = true;
+ break;
+ case (YHConfig::NoIcon):
+ showingTrayStatus = false;
+ break;
+ }
+
+ if(showingTrayStatus)
+ mTray->setPixmap(*trayStatus);
+ else
+ mTray->setPixmap(*trayBase);
+}
+
+
+// taken from patched karamba xmmssensor
+// modified heavily to work in this place
+void NoatunSystray::updateCover()
+{
+ //kdDebug(66666) << k_funcinfo << endl;
+ QString dir = napp->player()->current().url().directory();
+ QString cover;
+
+ // TODO: Maybe make these filenames configurable?
+ if(QFile::exists(dir + "/folder.png"))
+ cover = dir + "/folder.png";
+ else if(QFile::exists(dir + "/.folder.png"))
+ cover = dir + "/.folder.png";
+ else if(QFile::exists(dir + "/cover.png"))
+ cover = dir + "/cover.png";
+ else if(QFile::exists(dir + "/cover.jpg"))
+ cover = dir + "/cover.jpg";
+ else if(QFile::exists(dir + "/cover.jpeg"))
+ cover = dir + "/cover.jpeg";
+ else // no cover
+ {
+ //kdDebug(66666) << k_funcinfo << "NO COVER" << endl;
+ removeCover();
+ return;
+ }
+
+ QString title = napp->player()->current().title();
+
+ QImage previmg;
+ previmg.load(tmpCoverPath);
+
+ if(previmg.text("Title") != title)
+ { //Verify song change to limit CPU usage
+ /*kdDebug(66666) << k_funcinfo << "Creating new temp cover for '" <<
+ cover << "'" << endl;*/
+
+ QImage src;
+ QImage tmpimg;
+
+ if(src.load(cover))
+ {
+ if(src.width() >= COVER_MAXW || src.height() >= COVER_MAXH)
+ tmpimg = src.scale(COVER_MAXW, COVER_MAXH, QImage::ScaleMin);
+ else
+ tmpimg = src;
+
+ tmpimg.setText("Title", 0, title); //add Title in the image text for cache usage
+ tmpimg.save(tmpCoverPath, "PNG", 0);
+ }
+ else
+ {
+ removeCover();
+ }
+ }
+}
+
+
+void NoatunSystray::removeCover()
+{
+ if(QFile::exists(tmpCoverPath))
+ KIO::NetAccess::del(KURL(tmpCoverPath), this);
+}
+
+
+void NoatunSystray::setTipText(const QString& text)
+{
+ if(text == tipText) // save the planet, save cpu cycles ;)
+ return;
+ tipText = text;
+
+ YHConfig *c = YHConfig::self();
+ if(c->passivePopup())
+ QTimer::singleShot(0, this, SLOT(showPassivePopup()));
+
+ if(c->tip())
+ QToolTip::add(mTray, tipText);
+}
+
+
+void NoatunSystray::showPassivePopup()
+{
+ if (!mPassivePopup)
+ {
+ kdDebug(66666) << k_funcinfo << "Called but no KPassivePopup created yet!" << endl;
+ return;
+ }
+
+ mPassivePopup->reparent(0L, QPoint(0,0));
+
+ if (YHConfig::self()->passivePopupButtons() && !napp->player()->isStopped())
+ {
+ QVBox *widget = mPassivePopup->standardView(QString::null, tipText, QPixmap());
+ QHBox *box = new QHBox(mPassivePopup, "popupbox");
+
+ box->setSpacing(8);
+
+ // Algorithm for determining popup location from kpassivepopup.cpp via JuK
+ NETWinInfo ni(qt_xdisplay(), mTray->winId(), qt_xrootwin(),
+ NET::WMIconGeometry | NET::WMKDESystemTrayWinFor);
+ NETRect frame, win;
+ ni.kdeGeometry(frame, win);
+
+ QRect bounds = KGlobalSettings::desktopGeometry(QPoint(win.pos.x, win.pos.y));
+
+ if(win.pos.x < bounds.center().x())
+ {
+ // Buttons to the left
+
+ QVBox *buttonBox = new QVBox(box);
+ buttonBox->setSpacing(3);
+
+ QPushButton *forwardButton = new QPushButton(action("forward")->iconSet(), 0, buttonBox, "popup_forward");
+ forwardButton->setFlat(true);
+ connect(forwardButton, SIGNAL(clicked()), action("forward"), SLOT(activate()));
+
+ QPushButton *backButton = new QPushButton(action("back")->iconSet(), 0, buttonBox, "popup_back");
+ backButton->setFlat(true);
+ connect(backButton, SIGNAL(clicked()), action("back"), SLOT(activate()));
+
+ QFrame *line = new QFrame(box);
+ line->setFrameShape(QFrame::VLine);
+
+ widget->reparent(box, QPoint(0, 0));
+ }
+ else
+ {
+ // Buttons to the right
+ widget->reparent(box, QPoint(0, 0));
+
+ QFrame *line = new QFrame(box);
+ line->setFrameShape(QFrame::VLine);
+
+ QVBox *buttonBox = new QVBox(box);
+ buttonBox->setSpacing(3);
+
+ QPushButton *forwardButton = new QPushButton(action("forward")->iconSet(), 0, buttonBox, "popup_forward");
+ forwardButton->setFlat(true);
+ connect(forwardButton, SIGNAL(clicked()), action("forward"), SLOT(activate()));
+
+ QPushButton *backButton = new QPushButton(action("back")->iconSet(), 0, buttonBox, "popup_back");
+ backButton->setFlat(true);
+ connect(backButton, SIGNAL(clicked()), action("back"), SLOT(activate()));
+ }
+ mPassivePopup->setView(box);
+ }
+ else
+ {
+ mPassivePopup->setView(QString::null, tipText);
+ }
+
+ mPassivePopup->setTimeout(YHConfig::self()->passivePopupTimeout()*1000);
+ mPassivePopup->show();
+}
+
+
+QPixmap *NoatunSystray::renderIcon(const QString& baseIcon, const QString &overlayIcon) const
+{
+ QPixmap *base = new QPixmap(KSystemTray::loadIcon(baseIcon));
+
+ if(!(overlayIcon.isNull())) // otherwise leave the base as-is
+ {
+ QPixmap overlay = KSystemTray::loadIcon(overlayIcon);
+ if(!overlay.isNull())
+ {
+ // draw the overlay on top of it
+ QPainter p(base);
+ p.drawPixmap(0, 0, overlay);
+ }
+ }
+ return base;
+}
+
+#include "systray.moc"
diff --git a/noatun/modules/systray/systray.h b/noatun/modules/systray/systray.h
new file mode 100644
index 00000000..f602c4e3
--- /dev/null
+++ b/noatun/modules/systray/systray.h
@@ -0,0 +1,80 @@
+// systray.h
+//
+// Copyright (C) 2000 Neil Stevens <multivac@fcmail.com>
+// Copyright (C) 1999 Charles Samuels <charles@kde.org>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Except as contained in this notice, the name(s) of the author(s) shall not be
+// used in advertising or otherwise to promote the sale, use or other dealings
+// in this Software without prior written authorization from the author(s).
+
+#ifndef SYSTRAY_H
+#define SYSTRAY_H
+
+#include <noatun/plugin.h>
+#include <noatun/app.h>
+
+#include <qtimer.h>
+
+#include <kmainwindow.h>
+
+class KitSystemTray;
+class QTimer;
+class PassivePopup;
+
+class NoatunSystray : public KMainWindow, public Plugin
+{
+Q_OBJECT
+public:
+ NoatunSystray();
+ virtual ~NoatunSystray();
+ virtual void init();
+
+protected:
+ virtual void closeEvent(QCloseEvent *);
+
+public slots:
+ void slotPlayPause();
+ void slotStopped();
+
+private slots:
+ void changeTray(const QString &);
+ void slotLoadSettings();
+ void slotBlinkTimer();
+ void showPassivePopup();
+ QPixmap *renderIcon(const QString &, const QString &) const;
+
+private:
+ void setTipText(const QString&);
+ void updateCover();
+ void removeCover();
+
+private:
+ KitSystemTray *mTray;
+ QTimer *mBlinkTimer;
+ QPixmap *trayStatus;
+ QPixmap *trayBase;
+ PassivePopup *mPassivePopup;
+
+ bool showingTrayStatus;
+ QString tipText;
+ QString tmpCoverPath;
+};
+
+#endif
diff --git a/noatun/modules/systray/systray.plugin b/noatun/modules/systray/systray.plugin
new file mode 100644
index 00000000..24af57f5
--- /dev/null
+++ b/noatun/modules/systray/systray.plugin
@@ -0,0 +1,100 @@
+Filename=noatun_systray.la
+Author=Neil Stevens
+Site=http://noatun.kde.org/plugins/yh/
+Email=neil@qualityassistant.com
+Type=systray
+License=X11-like
+Name=Young Hickory
+Name[af]=Jong Hickory
+Name[ar]=شجرة الجوز الصغيرة
+Name[az]=Gənc Hickory
+Name[cs]=Mladý ořech
+Name[eo]=Juna hikorio
+Name[es]=Joven Nogal
+Name[et]=Noor hikkor
+Name[fa]=یانگ هیکوری
+Name[fi]=Nuori Hickory
+Name[fr]=Jeune Hickory
+Name[hi]=यंग हिकॉरी
+Name[is]=Ungi Hickory
+Name[it]=Giovane nocciolina
+Name[ko]=젊은 히코리
+Name[lt]=Jaunas Hickory
+Name[lv]=Jaunais Hickorijs
+Name[ne]=युवा हिक्कोरी
+Name[pl]=Tacka systemowa
+Name[ru]=Ветка гикори
+Name[sk]=Mladý Hickory
+Name[sl]=Mladi hikori
+Name[sv]=Ung valnöt
+Name[ta]=சின்ன ஒருவகை மரம்
+Name[tr]=Genç Hickory
+Name[ven]=Hickory mutuku
+Name[xh]=iHickory encinane
+Name[zh_CN]=小胡桃木
+Name[zh_HK]=小山胡桃
+Name[zh_TW]=小山胡桃
+Comment=A system tray interface
+Comment[af]='n stelsel laai koppelvlak
+Comment[ar]=واجهة للوحة النظام
+Comment[az]=Sistem rəf paneli
+Comment[bg]=Икона за управление от системния панел
+Comment[bn]=একটি সিস্টেম ট্রে ইন্টারফেস
+Comment[bs]=Interfejs za sistemski tray
+Comment[ca]=Una interfície de la safata del sistema
+Comment[cs]=Rozhraní systémové části panelu
+Comment[cy]=Rhyngwyneb hambwrdd cysawd
+Comment[da]=En statusfelt-grænseflade
+Comment[de]=Oberfläche für den Systembereich der Kontrollleiste
+Comment[el]=Μια διασύνδεση για το πλαίσιο συστήματος
+Comment[eo]=Interfaco por la dokejo
+Comment[es]=Una interfaz para la bandeja del sistema
+Comment[et]=Süsteemse doki liides
+Comment[eu]=Interfazea sistemaren bandejarentzat
+Comment[fa]=یک واسط سینی سیستم
+Comment[fi]=Järjestelmäikkunan rajapinta
+Comment[fr]=Une interface intégrée dans la boîte à miniatures
+Comment[gl]=Unha interface para a bandexa do sistema
+Comment[he]=ממשק מגש מערכת
+Comment[hi]=एक तंत्र तश्तरी इंटरफेस
+Comment[hr]=Sučelje za sustavsku ladicu
+Comment[hu]=A rendszertálca kezelői felülete
+Comment[id]=interface tray sistem
+Comment[is]=Aðgangur að kerfisbakka
+Comment[it]=Un'interfaccia per il vassoio di sistema
+Comment[ja]=システムトレイインターフェース
+Comment[kk]=Жүйелік сөре интерфейсі
+Comment[km]=ចំណុច​ប្រទាក់​ថាស​ប្រព័ន្ធ
+Comment[ko]=시스템 트레이 인터페이스
+Comment[lt]=Sistemos dėklo sąsaja
+Comment[lv]=Sistēmas teknes starpseja
+Comment[mk]=Интерфејс за системската лента
+Comment[ms]=Antaramuka dulang sistem
+Comment[mt]=Interfaċċja għat-tray tas-sistema
+Comment[nb]=Systemkurv grensesnitt
+Comment[nds]=Systeemafsnitt-Koppelsteed
+Comment[ne]=प्रणाली ट्रे इन्टरफेस
+Comment[nl]=Een systeemvakinterface
+Comment[nn]=Systemtrau-grensesnitt
+Comment[pa]=ਇੱਕ ਸਿਸਟਮ ਟਰੇ ਇੰਟਰਫੇਸ
+Comment[pl]=Interfejs tacki systemowej
+Comment[pt]=Uma interface para a bandeja do sistema
+Comment[pt_BR]=Uma interface para os ícones de sistema
+Comment[ro]=O interfaţă pentru tava de sistem
+Comment[ru]=Интерфейс панели системного лотка
+Comment[sk]=Rozhranie pre systémovú lištu
+Comment[sl]=Vmesnik za sistemsko vrstico v pultu
+Comment[sr]=Интерфејс за системску касету
+Comment[sr@Latn]=Interfejs za sistemsku kasetu
+Comment[sv]=Gränssnitt för aktivitetsfältet
+Comment[ta]=அமைப்பு தொகுதித் தட்டு இடைமுகம்
+Comment[tg]=Интерфейси сабади системавӣ
+Comment[th]=ส่วนติดต่อกับถาดระบบ
+Comment[tr]=Sistem çekmecesi arayüzü
+Comment[uk]=Інтерфейс системного лотка
+Comment[ven]=Thirei ya sisitemu
+Comment[xh]=Ujongano lwendlela yetreyi
+Comment[zh_CN]=一个系统托盘界面
+Comment[zh_HK]=系統匣介面
+Comment[zh_TW]=System Tray的介面
+Comment[zu]=Isistimu yetreyi loxhumano olubhekene
diff --git a/noatun/modules/systray/systrayui.rc b/noatun/modules/systray/systrayui.rc
new file mode 100644
index 00000000..2b50654b
--- /dev/null
+++ b/noatun/modules/systray/systrayui.rc
@@ -0,0 +1,20 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="noatunsystray" version="12">
+<Menu name="tray">
+ <Action name="file_open"/>
+ <Action name="show_playlist"/>
+ <Separator lineSeparator="true"/>
+ <Action name="back"/>
+ <Action name="stop"/>
+ <Action name="play"/>
+ <Action name="forward"/>
+ <Separator lineSeparator="true"/>
+ <Action name="loop_style"/>
+ <Action name="effects"/>
+ <Action name="equalizer"/>
+ <Separator lineSeparator="true"/>
+ <Action name="options_configure"/>
+ <Separator lineSeparator="true"/>
+ <Action name="file_quit"/>
+</Menu>
+</kpartgui>
diff --git a/noatun/modules/systray/yhconfig.kcfg b/noatun/modules/systray/yhconfig.kcfg
new file mode 100644
index 00000000..9b017aec
--- /dev/null
+++ b/noatun/modules/systray/yhconfig.kcfg
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="noatunrc"/>
+ <group name="Young Hickory">
+
+ <entry key="State Icon Display" type="Enum">
+ <label>State Icon Display</label>
+ <choices>
+ <choice name="Animation"/>
+ <choice name="FlashingIcon"/>
+ <choice name="StaticIcon"/>
+ <choice name="NoIcon"/>
+ </choices>
+ <default>FlashingIcon</default>
+ </entry>
+
+ <entry name="icon" type="Int">
+ <label>Icon</label>
+ <default>1</default>
+ </entry>
+
+ <entry name="tip" type="Bool">
+ <label>Show a tooltip for the current track</label>
+ <default>true</default>
+ </entry>
+
+ <entry name="passivePopup" type="Bool">
+ <label>Announce tracks with a popup window</label>
+ <default>true</default>
+ </entry>
+
+ <entry name="passivePopupTimeout" type="Int">
+ <label>Display popup window for x seconds</label>
+ <default>5</default>
+ </entry>
+
+ <entry name="passivePopupCovers" type="Bool">
+ <label>Show covers in popup window and tooltip</label>
+ <default>true</default>
+ </entry>
+
+ <entry name="passivePopupButtons" type="Bool">
+ <label>Show buttons in popup window</label>
+ <default>true</default>
+ </entry>
+
+
+ <entry key="MiddleMouse Action" type="Enum">
+ <label>Mode</label>
+ <choices>
+ <choice name="PlayPause"/>
+ <choice name="HideShowPlaylist"/>
+ </choices>
+ <default>HideShowPlaylist</default>
+ </entry>
+
+ <entry name="MouseWheelAction$(Modifier)" type="Enum" key="mousewheelaction_$(Modifier)">
+ <parameter name="Modifier" type="Enum">
+ <values>
+ <value>None</value>
+ <value>Shift</value>
+ <value>Alt</value>
+ <value>Ctrl</value>
+ </values>
+ </parameter>
+ <choices>
+ <choice name="Nothing"/>
+ <choice name="ChangeVolume"/>
+ <choice name="ChangeTrack"/>
+ </choices>
+ <default param="None">ChangeVolume</default>
+ <default param="Shift">Nothing</default>
+ <default param="Alt">Nothing</default>
+ <default param="Ctrl">ChangeTrack</default>
+ </entry>
+
+ </group>
+</kcfg>
diff --git a/noatun/modules/systray/yhconfig.kcfgc b/noatun/modules/systray/yhconfig.kcfgc
new file mode 100644
index 00000000..5b4f99e4
--- /dev/null
+++ b/noatun/modules/systray/yhconfig.kcfgc
@@ -0,0 +1,7 @@
+# Code generation options for kconfig_compiler
+File=yhconfig.kcfg
+ClassName=YHConfig
+Singleton=true
+Mutators=true
+MemberVariables=private
+GlobalEnums=true
diff --git a/noatun/modules/systray/yhconfigwidget.ui b/noatun/modules/systray/yhconfigwidget.ui
new file mode 100644
index 00000000..48267c28
--- /dev/null
+++ b/noatun/modules/systray/yhconfigwidget.ui
@@ -0,0 +1,333 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>YHConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>YHConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>371</width>
+ <height>379</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>chkUseTooltip</cstring>
+ </property>
+ <property name="text">
+ <string>Show a &amp;tooltip for the current track</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>chkUseCovers</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;covers in popup window and tooltip</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Popup Window</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lblPopupTimeout</cstring>
+ </property>
+ <property name="text">
+ <string>Display popup window t&amp;ime:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinPopupTimeout</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>chkPopupButtons</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;buttons in popup window</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>spinPopupTimeout</cstring>
+ </property>
+ <property name="suffix">
+ <string>s</string>
+ <comment>Seconds</comment>
+ </property>
+ <property name="maxValue">
+ <number>600</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>5</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>chkUsePopup</cstring>
+ </property>
+ <property name="text">
+ <string>Announce tracks with a &amp;popup window</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>State Icon Display</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>rbStateAnim</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Animated</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="1">
+ <property name="name">
+ <cstring>rbStateFlashing</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Flashing</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>rbStateStatic</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Static</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="1">
+ <property name="name">
+ <cstring>rbStateNone</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;None</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Ad&amp;vanced</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>grpMiddleMouse</cstring>
+ </property>
+ <property name="title">
+ <string>Middle Mouse Button Action</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rbHideShowPlaylist</cstring>
+ </property>
+ <property name="text">
+ <string>Hide / Show play&amp;list</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rbPlayPause</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Play / Pause</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>grpMwheel</cstring>
+ </property>
+ <property name="title">
+ <string>Mouse &amp;Wheel</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lblModifier</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Keyboard modifier:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cmbModifier</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>cmbModifier</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lblAction</cstring>
+ </property>
+ <property name="text">
+ <string>Action:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rbActNothing</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Nothing</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rbActVolume</cstring>
+ </property>
+ <property name="text">
+ <string>Change v&amp;olume</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rbActTrack</cstring>
+ </property>
+ <property name="text">
+ <string>Switch &amp;track</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>tabWidget2</tabstop>
+ <tabstop>chkUseTooltip</tabstop>
+ <tabstop>chkUseCovers</tabstop>
+ <tabstop>chkUsePopup</tabstop>
+ <tabstop>spinPopupTimeout</tabstop>
+ <tabstop>chkPopupButtons</tabstop>
+ <tabstop>rbStateAnim</tabstop>
+ <tabstop>rbStateFlashing</tabstop>
+ <tabstop>rbStateStatic</tabstop>
+ <tabstop>rbStateNone</tabstop>
+ <tabstop>rbHideShowPlaylist</tabstop>
+ <tabstop>rbPlayPause</tabstop>
+ <tabstop>cmbModifier</tabstop>
+ <tabstop>rbActNothing</tabstop>
+ <tabstop>rbActVolume</tabstop>
+ <tabstop>rbActTrack</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>