[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:11:32 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=819a0ec
The following commit has been merged in the master branch:
commit 819a0ec9f965bf63492d76608eee934a199afabb
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Thu Aug 25 11:04:19 2011 +0200
Made listview good looking
default mode is compact view. Need to implement bigger icons and the gridview. Using colored frames for status indicators.
Added presence message as well
---
CMakeLists.txt | 3 +
src/declarative/contents/frames/away.png | Bin 0 -> 2295 bytes
src/declarative/contents/frames/busy.png | Bin 0 -> 2284 bytes
src/declarative/contents/frames/offline.png | Bin 0 -> 1852 bytes
src/declarative/contents/frames/online.png | Bin 0 -> 2239 bytes
src/declarative/contents/ui/ContactList.qml | 5 +
.../contents/ui/ListContactDelegate.qml | 136 +++++++++++++++++++--
src/telepathyContactList.cpp | 21 +++-
src/telepathyContactList.h | 2 +
9 files changed, 153 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25652b0..a5681b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,7 @@ set(KDE_MIN_VERSION "4.7.0")
find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED)
find_package(KDE4Workspace REQUIRED)
find_package(TelepathyQt4 0.7.1 REQUIRED)
+# find_package(Nepomuk REQUIRED)
include(KDE4Defaults)
@@ -23,6 +24,7 @@ include_directories(${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
${TELEPATHY_QT4_INCLUDE_DIR}
+# ${NEPOMUK_INCLUDE_DIR}
)
set(telepathy_contact_list_applet_SRCS
@@ -36,6 +38,7 @@ target_link_libraries(plasma_applet_telepathy_contact_list
${KDE4_KDEUI_LIBS}
${TELEPATHY_QT4_LIBRARIES}
${QT_QTDECLARATIVE_LIBRARY})
+# ${NEPOMUK_LIBRARIES})
install(DIRECTORY src/declarative/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.telepathy-contact-list)
install(TARGETS plasma_applet_telepathy_contact_list DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/declarative/contents/frames/away.png b/src/declarative/contents/frames/away.png
new file mode 100644
index 0000000..c931726
Binary files /dev/null and b/src/declarative/contents/frames/away.png differ
diff --git a/src/declarative/contents/frames/busy.png b/src/declarative/contents/frames/busy.png
new file mode 100644
index 0000000..65ed0d6
Binary files /dev/null and b/src/declarative/contents/frames/busy.png differ
diff --git a/src/declarative/contents/frames/offline.png b/src/declarative/contents/frames/offline.png
new file mode 100644
index 0000000..d0a6aca
Binary files /dev/null and b/src/declarative/contents/frames/offline.png differ
diff --git a/src/declarative/contents/frames/online.png b/src/declarative/contents/frames/online.png
new file mode 100644
index 0000000..4b1b65e
Binary files /dev/null and b/src/declarative/contents/frames/online.png differ
diff --git a/src/declarative/contents/ui/ContactList.qml b/src/declarative/contents/ui/ContactList.qml
index 8fd5823..1c10302 100644
--- a/src/declarative/contents/ui/ContactList.qml
+++ b/src/declarative/contents/ui/ContactList.qml
@@ -76,6 +76,11 @@ Item {
delegate:
ListContactDelegate {
delegateDisplayName: displayName;
+ delegateAvatar: avatar;
+// delegatePresenceIcon: presenceIcon;
+ delegatePresenceMessage: presenceMessage;
+ delegatePresenceName: presenceName;
+// delegatePresenceType: presenceType;
}
}
diff --git a/src/declarative/contents/ui/ListContactDelegate.qml b/src/declarative/contents/ui/ListContactDelegate.qml
index e746b71..01acad6 100644
--- a/src/declarative/contents/ui/ListContactDelegate.qml
+++ b/src/declarative/contents/ui/ListContactDelegate.qml
@@ -18,6 +18,7 @@
***************************************************************************/
import Qt 4.7
+import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
Item {
@@ -28,12 +29,77 @@ Item {
property string delegateDisplayName;
property string delegateAvatar;
+// property string delegatePresenceIcon;
+ property string delegatePresenceMessage;
+// property string delegatePresenceType;
+ property string delegatePresenceName;
+
+ // get color from current plasma theme
+ property QtObject theme: PlasmaCore.Theme {}
+
+ PlasmaWidgets.IconWidget {
+ id: avatar;
+ width: 22;
+ height: parent.height;
+ icon: QIcon("im-user");
+
+ anchors {
+ left: parent.left;
+ leftMargin: 2;
+ verticalCenter: parent.verticalCenter;
+ }
+
+ Component.onCompleted: {
+ console.log("LOADED: " + delegate.delegateAvatar);
+// console.log("NEW URI IS: " + TelepathyContactList.extractAvatarPathFromNepomuk(delegate.delegateAvatar));
+// console.log("PRESENCE ICON: " + delegatePresenceIcon);
+ console.log("PRESENCE MESSAGE: "+ delegatePresenceMessage);
+ }
+ }
+
+ BorderImage {
+ id: avatarFrame;
+ width: 26;
+ height: 26;
+
+ border {
+ left: 2
+ right: 2
+ top: 2
+ bottom: 2
+ }
+
+ anchors {
+ left: parent.left;
+ verticalCenter: parent.verticalCenter;
+ }
+ }
+
+ Text {
+ id: nick;
+ text: delegateDisplayName;
+ color: theme.textColor;
+ font.bold: true;
+
+ anchors {
+ left: avatar.right;
+ leftMargin: 4;
+ verticalCenter: parent.verticalCenter;
+ }
+ }
Text {
- text: delegateDisplayName + delegateAvatar;
- color: "white"
+ id: presenceMessage;
+ text: delegatePresenceMessage;
+ color: theme.textColor;
+ elide: Text.ElideRight;
+ font.italic: true;
+
anchors {
+ left: nick.right;
+ leftMargin: 4;
right: parent.right;
+ verticalCenter: parent.verticalCenter;
}
}
@@ -43,19 +109,63 @@ Item {
anchors.fill: parent;
}
- PlasmaWidgets.IconWidget {
- width: 30;
- height: parent.height;
- icon: QIcon("im-user");
+// onDelegateDisplayNameChanged: {
+// console.log("CHANGING TEXT to " + delegateDisplayName)
+// nick.text = delegateDisplayName;
+// }
- anchors {
- left: parent.left;
- top: parent.top; // not needed
- bottom: parent.bottom; // not needed
- }
+// onDelegatePresenceMessageChanged: {
+// console.log("PRESENCE MESSAGE: "+ delegatePresenceMessage);
+// }
- Component.onCompleted: {
- console.log("LOADED: " + delegate.delegateAvatar);
+ onDelegatePresenceNameChanged: {
+ console.log("PRESENCE NAME: "+ delegatePresenceName);
+ setAvatarPresenceStatus(delegatePresenceName);
+ }
+
+// onDelegatePresenceTypeChanged: {
+// console.log("PRESENCE TYPE: "+ delegatePresenceType);
+// }
+
+// onDelegateAvatarChanged: {
+// console.log("AAAAAAAAAAAAAAA")
+// console.log("NEW URI IS: " + TelepathyContactList.extractAvatarPathFromNepomuk(delegate.delegateAvatar));
+// delegateAvatar = TelepathyContactList.extractAvatarPathFromNepomuk(delegate.delegateAvatar);
+// }
+
+ function setAvatarPresenceStatus(presenceStatus)
+ {
+ switch (presenceStatus) {
+ case "available":
+ avatarFrame.source = "../frames/online.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "dnd":
+ avatarFrame.source = "../frames/busy.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "away":
+ avatarFrame.source = "../frames/away.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "offline":
+ avatarFrame.source = "../frames/offline.png";
+ if (avatar.enabled) {
+ avatar.enabled = false;
+ }
+ break;
+ default:
+ avatarFrame.source = "../frames/offline.png";
+ if (avatar.enabled) {
+ avatar.enabled = false;
+ }
+ break;
}
}
}
diff --git a/src/telepathyContactList.cpp b/src/telepathyContactList.cpp
index 3c5b8c7..9f71388 100644
--- a/src/telepathyContactList.cpp
+++ b/src/telepathyContactList.cpp
@@ -20,6 +20,12 @@
#include "telepathyContactList.h"
#include <KStandardDirs>
+// #include <KUrl>
+//
+// #include <Nepomuk/File>
+// #include <Nepomuk/Vocabulary/NIE>
+// #include <Nepomuk/ResourceManager>
+// #include <Nepomuk/Variant>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeContext>
@@ -48,6 +54,20 @@ int TelepathyContactList::appletWidth() const
return geometry().width();
}
+// QString TelepathyContactList::extractAvatarPathFromNepomuk(const QString &nepomukUri)
+// {
+// /// TODO The resource doesn't have a file url
+// /// The Telepathy Nepomuk service isn't pushing the data properly. So wait till this is done for avatar support
+// Nepomuk::Resource asd(nepomukUri.toUrl());
+// qDebug() << "REsourCE is FILE: " << asd.isFile();
+// qDebug() << "INCOMING URI is: " << nepomukUri.toString();
+// Nepomuk::File file(KUrl(nepomukUri.toString()));
+// qDebug() << "VALID: " << file.isValid();
+// qDebug() << "TEST 2 NIE: " << asd.property(Nepomuk::Vocabulary::NIE::url()).toString();
+//
+// return nepomukUri.toString();
+// }
+
void TelepathyContactList::init()
{
// load QML part of the plasmoid
@@ -58,7 +78,6 @@ void TelepathyContactList::init()
// make C++ Plasma::Applet available to QML for resize signal
m_declarative->engine()->rootContext()->setContextProperty("TelepathyContactList", this);
-// m_declarative->engine()->rootContext()->setContextProperty("TelepathyContactListModel", /* model goes here */);
// setup qml object so that we can talk to the declarative part
m_qmlObject = dynamic_cast<QObject*>(m_declarative->rootObject());
diff --git a/src/telepathyContactList.h b/src/telepathyContactList.h
index 42280de..55b9ea7 100644
--- a/src/telepathyContactList.h
+++ b/src/telepathyContactList.h
@@ -37,6 +37,8 @@ public:
int appletWidth() const; /** returns plasma applet's width */
void init();
+public slots:
+// QString extractAvatarPathFromNepomuk(const QString &nepomukUri);
private:
Plasma::DeclarativeWidget *m_declarative;
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list