aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2008-03-13 00:43:51 +0000
committerGravatar Szymon Tomasz Stefanek2008-03-13 00:43:51 +0000
commit7435b8f7094f560f707d9ddec730351f8e73736c (patch)
treeaf56ce74309fd507ab6766f371281f02affd933a /src
parentupdated translation files: double check it before next release\! (diff)
downloadKVIrc-7435b8f7094f560f707d9ddec730351f8e73736c.tar.gz
KVIrc-7435b8f7094f560f707d9ddec730351f8e73736c.tar.bz2
KVIrc-7435b8f7094f560f707d9ddec730351f8e73736c.zip
Fixed the broken KDE logout ticket
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1211 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/kvirc/ui/kvi_frame.cpp75
1 files changed, 39 insertions, 36 deletions
diff --git a/src/kvirc/ui/kvi_frame.cpp b/src/kvirc/ui/kvi_frame.cpp
index 167bcc3a3..95e32fc0a 100644
--- a/src/kvirc/ui/kvi_frame.cpp
+++ b/src/kvirc/ui/kvi_frame.cpp
@@ -947,10 +947,11 @@ void KviFrame::updateCaption()
void KviFrame::closeEvent(QCloseEvent *e)
{
- e->ignore();
if(KVI_OPTION_BOOL(KviOption_boolCloseInTray))
{
+ e->ignore();
+
if(!dockExtension())
{
executeInternalCommand(KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW);
@@ -961,52 +962,54 @@ void KviFrame::closeEvent(QCloseEvent *e)
dockExtension()->setPrevWindowState(windowState());
QTimer::singleShot( 0, this, SLOT(hide()) );
}
+ return;
}
- else
+
+ if(KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections))
{
-
- if(KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections))
+ // check for running connections
+
+ bool bGotRunningConnection = false;
+ for(KviWindow * w = m_pWinList->first();w;w = m_pWinList->next())
{
- // check for running connections
-
- bool bGotRunningConnection = false;
- for(KviWindow * w = m_pWinList->first();w;w = m_pWinList->next())
+ if(w->type() == KVI_WINDOW_TYPE_CONSOLE)
{
- if(w->type() == KVI_WINDOW_TYPE_CONSOLE)
+ if(((KviConsole *)w)->connectionInProgress())
{
- if(((KviConsole *)w)->connectionInProgress())
- {
- bGotRunningConnection = true;
- break;
- }
+ bGotRunningConnection = true;
+ break;
}
}
-
- if(bGotRunningConnection)
- {
- QString txt = "<p>";
- txt += __tr2qs("There are active connections, are you sure you wish to ");
- txt += __tr2qs("quit KVIrc?");
- txt += "</p>";
+ }
- switch(QMessageBox::warning(this,__tr2qs("Confirmation - KVIrc"),txt,__tr2qs("&Yes"),__tr2qs("&Always"),__tr2qs("&No"),2,2))
- {
- case 0:
- // ok to close
- break;
- case 1:
- // ok to close but don't ask again
- KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections) = false;
- break;
- case 2:
- return;
- break;
- }
+ if(bGotRunningConnection)
+ {
+ QString txt = "<p>";
+ txt += __tr2qs("There are active connections, are you sure you wish to ");
+ txt += __tr2qs("quit KVIrc?");
+ txt += "</p>";
+
+ switch(QMessageBox::warning(this,__tr2qs("Confirmation - KVIrc"),txt,__tr2qs("&Yes"),__tr2qs("&Always"),__tr2qs("&No"),2,2))
+ {
+ case 0:
+ // ok to close
+ break;
+ case 1:
+ // ok to close but don't ask again
+ KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections) = false;
+ break;
+ case 2:
+ e->ignore();
+ return;
+ break;
}
}
-
- g_pApp->destroyFrame();
}
+
+ e->accept();
+
+ if(g_pApp)
+ g_pApp->destroyFrame();
}
void KviFrame::resizeEvent(QResizeEvent *e)