[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:17:35 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=55d1b45

The following commit has been merged in the master branch:
commit 55d1b4553ddc6df4075ec103fe14f7ec9956fcc6
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Wed Jan 16 02:14:44 2013 +0100

    Expand group on single click, confirm config dialog on double click
    
    Reviewed-By: David Edmundson
---
 contact/src/applet_config.cpp | 34 ++++++++++++++++++++++++++++------
 contact/src/applet_config.h   |  3 ++-
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/contact/src/applet_config.cpp b/contact/src/applet_config.cpp
index 7653a49..64910c8 100644
--- a/contact/src/applet_config.cpp
+++ b/contact/src/applet_config.cpp
@@ -52,11 +52,6 @@ AppletConfig::~AppletConfig()
     m_modelFilter->deleteLater();
 }
 
-void AppletConfig::activateOkButton()
-{
-    button(Ok)->setEnabled(true);
-}
-
 void AppletConfig::enableGroupsView(bool enable)
 {
     if (enable) {
@@ -103,12 +98,39 @@ void AppletConfig::setupContactsList()
     ui.contactsList->sortByColumn(0, Qt::AscendingOrder);
     ui.contactsList->setSelectionMode(QAbstractItemView::SingleSelection);
     ui.contactsList->setSelectionBehavior(QAbstractItemView::SelectItems);
+    ui.contactsList->setExpandsOnDoubleClick(false);
 
-    connect(ui.contactsList, SIGNAL(clicked(QModelIndex)), this, SLOT(activateOkButton()));
+    connect(ui.contactsList, SIGNAL(clicked(QModelIndex)), this, SLOT(contactListClicked(QModelIndex)));
+    connect(ui.contactsList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(contactListDoubleClicked(QModelIndex)));
     connect(ui.showOfflineContacts, SIGNAL(toggled(bool)), this, SLOT(enableOfflineContacts(bool)));
     connect(ui.showGroups, SIGNAL(toggled(bool)), this, SLOT(enableGroupsView(bool)));
 }
 
+void AppletConfig::contactListClicked(const QModelIndex& index)
+{
+    if (index.data(ContactsModel::TypeRole).toUInt() == ContactsModel::ContactRowType) {
+        button(Ok)->setEnabled(true);
+    } else if (index.data(ContactsModel::TypeRole).toUInt() == ContactsModel::AccountRowType) {
+        button(Ok)->setEnabled(false);
+
+        if (ui.contactsList->isExpanded(index)) {
+            ui.contactsList->collapse(index);
+        } else {
+            ui.contactsList->expand(index);
+        }
+    } else {
+        button(Ok)->setEnabled(false);
+    }
+}
+
+void AppletConfig::contactListDoubleClicked(const QModelIndex& index)
+{
+    if (index.data(ContactsModel::TypeRole).toUInt() == ContactsModel::ContactRowType) {
+        button(Ok)->setEnabled(true);
+        slotButtonClicked(Ok);
+    }
+}
+
 void AppletConfig::slotButtonClicked(int button)
 {
     QModelIndex selectedItem = ui.contactsList->currentIndex();
diff --git a/contact/src/applet_config.h b/contact/src/applet_config.h
index c236587..95da7da 100644
--- a/contact/src/applet_config.h
+++ b/contact/src/applet_config.h
@@ -48,7 +48,8 @@ protected slots:
     void slotButtonClicked(int button);
 
 private slots:
-    void activateOkButton();
+    void contactListClicked(const QModelIndex &index);
+    void contactListDoubleClicked(const QModelIndex &index);
     void enableGroupsView(bool enable);                     /** enable/disable groups view */
     void enableOfflineContacts(bool enable);                /** enable/disable offline contacts */
 

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list