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


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

The following commit has been merged in the master branch:
commit fc8c39ada011bb3410b1dd4e49c8bb09596ba763
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Thu Oct 13 23:47:16 2011 +0200

    Spinner for global presence combobox indicating activity (changing presences)
    
    Reviewed-by: David Edmundson
    REVIEW: 102859
    BUG: 283800
---
 global-presence-chooser.cpp | 19 +++++++++++++++++++
 global-presence-chooser.h   |  3 +++
 global-presence.cpp         | 10 +++++-----
 presence-model.cpp          |  3 ---
 4 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/global-presence-chooser.cpp b/global-presence-chooser.cpp
index fc2818c..c33b2f8 100644
--- a/global-presence-chooser.cpp
+++ b/global-presence-chooser.cpp
@@ -32,6 +32,7 @@
 #include <TelepathyQt4/Presence>
 
 #include <QMouseEvent>
+#include <KPixmapSequenceOverlayPainter>
 
 //A sneaky class that adds an extra entry to the end of the presence model
 //called "Configure Presences"
@@ -93,6 +94,7 @@ void PresenceModelPlusConfig::sourceRowsRemoved(const QModelIndex &index, int st
     endRemoveRows();
 }
 
+//----------------------------------------------------------------------------------------------------------
 
 GlobalPresenceChooser::GlobalPresenceChooser(QWidget *parent) :
     KComboBox(parent),
@@ -101,8 +103,16 @@ GlobalPresenceChooser::GlobalPresenceChooser(QWidget *parent) :
 {
     this->setModel(new PresenceModelPlusConfig(m_model, this));
 
+    m_busyOverlay = new KPixmapSequenceOverlayPainter(this);
+    m_busyOverlay->setSequence(KPixmapSequence("process-working"));
+    m_busyOverlay->setWidget(this);
+    QPoint topLeft(sizeHint().width() - m_busyOverlay->sequence().frameSize().width() - 22,
+                   (sizeHint().height() - m_busyOverlay->sequence().frameSize().height())/2);
+    m_busyOverlay->setRect(QRect(topLeft, m_busyOverlay->sequence().frameSize()));
+
     connect(this, SIGNAL(activated(int)), SLOT(onCurrentIndexChanged(int)));
     connect(m_globalPresence, SIGNAL(currentPresenceChanged(Tp::Presence)), SLOT(onPresenceChanged(Tp::Presence)));
+    connect(m_globalPresence, SIGNAL(changingPresence(bool)), SLOT(onPresenceChanging(bool)));
 
     onPresenceChanged(m_globalPresence->currentPresence());
 }
@@ -141,5 +151,14 @@ void GlobalPresenceChooser::onPresenceChanged(const Tp::Presence &presence)
     setCurrentIndex(index.row());
 }
 
+void GlobalPresenceChooser::onPresenceChanging(bool isChanging)
+{
+    if (isChanging) {
+        m_busyOverlay->start();
+    } else {
+        m_busyOverlay->stop();
+    }
+}
+
 #include "global-presence-chooser.moc"
 #include "moc_global-presence-chooser.cpp" //hack because we have two QObejcts in teh same file
diff --git a/global-presence-chooser.h b/global-presence-chooser.h
index 75f2c39..6c84496 100644
--- a/global-presence-chooser.h
+++ b/global-presence-chooser.h
@@ -25,6 +25,7 @@
 
 #include <TelepathyQt4/AccountManager>
 
+class KPixmapSequenceOverlayPainter;
 class GlobalPresence;
 class PresenceModel;
 
@@ -38,10 +39,12 @@ public:
 private slots:
     void onCurrentIndexChanged(int index);
     void onPresenceChanged(const Tp::Presence &presence);
+    void onPresenceChanging(bool isChanging);
 
 private:
     GlobalPresence *m_globalPresence;
     PresenceModel *m_model;
+    KPixmapSequenceOverlayPainter *m_busyOverlay;
 };
 
 #endif // GLOBALPRESENCECHOOSER_H
diff --git a/global-presence.cpp b/global-presence.cpp
index c1594f8..ba772b8 100644
--- a/global-presence.cpp
+++ b/global-presence.cpp
@@ -132,16 +132,16 @@ void GlobalPresence::onRequestedPresenceChanged()
 
 void GlobalPresence::onChangingPresence()
 {
-    bool changingPresence = false;
+    bool isChangingPresence = false;
     Q_FOREACH(const Tp::AccountPtr &account, m_enabledAccounts->accounts()) {
         if (account->isChangingPresence()) {
-            changingPresence = true;
+            isChangingPresence = true;
         }
     }
 
-    if (changingPresence != m_changingPresence) {
-        m_changingPresence = changingPresence;
-        Q_EMIT (m_changingPresence);
+    if (isChangingPresence != m_changingPresence) {
+        m_changingPresence = isChangingPresence;
+        Q_EMIT changingPresence(m_changingPresence);
     }
 }
 
diff --git a/presence-model.cpp b/presence-model.cpp
index 0d0bd42..555353b 100644
--- a/presence-model.cpp
+++ b/presence-model.cpp
@@ -29,8 +29,6 @@
 #include <KDE/KConfigGroup>
 #include <KDE/KGlobalSettings>
 
-
-
 PresenceModel::PresenceModel(QObject *parent) :
     QAbstractListModel(parent)
 {
@@ -168,4 +166,3 @@ void PresenceModel::removePresence(const Tp::Presence &presence)
         m_presenceGroup.sync();
     }
 }
-

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list