[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:07:52 UTC 2016


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

The following commit has been merged in the master branch:
commit 79362f2292c15fa5d7a16315ba47d2697a9f049b
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Fri Oct 14 14:08:37 2011 +0200

    Allow switching between global presence setting and per account presence setting
    
    Reviewed-by: David Edmundson
    REVIEW: 102861
    BUG: 283806
---
 main-widget.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 main-widget.h   |  2 ++
 2 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 1ae8a5c..aa8422a 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -176,6 +176,35 @@ MainWidget::MainWidget(QWidget *parent)
 
     settingsButtonMenu->addMenu(setDelegateTypeMenu);
 
+    KMenu *presenceChooser = new KMenu(settingsButton);
+    presenceChooser->setTitle(i18n("Control accounts presence"));
+
+    QActionGroup *presenceChooserGroup = new QActionGroup(this);
+    presenceChooserGroup->setExclusive(true);
+    presenceChooserGroup->addAction(presenceChooser->addAction(i18n("All at once"),
+                                                               this, SLOT(onUseGlobalPresenceTriggered())));
+
+    presenceChooserGroup->actions().last()->setCheckable(true);
+
+    if (guiConfigGroup.readEntry("selected_presence_chooser", "global") == QLatin1String("global")) {
+        presenceChooserGroup->actions().last()->setChecked(true);
+        //hide account buttons and show global presence
+        onUseGlobalPresenceTriggered();
+    }
+
+    presenceChooserGroup->addAction(presenceChooser->addAction(i18n("Separately"),
+                                                                    this, SLOT(onUsePerAccountPresenceTriggered())));
+
+    presenceChooserGroup->actions().last()->setCheckable(true);
+
+    if (guiConfigGroup.readEntry("selected_presence_chooser", "global") == QLatin1String("per-account")) {
+        presenceChooserGroup->actions().last()->setChecked(true);
+        //hide global presence and use account buttons
+        onUsePerAccountPresenceTriggered();
+    }
+
+    settingsButtonMenu->addMenu(presenceChooser);
+
     settingsButtonMenu->addAction(i18n("Join chat room"), this, SLOT(onJoinChatRoomRequested()));
     settingsButtonMenu->addSeparator();
     settingsButtonMenu->addMenu(helpMenu());
@@ -340,8 +369,6 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
     m_accountButtons->setAccountManager(m_accountManager);
     m_presenceChooser->setAccountManager(m_accountManager);
 
-    m_accountButtons->hide();
-
     QList<Tp::AccountPtr> accounts = m_accountManager->allAccounts();
 
     if(accounts.count() == 0) {
@@ -1476,4 +1503,30 @@ void MainWidget::onNewGroupModelItemsInserted(const QModelIndex& index, int star
     }
 }
 
+void MainWidget::onUseGlobalPresenceTriggered()
+{
+    KSharedConfigPtr config = KGlobal::config();
+    KConfigGroup configGroup(config, "GUI");
+
+    m_presenceChooser->show();
+    m_accountButtons->hide();
+
+    configGroup.writeEntry("selected_presence_chooser", "global");
+
+    configGroup.config()->sync();
+}
+
+void MainWidget::onUsePerAccountPresenceTriggered()
+{
+    KSharedConfigPtr config = KGlobal::config();
+    KConfigGroup configGroup(config, "GUI");
+
+    m_presenceChooser->hide();
+    m_accountButtons->show();
+
+    configGroup.writeEntry("selected_presence_chooser", "per-account");
+
+    configGroup.config()->sync();
+}
+
 #include "main-widget.moc"
diff --git a/main-widget.h b/main-widget.h
index 4b2b43f..f602a3a 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -103,6 +103,8 @@ private Q_SLOTS:
     void onShowInfoTriggered();
     void onDeleteContactTriggered();
     void onJoinChatRoomRequested();         /** join chat room action is triggered */
+    void onUseGlobalPresenceTriggered();
+    void onUsePerAccountPresenceTriggered();
 
     void onAccountManagerReady(Tp::PendingOperation *op);
     void onContactListClicked(const QModelIndex &index);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list