[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:10:27 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=83d5495
The following commit has been merged in the master branch:
commit 83d549587250d784917b31a6076ccd8ca255e62f
Author: George Goldberg <grundleborg at googlemail.com>
Date: Tue Jul 8 08:18:52 2008 +0000
Show the master presence icon on the main widget, not just the taskbar.
svn path=/trunk/playground/base/plasma/applets/presence/; revision=829346
---
presence/src/presence.cpp | 25 ++++++++++++++++++++++++-
presence/src/presence.h | 8 +++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/presence/src/presence.cpp b/presence/src/presence.cpp
index 9342bf0..4fd2adb 100644
--- a/presence/src/presence.cpp
+++ b/presence/src/presence.cpp
@@ -26,6 +26,7 @@
#include <Decibel/Types>
+#include <QLabel>
#include <QString>
#include <QStandardItemModel>
#include <QTreeView>
@@ -45,7 +46,8 @@ Presence::Presence(QObject *parent, const QVariantList &args)
m_accountsModel(0),
m_accountsView(0),
m_messageEdit(0),
- m_colorScheme(0)
+ m_colorScheme(0),
+ m_masterIconLabel(0)
{
m_layout = 0;
m_widget = 0;
@@ -61,6 +63,9 @@ void Presence::initialize()
// Set up the icon.
m_icon = new Plasma::Icon(KIcon("user-offline"), QString(), this);
+ // The icon has been changed.
+ iconChanged();
+
// Set up the accounts model.
m_accountsModel = new QStandardItemModel(this);
m_accountsModel->setColumnCount(4);
@@ -90,11 +95,16 @@ QWidget * Presence::widget()
m_accountsView->header()->setVisible(true);
m_accountsView->setColumnHidden(0, true); //Hide the source id column
+ // Make sure we have a masterIconPixmap.
+ m_masterIconLabel = new QLabel;
+ iconChanged();
+
// Set up the rest of the view/layout etc. stuff.
m_messageEdit = new KLineEdit;
m_widget = new QWidget();
m_layout = new QVBoxLayout(m_widget);
+ m_layout->addWidget(m_masterIconLabel);
m_layout->addWidget(m_accountsView);
m_layout->addWidget(m_messageEdit);
m_widget->setLayout(m_layout);
@@ -352,6 +362,19 @@ void Presence::updateMasterPresence()
{
m_icon->setIcon(KIcon("user-online"));
}
+
+ // Call the method to update the masterPresenceIcon.
+ iconChanged();
+}
+
+void Presence::iconChanged()
+{
+ // The icon has been changed. We must update the pixmap of the icon for
+ // display in the main widget.
+ if(m_masterIconLabel)
+ {
+ m_masterIconLabel->setPixmap(m_icon->icon().pixmap(QSize(22, 22)));
+ }
}
#include "presence.moc"
diff --git a/presence/src/presence.h b/presence/src/presence.h
index bb1afe3..c9aca59 100644
--- a/presence/src/presence.h
+++ b/presence/src/presence.h
@@ -30,6 +30,7 @@ class QStandardItemModel;
class QTreeView;
class QVBoxLayout;
class QWidget;
+class QLabel;
class KLineEdit;
class KColorScheme;
@@ -51,9 +52,13 @@ class Presence : public PlasmaAppletDialog
protected:
void initialize();
+
+ private Q_SLOTS:
+ void iconChanged();
+
private:
void updateMasterPresence();
-
+
QVBoxLayout* m_layout;
Plasma::DataEngine* m_engine;
QStandardItemModel *m_accountsModel;
@@ -61,6 +66,7 @@ class Presence : public PlasmaAppletDialog
QWidget * m_widget;
KLineEdit *m_messageEdit;
KColorScheme *m_colorScheme;
+ QLabel *m_masterIconLabel;
};
K_EXPORT_PLASMA_APPLET(presence, Presence)
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list