Summary: | Add confirmation dialog to "Close session" menu item | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Niklas Laxström <niklas.laxstrom> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | robertknight |
Priority: | NOR | ||
Version: | 1.6.4 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Niklas Laxström
2006-06-20 21:42:06 UTC
This is a bug not a wish... I'll commit the fix shortly. SVN commit 553664 by hindenburg: RMB->Close Session and tabbar menu->Close Session now uses the Close Confirmation Dialog. Will forward port once I get KDE4 compiling again. BUG: 129514 M +6 -4 konsole.cpp M +1 -1 konsole.h --- branches/KDE/3.5/kdebase/konsole/konsole/konsole.cpp #553663:553664 @@ -1109,7 +1109,7 @@ // "Configure Shortcuts"). m_closeSession = new KAction(i18n("C&lose Session"), "fileclose", 0, this, - SLOT(closeCurrentSession()), m_shortcuts, "close_session"); + SLOT(confirmCloseCurrentSession()), m_shortcuts, "close_session"); m_print = new KAction(i18n("&Print Screen..."), "fileprint", 0, this, SLOT( slotPrint() ), m_shortcuts, "file_print"); m_quit = new KAction(i18n("&Quit"), "exit", 0, this, SLOT( close() ), m_shortcuts, "file_quit"); @@ -1340,7 +1340,7 @@ void Konsole::slotTabCloseSession() { - m_contextMenuSession->closeSession(); + confirmCloseCurrentSession(m_contextMenuSession); } void Konsole::slotTabbarContextMenu(const QPoint & pos) @@ -2975,13 +2975,15 @@ */ } -void Konsole::confirmCloseCurrentSession() +void Konsole::confirmCloseCurrentSession( TESession* _se ) { + if ( !_se ) + _se = se; if (KMessageBox::warningContinueCancel(this, i18n("Are you sure that you want to close the current session?"), i18n("Close Confirmation"), KGuiItem(i18n("C&lose Session"),"tab_remove"), "ConfirmCloseSession")==KMessageBox::Continue) - closeCurrentSession(); + _se->closeSession(); } void Konsole::closeCurrentSession() --- branches/KDE/3.5/kdebase/konsole/konsole/konsole.h #553663:553664 @@ -139,7 +139,7 @@ void activateSession(); void activateSession(TESession*); void closeCurrentSession(); - void confirmCloseCurrentSession(); + void confirmCloseCurrentSession(TESession* _se=0); void doneSession(TESession*); void slotCouldNotClose(); void toggleFullScreen(); SVN commit 557634 by hindenburg: RMB->Close Session and tabbar menu->Close Session now uses the Close Confirmation Dialog. CCBUG: 129514 M +7 -4 konsole.cpp M +1 -1 konsole.h --- trunk/KDE/kdebase/apps/konsole/konsole/konsole.cpp #557633:557634 @@ -1135,7 +1135,7 @@ // "Configure Shortcuts"). m_closeSession = new KAction(KIcon("fileclose"), i18n("C&lose Session"), m_shortcuts, "close_session"); - connect(m_closeSession, SIGNAL(triggered(bool) ), SLOT(closeCurrentSession())); + connect(m_closeSession, SIGNAL(triggered(bool) ), SLOT( confirmCloseCurrentSession() )); m_print = new KAction(KIcon("fileprint"), i18n("&Print Screen..."), m_shortcuts, "file_print"); connect(m_print, SIGNAL(triggered(bool) ), SLOT( slotPrint() )); m_quit = new KAction(KIcon("exit"), i18n("&Quit"), m_shortcuts, "file_quit"); @@ -1393,7 +1393,7 @@ void Konsole::slotTabCloseSession() { - m_contextMenuSession->closeSession(); + confirmCloseCurrentSession(m_contextMenuSession); } void Konsole::slotTabbarContextMenu(const QPoint & pos) @@ -3001,13 +3001,16 @@ */ } -void Konsole::confirmCloseCurrentSession() +void Konsole::confirmCloseCurrentSession( TESession* _se ) { + if ( !_se ) + _se = se; + if (KMessageBox::warningContinueCancel(this, i18n("Are you sure that you want to close the current session?"), i18n("Close Confirmation"), KGuiItem(i18n("C&lose Session"),"tab_remove"), "ConfirmCloseSession")==KMessageBox::Continue) - closeCurrentSession(); + _se->closeSession(); } void Konsole::closeCurrentSession() --- trunk/KDE/kdebase/apps/konsole/konsole/konsole.h #557633:557634 @@ -140,7 +140,7 @@ void activateSession(); void activateSession(TESession*); void closeCurrentSession(); - void confirmCloseCurrentSession(); + void confirmCloseCurrentSession(TESession* _se=0); void doneSession(TESession*); void slotCouldNotClose(); void toggleFullScreen(); Hello, I found the new behaviour annoying because it prompted for closure even on sessions where I wasn't doing anything. For KDE 4 I have tried to make the behaviour more intelligent by only asking if there are running programs. eg. The idea being that it won't ask if you just have a shell open at a particular bookmark, but it will ask if you have Vi running with a possibly unsaved/unfinished document or are busy compiling something. Is this new behaviour likely to be a problem for your use case? I'm not sure the best way of handling this... I tried various other terms and they don't popup a confirmation window when exiting one session. However, I can understand the reporter's problem. Likely another option somewhere, unless you want to say 'hey you clicked close session' so that's what Konsole did. |