summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <martin.klapetek@gmail.com>2011-07-19 12:59:18 (GMT)
committerMartin Klapetek <martin.klapetek@gmail.com>2011-07-19 13:00:07 (GMT)
commitecc5d290437a8195cafb50dfd704893f0a90ea51 (patch)
treea868f0c4ed3f22509548abed834cd7e110f29fa9
parentbeae0383c263cf9573f0a7ae4131cb75e2baa217 (diff)
downloadkde-telepathy-contact-list-ecc5d290437a8195cafb50dfd704893f0a90ea51.tar.gz
kde-telepathy-contact-list-ecc5d290437a8195cafb50dfd704893f0a90ea51.tar.xz
Add Cancel button to the quit dialog
Reviewed-by: Francesco Nwokeka
-rw-r--r--main-widget.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/main-widget.cpp b/main-widget.cpp
index e924c61..b6b7cf8 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -32,6 +32,7 @@
#include <QtGui/QToolButton>
#include <QtCore/QWeakPointer>
#include <QWidgetAction>
+#include <QCloseEvent>
#include <TelepathyQt4/PendingReady>
#include <TelepathyQt4/PendingChannelRequest>
@@ -1458,16 +1459,22 @@ void MainWidget::closeEvent(QCloseEvent* e)
if (isAnyAccountOnline() && !dontCheckForPlasmoid) {
if (!isPresencePlasmoidPresent()) {
- if (KMessageBox::warningYesNo(this,
+ switch (KMessageBox::warningYesNoCancel(this,
i18n("You do not have any other presence controls active (a Presence widget for example).\n"
"Do you want to stay online or would you rather go offline?"),
i18n("No Other Presence Controls Found"),
KGuiItem(i18n("Stay Online"), KIcon("user-online")),
KGuiItem(i18n("Go Offline"), KIcon("user-offline")),
- QString("dont_check_for_plasmoid")) == KMessageBox::No) {
-
- generalConfigGroup.writeEntry("go_offline_when_closing", true);
- goOffline();
+ KStandardGuiItem::cancel(),
+ QString("dont_check_for_plasmoid"))) {
+
+ case KMessageBox::No:
+ generalConfigGroup.writeEntry("go_offline_when_closing", true);
+ goOffline();
+ break;
+ case KMessageBox::Cancel:
+ e->ignore();
+ return;
}
}
} else if (isAnyAccountOnline() && dontCheckForPlasmoid) {