[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:14:39 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=70d50c0

The following commit has been merged in the master branch:
commit 70d50c02511d102bb8365d8a951fca6beef07eb7
Author: Peter Amidon <peter at picnicpark.org>
Date:   Fri Nov 30 17:30:59 2012 +0100

    Fixed the on-quit go offline? dialog box to always write to file.
    
    Updated the on-quit go offline? dialog box to allow re-invocation when
    it is set to never prompt again -- useful for when the go offline
    checkbox is reset to manual. It previously didn't write to the file
    when the user selected stay online -- because of this if the user
    selects never ask me again and then go offline, then they get the
    dialog back again through the new checkbox, and say stay online never
    ask again, it doesn't use the correct choice.
---
 config/telepathy-kded-config.cpp | 51 ++++++++++++++++++++++++++++++++++++++--
 config/telepathy-kded-config.ui  | 42 +++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/config/telepathy-kded-config.cpp b/config/telepathy-kded-config.cpp
index ba90f50..fac1fc3 100644
--- a/config/telepathy-kded-config.cpp
+++ b/config/telepathy-kded-config.cpp
@@ -23,6 +23,7 @@
 #include "ui_telepathy-kded-config.h"
 
 #include <KPluginFactory>
+#include <KSharedConfig>
 #include <KLocalizedString>
 
 #include <QDBusMessage>
@@ -68,6 +69,7 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
     resizer->addWidgetsFromLayout(ui->autoAwayGroupBox->layout(), 0);
     resizer->addWidgetsFromLayout(ui->nowPlayingGroupBox->layout(), 0);
     resizer->addWidgetsFromLayout(ui->autoConnectGroupBox->layout(), 0);
+    resizer->addWidgetsFromLayout(ui->autoOfflineGroupBox->layout(), 0);
 
     //TODO enable this when it is supported by the approver
     ui->m_autoAcceptLabel->setHidden(true);
@@ -108,6 +110,8 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
             this, SLOT(settingsHasChanged()));
     connect(ui->m_autoConnectCheckBox, SIGNAL(stateChanged(int)),
             this, SLOT(settingsHasChanged()));
+    connect(ui->m_autoOfflineCheckBox, SIGNAL(stateChanged(int)),
+	    this, SLOT(settingsHasChanged()));
 
     connect(ui->m_awayCheckBox, SIGNAL(clicked(bool)),
             this, SLOT(autoAwayChecked(bool)));
@@ -126,7 +130,7 @@ void TelepathyKDEDConfig::load()
 {
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
 
-// File transfers config
+    // File transfers config
     KConfigGroup filetransferConfig = config->group(QLatin1String("File Transfers"));
 
     // download directory
@@ -138,7 +142,7 @@ void TelepathyKDEDConfig::load()
     bool autoAcceptEnabled = filetransferConfig.readEntry(QLatin1String("autoAccept"), false);
     ui->m_autoAcceptCheckBox->setChecked(autoAcceptEnabled);
 
-// KDED module config
+    // KDED module config
     KConfigGroup kdedConfig = config->group("KDED");
 
     //check if auto-away is enabled
@@ -210,6 +214,25 @@ void TelepathyKDEDConfig::load()
         ui->m_autoConnectCheckBox->setTristate(true);
         ui->m_autoConnectCheckBox->setCheckState(Qt::PartiallyChecked);
     }
+
+    KSharedConfigPtr contactListConfig = KSharedConfig::openConfig(QLatin1String("ktp-contactlistrc"));
+    KConfigGroup generalConfigGroup(contactListConfig, "General");
+    KConfigGroup notifyConfigGroup(contactListConfig, "Notification Messages");
+
+    bool dontCheckForPlasmoid = notifyConfigGroup.readEntry("dont_check_for_plasmoid", false);
+    if (dontCheckForPlasmoid) {
+        bool shouldGoOffline = generalConfigGroup.readEntry("go_offline_when_closing", false);
+        if (shouldGoOffline == true) {
+            ui->m_autoOfflineCheckBox->setTristate(true);
+            ui->m_autoOfflineCheckBox->setChecked(true);
+        } else {
+            ui->m_autoOfflineCheckBox->setTristate(true);
+            ui->m_autoOfflineCheckBox->setChecked(false);
+        }
+    } else {
+      ui->m_autoOfflineCheckBox->setTristate(true);
+      ui->m_autoOfflineCheckBox->setCheckState(Qt::PartiallyChecked);
+    }
 }
 
 void TelepathyKDEDConfig::save()
@@ -253,6 +276,30 @@ void TelepathyKDEDConfig::save()
         kdedConfig.writeEntry(QLatin1String("autoConnect"), AutoConnect::modeToString(AutoConnect::Enabled));
     }
 
+    KSharedConfigPtr contactListConfig = KSharedConfig::openConfig(QLatin1String("ktp-contactlistrc"));
+    KConfigGroup generalConfigGroup(contactListConfig, "General");
+    KConfigGroup notifyConfigGroup(contactListConfig, "Notification Messages");
+
+    bool oldGoOffline = generalConfigGroup.readEntry("go_offline_when_closing", false);
+
+    switch (ui->m_autoOfflineCheckBox->checkState()) {
+        case Qt::Unchecked:
+            notifyConfigGroup.writeEntry("dont_check_for_plasmoid", true);
+            generalConfigGroup.writeEntry("go_offline_when_closing", false);
+        break;
+        case Qt::Checked:
+            notifyConfigGroup.writeEntry("dont_check_for_plasmoid", true);
+            generalConfigGroup.writeEntry("go_offline_when_closing", true);
+        break;
+        case Qt::PartiallyChecked:
+            notifyConfigGroup.deleteEntry("dont_check_for_plasmoid");
+            generalConfigGroup.writeEntry("go_offline_when_closing", oldGoOffline);
+        break;
+    }
+
+    generalConfigGroup.sync();
+    notifyConfigGroup.sync();
+
     kdedConfig.sync();
 
     QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
diff --git a/config/telepathy-kded-config.ui b/config/telepathy-kded-config.ui
index 1dc89d0..54ebc54 100644
--- a/config/telepathy-kded-config.ui
+++ b/config/telepathy-kded-config.ui
@@ -386,6 +386,48 @@
      </property>
     </spacer>
    </item>
+   <item>
+    <widget class="QGroupBox" name="autoOfflineGroupBox">
+     <property name="title">
+      <string>Auto Offline</string>
+     </property>
+     <property name="flat">
+      <bool>true</bool>
+     </property>
+     <layout class="QFormLayout" name="formLayout_5">
+      <item row="0" column="0">
+       <widget class="QLabel" name="m_autoOfflineLabel">
+        <property name="text">
+         <string>Go offline when closing the contact list:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="m_autoOfflineCheckBox">
+        <property name="text">
+         <string>Enabled</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer_5">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::MinimumExpanding</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <customwidgets>

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list