From e16f15ff12eb654d2c09f5a280d28389a3ad74fc Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 4 Aug 2008 20:12:45 +0000 Subject: 0.2 fixes git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@490 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/statusicon/statusicon.cpp | 10 ++++++++-- src/plugins/General/statusicon/statusicon.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/plugins/General') diff --git a/src/plugins/General/statusicon/statusicon.cpp b/src/plugins/General/statusicon/statusicon.cpp index 53d92f36f..4946a4ba2 100644 --- a/src/plugins/General/statusicon/statusicon.cpp +++ b/src/plugins/General/statusicon/statusicon.cpp @@ -54,7 +54,7 @@ StatusIcon::StatusIcon(Control *control, QObject *parent) settings.endGroup(); m_enabled = FALSE; QTimer::singleShot(200, this, SLOT(enable())); - + m_state = General::Stopped; } @@ -63,6 +63,7 @@ StatusIcon::~StatusIcon() void StatusIcon::setState(const uint &state) { + m_state = state; switch ((uint) state) { case General::Playing: @@ -106,7 +107,12 @@ void StatusIcon::trayActivated(QSystemTrayIcon::ActivationReason reason) if (reason == QSystemTrayIcon::Trigger) m_control->toggleVisibility(); else if (reason == QSystemTrayIcon::MiddleClick) - m_control->pause(); + { + if(m_state == General::Stopped) + m_control->play(); + else + m_control->pause(); + } } void StatusIcon::enable() diff --git a/src/plugins/General/statusicon/statusicon.h b/src/plugins/General/statusicon/statusicon.h index 549cf5f18..b6d8a3e04 100644 --- a/src/plugins/General/statusicon/statusicon.h +++ b/src/plugins/General/statusicon/statusicon.h @@ -53,6 +53,7 @@ private: bool m_enabled; int m_messageDelay; Control *m_control; + uint m_state; }; -- cgit v1.2.3-13-gbd6f