Commit 0a99ae67 authored by Scott Wheeler's avatar Scott Wheeler

Make quit from the system tray do the right thing.

CCMAIL:klas.kalass@gmx.de

svn path=/trunk/kdemultimedia/juk/; revision=211973
parent 06118441
......@@ -43,7 +43,8 @@
// public members
////////////////////////////////////////////////////////////////////////////////
JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestructiveClose)
JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name, WDestructiveClose),
m_shuttingDown(false)
{
SplashScreen::instance()->show();
kapp->processEvents();
......@@ -101,16 +102,15 @@ void JuK::setupActions()
new KAction(i18n("Open &Directory..."), "fileopen", 0, m_splitter, SLOT(slotOpenDirectory()), actionCollection(), "openDirectory");
m_renamePlaylistAction = new KAction(i18n("Rename..."), 0, m_splitter, SLOT(slotRenamePlaylist()),
actionCollection(), "renamePlaylist");
actionCollection(), "renamePlaylist");
new KAction(i18n("Duplicate..."), "editcopy", 0, m_splitter, SLOT(slotDuplicatePlaylist()), actionCollection(), "duplicatePlaylist");
m_savePlaylistAction = KStdAction::save(m_splitter, SLOT(slotSavePlaylist()), actionCollection());
m_saveAsPlaylistAction = KStdAction::saveAs(m_splitter, SLOT(slotSaveAsPlaylist()), actionCollection());
m_deleteItemPlaylistAction = new KAction(i18n("Remove"), "edittrash", 0, m_splitter, SLOT(slotDeletePlaylist()),
actionCollection(), "deleteItemPlaylist");
actionCollection(), "deleteItemPlaylist");
//KStdAction::quit(this, SLOT(close()), actionCollection());
KStdAction::quit(kapp, SLOT(quit()), actionCollection());
KStdAction::quit(this, SLOT(slotQuit()), actionCollection());
// edit menu
KStdAction::cut(this, SLOT(cut()), actionCollection());
......@@ -189,6 +189,8 @@ void JuK::setupSystemTray()
m_systemTray->slotPlay();
m_toggleDockOnCloseAction->setEnabled(true);
connect(m_systemTray, SIGNAL(quitSelected()), this, SLOT(slotQuit()));
}
else {
m_systemTray = 0;
......@@ -332,7 +334,7 @@ bool JuK::queryExit()
bool JuK::queryClose()
{
if(m_systemTray && m_toggleDockOnCloseAction->isChecked()) {
if(!m_shuttingDown && m_systemTray && m_toggleDockOnCloseAction->isChecked()) {
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>"),
......
......@@ -84,6 +84,9 @@ private:
private slots:
void slotPlaylistChanged();
// file menu
void slotQuit() { m_shuttingDown = true; kapp->quit(); }
// edit menu
void cut();
void copy();
......@@ -157,6 +160,7 @@ private:
bool m_trackPositionDragging;
bool m_noSeek;
bool m_restore;
bool m_shuttingDown;
static const int m_pollInterval = 800;
};
......
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