aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/statusicon
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-26 19:14:04 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-12-26 19:14:04 +0000
commitee02df7935ad4c747f64030bd2f3b8a98ab2c4c9 (patch)
treef972d9ed5b203f8de267e41a93eb2c0272b6ea87 /src/plugins/General/statusicon
parent12442084d5cacdd65130f106dfe8df72d160d126 (diff)
downloadqmmp-ee02df7935ad4c747f64030bd2f3b8a98ab2c4c9.tar.gz
qmmp-ee02df7935ad4c747f64030bd2f3b8a98ab2c4c9.tar.bz2
qmmp-ee02df7935ad4c747f64030bd2f3b8a98ab2c4c9.zip
status icon: fixed state tracking; notifier plugin: show test message
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@716 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/statusicon')
-rw-r--r--src/plugins/General/statusicon/statusicon.cpp12
-rw-r--r--src/plugins/General/statusicon/statusicon.h2
2 files changed, 3 insertions, 11 deletions
diff --git a/src/plugins/General/statusicon/statusicon.cpp b/src/plugins/General/statusicon/statusicon.cpp
index 9c6453acb..b28a2bc20 100644
--- a/src/plugins/General/statusicon/statusicon.cpp
+++ b/src/plugins/General/statusicon/statusicon.cpp
@@ -58,10 +58,11 @@ StatusIcon::StatusIcon(QObject *parent)
m_showTooltip = settings.value("show_tooltip",FALSE).toBool();
m_hideToTray = settings.value("hide_on_close", FALSE).toBool();
settings.endGroup();
- m_enabled = FALSE;
connect (m_core, SIGNAL(metaDataChanged ()), SLOT(showMetaData()));
connect (m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(setState(Qmmp::State)));
- QTimer::singleShot(200, this, SLOT(enable()));
+ setState(m_core->state()); //update state
+ if (m_core->state() == Qmmp::Playing) //show test message
+ QTimer::singleShot(1500, this, SLOT(showMetaData()));
}
@@ -92,8 +93,6 @@ void StatusIcon::setState(Qmmp::State state)
void StatusIcon::showMetaData()
{
- if (!m_enabled)
- return;
QString message = m_core->metaData(Qmmp::ARTIST) + " - " + m_core->metaData(Qmmp::TITLE);
if (message.startsWith (" - ") || message.endsWith (" - "))
message.remove(" - ");
@@ -119,8 +118,3 @@ void StatusIcon::trayActivated(QSystemTrayIcon::ActivationReason reason)
m_core->pause();
}
}
-
-void StatusIcon::enable()
-{
- m_enabled = TRUE;
-}
diff --git a/src/plugins/General/statusicon/statusicon.h b/src/plugins/General/statusicon/statusicon.h
index 42978d592..8fcabc25f 100644
--- a/src/plugins/General/statusicon/statusicon.h
+++ b/src/plugins/General/statusicon/statusicon.h
@@ -46,14 +46,12 @@ private slots:
void showMetaData();
void setState(Qmmp::State state);
void trayActivated(QSystemTrayIcon::ActivationReason);
- void enable();
private:
QSystemTrayIcon *m_tray;
bool m_showMessage;
bool m_showTooltip;
bool m_hideToTray;
- bool m_enabled;
int m_messageDelay;
SoundCore *m_core;
MediaPlayer *m_player;