Commit 35308a0a authored by Scott Wheeler's avatar Scott Wheeler

Adding a simplified version of Klas's patch to make JuK dock in the system

tray by default on close.  I'll have another commit soon that makes this
configurable.

CCMAIL:klas.kalass@gmx.de

svn path=/trunk/kdemultimedia/juk/; revision=211621
parent 9a7bea26
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <kstatusbar.h> #include <kstatusbar.h>
#include <kconfig.h> #include <kconfig.h>
#include <kdebug.h> #include <kdebug.h>
#include <kmessagebox.h>
#include <qtimer.h> #include <qtimer.h>
#include <qlistview.h> #include <qlistview.h>
...@@ -108,7 +109,8 @@ void JuK::setupActions() ...@@ -108,7 +109,8 @@ void JuK::setupActions()
m_deleteItemPlaylistAction = new KAction(i18n("Remove"), "edittrash", 0, m_splitter, SLOT(slotDeletePlaylist()), m_deleteItemPlaylistAction = new KAction(i18n("Remove"), "edittrash", 0, m_splitter, SLOT(slotDeletePlaylist()),
actionCollection(), "deleteItemPlaylist"); actionCollection(), "deleteItemPlaylist");
KStdAction::quit(this, SLOT(close()), actionCollection()); //KStdAction::quit(this, SLOT(close()), actionCollection());
KStdAction::quit(kapp, SLOT(quit()), actionCollection());
// edit menu // edit menu
KStdAction::cut(this, SLOT(cut()), actionCollection()); KStdAction::cut(this, SLOT(cut()), actionCollection());
...@@ -307,7 +309,7 @@ void JuK::saveConfig() ...@@ -307,7 +309,7 @@ void JuK::saveConfig()
} }
} }
bool JuK::queryClose() bool JuK::queryExit()
{ {
slotStop(); slotStop();
delete m_player; delete m_player;
...@@ -317,6 +319,20 @@ bool JuK::queryClose() ...@@ -317,6 +319,20 @@ bool JuK::queryClose()
return true; return true;
} }
bool JuK::queryClose()
{
if(m_systemTray) {
KMessageBox::information(this,
i18n("<qt>Closing the main window will keep JuK running in the system tray. "
"Use Quit from the File menu to quit the application.</qt>"),
i18n("Docking in System Tray"), "hideOnCloseInfo");
hide();
return false;
}
else
return true;
}
void JuK::invokeEditSlot( const char *slotName, const char *slot ) void JuK::invokeEditSlot( const char *slotName, const char *slot )
{ {
QObject *object = focusWidget(); QObject *object = focusWidget();
......
...@@ -68,6 +68,7 @@ private: ...@@ -68,6 +68,7 @@ private:
void readConfig(); void readConfig();
void saveConfig(); void saveConfig();
virtual bool queryExit();
virtual bool queryClose(); virtual bool queryClose();
void invokeEditSlot(const char *slotName, const char *slot); void invokeEditSlot(const char *slotName, const char *slot);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment