[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:06:57 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=b44f756

The following commit has been merged in the master branch:
commit b44f7564add4e2099ba074759d331a0af7bf0856
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed Jul 13 18:52:01 2011 +0200

    Switch to standard KMessageBox + some i18n fixes.
    
    Reviewed-by: Pino Toscano, David Edmundson
---
 main-widget.cpp | 49 +++++++++++++------------------------------------
 1 file changed, 13 insertions(+), 36 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index e182936..c0dcb77 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -1293,49 +1293,24 @@ void MainWidget::closeEvent(QCloseEvent* e)
 {
     KSharedConfigPtr config = KGlobal::config();
     KConfigGroup generalConfigGroup(config, "General");
+    KConfigGroup notifyConigGroup(config, "Notification Messages");
 
-    bool checkForPlasmoid = generalConfigGroup.readEntry("check_for_plasmoid", true);
-
-    if (checkForPlasmoid) {
+    //the standard KMessageBox control saves "true" if you select the checkbox, therefore the reversed var name
+    bool dontCheckForPlasmoid = notifyConigGroup.readEntry("dont_check_for_plasmoid", false);
 
+    if (!dontCheckForPlasmoid) {
         if (!isPresencePlasmoidPresent()) {
-            KDialog *noPlasmoidDialog = new KDialog(this);
-
-            QWidget *dialogMainWidget = new QWidget(noPlasmoidDialog);
-
-            QLabel *text = new QLabel(i18n("You don't have any other presence controls active (a Presence plasmoid for example).

"
-                                           "Do you want to stay online or would you rather go offline?

"),
-                                    dialogMainWidget);
-            QCheckBox *dontAskCheckbox = new QCheckBox(i18n("Remember my preference"), dialogMainWidget);
-
-            QLabel *icon = new QLabel();
-            icon->setPixmap(KIconLoader::global()->loadIcon("dialog-information", KIconLoader::Dialog, 48));
-
-            QHBoxLayout *mainLayout = new QHBoxLayout(dialogMainWidget);
-            mainLayout->addWidget(icon);
-
-            QVBoxLayout *innerLayout = new QVBoxLayout(dialogMainWidget);
-            innerLayout->addWidget(text);
-            innerLayout->addWidget(dontAskCheckbox);
+            if (KMessageBox::warningYesNo(this,
+                    i18n("You do not have any other presence controls active (a Presence widget for example).
"
+                         "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")) == KDialog::No) {
 
-            mainLayout->addLayout(innerLayout);
-
-            noPlasmoidDialog->setCaption(i18n("No other presence controls found"));
-            noPlasmoidDialog->setButtons(KDialog::Yes | KDialog::No);
-            noPlasmoidDialog->setMainWidget(dialogMainWidget);
-            noPlasmoidDialog->setButtonText(KDialog::Yes, i18n("Stay online"));
-            noPlasmoidDialog->setButtonText(KDialog::No, i18n("Go offline"));
-
-            if (noPlasmoidDialog->exec() == KDialog::No) {
                 generalConfigGroup.writeEntry("go_offline_when_closing", true);
                 goOffline();
             }
-
-            if (dontAskCheckbox->isChecked()) {
-                generalConfigGroup.writeEntry("check_for_plasmoid", false);
-            }
-
-            generalConfigGroup.config()->sync();
         }
     } else {
         bool shouldGoOffline = generalConfigGroup.readEntry("go_offline_when_closing", false);
@@ -1344,6 +1319,8 @@ void MainWidget::closeEvent(QCloseEvent* e)
         }
     }
 
+    generalConfigGroup.config()->sync();
+
     KMainWindow::closeEvent(e);
 }
 

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list