[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:26:50 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=60b3c3c

The following commit has been merged in the master branch:
commit 60b3c3c1d4b41455088bd3781d727698a03e3178
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Wed Aug 21 18:28:11 2013 +0200

    Base source borrowed from device-notifier
---
 plasmoid/CMakeLists.txt                            |   9 ++
 plasmoid/Messages.sh                               |   4 +
 plasmoid/kdeconnect/CMakeLists.txt                 |  42 ++++++
 .../kdeconnect/kdeconnectdeclarativeplugin.cpp     |  22 ++-
 .../kdeconnect/kdeconnectdeclarativeplugin.h       |  26 ++--
 plasmoid/kdeconnect/kdeconnectengine.cpp           |  65 +++++++++
 plasmoid/kdeconnect/kdeconnectengine.h             |  52 ++++++++
 .../kdeconnect/org.kde.kdeconnect.plasmoid.xml     |  11 ++
 .../plasma-dataengine-kdeconnect.desktop           |  14 ++
 plasmoid/kdeconnect/qmldir                         |   1 +
 plasmoid/package/contents/config/main.xml          |  20 +++
 plasmoid/package/contents/ui/ActionItem.qml        |  82 ++++++++++++
 plasmoid/package/contents/ui/DeviceDelegate.qml    |  37 ++++++
 plasmoid/package/contents/ui/StatusBar.qml         | 147 +++++++++++++++++++++
 plasmoid/package/contents/ui/config.ui             |  65 +++++++++
 plasmoid/package/contents/ui/devicenotifier.qml    | 135 +++++++++++++++++++
 plasmoid/package/metadata.desktop                  |  23 ++++
 17 files changed, 724 insertions(+), 31 deletions(-)

diff --git a/plasmoid/CMakeLists.txt b/plasmoid/CMakeLists.txt
new file mode 100644
index 0000000..264614d
--- /dev/null
+++ b/plasmoid/CMakeLists.txt
@@ -0,0 +1,9 @@
+
+add_subdirectory(kdeconnect)
+
+install(DIRECTORY package/
+        DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/kdeconnect)
+
+install(FILES package/metadata.desktop
+        DESTINATION ${SERVICES_INSTALL_DIR}
+        RENAME plasma-kdeconnect.desktop)
diff --git a/plasmoid/Messages.sh b/plasmoid/Messages.sh
new file mode 100644
index 0000000..ffde1a7
--- /dev/null
+++ b/plasmoid/Messages.sh
@@ -0,0 +1,4 @@
+#! /usr/bin/env bash
+$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
+$XGETTEXT `find . -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_notifier.pot
+rm -f rc.cpp
diff --git a/plasmoid/kdeconnect/CMakeLists.txt b/plasmoid/kdeconnect/CMakeLists.txt
new file mode 100644
index 0000000..0589e2c
--- /dev/null
+++ b/plasmoid/kdeconnect/CMakeLists.txt
@@ -0,0 +1,42 @@
+include_directories(${CMAKE_CURRENT_BINARY_DIR}
+                    ${CMAKE_CURRENT_SOURCE_DIR}
+                    ${CMAKE_SOURCE_DIR}
+                    ${CMAKE_BINARY_DIR})
+
+
+
+
+#DataEngine
+set(plasma_engine_kdeconnect_SRC
+    kdeconnectengine.cpp
+    plasmoidadaptor.cpp
+)
+kde4_add_plugin(plasma_engine_kdeconnect ${plasma_engine_kdeconnect_SRC} )
+qt4_add_dbus_adaptor(kdeconnect_engine_SRCS org.kde.kdeconnect.plasmoid.xml kdeconnectengine.h KdeConnectEngine )
+target_link_libraries(plasma_engine_kdeconnect
+    ${KDE4_PLASMA_LIBS}
+    ${KDE4_KDECORE_LIBS}
+)
+install(TARGETS plasma_engine_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
+
+
+#DeclarativePlugin
+set(kdeconnectdeclarativeplugin_SRC
+    kdeconnectdeclarativeplugin.cpp
+)
+kde4_add_library(kdeconnectdeclarativeplugin SHARED ${kdeconnectdeclarativeplugin_SRC})
+add_dependencies(kdeconnectdeclarativeplugin libkdeconnect)
+target_link_libraries(kdeconnectdeclarativeplugin
+    ${KDE4_KDEUI_LIBS}
+    ${KDE4_KDECORE_LIBS}
+    ${QT_QTCORE_LIBRARY}
+    ${QT_QTGUI_LIBRARY}
+    ${QT_QTDECLARATIVE_LIBRARY}
+    kdeconnect
+)
+install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kdeconnect)
+install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kdeconnect)
+
+
+#Desktop file
+install(FILES plasma-dataengine-kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/daemon/netaddress.h b/plasmoid/kdeconnect/kdeconnectdeclarativeplugin.cpp
similarity index 68%
copy from daemon/netaddress.h
copy to plasmoid/kdeconnect/kdeconnectdeclarativeplugin.cpp
index f264ba1..94c66ee 100644
--- a/daemon/netaddress.h
+++ b/plasmoid/kdeconnect/kdeconnectdeclarativeplugin.cpp
@@ -18,20 +18,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef NETADDRESS_H
-#define NETADDRESS_H
+#include "kdeconnectdeclarativeplugin.h"
 
-#include <QHostAddress>
+#include <QtDeclarative/QDeclarativeItem>
 
-struct NetAddress {
-    NetAddress() { }
-    NetAddress(QHostAddress _ip, quint16 _port) : ip(_ip), port(_port) { }
-    QHostAddress ip;
-    quint16 port;
-};
+#include "libkdeconnect/devicesmodel.h"
+#include "libkdeconnect/notificationsmodel.h"
 
-inline bool operator< (const NetAddress& a, const NetAddress& b){
-    return (a.ip.toString()+a.port) < (b.ip.toString()+b.port);
+void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
+{
+    Q_UNUSED(uri);
+    qmlRegisterType<DevicesModel>("org.kde.kdeconnect", 1, 0, "DevicesModel");
+    qmlRegisterType<NotificationsModel>("org.kde.kdeconnect", 1, 0, "NotificationsModel");
 }
-
-#endif // NETADDRESS_H
diff --git a/test/backendtests.h b/plasmoid/kdeconnect/kdeconnectdeclarativeplugin.h
similarity index 72%
copy from test/backendtests.h
copy to plasmoid/kdeconnect/kdeconnectdeclarativeplugin.h
index 2ed22e8..900dd9d 100644
--- a/test/backendtests.h
+++ b/plasmoid/kdeconnect/kdeconnectdeclarativeplugin.h
@@ -18,26 +18,16 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef BACKENDTESTS_H
-#define BACKENDTESTS_H
+#ifndef ANALITZADECLARATIVEPLUGIN_H
+#define ANALITZADECLARATIVEPLUGIN_H
 
-#include <QObject>
+#include <QDeclarativeExtensionPlugin>
 
-class BackendTests : public QObject
+class KdeConnectDeclarativePlugin : public QDeclarativeExtensionPlugin
 {
-    Q_OBJECT
-
-private Q_SLOTS:
-    void initTestCase();
-
-    void dummyTest();
-    void networkPackageTest();
-
-    void cleanupTestCase();
-
-    void init();
-    void cleanup();
-
+    virtual void registerTypes(const char* uri);
 };
 
-#endif // BACKENDTESTS_H
+Q_EXPORT_PLUGIN2(kdeconnectdeclarativeplugin, KdeConnectDeclarativePlugin);
+
+#endif // ANALITZADECLARATIVEPLUGIN_H
diff --git a/plasmoid/kdeconnect/kdeconnectengine.cpp b/plasmoid/kdeconnect/kdeconnectengine.cpp
new file mode 100644
index 0000000..d67ea6f
--- /dev/null
+++ b/plasmoid/kdeconnect/kdeconnectengine.cpp
@@ -0,0 +1,65 @@
+/*
+ *   Copyright (C) 2010 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ * This program is free software you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "kdeconnectengine.h"
+
+#include <QDBusConnection>
+
+#include <Plasma/DataContainer>
+
+#include "plasmoidadaptor.h"
+
+#include <KDebug>
+
+KdeConnectEngine::KdeConnectEngine( QObject* parent, const QVariantList& args )
+    : Plasma::DataEngine( parent, args ),
+      m_id(0)
+{
+    new PlasmoidAdaptor(this);
+
+    QDBusConnection dbus = QDBusConnection::sessionBus();
+    dbus.registerService( "org.kde.kdeconnect.plasmoid" );
+    dbus.registerObject( "/modules/kdeconnect/plasmoid", this );
+}
+
+KdeConnectEngine::~KdeConnectEngine()
+{
+    QDBusConnection dbus = QDBusConnection::sessionBus();
+    dbus.unregisterService( "org.kde.kdeconnect.plasmoid" );
+}
+
+void KdeConnectEngine::init()
+{
+}
+
+void KdeConnectEngine::notify(int solidError, const QString& error, const QString& errorDetails, const QString &udi)
+{
+    kDebug() << error << errorDetails << udi;
+    const QString source = QString("notification %1").arg(m_id++);
+
+    Plasma::DataEngine::Data notificationData;
+    notificationData.insert("solidError", solidError);
+    notificationData.insert("error", error);
+    notificationData.insert("errorDetails", errorDetails);
+    notificationData.insert("udi", udi);
+
+    setData(source, notificationData );
+}
+
+K_EXPORT_PLASMA_DATAENGINE(devicenotifications, KdeConnectEngine)
diff --git a/plasmoid/kdeconnect/kdeconnectengine.h b/plasmoid/kdeconnect/kdeconnectengine.h
new file mode 100644
index 0000000..6af7618
--- /dev/null
+++ b/plasmoid/kdeconnect/kdeconnectengine.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ * This program is free software you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef DEVICENOTIFICATIONSENGINE_H
+#define DEVICENOTIFICATIONSENGINE_H
+
+#include <Plasma/DataEngine>
+
+/**
+ *  Engine which provides data sources for device notifications.
+ *  Each notification is represented by one source.
+ */
+class KdeConnectEngine : public Plasma::DataEngine
+{
+    Q_OBJECT
+    Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.plasmoid")
+
+public:
+    KdeConnectEngine( QObject* parent, const QVariantList& args );
+    ~KdeConnectEngine();
+
+    virtual void init();
+
+    /**
+     *  This function implements part of Notifications DBus interface.
+     *  Once called, will add notification source to the engine
+     */
+public slots:
+     void notify(int solidError, const QString& error, const QString& errorDetails, const QString &udi);
+
+private:
+    uint m_id;
+};
+
+#endif
diff --git a/plasmoid/kdeconnect/org.kde.kdeconnect.plasmoid.xml b/plasmoid/kdeconnect/org.kde.kdeconnect.plasmoid.xml
new file mode 100644
index 0000000..74c8d4b
--- /dev/null
+++ b/plasmoid/kdeconnect/org.kde.kdeconnect.plasmoid.xml
@@ -0,0 +1,11 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+  <interface name="org.kde.kdeconnect.plasmoid">
+    <method name="notify">
+      <arg name="solidError" type="i" direction="in"/>
+      <arg name="error" type="s" direction="in"/>
+      <arg name="errorDetails" type="s" direction="in"/>
+      <arg name="udi" type="s" direction="in"/>
+    </method>
+  </interface>
+</node>
diff --git a/plasmoid/kdeconnect/plasma-dataengine-kdeconnect.desktop b/plasmoid/kdeconnect/plasma-dataengine-kdeconnect.desktop
new file mode 100644
index 0000000..b69bbb4
--- /dev/null
+++ b/plasmoid/kdeconnect/plasma-dataengine-kdeconnect.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=KdeConnect
+Comment=Passive device notifications for the user.
+X-KDE-ServiceTypes=Plasma/DataEngine
+Type=Service
+Icon=device-notifier
+X-KDE-Library=plasma_engine_kdeconnect
+
+X-KDE-PluginInfo-Author=Jacopo De Simoi
+X-KDE-PluginInfo-Email=wilderkde at gmail.com
+X-KDE-PluginInfo-Name=kdeconnect
+X-KDE-PluginInfo-Version=
+X-KDE-PluginInfo-Website=
+X-KDE-PluginInfo-Category=
diff --git a/plasmoid/kdeconnect/qmldir b/plasmoid/kdeconnect/qmldir
new file mode 100644
index 0000000..9d5f411
--- /dev/null
+++ b/plasmoid/kdeconnect/qmldir
@@ -0,0 +1 @@
+plugin kdeconnectdeclarativeplugin
diff --git a/plasmoid/package/contents/config/main.xml b/plasmoid/package/contents/config/main.xml
new file mode 100644
index 0000000..eb11686
--- /dev/null
+++ b/plasmoid/package/contents/config/main.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+  <kcfgfile name=""/>
+
+  <group name="General">
+    <entry name="removableDevices" type="Bool">
+      <default>true</default>
+    </entry>
+    <entry name="nonRemovableDevices" type="Bool">
+      <default>false</default>
+    </entry>
+    <entry name="allDevices" type="Bool">
+      <default>false</default>
+    </entry>
+  </group>
+
+</kcfg>
diff --git a/plasmoid/package/contents/ui/ActionItem.qml b/plasmoid/package/contents/ui/ActionItem.qml
new file mode 100644
index 0000000..1394d57
--- /dev/null
+++ b/plasmoid/package/contents/ui/ActionItem.qml
@@ -0,0 +1,82 @@
+/*
+ *   Copyright 2011 Viranch Mehta <viranch.mehta at gmail.com>
+ *   Copyright 2012 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import Qt 4.7
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.qtextracomponents 0.1
+import org.kde.plasma.components 0.1 as PlasmaComponents
+
+Item {
+    property string icon
+    property alias label: actionText.text
+    property string predicate
+    height: actionIcon.height+(2*actionsList.actionVerticalMargins)
+    width: actionsList.width
+
+    PlasmaCore.IconItem {
+        id: actionIcon
+        source: QIcon (parent.icon)
+        height: actionsList.actionIconHeight
+        width: actionsList.actionIconHeight
+        anchors {
+            top: parent.top
+            topMargin: actionsList.actionVerticalMargins
+            bottom: parent.bottom
+            bottomMargin: actionsList.actionVerticalMargins
+            left: parent.left
+            leftMargin: 3
+        }
+    }
+
+    PlasmaComponents.Label {
+        id: actionText
+        anchors {
+            top: actionIcon.top
+            bottom: actionIcon.bottom
+            left: actionIcon.right
+            leftMargin: 5
+            right: parent.right
+            rightMargin: 3
+        }
+        verticalAlignment: Text.AlignVCenter
+        wrapMode: Text.WordWrap
+    }
+
+    MouseArea {
+        anchors.fill: parent
+        hoverEnabled: true
+        onEntered: {
+            actionsList.currentIndex = index;
+            actionsList.highlightItem.opacity = 1;
+            makeCurrent();
+        }
+        onExited: {
+            actionsList.highlightItem.opacity = 0;
+        }
+        onClicked: {
+            service = hpSource.serviceForSource(udi);
+            operation = service.operationDescription("invokeAction");
+            operation.predicate = predicate;
+            service.startOperationCall(operation);
+            notifierDialog.currentExpanded = -1;
+            notifierDialog.currentIndex = -1;
+        }
+    }
+}
diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml
new file mode 100644
index 0000000..3f1e474
--- /dev/null
+++ b/plasmoid/package/contents/ui/DeviceDelegate.qml
@@ -0,0 +1,37 @@
+/*
+ *   Copyright 2011 Viranch Mehta <viranch.mehta at gmail.com>
+ *   Copyright 2012 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import Qt 4.7
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.qtextracomponents 0.1
+
+PlasmaComponents.ListItem {
+    enabled: true
+    Row {
+        PlasmaCore.IconItem {
+            source: decoration
+        }
+        PlasmaComponents.Label {
+            text: display
+        }
+    }
+
+}
diff --git a/plasmoid/package/contents/ui/StatusBar.qml b/plasmoid/package/contents/ui/StatusBar.qml
new file mode 100644
index 0000000..11e67d4
--- /dev/null
+++ b/plasmoid/package/contents/ui/StatusBar.qml
@@ -0,0 +1,147 @@
+/*
+ *   Copyright 2011 Viranch Mehta <viranch.mehta at gmail.com>
+ *   Copyright 2012 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import Qt 4.7
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+
+Item {
+    id: statusBar
+    property bool expanded: false
+    visible: false
+    height: visible ? (expanded ? statusText.paintedHeight+detailsText.paintedHeight+3 : statusText.paintedHeight) : 0
+
+    Behavior on height { NumberAnimation { duration: 200 } }
+
+    function setData(error, details, udi) {
+        shown = visible;
+        if (shown)
+            close();
+        statusText.text = error;
+        detailsText.text = details;
+        if (shown)
+            showTimer.restart();
+        else
+            show();
+    }
+
+    function show() {
+        expanded = false;
+        visible = true;
+        showTimer.stop();
+        hideTimer.restart();
+    }
+
+    function toggleDetails() {
+        expanded = !expanded;
+        hideTimer.running = !expanded;
+    }
+
+    function close() {
+        hideTimer.stop();
+        showTimer.stop();
+        expanded = false;
+        visible = false;
+    }
+
+    Timer {
+        id: hideTimer
+        interval: 7500
+        onTriggered: close();
+    }
+
+    Timer {
+        id: showTimer
+        interval: 300
+        onTriggered: show();
+    }
+
+    PlasmaCore.Svg {
+        id: iconsSvg
+        imagePath: "widgets/configuration-icons"
+    }
+
+    property int iconSize: 16
+
+    PlasmaCore.SvgItem {
+        id: closeBtn
+        width: iconSize
+        height: iconSize
+        svg: iconsSvg
+        elementId: "close"
+        anchors {
+            top: parent.top
+            right: parent.right
+        }
+    }
+
+    MouseArea {
+        anchors.fill: closeBtn
+        onClicked: close();
+    }
+
+    PlasmaCore.SvgItem {
+        id: detailsBtn
+        visible: detailsText.text!=""
+        width: visible ? iconSize : 0
+        height: visible ? iconSize : 0
+        svg: iconsSvg
+        elementId: expanded ? "collapse" : "restore"
+        anchors {
+            top: parent.top
+            right: closeBtn.left
+            rightMargin: 5
+        }
+    }
+
+    MouseArea {
+        anchors.fill: detailsBtn
+        enabled: detailsBtn.visible
+        onClicked: toggleDetails();
+    }
+
+    PlasmaComponents.Label {
+        id: statusText
+        anchors {
+            top: parent.top
+            left: parent.left
+            right: detailsBtn.left
+            bottom: detailsText.top
+            bottomMargin: expanded ? 3 : 0
+        }
+        clip: true
+        wrapMode: Text.WordWrap
+    }
+
+    PlasmaComponents.Label {
+        id: detailsText
+        anchors {
+            left: parent.left
+            right: parent.right
+            bottom: parent.bottom 
+        }
+        font.pointSize: theme.defaultFont.pointSize * 0.8
+        clip: true
+        wrapMode: Text.WordWrap
+        height: expanded ? paintedHeight : 0
+
+        Behavior on height { NumberAnimation { duration: 200 } }
+    }
+}
diff --git a/plasmoid/package/contents/ui/config.ui b/plasmoid/package/contents/ui/config.ui
new file mode 100644
index 0000000..2418cc8
--- /dev/null
+++ b/plasmoid/package/contents/ui/config.ui
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>devicenotifierConfig</class>
+ <widget class="QWidget" name="devicenotifierConfig">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>193</width>
+    <height>83</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QRadioButton" name="kcfg_removableDevices">
+     <property name="text">
+      <string>Removable devices only</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QRadioButton" name="kcfg_nonRemovableDevices">
+     <property name="text">
+      <string>Non-removable devices only</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" rowspan="3">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>2</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="0">
+    <widget class="QRadioButton" name="kcfg_allDevices">
+     <property name="text">
+      <string>All devices</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>3</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/plasmoid/package/contents/ui/devicenotifier.qml b/plasmoid/package/contents/ui/devicenotifier.qml
new file mode 100644
index 0000000..93c6f34
--- /dev/null
+++ b/plasmoid/package/contents/ui/devicenotifier.qml
@@ -0,0 +1,135 @@
+/*
+ *   Copyright 2011 Viranch Mehta <viranch.mehta at gmail.com>
+ *   Copyright 2012 Jacopo De Simoi <wilderkde at gmail.com>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Library General Public License as
+ *   published by the Free Software Foundation; either version 2 or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details
+ *
+ *   You should have received a copy of the GNU Library General Public
+ *   License along with this program; if not, write to the
+ *   Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+import QtQuick 1.0
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.plasma.extras 0.1 as PlasmaExtras
+import org.kde.kdeconnect 1.0 as KdeConnect
+
+Item {
+    id: devicenotifier
+    property int implicitWidth: 500
+    property int implicitHeight: 500
+    property string devicesType: "removable"
+
+    PlasmaCore.Theme {
+        id: theme
+    }
+
+    PlasmaCore.DataSource {
+        id: kdeconnectSource
+        engine: "kdeconnect"
+        property string last
+        onSourceAdded: {
+            last = source;
+            connectSource(source);
+        }
+        onDataChanged: {
+            if (last != "") {
+                statusBar.setData(data[last]["error"], data[last]["errorDetails"], data[last]["udi"]);
+                plasmoid.status = "NeedsAttentionStatus";
+                plasmoid.showPopup(2500)
+            }
+            expandDevice(1)
+        }
+    }
+
+
+
+
+    MouseArea {
+        hoverEnabled: true
+        anchors.fill: parent
+
+        PlasmaComponents.Label {
+            id: header
+            text: devicesModel.count>0 ? i18n("Available Devices") : i18n("No Devices Available")
+            anchors { top: parent.top; topMargin: 3; left: parent.left; right: parent.right }
+            horizontalAlignment: Text.AlignHCenter
+        }
+
+
+        PlasmaCore.Svg {
+            id: lineSvg
+            imagePath: "widgets/line"
+        }
+        PlasmaCore.SvgItem {
+            id: headerSeparator
+            svg: lineSvg
+            elementId: "horizontal-line"
+            anchors {
+                top: header.bottom
+                left: parent.left
+                right: parent.right
+                topMargin: 3
+            }
+            height: lineSvg.elementSize("horizontal-line").height
+        }
+
+        PlasmaExtras.ScrollArea {
+            anchors {
+                top : headerSeparator.bottom
+                topMargin: 10
+                bottom: statusBarSeparator.top
+                left: parent.left
+                right: parent.right
+            }
+            flickableItem: ListView {
+                id: notifierDialog
+
+                model: KdeConnect.DevicesModel {
+                    id: devicesModel
+                }
+
+                delegate: DeviceDelegate { }
+
+            }
+        }
+
+        PlasmaCore.SvgItem {
+            id: statusBarSeparator
+            svg: lineSvg
+            elementId: "horizontal-line"
+            height: lineSvg.elementSize("horizontal-line").height
+            anchors {
+                bottom: statusBar.top
+                bottomMargin: statusBar.visible ? 3:0
+                left: parent.left
+                right: parent.right
+            }
+            visible: statusBar.height>0
+        }
+
+        StatusBar {
+            id: statusBar
+            anchors {
+                left: parent.left
+                leftMargin: 5
+                right: parent.right
+                rightMargin: 5
+                bottom: parent.bottom
+                bottomMargin: 5
+            }
+        }
+    } // MouseArea
+
+
+}
diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop
new file mode 100644
index 0000000..983c7ea
--- /dev/null
+++ b/plasmoid/package/metadata.desktop
@@ -0,0 +1,23 @@
+[Desktop Entry]
+Name=KdeConnect
+Comment=KdeConnect awesome plasmoid
+
+Icon=device-notifier
+Type=Service
+X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet
+
+X-Plasma-API=declarativeappletscript
+X-Plasma-MainScript=ui/devicenotifier.qml
+X-Plasma-DefaultSize=290,340
+X-Plasma-NotificationArea=true
+X-Plasma-ConfigPlugins=solid-actions,device_automounter_kcm
+
+X-KDE-PluginInfo-Author=Viranch Mehta, Jacopo De Simoi
+X-KDE-PluginInfo-Email=wilderkde at gmail.com
+X-KDE-PluginInfo-Name=kdeconnect
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Website=http://userbase.kde.org/Plasma/DeviceNotifier
+X-KDE-PluginInfo-Category=System Information
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list