[-]
[+]
|
Changed |
plasma-phone-components.spec
|
|
[-]
[+]
|
Deleted |
plasma-phone-components-0.2.3.tar.xz/shell/contents/views/SlidingPanel.qml
^
|
@@ -1,144 +0,0 @@
-/*
- * Copyright 2014 Marco Martin <notmart@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 Library 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 2.0
-import QtQuick.Window 2.0
-import org.kde.plasma.core 2.0 as PlasmaCore
-
-Window {
- id: window
- flags: Qt.WindowDoesNotAcceptFocus
-
- property int offset: 0
-
- color: "transparent"
-
- function updateState() {
- var delta = offset - mouseArea.startOffset;
- if (delta > units.gridUnit * 8) {
- mouseArea.state = "open";
- } else if (delta < -units.gridUnit * 8) {
- mouseArea.state = "closed";
- } else {
- mouseArea.state = mouseArea.startState;
- }
- mouseArea.startState = mouseArea.state;
- }
-
- onVisibleChanged: {
- if (visible) {
- mouseArea.state = "draggingFromClosed";
- mouseArea.startOffset = units.gridUnit * 4;
- }
- }
-
- MouseArea {
- id: mouseArea
- y: units.iconSizes.small
- width: window.width
- height: window.height - y
- clip: true
- state: "closed"
-
- property int oldMouseY: 0
- property int startOffset: units.iconSizes.large;
- property string startState: "closed"
- onPressed: {
- startState = state;
- startOffset = window.offset;
- oldMouseY = mouse.y;
- state = "draggingFromOpen";
- window.offset = startOffset;
- }
- onPositionChanged: {
- window.offset = window.offset + (mouse.y - oldMouseY);
- oldMouseY = mouse.y;
- }
- onReleased: window.updateState()
-
- Rectangle {
- id: slidingArea
- width: parent.width
- height: parent.height
- y: Math.min(0, -height + window.offset)
-
- color: Qt.rgba(0, 0, 0, 0.7)
- Rectangle {
- width: parent.width / 4
- height: units.gridUnit/2
- color: "yellow"
- anchors {
- horizontalCenter: parent.horizontalCenter
- bottom: parent.bottom
- bottomMargin: units.gridUnit/2
- }
- }
- }
-
- states: [
- State {
- name: "closed"
- PropertyChanges {
- target: window
- offset: 0
- }
- },
- State {
- name: "open"
- PropertyChanges {
- target: window
- offset: slidingArea.height
- }
- },
- State {
- name: "draggingFromOpen"
- },
- State {
- name: "draggingFromClosed"
- PropertyChanges {
- target: window
- offset: units.gridUnit * 4
- }
- }
- ]
-
- transitions: [
- Transition {
- to: "draggingFromOpen"
- },
- Transition {
- SequentialAnimation {
- PropertyAnimation {
- target: window
- duration: units.longDuration
- easing: Easing.InOutQuad
- properties: "offset"
- }
- ScriptAction {
- script: {
- if (mouseArea.state == "closed") {
- window.visible = false;
- }
- }
- }
- }
- }
- ]
- }
-}
|
|
Deleted |
plasma-phone-components-0.2.3.tar.xz/wallpaper/contents/images/1920x1079.png
^
|
|
Deleted |
plasma-phone-components-0.2.3.tar.xz/wallpaper/contents/images/611x1079.png
^
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/CMakeLists.txt
^
|
@@ -23,10 +23,10 @@
include(GenerateExportHeader)
include(FeatureSummary)
-find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Gui Widgets Qml Quick)
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Gui Widgets Qml Quick Test)
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative)
-find_package(KF5 REQUIRED COMPONENTS PlasmaQuick)
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative I18n)
+find_package(KF5 REQUIRED COMPONENTS PlasmaQuick DBusAddons Notifications)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
@@ -48,3 +48,6 @@
add_subdirectory(qmlcomponents)
add_subdirectory(services)
add_subdirectory(settingsmodules)
+add_subdirectory(applets)
+add_subdirectory(containments)
+add_subdirectory(dialer)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/CMakeLists.txt
^
|
@@ -0,0 +1,5 @@
+
+plasma_install_package(clock org.kde.phone.clock)
+plasma_install_package(notifications org.kde.phone.notifications)
+
+add_subdirectory(quicksettings)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock/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 \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.clock.pot
+rm -f rc.cpp
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock/contents/ui/main.qml
^
|
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.1
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+
+PlasmaComponents.Label {
+ id: bigClock
+
+ PlasmaCore.DataSource {
+ id: timeSource
+ engine: "time"
+ connectedSources: ["Local"]
+ interval: 60 * 1000
+ }
+
+ Layout.minimumWidth: implicitWidth
+ Layout.minimumHeight: implicitHeight
+
+ text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
+ color: PlasmaCore.ColorScope.textColor
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ font.pointSize: 40
+ style: Text.Raised
+ styleColor: "black"
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/clock/metadata.desktop
^
|
@@ -0,0 +1,22 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Clock
+
+Comment=Time displayed in a digital format
+
+Icon=preferences-system-time
+Type=Service
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-Name=org.kde.phone.clock
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Website=plasma.kde.org
+X-KDE-ServiceTypes=Plasma/Applet
+X-Plasma-API=declarativeappletscript
+X-KDE-PluginInfo-Category=Date and Time
+X-Plasma-Provides=org.kde.plasma.time
+
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-RemoteLocation=
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/Messages.sh
^
|
@@ -0,0 +1,5 @@
+#! /usr/bin/env bash
+$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
+$XGETTEXT `find . -name \*.qml` -L Java -o $podir/plasma_applet_org.kde.phone.notifications.pot
+$XGETTEXT rc.cpp -jo $podir/plasma_applet_org.kde.phone.notifications.pot
+rm -f rc.cpp
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/contents/ui/NotificationStripe.qml
^
|
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+MouseArea {
+ id: notificationItem
+
+
+ height: units.gridUnit * (expanded ? (actionsLayout.visible ? 6 : 4) : 2) + background.margins.top + background.margins.bottom
+ width: parent.width
+ anchors.bottomMargin: 10
+ drag.axis: Drag.XAxis
+ drag.target: notificationItem
+
+ property bool expanded: false
+ property string source: model.source
+ property var actions: model.actions
+
+ Behavior on x {
+ SpringAnimation { spring: 2; damping: 0.2 }
+ }
+
+ Behavior on height {
+ SpringAnimation { spring: 5; damping: 0.3 }
+ }
+
+ onReleased: {
+ if (drag.active) {
+ if (x > width / 4 || x < width / -4) {
+ //if there is an action, execute the first when swiping left
+ if (x < 0 && actions) {
+ var action = actions.get(0)
+ root.executeAction(source, action.id)
+ }
+ notificationsModel.remove(index);
+ } else {
+ x = 0;
+ }
+ } else if (body || actions) {
+ expanded = !expanded;
+ }
+ }
+
+
+ PlasmaCore.FrameSvgItem {
+ id: background
+ imagePath: "widgets/background"
+ anchors {
+ fill: parent
+ rightMargin: -notificationItem.width
+ leftMargin: units.gridUnit
+ }
+ colorGroup: PlasmaCore.ColorScope.colorGroup
+ }
+
+ PlasmaComponents.ToolButton {
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ leftMargin: units.gridUnit / 2
+ }
+ iconSource: "window-close"
+ flat: false
+ onClicked: {
+ notificationsModel.remove(index);
+ }
+ }
+
+ PlasmaComponents.Label {
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ leftMargin: units.gridUnit * 3
+ }
+ color: PlasmaCore.ColorScope.textColor
+ text: model.appName
+ }
+
+ PlasmaComponents.Label {
+ id: summaryText
+ anchors {
+ right: icon.left
+ verticalCenter: parent.verticalCenter
+ rightMargin: units.smallSpacing
+ }
+ horizontalAlignment: Qt.AlignRight
+ verticalAlignment: Qt.AlignVCenter
+ color: PlasmaCore.ColorScope.textColor
+ text: summary + (notificationItem.expanded ? (body ? "\n" + body : '') :
+ (body ? '...' : ''))
+ }
+
+ PlasmaCore.IconItem {
+ id: icon
+ anchors {
+ right: notificationItem.right
+ verticalCenter: parent.verticalCenter
+ }
+ width: units.iconSizes.medium
+ height: width
+ source: appIcon && appIcon.length > 0 ? appIcon : "im-user"
+ }
+ RowLayout {
+ id: actionsLayout
+ anchors {
+ right: summaryText.right
+ top: summaryText.bottom
+ topMargin: units.smallSpacing
+ }
+ opacity: notificationItem.expanded && notificationItem.actions && notificationItem.actions.count > 0 ? 1 : 0
+ Behavior on opacity {
+ NumberAnimation {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ Repeater {
+ model: notificationItem.actions
+ delegate: PlasmaComponents.Button {
+ text: model.text
+ onClicked: {
+ root.executeAction(notificationItem.source, model.id)
+ notificationsModel.remove(index);
+ }
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/contents/ui/main.qml
^
|
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.1
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Item {
+ id: root
+ property int notificationId: 0
+
+ Layout.minimumHeight: notificationView.contentsHeight
+
+ function addNotification(source, data, actions) {
+ // Do not show duplicated notifications
+ // Remove notifications that are sent again (odd, but true)
+ for (var i = 0; i < notificationsModel.count; ++i) {
+ var tmp = notificationsModel.get(i);
+ var matches = (tmp.appName == data.appName &&
+ tmp.summary == data.summary &&
+ tmp.body == data.body);
+ var sameSource = tmp.source == source;
+
+ if (sameSource && matches) {
+ return;
+ }
+
+ if (sameSource || matches) {
+ notificationsModel.remove(i)
+ break;
+ }
+ }
+
+ data["id"] = ++notificationId;
+ data["source"] = source;
+ if (data["summary"].length < 1) {
+ data["summary"] = data["body"];
+ data["body"] = '';
+ }
+ data["actions"] = actions;
+
+ notificationsModel.insert(0, data);
+ if (!data["isPersistent"]) {
+ pendingRemovals.push(notificationId);
+ pendingTimer.start();
+ }
+ }
+
+ function executeAction(source, id) {
+ //try to use the service
+ if (source.indexOf("notification") !== -1) {
+ var service = notificationsSource.serviceForSource(source)
+ var op = service.operationDescription("invokeAction")
+ op["actionId"] = id
+
+ service.startOperationCall(op)
+ //try to open the id as url
+ } else if (source.indexOf("Job") !== -1) {
+ Qt.openUrlExternally(id)
+ }
+ }
+
+ PlasmaCore.DataSource {
+ id: notificationsSource
+
+ engine: "notifications"
+ interval: 0
+
+ onSourceAdded: {
+ connectSource(source);
+ }
+
+ onSourceRemoved: {
+ for (var i = 0; i < notificationsModel.count; ++i) {
+ if (notificationsModel.get(i) == source) {
+ notificationsModel.remove(i);
+ break;
+ }
+ }
+ }
+
+ onNewData: {
+ var actions = new Array()
+ if (data["actions"] && data["actions"].length % 2 == 0) {
+ for (var i = 0; i < data["actions"].length; i += 2) {
+ var action = new Object();
+ action["id"] = data["actions"][i];
+ action["text"] = data["actions"][i+1];
+ actions.push(action);
+ }
+ }
+
+ root.addNotification(
+ sourceName,
+ data,
+ actions);
+ }
+
+ }
+
+ ListModel {
+ id: notificationsModel
+
+ ListElement {
+ source: "call1Source"
+ appIcon: "call-start"
+ summary: "Missed call from Joe"
+ appName: "Phone"
+ body: "Called at 8:42 from +41 56 373 37 31"
+ actions: []
+ }
+ ListElement {
+ source: "im1Source"
+ appIcon: "im-google"
+ appName: "Message"
+ summary: "July: Hey! Are you around?"
+ actions: []
+ }
+ ListElement {
+ source: "im2Source"
+ appIcon: "im-google"
+ appName: "Message"
+ summary: "July: Hello?"
+ actions: []
+ }
+ }
+
+ ListView {
+ id: notificationView
+ spacing: units.smallSpacing
+ anchors.fill: parent
+ interactive: false
+
+ z: 1
+ verticalLayoutDirection: ListView.BottomToTop
+ model: notificationsModel
+
+ add: Transition {
+ NumberAnimation {
+ properties: "x"
+ from: notificationView.width
+ duration: 100
+ }
+ }
+
+ remove: Transition {
+ NumberAnimation {
+ properties: "x"
+ to: notificationView.width
+ duration: 500
+ }
+ NumberAnimation {
+ properties: "opacity"
+ to: 0
+ duration: 500
+ }
+ }
+
+ removeDisplaced: Transition {
+ SequentialAnimation {
+ PauseAnimation { duration: 600 }
+ NumberAnimation { properties: "x,y"; duration: 100 }
+ }
+ }
+
+ delegate: NotificationStripe {}
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/notifications/metadata.desktop
^
|
@@ -0,0 +1,22 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Notifications
+Comment=Display notifications and jobs
+
+Type=Service
+Icon=preferences-desktop-notification
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Category=Tasks
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-Name=org.kde.phone.notifications
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-Website=http://plasma.kde.org/
+X-KDE-ServiceTypes=Plasma/Applet
+X-Plasma-API=declarativeappletscript
+X-Plasma-Provides=org.kde.plasma.notifications
+X-KDE-PluginInfo-EnabledByDefault=true
+
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-NotificationArea=true
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/CMakeLists.txt
^
|
@@ -0,0 +1,19 @@
+set(quicksettings_SRCS
+ quicksettings.cpp
+)
+
+add_library(plasma_applet_quicksettings MODULE ${quicksettings_SRCS})
+
+kcoreaddons_desktop_to_json(plasma_applet_quicksettings package/metadata.desktop)
+
+target_link_libraries(plasma_applet_quicksettings
+ Qt5::Gui
+ KF5::Plasma
+ KF5::I18n)
+
+
+install(TARGETS plasma_applet_quicksettings DESTINATION ${PLUGIN_INSTALL_DIR})
+#install(FILES plasma-quicksettings-default.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+
+plasma_install_package(package org.kde.phone.quicksettings)
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/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 \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.quicksettings.pot
+rm -f rc.cpp
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/contents/ui/BrightnessDelegate.qml
^
|
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Item {
+ id: delegateRoot
+ implicitWidth: delegate.implicitWidth
+ implicitHeight: delegate.implicitHeight + (slider.opacity > 0 ? slider.height : 0)
+
+ property int screenBrightness
+ readonly property int maximumScreenBrightness: pmSource.data["PowerDevil"] ? pmSource.data["PowerDevil"]["Maximum Screen Brightness"] || 0 : 0
+
+ PlasmaCore.DataSource {
+ id: pmSource
+ engine: "powermanagement"
+ connectedSources: ["PowerDevil"]
+
+ onDataChanged: {
+ delegateRoot.screenBrightness = source.data["PowerDevil"]["Screen Brightness"];
+ }
+ }
+
+ Delegate {
+ id: delegate
+ toggled: slider.opacity > 0
+ function toggle() {
+ slider.opacity = slider.opacity > 0 ? 0 : 1;
+ }
+ }
+ PlasmaComponents.Slider {
+ id: slider
+ anchors.top: delegate.bottom
+ width: flow.width
+ opacity: 0
+ x: -delegateRoot.parent.x
+ value: screenBrightness
+ minimumValue: maximumValue > 100 ? 1 : 0
+ maximumValue: delegateRoot.maximumScreenBrightness
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ onScreenBrightnessChanged: {
+ var service = pmSource.serviceForSource("PowerDevil");
+ var operation = service.operationDescription("setBrightness");
+ operation.brightness = slider.value;
+ operation.silent = true
+ service.startOperationCall(operation);
+ }
+}
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/contents/ui/Delegate.qml
^
|
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.1
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+RowLayout {
+ id: delegateRoot
+ property bool toggled: model.enabled
+ spacing: units.smallSpacing
+ implicitWidth: flow.width / 2 - units.largeSpacing / 2
+ Rectangle {
+ Layout.minimumWidth: units.iconSizes.large
+ Layout.minimumHeight: width
+ color: toggled ?
+ Qt.rgba(PlasmaCore.ColorScope.highlightColor.r, PlasmaCore.ColorScope.highlightColor.g, PlasmaCore.ColorScope.highlightColor.b, iconMouseArea.pressed ? 0.5 : 0.3) :
+ Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, iconMouseArea.pressed ? 0.5 : 0.2)
+
+ PlasmaCore.IconItem {
+ colorGroup: PlasmaCore.ColorScope.colorGroup
+ anchors {
+ fill: parent
+ margins: units.smallSpacing
+ }
+ source: model.icon
+ MouseArea {
+ id: iconMouseArea
+ anchors.fill: parent
+ onClicked: {
+ if (delegateRoot.toggle) {
+ delegateRoot.toggle();
+ } else if (model.toggleFunction) {
+ root[model.toggleFunction]();
+ } else if (model.settingsCommand) {
+ plasmoid.nativeInterface.executeCommand(model.settingsCommand);
+ }
+ }
+ }
+ }
+ }
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ color: Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, labelMouseArea.pressed ? 0.5 : 0.2)
+ PlasmaComponents.Label {
+ anchors {
+ fill: parent
+ margins: units.smallSpacing
+ }
+ text: model.text
+ elide: Text.ElideRight
+ verticalAlignment: Text.AlignVCenter
+ MouseArea {
+ id: labelMouseArea
+ anchors.fill: parent
+ onClicked: {
+ if (model.settingsCommand) {
+ plasmoid.nativeInterface.executeCommand(model.settingsCommand);
+ } else if (model.toggleFunction) {
+ root[model.toggleFunction]();
+ }
+ }
+ }
+ }
+ }
+}
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/contents/ui/main.qml
^
|
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.1
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.plasmoid 2.0
+
+
+Item {
+ id: root
+
+ function toggleAirplane() {
+ print("toggle airplane mode")
+ }
+
+ Plasmoid.preferredRepresentation: plasmoid.fullRepresentation
+
+ ListModel {
+ id: settingsModel
+
+ ListElement {
+ text: "Settings"
+ icon: "configure"
+ enabled: false
+ settingsCommand: "active-settings"
+ toggleFunction: ""
+ delegate: ""
+ }
+ ListElement {
+ text: "Mobile network"
+ icon: "network-mobile-80"
+ enabled: true
+ settingsCommand: ""
+ }
+ ListElement {
+ text: "Airplane mode"
+ icon: "flightmode-on"
+ enabled: false
+ settingsCommand: ""
+ toggleFunction: "toggleAirplane"
+ }
+ ListElement {
+ text: "Bluetooth"
+ icon: "preferences-system-bluetooth"
+ enabled: false
+ settingsCommand: ""
+ }
+ ListElement {
+ text: "Wireless"
+ icon: "network-wireless-on"
+ enabled: true
+ settingsCommand: "active-settings -m org.kde.satellite.settings.wifi"
+ }
+ ListElement {
+ text: "Alarms"
+ icon: "korgac"
+ enabled: false
+ settingsCommand: ""
+ }
+ ListElement {
+ text: "Notifications"
+ icon: "preferences-desktop-notification"
+ enabled: true
+ settingsCommand: ""
+ }
+ ListElement {
+ text: "Brightness"
+ icon: "video-display-brightness"
+ enabled: false
+ settingsCommand: "active-settings -m org.kde.active.settings.powermanagement"
+ delegate: "BrightnessDelegate"
+ }
+ ListElement {
+ text: "Flashlight"
+ icon: "package_games_puzzle"
+ enabled: false
+ settingsCommand: ""
+ }
+ ListElement {
+ text: "Location"
+ icon: "plasmaapplet-location"
+ enabled: false
+ settingsCommand: ""
+ }
+ }
+
+ Flow {
+ id: flow
+ anchors {
+ fill: parent
+ margins: units.largeSpacing
+ }
+ spacing: units.largeSpacing
+ Repeater {
+ model: settingsModel
+ delegate: Loader {
+ width: item ? item.implicitWidth : 0
+ height: item ? item.implicitHeight : 0
+ source: Qt.resolvedUrl((model.delegate ? model.delegate : "Delegate") + ".qml")
+ }
+ }
+ move: Transition {
+ NumberAnimation {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ properties: "x,y"
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/package/metadata.desktop
^
|
@@ -0,0 +1,22 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Quick Settings
+
+Comment=A panel to quickly access most important settings
+
+Icon=systemsettings
+Type=Service
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-Name=org.kde.phone.quicksettings
+X-KDE-Library=plasma_applet_quicksettings
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Website=plasma.kde.org
+X-KDE-ServiceTypes=Plasma/Applet
+X-Plasma-API=declarativeappletscript
+X-KDE-PluginInfo-Category=Settings
+
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-RemoteLocation=
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/quicksettings.cpp
^
|
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2015 Marco Martin <mart@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU 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 General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU 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 . *
+ ***************************************************************************/
+
+#include "quicksettings.h"
+
+#include <QDebug>
+#include <QProcess>
+
+QuickSettings::QuickSettings(QObject *parent, const QVariantList &args)
+ : Plasma::Applet(parent, args)
+{
+ setHasConfigurationInterface(true);
+}
+
+QuickSettings::~QuickSettings()
+{
+}
+
+void QuickSettings::executeCommand(const QString &command)
+{
+ qWarning()<<"Executing"<<command;
+ QProcess::startDetached(command);
+}
+
+K_EXPORT_PLASMA_APPLET_WITH_JSON(quicksettings, QuickSettings, "metadata.json")
+
+#include "quicksettings.moc"
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/applets/quicksettings/quicksettings.h
^
|
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2015 Marco Martin <mart@kde.org> *
+ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU 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 General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU 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 . *
+ ***************************************************************************/
+
+#ifndef QUICKSETTINGS_H
+#define QUICKSETTINGS_H
+
+
+#include <Plasma/Applet>
+
+
+class QuickSettings : public Plasma::Applet
+{
+ Q_OBJECT
+
+public:
+ QuickSettings( QObject *parent, const QVariantList &args );
+ ~QuickSettings();
+
+public Q_SLOTS:
+ void executeCommand(const QString &command);
+
+private:
+
+};
+
+#endif
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/compositor/Compositor.qml
^
|
@@ -154,8 +154,8 @@
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
- height: compositorRoot.state == "homeScreen" ? 0 : bottomBarHeight
- color: Qt.rgba(0, 0, 0, 0.9 + 0.1*windowsZoom.scale)
+ height: bottomBarHeight
+ color: Qt.rgba(0, 0, 0, 0.9)
Behavior on height {
NumberAnimation {
@@ -171,7 +171,28 @@
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
width: units.iconSizes.smallMedium
height: width
+ source: "distribute-horizontal-x"
+ enabled: compositorRoot.state != "switcher" && windowsLayout.children.length > 0
+ opacity: enabled ? 1 : 0.2
+
+ Layout.alignment: Qt.AlignHCenter
+ Layout.preferredWidth: units.iconSizes.medium
+ Layout.preferredHeight: units.iconSizes.medium
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ compositorRoot.state = "switcher";
+ }
+ }
+ }
+ PlasmaCore.IconItem {
+ colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+ width: units.iconSizes.smallMedium
+ height: width
source: "go-home"
+ enabled: compositorRoot.state != "homeScreen";
+ opacity: enabled ? 1 : 0.2
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: units.iconSizes.medium
@@ -190,7 +211,7 @@
height: width
source: "window-close"
enabled: compositorRoot.currentWindow
- opacity: enabled ? 1 : 0.6
+ opacity: enabled ? 1 : 0.2
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: units.iconSizes.medium
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/CMakeLists.txt
^
|
@@ -0,0 +1,3 @@
+
+plasma_install_package(homescreen org.kde.phone.homescreen)
+plasma_install_package(panel org.kde.phone.panel)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/code
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/code/LayoutManager.js
^
|
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2013 Marco Martin <mart@kde.org>
+ *
+ * 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.
+ */
+
+.pragma library
+
+
+var layout;
+var root;
+var plasmoid;
+var lastSpacer;
+
+
+function restore() {
+ var configString = String(plasmoid.configuration.AppletOrder)
+
+ //array, a cell for encoded item order
+ var itemsArray = configString.split(";");
+
+ //map applet id->order in panel
+ var idsOrder = new Object();
+ //map order in panel -> applet pointer
+ var appletsOrder = new Object();
+
+ for (var i = 0; i < itemsArray.length; i++) {
+ //property name: applet id
+ //property value: order
+ idsOrder[itemsArray[i]] = i;
+ }
+
+ for (var i = 0; i < plasmoid.applets.length; ++i) {
+ if (idsOrder[plasmoid.applets[i].id] !== undefined) {
+ appletsOrder[idsOrder[plasmoid.applets[i].id]] = plasmoid.applets[i];
+ //ones that weren't saved in AppletOrder go to the end
+ } else {
+ appletsOrder["unordered"+i] = plasmoid.applets[i];
+ }
+ }
+
+ //finally, restore the applets in the correct order
+ for (var i in appletsOrder) {
+ root.addApplet(appletsOrder[i], -1, -1)
+ }
+ //rewrite, so if in the orders there were now invalid ids or if some were missing creates a correct list instead
+ save();
+}
+
+function save() {
+ var ids = new Array();
+ for (var i = 0; i < layout.children.length; ++i) {
+ var child = layout.children[i];
+
+ if (child.applet) {
+ ids.push(child.applet.id);
+ }
+ }
+ plasmoid.configuration.AppletOrder = ids.join(';');
+}
+
+function removeApplet (applet) {
+ for (var i = layout.children.length - 1; i >= 0; --i) {
+ var child = layout.children[i];
+ if (child.applet === applet) {
+ child.destroy();
+ }
+ }
+}
+
+//insert item2 before item1
+function insertBefore(item1, item2) {
+ if (item1 === item2) {
+ return;
+ }
+ var removed = new Array();
+
+ var child;
+
+ var i;
+ for (i = layout.children.length - 1; i >= 0; --i) {
+ child = layout.children[i];
+ removed.push(child);
+ child.parent = root;
+
+ if (child === item1) {
+ break;
+ }
+ }
+
+ item2.parent = layout;
+
+ for (var j = removed.length - 1; j >= 0; --j) {
+ removed[j].parent = layout;
+ }
+ return i;
+}
+
+//insert item2 after item1
+function insertAfter(item1, item2) {
+ if (item1 === item2) {
+ return;
+ }
+ var removed = new Array();
+
+ var child;
+
+ var i;
+ for (i = layout.children.length - 1; i >= 0; --i) {
+ child = layout.children[i];
+ //never ever insert after lastSpacer
+ if (child === lastSpacer && item1 === lastSpacer) {
+ removed.push(child);
+ child.parent = root;
+ break;
+ } else if (child === item1) {
+ break;
+ }
+
+ removed.push(child);
+ child.parent = root;
+ }
+
+ item2.parent = layout;
+
+ for (var j = removed.length - 1; j >= 0; --j) {
+ removed[j].parent = layout;
+ }
+ return i;
+}
+
+function insertAtIndex(item, position) {
+ if (position < 0 || position >= layout.children.length) {
+ return;
+ }
+
+ //never ever insert after lastSpacer
+ if (layout.children[position] === lastSpacer) {
+ --position;
+ }
+
+ var removedItems = new Array();
+
+ for (var i = position; i < layout.children.length; ++i) {
+ var child = layout.children[position];
+ child.parent = root;
+ removedItems.push(child);
+ }
+
+ item.parent = layout;
+ for (var i in removedItems) {
+ removedItems[i].parent = layout;
+ }
+}
+
+function insertAtCoordinates(item, x, y) {
+ if (root.isHorizontal) {
+ y = layout.height / 2;
+ } else {
+ x = layout.width / 2;
+ }
+ var child = layout.childAt(x, y);
+
+ if (!child || child === item) {
+ child = layout.children[0];
+ }
+ item.parent = root;
+
+ //PlasmaCore.Types.Vertical = 3
+ if ((plasmoid.formFactor === 3 && y < child.y + child.height/2) ||
+ (plasmoid.formFactor !== 3 && x < child.x + child.width/2)) {
+ return insertBefore(child, item);
+ } else {
+ return insertAfter(child, item);
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/config
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/config/main.xml
^
|
@@ -0,0 +1,18 @@
+<?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="AppletOrder" type="String">
+ <label>encoded order of items</label>
+ </entry>
+ <entry name="AppOrder" type="StringList">
+ <label>order of apps</label>
+ <default>org.kde.phone.dialer.desktop</default>
+ </entry>
+ </group>
+
+</kcfg>
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/images
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/images/homescreenicons.svg
^
|
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="972.16351"
+ height="203.95906"
+ id="svg4025"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="New document 4">
+ <defs
+ id="defs4027" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="423.57766"
+ inkscape:cy="19.47953"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="3200"
+ inkscape:window-height="1768"
+ inkscape:window-x="0"
+ inkscape:window-y="-3"
+ inkscape:window-maximized="1"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <metadata
+ id="metadata4030">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-259.63254,-347.88266)">
+ <g
+ transform="translate(207.79603,359.47951)"
+ id="email"
+ inkscape:label="#g3960">
+ <path
+ transform="matrix(2.6315789,0,0,2.6315789,1578.5263,1202.8885)"
+ d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
+ sodipodi:ry="38"
+ sodipodi:rx="38"
+ sodipodi:cy="-422"
+ sodipodi:cx="-346"
+ id="path5038-4"
+ style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
+ sodipodi:type="arc" />
+ <g
+ id="g3953">
+ <g
+ id="layer1-8"
+ transform="matrix(3.0415044,0,0,3.0415044,593.47877,17.283066)"
+ style="fill:#f2d842;fill-opacity:1">
+ <path
+ d="M 0,0 0,30 13.334,15.0012 z"
+ transform="translate(5,9)"
+ id="path4127"
+ inkscape:connector-curvature="0"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
+ <path
+ d="M 0,0 17.6439,17 19,18.3 20.3561,17 38,0 z"
+ transform="translate(5,9)"
+ id="path4125"
+ inkscape:connector-curvature="0"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
+ <path
+ d="M 13.334,0 0,15.0012 13.334,30 z"
+ transform="translate(29.666,9)"
+ id="path4123"
+ inkscape:connector-curvature="0"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
+ <path
+ d="M 15.2227,0 0,12.6309 l 37.5547,0 L 22.332,0 18.7773,3.36719 z"
+ transform="translate(5.22266,26.3691)"
+ id="rect3260"
+ inkscape:connector-curvature="0"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
+ </g>
+ </g>
+ </g>
+ <g
+ transform="translate(919.2246,317.33665)"
+ id="phone"
+ inkscape:label="#g3944">
+ <path
+ transform="matrix(2.6315789,0,0,2.6315789,350.93424,1241.0723)"
+ d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
+ sodipodi:ry="38"
+ sodipodi:rx="38"
+ sodipodi:cy="-422"
+ sodipodi:cx="-346"
+ id="path5038"
+ style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
+ sodipodi:type="arc" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4128-0-9"
+ d="m -583.50447,76.46575 c -1.86372,-0.0072 -27.21217,10.305195 -28.75978,11.703933 -1.84203,1.665344 0.23482,13.309167 4.59876,25.744457 9.88137,28.17454 35.33169,53.80871 63.99465,64.45741 8.30341,3.08482 24.41316,6.96228 26.66305,6.41896 0.66145,-0.16041 3.89288,-6.89324 7.18318,-14.96835 l 0,0 c 3.29029,-8.07514 5.98019,-14.84698 5.98019,-15.05083 0,-0.20303 -7.38909,-4.03543 -16.42151,-8.51508 l -16.42115,-8.14392 -7.88437,7.73158 -7.87713,7.72473 -4.95604,-3.40189 c -5.58462,-3.83035 -18.54569,-16.86252 -22.01662,-22.1433 l -2.28202,-3.4775 7.7879,-7.78658 7.78791,-7.7797 -8.22791,-16.25353 c -4.52616,-8.939403 -8.64517,-16.257572 -9.15599,-16.26039 z"
+ style="fill:#f2d842;fill-opacity:1"
+ sodipodi:nodetypes="cccscccscccccccccccc" />
+ </g>
+ <g
+ transform="translate(207.79603,359.47951)"
+ id="web"
+ inkscape:label="#g3969">
+ <path
+ transform="matrix(2.6315789,0,0,2.6315789,1834.5263,1202.8885)"
+ d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
+ sodipodi:ry="38"
+ sodipodi:rx="38"
+ sodipodi:cy="-422"
+ sodipodi:cx="-346"
+ id="path5038-8"
+ style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
+ sodipodi:type="arc" />
+ <g
+ transform="matrix(8.6577389,0,0,8.6577389,6742.4809,7725.3521)"
+ id="g5084">
+ <rect
+ style="fill:none;stroke:none"
+ id="rect3260-3"
+ width="15"
+ height="15"
+ x="-679.5"
+ y="-889.13782" />
+ <rect
+ ry="2"
+ y="-878.13782"
+ x="-674"
+ height="4"
+ width="4"
+ id="rect3292"
+ style="fill:none;stroke:none" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ d="m -672,-889.1378 c -4.155,0 -7.5,3.345 -7.5,7.5 0,4.155 3.345,7.5 7.5,7.5 4.155,0 7.5,-3.345 7.5,-7.5 0,-4.155 -3.345,-7.5 -7.5,-7.5 z m 0,2 c 3.047,0 5.5,2.453 5.5,5.5 0,3.047 -2.453,5.5 -5.5,5.5 -3.047,0 -5.5,-2.453 -5.5,-5.5 0,-3.047 2.453,-5.5 5.5,-5.5 z"
+ id="rect3272" />
+ <rect
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="rect3279"
+ width="12"
+ height="1"
+ x="-678"
+ y="-882.13782"
+ ry="0" />
+ <rect
+ ry="0"
+ y="-672.5"
+ x="875.63782"
+ height="1"
+ width="12"
+ id="rect3281"
+ style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ transform="matrix(0,-1,1,0,0,0)" />
+ <rect
+ ry="1"
+ y="-876.13782"
+ x="-673"
+ height="2"
+ width="2"
+ id="rect3274"
+ style="fill:none;stroke:none" />
+ <rect
+ style="fill:none;stroke:none"
+ id="rect3283"
+ width="0.99999976"
+ height="0.99999976"
+ x="-672.5"
+ y="-875.13806"
+ ry="0.49999988" />
+ <rect
+ ry="2"
+ y="-883.63782"
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui/Clock.qml
^
|
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2015 Marco Martin <notmart@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 Library 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 2.1
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+
+PlasmaComponents.Label {
+ id: bigClock
+
+ PlasmaCore.DataSource {
+ id: timeSource
+ engine: "time"
+ connectedSources: ["Local"]
+ interval: 60 * 1000
+ }
+
+ Layout.minimumWidth: implicitWidth
+ Layout.minimumHeight: implicitHeight
+
+ text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
+ color: PlasmaCore.ColorScope.textColor
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ font.pointSize: 40
+ style: Text.Raised
+ styleColor: "black"
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui/HomeLauncher.qml
^
|
@@ -0,0 +1,50 @@
+import QtQuick 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.kio 1.0 as Kio
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Item {
+ id: delegateRoot
+ width: applicationsView.cellWidth
+ height: width
+
+ property var modelData: model
+ property bool isDropTarget: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole
+
+ opacity: isDropTarget ? 0.3 : 1
+
+ PlasmaCore.IconItem {
+ id: icon
+ anchors.centerIn: parent
+ width: parent.height / 2
+ height: width
+ source: modelData.ApplicationIconRole
+ scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
+ Behavior on scale {
+ NumberAnimation {
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ PlasmaComponents.Label {
+ id: label
+ visible: text.length > 0
+
+ anchors {
+ top: icon.bottom
+ left: icon.left
+ right: icon.right
+ }
+
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ maximumLineCount: 2
+
+ text: modelData.ApplicationNameRole
+ font.pixelSize: theme.smallestFont.pixelSize
+ color: PlasmaCore.ColorScope.textColor
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui/HomeLauncherSvg.qml
^
|
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+
+Item {
+ id: root
+ width: parent.width / parent.columns
+ height: parent.buttonHeight
+ property var callback
+ property string text
+ property string sub
+ property alias svg: icon.svg
+ property alias elementId: icon.elementId
+
+ PlasmaCore.SvgItem{
+ id: icon
+ width: units.iconSizes.medium
+ height: width
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ propagateComposedEvents: true
+
+ onClicked: {
+ if (callback) {
+ callback();
+ } else {
+ addNumber(parent.text);
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui/SatelliteStripe.qml
^
|
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+
+PlasmaCore.ColorScope {
+ colorGroup: PlasmaCore.Theme.NormalColorGroup
+
+ PlasmaCore.FrameSvgItem {
+ z: -1
+ imagePath: "widgets/background"
+ enabledBorders: PlasmaCore.FrameSvgItem.TopBorder | PlasmaCore.FrameSvgItem.BottomBorder
+ anchors {
+ fill: parent
+ topMargin: -margins.top
+ bottomMargin: -margins.bottom
+ }
+ Rectangle {
+ anchors {
+ fill: parent
+ topMargin: parent.margins.top
+ bottomMargin: parent.margins.bottom
+ }
+ color: PlasmaCore.ColorScope.backgroundColor
+ }
+ }
+
+ height: applicationsView.cellWidth
+ width: parent.width
+ y: parent.height / 2 - height / 2
+ x: 0
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/contents/ui/main.qml
^
|
@@ -0,0 +1,551 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.4
+import QtQuick.Layouts 1.1
+
+import org.kde.plasma.plasmoid 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.kquickcontrolsaddons 2.0
+import org.kde.satellite.components 0.1 as SatelliteComponents
+
+import "plasmapackage:/code/LayoutManager.js" as LayoutManager
+
+MouseEventListener {
+ id: root
+ width: 480
+ height: 640
+
+ property Item toolBox
+ property alias appletsSpace: applicationsView.headerItem
+ property int buttonHeight: width/4
+ property bool reorderingApps: false
+
+ Containment.onAppletAdded: {
+ addApplet(applet, x, y);
+ LayoutManager.save();
+ }
+
+ Plasmoid.onFocusChanged: {
+ if (!plasmoid.focus && applicationsView.contentY > -(applicationsView.headerItem.height - root.height/2)) {
+ applicationsView.contentY = -root.height;
+ }
+ }
+
+ function addApplet(applet, x, y) {
+ var container = appletContainerComponent.createObject(appletsSpace.layout)
+ container.visible = true
+ print("Applet added: " + applet)
+
+ var appletWidth = applet.width;
+ var appletHeight = applet.height;
+ applet.parent = container;
+ container.applet = applet;
+ applet.anchors.fill = container;
+ applet.visible = true;
+ container.visible = true;
+
+ // If the provided position is valid, use it.
+ if (x >= 0 && y >= 0) {
+ var index = LayoutManager.insertAtCoordinates(container, x , y);
+
+ // Fall through to determining an appropriate insert position.
+ } else {
+ var before = null;
+ container.animationsEnabled = false;
+
+ if (appletsSpace.lastSpacer.parent === appletsSpace.layout) {
+ //Uncomment to make the spacer the last element again
+ // before = appletsSpace.lastSpacer;
+ }
+
+ if (before) {
+ LayoutManager.insertBefore(before, container);
+
+ // Fall through to adding at the end.
+ } else {
+ container.parent = appletsSpace.layout;
+ }
+
+ //event compress the enable of animations
+ //startupTimer.restart();
+ }
+
+ if (applet.Layout.fillWidth) {
+ appletsSpace.lastSpacer.parent = root;
+ }
+ }
+
+ Component.onCompleted: {
+ LayoutManager.plasmoid = plasmoid;
+ LayoutManager.root = root;
+ LayoutManager.layout = appletsSpace.layout;
+ LayoutManager.lastSpacer = appletsSpace.lastSpacer;
+ LayoutManager.restore();
+ applicationsView.contentY = -root.height;
+
+ appListModel.appOrder = plasmoid.configuration.AppOrder;
+ appListModel.loadApplications();
+ }
+
+ SatelliteComponents.ApplicationListModel {
+ id: appListModel
+ onAppOrderChanged: {
+ plasmoid.configuration.AppOrder = appListModel.appOrder;
+ }
+ }
+
+ Timer {
+ id: autoScrollTimer
+ property bool scrollDown: true
+ repeat: true
+ interval: 1500
+ onTriggered: {
+ scrollAnim.to = scrollDown ?
+ Math.min(applicationsView.contentItem.height - applicationsView.headerItem.height - root.height, applicationsView.contentY + root.height/2) :
+ Math.max(0, applicationsView.contentY - root.height/2);
+ scrollAnim.running = true;
+ }
+ }
+
+ Component {
+ id: appletContainerComponent
+ Item {
+ //not used yet
+ property bool animationsEnabled: false
+ property Item applet
+ Layout.fillWidth: true
+ Layout.fillHeight: applet && applet.Layout.fillHeight
+ Layout.onFillHeightChanged: {
+ if (plasmoid.formFactor == PlasmaCore.Types.Vertical) {
+ checkLastSpacer();
+ }
+ }
+
+ Layout.minimumWidth: root.width
+ Layout.minimumHeight: Math.max(applet.Layout.minimumHeight, (root.height-applicationsView.headerItem.margin) / 2)
+
+ Layout.preferredWidth: root.width
+ Layout.preferredHeight: Layout.minimumHeight
+
+ Layout.maximumWidth: root.width
+ Layout.maximumHeight: Layout.minimumHeight
+ }
+ }
+
+ onPressAndHold: {
+ var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
+ //in favorites area?
+ var item;
+ if (applicationsView.headerItem.favoritesStrip.contains(pos)) {
+ item = applicationsView.headerItem.favoritesStrip.itemAt(pos.x, pos.y);
+ } else {
+ pos = mapToItem(applicationsView.contentItem, mouse.x, mouse.y);
+ item = applicationsView.itemAt(pos.x, pos.y)
+ }
+ if (!item) {
+ return;
+ }
+
+ applicationsView.dragData = new Object;
+ applicationsView.dragData.ApplicationNameRole = item.modelData.ApplicationNameRole;
+ applicationsView.dragData.ApplicationIconRole = item.modelData.ApplicationIconRole;
+ applicationsView.dragData.ApplicationStorageIdRole = item.modelData.ApplicationStorageIdRole;
+ applicationsView.dragData.ApplicationEntryPathRole = item.modelData.ApplicationEntryPathRole;
+ applicationsView.dragData.ApplicationOriginalRowRole = item.modelData.ApplicationOriginalRowRole;
+
+ dragDelegate.modelData = applicationsView.dragData;
+ applicationsView.interactive = false;
+ root.reorderingApps = true;
+ dragDelegate.x = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight
+ dragDelegate.y = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight
+ dragDelegate.xTarget = mouse.x - dragDelegate.width/2;
+ dragDelegate.yTarget = mouse.y - dragDelegate.width/2;
+ dragDelegate.opacity = 1;
+ }
+ onPositionChanged: {
+ if (!applicationsView.dragData) {
+ return;
+ }
+ dragDelegate.x = mouse.x - dragDelegate.width/2;
+ dragDelegate.y = mouse.y - dragDelegate.height/2;
+
+ var pos = mapToItem(applicationsView.contentItem, mouse.x, mouse.y);
+
+ //in favorites area?
+ if (applicationsView.headerItem.favoritesStrip.contains(mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y))) {
+ pos.y = 1;
+ }
+
+ var newRow = (Math.round(applicationsView.width / applicationsView.cellWidth) * Math.floor(pos.y / applicationsView.cellHeight) + Math.floor(pos.x / applicationsView.cellWidth));
+
+ if (applicationsView.dragData.ApplicationOriginalRowRole != newRow) {
+ appListModel.moveItem(applicationsView.dragData.ApplicationOriginalRowRole, newRow);
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/homescreen/metadata.desktop
^
|
@@ -0,0 +1,17 @@
+[Desktop Entry]
+Encoding=UTF-8
+Keywords=
+Name=Phone Homescreen
+Type=Service
+
+X-KDE-ServiceTypes=Plasma/Applet,Plasma/Containment
+X-Plasma-API=declarativeappletscript
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Category=
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPLv2+
+X-KDE-PluginInfo-Name=org.kde.phone.homescreen
+X-KDE-PluginInfo-Version=
+X-KDE-PluginInfo-Website=
+X-Plasma-MainScript=ui/main.qml
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/code
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/code/LayoutManager.js
^
|
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2013 Marco Martin <mart@kde.org>
+ *
+ * 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.
+ */
+
+.pragma library
+
+
+var layout;
+var root;
+var plasmoid;
+var lastSpacer;
+
+
+function restore() {
+ var configString = String(plasmoid.configuration.AppletOrder)
+
+ //array, a cell for encoded item order
+ var itemsArray = configString.split(";");
+
+ //map applet id->order in panel
+ var idsOrder = new Object();
+ //map order in panel -> applet pointer
+ var appletsOrder = new Object();
+
+ for (var i = 0; i < itemsArray.length; i++) {
+ //property name: applet id
+ //property value: order
+ idsOrder[itemsArray[i]] = i;
+ }
+
+ for (var i = 0; i < plasmoid.applets.length; ++i) {
+ if (idsOrder[plasmoid.applets[i].id] !== undefined) {
+ appletsOrder[idsOrder[plasmoid.applets[i].id]] = plasmoid.applets[i];
+ //ones that weren't saved in AppletOrder go to the end
+ } else {
+ appletsOrder["unordered"+i] = plasmoid.applets[i];
+ }
+ }
+
+ //finally, restore the applets in the correct order
+ for (var i in appletsOrder) {
+ root.addApplet(appletsOrder[i], -1, -1)
+ }
+ //rewrite, so if in the orders there were now invalid ids or if some were missing creates a correct list instead
+ save();
+}
+
+function save() {
+ var ids = new Array();
+ for (var i = 0; i < layout.children.length; ++i) {
+ var child = layout.children[i];
+
+ if (child.applet) {
+ ids.push(child.applet.id);
+ }
+ }
+ plasmoid.configuration.AppletOrder = ids.join(';');
+}
+
+function removeApplet (applet) {
+ for (var i = layout.children.length - 1; i >= 0; --i) {
+ var child = layout.children[i];
+ if (child.applet === applet) {
+ child.destroy();
+ }
+ }
+}
+
+//insert item2 before item1
+function insertBefore(item1, item2) {
+ if (item1 === item2) {
+ return;
+ }
+ var removed = new Array();
+
+ var child;
+
+ var i;
+ for (i = layout.children.length - 1; i >= 0; --i) {
+ child = layout.children[i];
+ removed.push(child);
+ child.parent = root;
+
+ if (child === item1) {
+ break;
+ }
+ }
+
+ item2.parent = layout;
+
+ for (var j = removed.length - 1; j >= 0; --j) {
+ removed[j].parent = layout;
+ }
+ return i;
+}
+
+//insert item2 after item1
+function insertAfter(item1, item2) {
+ if (item1 === item2) {
+ return;
+ }
+ var removed = new Array();
+
+ var child;
+
+ var i;
+ for (i = layout.children.length - 1; i >= 0; --i) {
+ child = layout.children[i];
+ //never ever insert after lastSpacer
+ if (child === lastSpacer && item1 === lastSpacer) {
+ removed.push(child);
+ child.parent = root;
+ break;
+ } else if (child === item1) {
+ break;
+ }
+
+ removed.push(child);
+ child.parent = root;
+ }
+
+ item2.parent = layout;
+
+ for (var j = removed.length - 1; j >= 0; --j) {
+ removed[j].parent = layout;
+ }
+ return i;
+}
+
+function insertAtIndex(item, position) {
+ if (position < 0 || position >= layout.children.length) {
+ return;
+ }
+
+ //never ever insert after lastSpacer
+ if (layout.children[position] === lastSpacer) {
+ --position;
+ }
+
+ var removedItems = new Array();
+
+ for (var i = position; i < layout.children.length; ++i) {
+ var child = layout.children[position];
+ child.parent = root;
+ removedItems.push(child);
+ }
+
+ item.parent = layout;
+ for (var i in removedItems) {
+ removedItems[i].parent = layout;
+ }
+}
+
+function insertAtCoordinates(item, x, y) {
+ if (root.isHorizontal) {
+ y = layout.height / 2;
+ } else {
+ x = layout.width / 2;
+ }
+ var child = layout.childAt(x, y);
+
+ if (!child || child === item) {
+ child = layout.children[0];
+ }
+ item.parent = root;
+
+ //PlasmaCore.Types.Vertical = 3
+ if ((plasmoid.formFactor === 3 && y < child.y + child.height/2) ||
+ (plasmoid.formFactor !== 3 && x < child.x + child.width/2)) {
+ return insertBefore(child, item);
+ } else {
+ return insertAfter(child, item);
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/config
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/config/main.xml
^
|
@@ -0,0 +1,14 @@
+<?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="AppletOrder" type="String">
+ <label>encoded order of items</label>
+ </entry>
+ </group>
+
+</kcfg>
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/ui/SlidingPanel.qml
^
|
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2014 Marco Martin <notmart@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 Library 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 2.0
+import QtQuick.Window 2.2
+import org.kde.plasma.core 2.0 as PlasmaCore
+
+Window {
+ id: window
+ flags: Qt.WindowDoesNotAcceptFocus
+
+ property int offset: 0
+ property int overShoot: units.gridUnit * 2
+
+ color: "transparent"
+ property alias contents: contentArea.data
+
+ function updateState() {
+ var delta = offset - mouseArea.startOffset;
+ if (delta > units.gridUnit * 8) {
+ mouseArea.state = "open";
+ } else if (delta < -units.gridUnit * 8) {
+ mouseArea.state = "closed";
+ } else {
+ mouseArea.state = mouseArea.startState;
+ }
+ mouseArea.startState = mouseArea.state;
+ }
+
+ onVisibleChanged: {
+ if (visible) {
+ mouseArea.state = "draggingFromClosed";
+ mouseArea.startOffset = units.gridUnit * 4;
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ y: 0
+ width: window.width
+ height: window.height - y
+ clip: true
+ state: "closed"
+ drag.filterChildren: true
+
+ property int oldMouseY: 0
+ property int startOffset: units.iconSizes.large;
+ property string startState: "closed"
+
+ onPressed: {
+ startState = state;
+ startOffset = window.offset;
+ oldMouseY = mouse.y;
+ state = "draggingFromOpen";
+ window.offset = startOffset;
+ }
+ onPositionChanged: {
+ var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + overShoot) / overShoot)) : 1
+
+ window.offset = window.offset + (mouse.y - oldMouseY) * factor;
+ oldMouseY = mouse.y;
+ }
+ onReleased: {
+ if (Math.abs(window.offset - mouseArea.startOffset) < units.gridUnit &&
+ slidingArea.y + slidingArea.height < mouse.y) {
+ mouseArea.state = "closed";
+ } else {
+ window.updateState();
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: Qt.rgba(0, 0, 0, 0.6-Math.abs(slidingArea.y/slidingArea.height))
+ }
+ PlasmaCore.ColorScope {
+ id: slidingArea
+ width: parent.width
+ height: parent.height/1.5
+ y: Math.min(0, -height + window.offset)
+ colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+ Rectangle {
+ anchors.fill: parent
+
+ Item {
+ id: contentArea
+ anchors {
+ fill: parent
+ topMargin: overShoot
+ }
+ }
+ color: PlasmaCore.ColorScope.backgroundColor
+
+ Rectangle {
+ height: units.gridUnit
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.bottom
+ }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: Qt.rgba(0, 0, 0, 0.6)
+ }
+ GradientStop {
+ position: 0.5
+ color: Qt.rgba(0, 0, 0, 0.2)
+ }
+ GradientStop {
+ position: 1.0
+ color: "transparent"
+ }
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "closed"
+ PropertyChanges {
+ target: window
+ offset: 0
+ }
+ },
+ State {
+ name: "open"
+ PropertyChanges {
+ target: window
+ offset: slidingArea.height - overShoot
+ }
+ },
+ State {
+ name: "draggingFromOpen"
+ },
+ State {
+ name: "draggingFromClosed"
+ PropertyChanges {
+ target: window
+ offset: units.gridUnit * 4
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "draggingFromOpen"
+ },
+ Transition {
+ SequentialAnimation {
+ PropertyAnimation {
+ target: window
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ properties: "offset"
+ }
+ ScriptAction {
+ script: {
+ if (mouseArea.state == "closed") {
+ window.visible = false;
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/contents/ui/main.qml
^
|
@@ -0,0 +1,309 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.1
+
+import MeeGo.QOfono 0.2
+
+import org.kde.plasma.plasmoid 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
+
+import "plasmapackage:/code/LayoutManager.js" as LayoutManager
+
+PlasmaCore.ColorScope {
+ id: root
+ width: 480
+ height: 640
+ colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+
+ property Item toolBox
+ property int buttonHeight: width/4
+ property bool reorderingApps: false
+ property QtObject expandedApplet
+
+ Containment.onAppletAdded: {
+ addApplet(applet, x, y);
+ LayoutManager.save();
+ }
+
+ function addApplet(applet, x, y) {
+ var container = appletContainerComponent.createObject(layout)
+ container.visible = true
+ print("Applet added: " + applet)
+
+ var appletWidth = applet.width;
+ var appletHeight = applet.height;
+ applet.parent = container;
+ container.applet = applet;
+ //applet.anchors.fill = container;
+ applet.anchors.left = container.left;
+ applet.anchors.right = container.right;
+ applet.height = units.iconSizes.medium
+ applet.visible = true;
+ container.visible = true;
+
+ // If the provided position is valid, use it.
+ if (x >= 0 && y >= 0) {
+ var index = LayoutManager.insertAtCoordinates(container, x , y);
+
+ // Fall through to determining an appropriate insert position.
+ } else {
+ var before = null;
+
+ if (lastSpacer.parent === layout) {
+ before = lastSpacer;
+ }
+
+ if (before) {
+ LayoutManager.insertBefore(before, container);
+
+ // Fall through to adding at the end.
+ } else {
+ container.parent = layout;
+ }
+
+ //event compress the enable of animations
+ //startupTimer.restart();
+ }
+
+ if (applet.Layout.fillWidth) {
+ lastSpacer.parent = root;
+ } else {
+ lastSpacer.parent = layout;
+ }
+ }
+
+ Component.onCompleted: {
+ LayoutManager.plasmoid = plasmoid;
+ LayoutManager.root = root;
+ LayoutManager.layout = layout;
+ LayoutManager.restore();
+ }
+
+ RowLayout {
+ id: appletsLayout
+ Layout.minimumHeight: Math.max(root.height, Math.round(Layout.preferredHeight / root.height) * root.height)
+ }
+
+ Component {
+ id: appletContainerComponent
+ Item {
+ property Item applet
+ Layout.fillWidth: true
+ clip: true
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ height: applet && applet.expanded ? Math.max(applet.fullRepresentationItem.Layout.minimumHeight, units.iconSizes.medium) : units.iconSizes.medium
+ Behavior on height {
+ NumberAnimation {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ Connections {
+ target: applet
+ onExpandedChanged: {
+ if (root.expandedApplet) {
+ root.expandedApplet.expanded = false;
+ }
+ root.expandedApplet = applet;
+ }
+ }
+ }
+ }
+
+ Component {
+ id: tabComponent
+ PlasmaComponents.TabButton {
+ width: parent.width / parent.children.length
+ height: units.iconSizes.huge
+ }
+ }
+
+
+ PlasmaCore.DataSource {
+ id: timeSource
+ engine: "time"
+ connectedSources: ["Local"]
+ interval: 60 * 1000
+ }
+
+ OfonoManager {
+ id: ofonoManager
+ onAvailableChanged: {
+ console.log("Ofono is " + available)
+ }
+ onModemAdded: {
+ console.log("modem added " + modem)
+ }
+ onModemRemoved: console.log("modem removed")
+ }
+
+ OfonoNetworkRegistration {
+ id: netreg
+ Component.onCompleted: {
+ netreg.scan()
+ updateStrengthIcon()
+ }
+
+ onNetworkOperatorsChanged : {
+ console.log("operators :"+netreg.currentOperator["Name"].toString())
+ }
+ modemPath: ofonoManager.modems.length ? ofonoManager.modems[0] : ""
+ function updateStrengthIcon() {
+ if (netreg.strength >= 100) {
+ strengthIcon.source = "network-mobile-100";
+ } else if (netreg.strength >= 80) {
+ strengthIcon.source = "network-mobile-80";
+ } else if (netreg.strength >= 60) {
+ strengthIcon.source = "network-mobile-60";
+ } else if (netreg.strength >= 40) {
+ strengthIcon.source = "network-mobile-40";
+ } else if (netreg.strength >= 20) {
+ strengthIcon.source = "network-mobile-20";
+ } else {
+ strengthIcon.source = "network-mobile-0";
+ }
+ }
+
+ onStrengthChanged: {
+ console.log("Strength changed to " + netreg.strength)
+ updateStrengthIcon()
+ }
+ }
+
+ Rectangle {
+ parent: slidingPanel.visible ? panelContents : root
+ anchors {
+ left: parent.left
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/containments/panel/metadata.desktop
^
|
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Encoding=UTF-8
+Keywords=
+Name=Phone Panel
+Type=Service
+
+X-KDE-ServiceTypes=Plasma/Applet,Plasma/Containment
+X-Plasma-API=declarativeappletscript
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Category=
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPLv2+
+X-KDE-PluginInfo-Name=org.kde.phone.panel
+X-KDE-PluginInfo-Version=
+X-KDE-PluginInfo-Website=
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-ContainmentType=Panel
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/changelog
^
|
@@ -0,0 +1,35 @@
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppaubuntu1) vivid; urgency=medium
+
+ * Follow green island
+
+ -- Boudewijn Rempt <boud@kde.org> Tue, 03 Mar 2015 13:23:38 +0000
+
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppa) vivid; urgency=medium
+
+ * bump for Qt 5.4
+
+ -- Boudewijn Rempt <boud@kde.org> Tue, 24 Feb 2015 09:19:17 +0000
+
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppaubuntu3) vivid; urgency=medium
+
+ * add systemd to the build depds
+
+ -- Boudewijn Rempt <boud@kde.org> Wed, 11 Feb 2015 17:32:07 +0100
+
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppaubuntu2) vivid; urgency=medium
+
+ * Try again
+
+ -- Boudewijn Rempt <boud@kde.org> Wed, 11 Feb 2015 17:25:39 +0100
+
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppaubuntu1) vivid; urgency=medium
+
+ * Add system dependency
+
+ -- Boudewijn Rempt <boud@kde.org> Wed, 11 Feb 2015 17:21:00 +0100
+
+plasma-phone-components (0.1+kubuntu1-0ubuntu1~ppa) vivid; urgency=medium
+
+ * Initial release.
+
+ -- Boudewijn Rempt <boud@kde.org> Thu, 05 Feb 2015 11:07:11 +0100
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/compat
^
|
@@ -0,0 +1 @@
+9
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/control
^
|
@@ -0,0 +1,35 @@
+Source: plasma-phone-components
+Section: kde
+Priority: optional
+Maintainer: Boudewijn Rempt <boud@valdyas.org>
+Build-Depends: cmake (>= 2.6.3),
+ debhelper (>= 8.0~),
+ pkg-config,
+ pkg-kde-tools (>= 0.9),
+ extra-cmake-modules,
+ libkf5declarative-dev,
+ plasma-framework-dev,
+ libkf5service-dev,
+ qtdeclarative5-dev,
+ systemd,
+ libsystemd-dev,
+ qt5-default,
+ qtwayland,
+ greenisland
+Standards-Version: 3.9.1
+
+Package: plasma-phone-components
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends},
+ libkf5plasmaquick5,
+ plasma-workspace,
+ plasma-workspace-wallpapers,
+ breeze-icon-theme,
+ ttf-oxygen-font-family,
+ libqofono-qt5-0,
+ qtwayland,
+ systemd,
+ greenisland
+Description: Plasma Phone Components
+ This package contains the Plasma Phone components
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/copyright
^
|
@@ -0,0 +1,31 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Plasma Phone Components
+
+Files: *
+Copyright: Copyright (C) 2013-2015 Blue Systems GmbH
+License: GPL-2+
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU 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 General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+Files: debian/*
+Copyright: Copyright 2015 Blue Systems GmbH
+License: GPL-2+
+ [LICENSE TEXT]
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/rules
^
|
@@ -0,0 +1,15 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export LDFLAGS += -Wl,--as-needed
+
+%:
+ dh $@ --parallel --with kde --with sodeps
+
+override_dh_auto_configure:
+ dh_auto_configure -Skde -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+.PHONY: override_dh_auto_test
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/source
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/debian/source/format
^
|
@@ -0,0 +1 @@
+3.0 (quilt)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/CMakeLists.txt
^
|
@@ -0,0 +1,5 @@
+
+kpackage_install_package(package org.kde.phone.dialer genericqml)
+install(FILES package/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.phone.dialer.desktop)
+
+add_subdirectory(src)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Call
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Call/AnswerSwipe.qml
^
|
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.nemomobile.voicecall 1.0
+
+MouseArea {
+ id: root
+
+ signal accepted
+ signal rejected
+
+ Layout.minimumHeight: units.gridUnit * 5
+ Layout.fillWidth: true
+ property int handlePosition: (answerHandle.x + answerHandle.width/2)
+ drag {
+ target: answerHandle
+ axis: Drag.XAxis
+ minimumX: 0
+ maximumX: width - answerHandle.width
+ }
+ Rectangle {
+ anchors.fill: parent
+ radius: height
+ color: Qt.rgba((handlePosition > root.width/2 ? 0.6 : 0)+0.2, (handlePosition < root.width/2 ? 0.6 : 0)+0.2, 0.2, Math.abs(handlePosition - (root.width/2)) / answerHandle.width/2);
+
+ PlasmaCore.IconItem {
+ source: "call-start"
+ width: icon.width
+ height: width
+ anchors {
+ verticalCenter: parent.verticalCenter
+ left: parent.left
+ leftMargin: units.largeSpacing
+ }
+ }
+ PlasmaCore.IconItem {
+ source: "call-stop"
+ width: icon.width
+ height: width
+ anchors {
+ verticalCenter: parent.verticalCenter
+ right: parent.right
+ leftMargin: units.largeSpacing
+ }
+ }
+
+ Rectangle {
+ id: answerHandle
+ x: parent.width/2 - width/2
+ height: parent.height
+ width: height
+ radius: width
+ color: Qt.rgba(0.2, 0.8, 0.2, 1)
+ PlasmaCore.IconItem {
+ id: icon
+ source: "call-start"
+ width: parent.width * 0.7
+ height: width
+ anchors.centerIn: parent
+ }
+ Behavior on x {
+ enabled: root.pressed
+ XAnimator {
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+ onReleased: {
+ if (answerHandle.x <= answerHandle.width) {
+ root.accepted();
+ } else if (answerHandle.x + answerHandle.width >= root.width - answerHandle.width) {
+ root.rejected();
+ }
+
+ answerHandle.x = width/2 - answerHandle.width/2
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Call/Avatar.qml
^
|
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+
+Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumHeight: parent.height/2
+ Rectangle {
+ height: Math.min(parent.width, parent.height)
+ width: height
+ radius: 5
+ anchors.centerIn: parent
+ PlasmaCore.IconItem {
+ anchors {
+ fill: parent
+ centerIn: parent
+ margins: 20
+ }
+ source: "im-user"
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Call/CallPage.qml
^
|
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.nemomobile.voicecall 1.0
+
+import "../Dialpad"
+
+Item {
+ id: callPage
+
+ state: voiceCallmanager.activeVoiceCall ? voiceCallmanager.activeVoiceCall.statusText : "disconnected"
+ property int status: voiceCallmanager.activeVoiceCall ? voiceCallmanager.activeVoiceCall.status : 0
+
+ property string providerId: voiceCallmanager.providers.id(0)
+
+ function secondsToTimeString(seconds) {
+ seconds = Math.floor(seconds/1000)
+ var h = Math.floor(seconds / 3600);
+ var m = Math.floor((seconds - (h * 3600)) / 60);
+ var s = seconds - h * 3600 - m * 60;
+ if(h < 10) h = '0' + h;
+ if(m < 10) m = '0' + m;
+ if(s < 10) s = '0' + s;
+ return '' + h + ':' + m + ':' + s;
+ }
+
+ onStatusChanged: {
+ if (status != 1) {
+ dialerButton.checked = false;
+ }
+ }
+
+ ColumnLayout {
+ id: activeCallUi
+ spacing: 10
+
+ anchors {
+ fill: parent
+ margins: 20
+ }
+
+ Flickable {
+ id: topFlickable
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumHeight: parent.height/2
+
+ contentWidth: topContents.width
+ contentHeight: topContents.height
+ interactive: status == 1;
+ Row {
+ id: topContents
+ Avatar {
+ width: topFlickable.width
+ height: topFlickable.height
+ }
+ Dialpad {
+ width: topFlickable.width
+ height: topFlickable.height
+
+ callback: function (string) {
+ if (voiceCallmanager.activeVoiceCall) {
+ voiceCallmanager.activeVoiceCall.sendDtmf(string);
+ }
+ }
+ }
+ }
+
+ onMovingChanged: {
+ var checked = contentX > topFlickable.width/2;
+
+ if (checked) {
+ topSlideAnim.to = topFlickable.width;
+ } else {
+ topSlideAnim.to = 0;
+ }
+ dialerButton.checked = checked;
+ topSlideAnim.running = true;
+ }
+ PropertyAnimation {
+ id: topSlideAnim
+ target: topFlickable
+ properties: "contentX"
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+
+ PlasmaComponents.Label {
+ Layout.fillWidth: true
+ Layout.minimumHeight: implicitHeight
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ font.pointSize: theme.defaultFont.pointSize * 2
+ text: voiceCallmanager.activeVoiceCall ? voiceCallmanager.activeVoiceCall.lineId : ""
+ }
+ PlasmaComponents.Label {
+ Layout.fillWidth: true
+ Layout.minimumHeight: implicitHeight
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ text: {
+ if (!voiceCallmanager.activeVoiceCall) {
+ return '';
+ //STATUS_DIALING
+ } else if (voiceCallmanager.activeVoiceCall.status == 3) {
+ return i18n("Calling...");
+ } else if (voiceCallmanager.activeVoiceCall.duration > 0) {
+ return secondsToTimeString(voiceCallmanager.activeVoiceCall.duration);
+ } else {
+ return '';
+ }
+ }
+ }
+ PlasmaComponents.ButtonRow {
+ opacity: status == 1 ? 1 : 0
+ exclusive: false
+ spacing: 0
+ Layout.alignment: Qt.AlignHCenter
+ PlasmaComponents.ToolButton {
+ id: muteButton
+ flat: false
+ iconSource: voiceCallmanager.isMicrophoneMuted ? "audio-volume-muted" : "audio-volume-high"
+ onClicked: {
+ voiceCallmanager.isMicrophoneMuted = !voiceCallmanager.isMicrophoneMuted;
+ }
+ }
+ PlasmaComponents.ToolButton {
+ id: dialerButton
+ flat: false
+ iconSource: "input-keyboard"
+ checkable: true
+ onCheckedChanged: {
+ if (checked) {
+ topSlideAnim.to = topFlickable.width;
+ } else {
+ topSlideAnim.to = 0;
+ }
+ topSlideAnim.running = true;
+ }
+ }
+ }
+
+
+ Item {
+ Layout.minimumHeight: units.gridUnit * 5
+ Layout.fillWidth: true
+
+ AnswerSwipe {
+ anchors.fill: parent
+ //STATUS_INCOMING
+ visible: status == 5
+ onAccepted: {
+ if (voiceCallmanager.activeVoiceCall) {
+ voiceCallmanager.activeVoiceCall.answer();
+ }
+ }
+ onRejected: {
+ if (voiceCallmanager.activeVoiceCall) {
+ voiceCallmanager.activeVoiceCall.hangup();
+ }
+ }
+ }
+
+ PlasmaComponents.Button {
+ anchors.fill: parent
+ //STATUS_INCOMING
+ visible: status != 5
+ iconSource: "call-stop"
+ Layout.fillWidth: true
+ text: i18n("End Call")
+ onClicked: {
+ if (voiceCallmanager.activeVoiceCall) {
+ voiceCallmanager.activeVoiceCall.hangup();
+ }
+ }
+ }
+ }
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer/Contacts.qml
^
|
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Item {
+ PlasmaComponents.Label {
+ anchors.centerIn: parent
+ text: i18n("No contacts")
+ }
+}
\ No newline at end of file
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer/DialPage.qml
^
|
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Column {
+ spacing: 0
+ PlasmaComponents.TabGroup {
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ height: parent.height - tabbar.height
+ History {
+ id: history
+ }
+ Contacts {
+ id: contacts
+ }
+ Dialer {
+ id: dialer
+ }
+ }
+ PlasmaComponents.TabBar {
+ id: tabbar
+ height: units.gridUnit * 5
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ tabPosition: Qt.BottomEdge
+ PlasmaComponents.TabButton {
+ iconSource: "view-history"
+ text: i18n("History")
+ tab: history
+ }
+ PlasmaComponents.TabButton {
+ iconSource: "view-pim-contacts"
+ text: i18n("Contacts")
+ tab: contacts
+ }
+ PlasmaComponents.TabButton {
+ iconSource: "input-keyboard"
+ text: i18n("Dialpad")
+ tab: dialer
+ }
+ }
+}
\ No newline at end of file
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer/Dialer.qml
^
|
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2014 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.nemomobile.voicecall 1.0
+import "../Dialpad"
+
+Item {
+ id: dialer
+
+ property alias numberEntryText: status.text
+
+ property string providerId: voiceCallmanager.providers.id(0)
+
+ function addNumber(number) {
+ status.text = status.text + number
+ }
+
+ ColumnLayout {
+ id: dialPadArea
+
+ anchors {
+ fill: parent
+ margins: units.largeSpacing
+ }
+ PlasmaComponents.Label {
+ id: status
+ Layout.fillWidth: true
+ Layout.minimumHeight: parent.height / 6
+ Layout.maximumHeight: Layout.minimumHeight
+ horizontalAlignment: Qt.AlignRight
+ verticalAlignment: Qt.AlignVCenter
+ font.pointSize: 1024
+ fontSizeMode: Text.Fit
+ }
+
+ Dialpad {
+ callback: function (string) {
+ addNumber(string);
+ }
+ pressedCallback: function (string) {
+ voiceCallmanager.startDtmfTone(string);
+ }
+ releasedCallback: function (string) {
+ voiceCallmanager.stopDtmfTone();
+ }
+ }
+
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.minimumHeight: parent.height / 6
+ Layout.maximumHeight: Layout.minimumHeight
+ DialerIconButton {
+ id: callButton
+ Layout.minimumWidth: dialPadArea.width/3
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ enabled: status.text.length > 0
+ opacity: enabled ? 1 : 0.5
+ source: "call-start"
+ callback: function() {
+ call(status.text);
+ }
+ }
+ Item {
+ Layout.minimumWidth: dialPadArea.width/3
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+ DialerIconButton {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumWidth: dialPadArea.width/3
+ enabled: status.text.length > 0
+ opacity: enabled ? 1 : 0.5
+ source: "edit-clear"
+ callback: function(text) {
+ if (status.text.length > 0) {
+ status.text = status.text.substr(0, status.text.length - 1);
+ }
+ }
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer/History.qml
^
|
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+Item {
+
+ function secondsToTimeString(seconds) {
+ seconds = Math.floor(seconds/1000)
+ var h = Math.floor(seconds / 3600);
+ var m = Math.floor((seconds - (h * 3600)) / 60);
+ var s = seconds - h * 3600 - m * 60;
+ if(h < 10) h = '0' + h;
+ if(m < 10) m = '0' + m;
+ if(s < 10) s = '0' + s;
+ return '' + h + ':' + m + ':' + s;
+ }
+
+ PlasmaComponents.Label {
+ anchors.centerIn: parent
+ text: i18n("No recent calls")
+ visible: historyModel.count == 0
+ }
+
+ ColumnLayout {
+ anchors.fill: parent
+ visible: historyModel.count > 0
+ PlasmaComponents.ToolBar {
+ Layout.fillWidth: true
+ tools: RowLayout {
+ id: toolBarLayout
+ PlasmaComponents.TabBar {
+ tabPosition: Qt.TopEdge
+ PlasmaComponents.TabButton {
+ iconSource: "call-start"
+ text: i18n("All")
+ onCheckedChanged: {
+ if (checked) {
+ filterModel.filterString = "";
+ }
+ }
+ }
+ PlasmaComponents.TabButton {
+ iconSource: "list-remove"
+ text: i18n("Missed")
+ onCheckedChanged: {
+ if (checked) {
+ filterModel.filterString = "0";
+ }
+ }
+ }
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+ PlasmaComponents.Button {
+ text: i18n("Clear")
+ onClicked: clearHistory();
+ }
+ }
+ }
+ PlasmaExtras.ScrollArea {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ ListView {
+ id: view
+ model: PlasmaCore.SortFilterModel {
+ id: filterModel
+ sourceModel: historyModel
+ filterRole: "callType"
+ sortRole: "time"
+ sortOrder: Qt.DescendingOrder
+ }
+ section {
+ property: "date"
+ delegate: PlasmaComponents.ListItem {
+ id: sectionItem
+ sectionDelegate: true
+ PlasmaComponents.Label {
+ text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));
+ }
+ }
+ }
+ delegate: HistoryDelegate {}
+ }
+ }
+ }
+}
\ No newline at end of file
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialer/HistoryDelegate.qml
^
|
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+Item {
+ id: delegateParent
+ width: view.width
+ height: childrenRect.height
+
+ Behavior on height {
+ SpringAnimation { spring: 5; damping: 0.3 }
+ }
+ SequentialAnimation {
+ id: removeAnim
+ XAnimator {
+ target: delegate
+ from: delegate.x
+ to: delegate.x > 0 ? width : -width
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ PropertyAnimation {
+ target: delegateParent
+ properties: "height"
+ to: 0
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ ScriptAction {
+ script: removeCallFromHistory(model.originalIndex);
+ }
+ }
+
+ XAnimator {
+ id: resetAnim
+ target: delegate
+ from: delegate.x
+ to: 0
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+
+ PlasmaComponents.ListItem {
+ id: delegate
+
+ MouseArea {
+ width: parent.width
+ height: childrenRect.height
+ onClicked: call(model.number);
+ drag.axis: Drag.XAxis
+ drag.target: delegate
+ onReleased: {
+ if (drag.active) {
+ if (delegate.x > delegate.width / 3 || delegate.x < width / -3) {
+ removeAnim.running = true;
+ } else {
+ resetAnim.running = true;
+ }
+ }
+ }
+
+ RowLayout {
+ width: parent.width
+ //FIXME: ad hoc icons
+ PlasmaCore.IconItem {
+ width: units.iconSizes.medium
+ height: width
+ source: {
+ switch (model.callType) {
+ case 0:
+ return "list-remove";
+ case 1:
+ return "go-down";
+ case 2:
+ return "go-up";
+ }
+ }
+ }
+ ColumnLayout {
+ PlasmaComponents.Label {
+ text: "Name (todo)"
+ }
+ PlasmaComponents.Label {
+ text: i18n("Number: %1", model.number)
+ Layout.fillWidth: true
+ }
+ }
+ ColumnLayout {
+ PlasmaComponents.Label {
+ Layout.alignment: Qt.AlignRight
+ text: Qt.formatTime(model.time, Qt.locale().timeFormat(Locale.ShortFormat));
+ }
+ PlasmaComponents.Label {
+ Layout.alignment: Qt.AlignRight
+ text: i18n("Duration: %1", secondsToTimeString(model.duration));
+ }
+ }
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialpad
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialpad/DialerButton.qml
^
|
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2014 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+PlasmaComponents.Label {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ //This is 0 to override the Label default height that would cause a binding loop
+ height: 0
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ font.pointSize: 1024
+ fontSizeMode: Text.VerticalFit
+
+ property alias sub: longHold.text
+ property var callback
+ property var pressedCallback
+ property var releasedCallback
+
+ Rectangle {
+ anchors.fill: parent
+ z: -1
+ color: PlasmaCore.ColorScope.highlightColor
+ radius: units.smallSpacing
+ opacity: mouse.pressed ? 0.4 : 0
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onPressed: {
+ if (pressedCallback) {
+ pressedCallback(parent.text);
+ } else if (pad.pressedCallback) {
+ pad.pressedCallback(parent.text);
+ }
+ }
+ onReleased: {
+ if (releasedCallback) {
+ releasedCallback(parent.text);
+ } else if (pad.releasedCallback) {
+ pad.releasedCallback(parent.text);
+ }
+ }
+ onCanceled: {
+ if (releasedCallback) {
+ releasedCallback(parent.text);
+ } else if (pad.releasedCallback) {
+ pad.releasedCallback(parent.text);
+ }
+ }
+
+ onClicked: {
+ if (callback) {
+ callback(parent.text);
+ } else if (pad.callback) {
+ pad.callback(parent.text);
+ }
+ }
+
+ onPressAndHold: {
+ var text;
+ if (longHold.visible) {
+ text = longHold.text;
+ } else {
+ text = parent.text;
+ }
+
+ if (text.length > 1) {
+ return;
+ }
+
+ if (callback) {
+ callback(text);
+ } else if (pad.callback) {
+ pad.callback(text);
+ }
+ }
+ }
+
+ PlasmaComponents.Label {
+ id: longHold
+ anchors {
+ verticalCenter: parent.verticalCenter
+ right: parent.right
+ rightMargin: units.largeSpacing
+ }
+ height: parent.height * 0.4
+ width: parent.width / 4
+ verticalAlignment: Qt.AlignVCenter
+ visible: text.length > 0
+ opacity: 0.6
+
+ font.pointSize: 1024
+ fontSizeMode: Text.Fit
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialpad/DialerIconButton.qml
^
|
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2014 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.4
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Item {
+ id: buttonRoot
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ property var callback
+ property var pressedCallback
+ property var releasedCallback
+ property string sub
+ property alias source: icon.source
+ property alias text: label.text
+
+ Rectangle {
+ anchors.fill: parent
+ z: -1
+ color: PlasmaCore.ColorScope.highlightColor
+ radius: units.smallSpacing
+ opacity: mouse.pressed ? 0.4 : 0
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ Row {
+ anchors.centerIn: parent
+ PlasmaCore.IconItem {
+ id: icon
+ anchors.verticalCenter: parent.verticalCenter
+ width: height
+ height: buttonRoot.height * 0.6
+ }
+ PlasmaComponents.Label {
+ id: label
+ height: buttonRoot.height
+ anchors.verticalCenter: parent.verticalCenter
+ font.pointSize: 1024
+ fontSizeMode: Text.VerticalFit
+ }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onClicked: {
+ if (callback) {
+ callback(parent.text);
+ } else {
+ addNumber(parent.text);
+ }
+ }
+
+ onPressAndHold: {
+ var text;
+ if (longHold.visible) {
+ text = longHold.text;
+ } else {
+ text = parent.text;
+ }
+
+ if (callback) {
+ callback(text);
+ } else if (pad.callback) {
+ pad.callback(text);
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/Dialpad/Dialpad.qml
^
|
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2014 Marco Martin <mart@kde.org>
+ *
+ * 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 Library 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 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+GridLayout {
+ id: pad
+ columns: 3
+
+ property var callback
+ property var pressedCallback
+ property var releasedCallback
+
+ property int buttonHeight: parent.height / 6
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ DialerButton { id: one; text: "1" }
+ DialerButton { text: "2"; sub: "ABC" }
+ DialerButton { text: "3"; sub: "DEF" }
+
+ DialerButton { text: "4"; sub: "GHI" }
+ DialerButton { text: "5"; sub: "JKL" }
+ DialerButton { text: "6"; sub: "MNO" }
+
+ DialerButton { text: "7"; sub: "PQRS" }
+ DialerButton { text: "8"; sub: "TUV" }
+ DialerButton { text: "9"; sub: "WXYZ" }
+
+ DialerButton { text: "*"; }
+ DialerButton { text: "0"; sub: "+"; }
+ DialerButton { text: "#" }
+}
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/contents/ui/main.qml
^
|
@@ -0,0 +1,296 @@
+/**
+ * Copyright 2014 Aaron Seigo <aseigo@kde.org>
+ * Copyright 2014 Marco Martin <mart@kde.org>
+ *
+ * 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 2.3
+import QtQuick.Controls 1.3
+import QtQuick.Layouts 1.1
+import QtQuick.LocalStorage 2.0
+import org.nemomobile.voicecall 1.0
+import MeeGo.QOfono 0.2
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+ApplicationWindow {
+ id: root
+
+//BEGIN PROPERTIES
+ width: 600
+ height: 800
+
+ property int status: voiceCallmanager.activeVoiceCall ? voiceCallmanager.activeVoiceCall.status : 0
+ //keep track of the status we were in
+ property int previousStatus
+ //keep track if we were visible when ringing
+ property bool wasVisible
+ //support a single provider for now
+ property string providerId: voiceCallmanager.providers.id(0)
+ //was the last call an incoming one?
+ property bool isIncoming
+//END PROPERTIES
+
+//BEGIN SIGNAL HANDLERS
+ onStatusChanged: {
+ //STATUS_ACTIVE
+ if (status == 1) {
+ root.isIncoming = voiceCallmanager.activeVoiceCall.isIncoming;
+ //STATUS_INCOMING
+ } else if (status == 5) {
+ wasVisible = root.visible;
+ root.visible = true;
+ dialerUtils.notifyRinging();
+ //Was STATUS_INCOMING now is STATUS_DISCONNECTED: Missed call!
+ } else if (status == 7 && previousStatus == 5) {
+ var prettyDate = Qt.formatTime(voiceCallmanager.activeVoiceCall.startedAt, Qt.locale().timeFormat(Locale.ShortFormat));
+ dialerUtils.notifyMissedCall(voiceCallmanager.activeVoiceCall.lineId, i18n("%1 called at %2", voiceCallmanager.activeVoiceCall.lineId, prettyDate));
+ root.visible = wasVisible;
+ insertCallInHistory(voiceCallmanager.activeVoiceCall.lineId, 0, 0);
+ } else if (status == 7) {
+ insertCallInHistory(voiceCallmanager.activeVoiceCall.lineId, voiceCallmanager.activeVoiceCall.duration, isIncoming ? 1 : 2);
+ }
+
+ if (status != 5) {
+ dialerUtils.stopRinging();
+ }
+
+ previousStatus = status;
+ }
+
+ Connections {
+ target: dialerUtils
+ onMissedCallsActionTriggered: {
+ root.visible = true;
+ }
+ }
+
+ onVisibleChanged: {
+ //reset missed calls if the status is not STATUS_INCOMING when got visible
+ if (visible && status != 5) {
+ dialerUtils.resetMissedCalls();
+ }
+ }
+//END SIGNAL HANDLERS
+
+//BEGIN FUNCTIONS
+ function call(number) {
+ if (!voiceCallmanager.activeVoiceCall) {
+ console.log("Calling: " + providerId + " " + number);
+ voiceCallmanager.dial(providerId, number);
+
+ } else {
+ console.log("Hanging up: " + voiceCallmanager.activeVoiceCall.lineId);
+ status.text = '';
+ var call = voiceCallmanager.activeVoiceCall;
+ if (call) {
+ call.hangup();
+ }
+ }
+ }
+
+ function insertCallInHistory(number, duration, callType) {
+ //DATABSE
+ var db = LocalStorage.openDatabaseSync("PlasmaPhoneDialer", "1.0", "Call history of the Plasma Phone dialer", 1000000);
+
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql("INSERT INTO History VALUES(NULL, ?, datetime('now'), ?, ? )", [number, duration, callType]);
+
+ var rs = tx.executeSql('SELECT * FROM History where id=?', [rs.insertId]);
+
+ for(var i = 0; i < rs.rows.length; i++) {
+ var row = rs.rows.item(i);
+ row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
+ row.originalIndex = historyModel.count;
+ historyModel.append(row);
+ }
+ }
+ )
+ }
+
+ //index is historyModel row number, not db id and not sortmodel row number
+ function removeCallFromHistory(index) {
+ var item = historyModel.get(index);
+
+ if (!item) {
+ return;
+ }
+
+ var db = LocalStorage.openDatabaseSync("PlasmaPhoneDialer", "1.0", "Call history of the Plasma Phone dialer", 1000000);
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql("DELETE from History WHERE id=?", [item.id]);
+ }
+ )
+
+ historyModel.remove(index);
+ }
+
+ function clearHistory() {
+ var db = LocalStorage.openDatabaseSync("PlasmaPhoneDialer", "1.0", "Call history of the Plasma Phone dialer", 1000000);
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql("DELETE from History");
+ }
+ )
+
+ historyModel.clear();
+ }
+
+//END FUNCTIONS
+
+//BEGIN DATABASE
+ Component.onCompleted: {
+ //HACK: make sure activeVoiceCall is loaded if already existing
+ voiceCallmanager.voiceCalls.onVoiceCallsChanged();
+ voiceCallmanager.onActiveVoiceCallChanged();
+
+ //DATABSE
+ var db = LocalStorage.openDatabaseSync("PlasmaPhoneDialer", "1.0", "Call history of the Plasma Phone dialer", 1000000);
+
+ db.transaction(
+ function(tx) {
+ // Create the database if it doesn't already exist
+ //callType: wether is incoming, outgoing, unanswered
+ tx.executeSql('CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, time DATETIME, duration INTEGER, callType INTEGER)');
+
+ var rs = tx.executeSql('SELECT * FROM History');
+
+ for(var i = 0; i < rs.rows.length; i++) {
+ var row = rs.rows.item(i);
+ row.date = Qt.formatDate(row.time, "yyyy-MM-dd");
+ row.originalIndex = historyModel.count;
+ historyModel.append(row);
+ }
+ }
+ )
+ }
+//END DATABASE
+
+//BEGIN MODELS
+ ListModel {
+ id: historyModel
+ }
+
+ OfonoManager {
+ id: ofonoManager
+ onAvailableChanged: {
+ console.log("Ofono is " + available)
+ }
+ onModemAdded: {
+ console.log("modem added " + modem)
+ }
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/package/metadata.desktop
^
|
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Comment=Plasma phone dialer
+Encoding=UTF-8
+Keywords=
+Name=Phone
+Type=Application
+Icon=call-start
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Category=Communications
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-Name=org.kde.phone.dialer
+X-KDE-PluginInfo-Version=
+X-KDE-PluginInfo-Website=
+X-KDE-ServiceTypes=KPackage/Generic
+Exec=plasmaphonedialer
+
+X-Plasma-MainScript=ui/main.qml
+X-Plasma-RemoteLocation=
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src/CMakeLists.txt
^
|
@@ -0,0 +1,26 @@
+
+
+set(plasmaphonedialer_SRCS
+ main.cpp
+ dialerutils.cpp
+)
+
+add_executable(plasmaphonedialer ${plasmaphonedialer_SRCS})
+target_compile_definitions(plasmaphonedialer PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
+
+#find_package(ActiveApp REQUIRED)
+
+target_link_libraries(plasmaphonedialer
+ Qt5::Gui
+ Qt5::Quick
+ Qt5::Widgets
+ KF5::Declarative
+ KF5::I18n
+ KF5::Package
+ KF5::QuickAddons
+ KF5::DBusAddons
+ KF5::Notifications
+)
+
+install(TARGETS plasmaphonedialer ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(FILES plasma_dialer.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src/dialerutils.cpp
^
|
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * 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 General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "dialerutils.h"
+
+#include <QDebug>
+
+#include <KLocalizedString>
+
+DialerUtils::DialerUtils(QObject *parent)
+: QObject(parent),
+ m_missedCalls(0)
+{
+}
+
+DialerUtils::~DialerUtils()
+{
+}
+
+void DialerUtils::notifyMissedCall(const QString &caller, const QString &description)
+{
+ qWarning() << "Missed Call.";
+
+ ++m_missedCalls;
+ if (!m_callsNotification) {
+ m_callsNotification = new KNotification("callMissed", KNotification::Persistent, 0);
+ }
+ m_callsNotification->setComponentName("plasma_dialer");
+ m_callsNotification->setIconName("call-start");
+ if (m_missedCalls == 1) {
+ m_callsNotification->setTitle(i18n("Missed call from %1", caller));
+ m_callsNotification->setText(description);
+ } else {
+ m_callsNotification->setTitle(i18n("%1 calls missed", m_missedCalls));
+ m_callsNotification->setText(i18n("Last call: %1", description));
+ }
+
+ QStringList actions;
+ actions.append(i18n("View"));
+ m_callsNotification->setActions(actions);
+ QObject::connect(m_callsNotification.data(), &KNotification::action1Activated,
+ [=]() {
+ qWarning()<<"View action activated";
+ emit missedCallsActionTriggered();
+ resetMissedCalls();
+ });
+
+ if (m_missedCalls == 1) {
+ m_callsNotification->sendEvent();
+ } else {
+ m_callsNotification->update();
+ }
+}
+
+void DialerUtils::resetMissedCalls()
+{
+ m_missedCalls = 0;
+ if (m_callsNotification) {
+ m_callsNotification->close();
+ }
+ m_callsNotification.clear();
+}
+
+void DialerUtils::notifyRinging()
+{
+ if (!m_ringingNotification) {
+ m_ringingNotification = new KNotification("ringing", KNotification::Persistent|KNotification::LoopSound, 0);
+ m_ringingNotification->setComponentName("plasma_dialer");
+ }
+ m_ringingNotification->sendEvent();
+}
+
+void DialerUtils::stopRinging()
+{
+ if (m_ringingNotification) {
+ m_ringingNotification->close();
+ }
+}
+
+#include "moc_dialerutils.cpp"
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src/dialerutils.h
^
|
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * 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 General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef DIALERUTILS_H
+#define DIALERUTILS_H
+
+#include <QObject>
+#include <QPointer>
+#include <KNotification>
+
+class DialerUtils : public QObject
+{
+ Q_OBJECT
+public:
+
+ DialerUtils(QObject *parent = 0);
+ virtual ~DialerUtils();
+
+ Q_INVOKABLE void notifyMissedCall(const QString &caller, const QString &description);
+ Q_INVOKABLE void resetMissedCalls();
+ Q_INVOKABLE void notifyRinging();
+ Q_INVOKABLE void stopRinging();
+
+Q_SIGNALS:
+ void missedCallsActionTriggered();
+
+private:
+ QPointer <KNotification> m_callsNotification;
+ QPointer <KNotification> m_ringingNotification;
+ int m_missedCalls;
+};
+
+
+#endif
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src/main.cpp
^
|
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * 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.
+ */
+
+#include <QApplication>
+
+#include "dialerutils.h"
+
+#include <klocalizedstring.h>
+#include <qcommandlineparser.h>
+#include <qcommandlineoption.h>
+#include <QQuickItem>
+#include <QtQml>
+
+#include <kpackage/package.h>
+#include <kpackage/packageloader.h>
+#include <QQmlContext>
+#include <QQmlEngine>
+#include <QQmlExpression>
+#include <QQmlProperty>
+#include <QQuickWindow>
+#include <kdeclarative/qmlobject.h>
+#include <KAboutData>
+#include <KDBusService>
+
+int main(int argc, char **argv)
+{
+ QCommandLineParser parser;
+ QApplication app(argc, argv);
+
+ app.setQuitOnLastWindowClosed(false);
+ KDBusService service(KDBusService::Unique);
+
+ const QString description = i18n("Plasma Phone Dialer");
+ const char version[] = PROJECT_VERSION;
+
+ app.setApplicationVersion(version);
+ parser.addVersionOption();
+ parser.addHelpOption();
+ parser.setApplicationDescription(description);
+
+ QCommandLineOption daemonOption("daemon", "Daemon mode. run without displaying anything.");
+
+ parser.addOption(daemonOption);
+
+ parser.process(app);
+
+ const QString packagePath("org.kde.phone.dialer");
+
+ //usually we have an ApplicationWindow here, so we do not need to create a window by ourselves
+ KDeclarative::QmlObject *obj = new KDeclarative::QmlObject();
+ obj->setTranslationDomain(packagePath);
+ obj->setInitializationDelayed(true);
+ obj->loadPackage(packagePath);
+ obj->engine()->rootContext()->setContextProperty("commandlineArguments", parser.positionalArguments());
+
+ DialerUtils *dialerUtils = new DialerUtils;
+ obj->engine()->rootContext()->setContextProperty("dialerUtils", QVariant::fromValue(dialerUtils));
+
+ obj->completeInitialization();
+
+ if (!obj->package().metadata().isValid()) {
+ return -1;
+ }
+
+ KPluginMetaData data = obj->package().metadata();
+ // About data
+ KAboutData aboutData(data.pluginId(), data.name(), data.version(), data.description(), KAboutLicense::byKeyword(data.license()).key());
+
+ for (auto author : data.authors()) {
+ aboutData.addAuthor(author.name(), author.task(), author.emailAddress(), author.webAddress(), author.ocsUsername());
+ }
+
+ //The root is not a window?
+ //have to use a normal QQuickWindow since the root item is already created
+ QWindow *window = qobject_cast<QWindow *>(obj->rootObject());
+ if (window) {
+ QObject::connect(&service, &KDBusService::activateRequested, [=](const QStringList &arguments, const QString &workingDirectory) {
+ Q_UNUSED(arguments)
+ Q_UNUSED(workingDirectory);
+ window->show();
+ window->requestActivate();
+ });
+ if (!parser.isSet(daemonOption)) {
+ window->show();
+ window->requestActivate();
+ }
+ window->setTitle(obj->package().metadata().name());
+ window->setIcon(QIcon::fromTheme(obj->package().metadata().iconName()));
+ } else {
+ qWarning() << "Error loading the ApplicationWindow";
+ }
+
+ return app.exec();
+}
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/dialer/src/plasma_dialer.notifyrc
^
|
@@ -0,0 +1,15 @@
+[Global]
+IconName=call-start
+Comment=Phone
+
+[Event/callMissed]
+Name=Missed Call
+Comment=A call has been missed
+Action=Popup
+
+[Event/ringing]
+Name=Ringing
+Comment=The phone is ringing
+Action=Sound
+Sound=KDE-Sys-Question.ogg
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards/Card.qml
^
|
@@ -0,0 +1,23 @@
+
+import QtQuick 2.1
+
+Rectangle {
+ id: cardRoot
+ color: "red"
+ width: parent.width
+ height: parent.height
+ y: Math.max(Math.min((height - root.cardMargins * (parent.children.length - step)), (root.scrollValue + height * step)),
+ root.cardMargins*step)
+ property int step: 0
+ property bool current: root.scrollValue + cardRoot.height * step == 0
+
+ Image {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.top
+ }
+ opacity: (root.cardMargins/20)*0.4
+ source: "top-shadow.png"
+ }
+}
|
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards/bottom-shadow.png
^
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards/main.qml
^
|
@@ -0,0 +1,148 @@
+
+import QtQuick 2.1
+import org.kde.kquickcontrolsaddons 2.0
+
+Rectangle {
+ id: root
+ width: 300
+ height: 500
+ property real scrollValue: 0
+ property real cardMargins: 20
+ property bool scrollingEnabled: true
+ Behavior on scrollValue {
+ id: scrollAnim
+ NumberAnimation {
+ duration: 150
+ }
+ }
+ Behavior on cardMargins {
+ PropertyAnimation {
+ duration: 500
+ }
+ }
+
+ Text {
+ anchors.centerIn: parent
+ text: "Settings stuff"
+ font.pointSize: 20
+ }
+ MouseEventListener {
+ anchors.fill: parent
+ property real oldY: 0
+ onPressed: {
+ scrollAnim.enabled = false;
+ oldY = mouse.y
+ }
+ onPositionChanged: {
+ if (!root.scrollingEnabled) {
+ return;
+ }
+ scrollValue += (mouse.y - oldY)
+ oldY = mouse.y
+ }
+ onReleased: {
+ scrollAnim.enabled = true;
+ scrollValue = Math.round(scrollValue / root.height) * root.height
+ }
+ Card {
+ step: 0
+ color: "red"
+ Text {
+ anchors.centerIn: parent
+ text: "13:37"
+ font.pointSize: 40
+ }
+ }
+ Card {
+ id: appCard
+ step: 1
+ color: "green"
+ property bool switching: true
+ onSwitchingChanged: {
+ if (switching) {
+ root.cardMargins = 20
+ } else {
+ root.cardMargins = 0
+ }
+ }
+ onCurrentChanged: {
+ if (!current) {
+ switching = true;
+ }
+ }
+
+ Item {
+ width: parent.width
+ height: parent.height
+ scale: !appCard.current || appCard.switching ? 0.4 : 1
+ y: appCard.switching ? -70 : 0
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 150
+ }
+ }
+ Behavior on y {
+ PropertyAnimation {
+ duration: 150
+ }
+ }
+ Rectangle {
+ z: 2
+ anchors.top: parent.top
+ width: parent.width
+ height: parent.height
+ Text {
+ anchors.centerIn: parent
+ text: "APP"
+ font.pointSize: 40
+ }
+
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: appCard.switching = false
+ }
+ }
+
+ }
+ ListView {
+ orientation: ListView.Horizontal
+ spacing: 4
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: parent.height/2.5
+ model: 4
+ delegate: Rectangle {
+ height: parent.height
+ width: height / (root.height/root.width)
+ }
+ }
+ }
+ Card {
+ id: appsCard
+ step: 2
+ color: "blue"
+ GridView {
+ id: grid
+ clip: true
+ anchors.fill: parent
+ model: 50
+ onAtYBeginningChanged: {
+ root.scrollingEnabled = atYBeginning || !appsCard.current;
+ }
+ delegate: Item {
+ width: grid.cellWidth
+ height: grid.cellHeight
+ Rectangle {
+ anchors.centerIn: parent
+ width: 48
+ height: 48
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
|
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards/top-shadow.png
^
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards2
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards2/Card.qml
^
|
@@ -0,0 +1,23 @@
+
+import QtQuick 2.1
+
+Rectangle {
+ id: cardRoot
+ color: "red"
+ width: root.width
+ height: root.height
+ y: Math.max(Math.min((height - root.cardMargins * (parent.children.length - step)), (-root.contentY + height * step)),
+ root.cardMargins*step)
+ property int step: 0
+ property bool current: -root.contentY + cardRoot.height * step == 0
+
+ Image {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.top
+ }
+ opacity: (root.cardMargins/20)*0.4
+ source: "top-shadow.png"
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards2/main.qml
^
|
@@ -0,0 +1,136 @@
+
+import QtQuick 2.1
+import org.kde.kquickcontrolsaddons 2.0
+
+Flickable {
+ id: root
+ width: 300
+ height: 500
+ contentWidth: width
+ contentHeight: mainColumn.height
+ property real cardMargins: 20
+
+ onMovementEnded: {
+ if (contentY > root.height * 3) {
+ return;
+ }
+ slideAnim.enabled = true;
+ contentY = Math.round(contentY/root.height) * root.height
+ }
+ Behavior on contentY {
+ id: slideAnim
+ enabled: false
+ SequentialAnimation {
+ PropertyAnimation {
+ duration: 150
+ }
+ ScriptAction {
+ script: slideAnim.enabled = false;
+ }
+ }
+ }
+ Behavior on cardMargins {
+ PropertyAnimation {
+ duration: 500
+ }
+ }
+
+ Item {
+ id: mainColumn
+ width: root.width
+ height: root.height * cardHolder.children.length
+ Item {
+ id: cardHolder
+ y: root.contentY
+ width: root.width
+ height: root.height
+ Card {
+ step: 0
+ Text {
+ anchors.centerIn: parent
+ text: "Settings stuff"
+ font.pointSize: 20
+ }
+ }
+ Card {
+ step: 1
+ color: "blue"
+ Text {
+ anchors.centerIn: parent
+ text: "13:37"
+ font.pointSize: 40
+ }
+ }
+ Card {
+ step: 2
+ id: tasksCard
+ color: "green"
+ property bool switching: true
+ onCurrentChanged: {
+ if (!current) {
+ switching = true;
+ }
+ }
+ onSwitchingChanged: {
+ if (switching) {
+ root.cardMargins = 20;
+ } else {
+ root.cardMargins = 0;
+ }
+ }
+ Item {
+ scale: tasksCard.switching ? 0.333 : 1
+ anchors.fill: parent
+ ListView {
+ orientation: ListView.Horizontal
+ anchors {
+ fill: parent
+ leftMargin: -root.width
+ rightMargin: -root.width
+ }
+ model: 8
+ spacing: 4
+ delegate: Rectangle {
+ width: root.width
+ height: root.height
+ Text {
+ anchors.centerIn: parent
+ text: "App " + (modelData+1)
+ font.pointSize: 40
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tasksCard.switching = false;
+ }
+ }
+ }
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 150
+ }
+ }
+ }
+ }
+ Card {
+ step: 3
+ Flow {
+ id: appsFlow
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.floor(parent.width/64) * 64
+ Repeater {
+ model: 40
+ delegate: Item {
+ width: 64
+ height: 64
+ Rectangle {
+ width: 48
+ height: 48
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
|
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/cards2/top-shadow.png
^
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/gridmultitasking
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/gridmultitasking/main.qml
^
|
@@ -0,0 +1,253 @@
+
+import QtQuick 2.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Rectangle {
+ id: root
+ width: 300
+ height: 500
+ property Item currentApp
+ state: "switcher"
+
+ Text {
+ anchors.centerIn: parent
+ text: "Homescreen"
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.6 * Math.min(1, mainFlickable.contentY/(root.height*2))
+ }
+
+ Flickable {
+ id: mainFlickable
+ //Scale adjusted in the 0-1 range
+ property real zoomFactor: Math.max(mainFlickable.scale/0.5, 1) - 1
+ width: root.width * 2 + 5
+ height: root.height * 2 + 5
+
+ scale: 0.5
+ contentWidth: width
+ contentHeight: mainContent.height
+ Behavior on scale {
+ NumberAnimation {
+ duration: units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ onMovingChanged: {
+ if (!moving && contentY < root.height * 2) {
+ root.state = "dragging";
+ }
+ if (contentY < root.height) {
+ root.state = "homescreen"
+ } else {
+ root.state = "switcher"
+ }
+ }
+
+ Item {
+ id: mainContent
+ width: parent.width
+ height: flow.y + flow.height + root.height
+ Flow {
+ id: flow
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ y: root.height*2
+ spacing: 5
+ Repeater {
+ model: 5
+ delegate: Rectangle {
+ id: appRect
+ color: "red"
+ width: root.width
+ height: root.height
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ root.state = "scrolling"
+ root.currentApp = appRect
+ root.state = "app"
+ }
+ Text {
+ anchors.centerIn: parent
+ text: "App " + modelData
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Rectangle {
+ id: bottomBar
+ z: 99
+ color: "blue"
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: 50
+ MouseArea {
+ anchors.fill: parent
+ property int oldY
+ property real startY
+ onClicked: {
+ root.state = "switcher"
+ }
+ onPressed: {
+ if (root.state == "app") {
+ root.state = "zooming";
+ } else {
+ root.state = "dragging";
+ }
+ oldY = mouse.y;
+ startY = mouse.y;
+ }
+ onPositionChanged: {
+ if (root.state == "app" || root.state == "zooming") {
+ mainFlickable.scale = (1 - (startY - mouse.y) / root.height);
+ } else {
+ mainFlickable.contentY += oldY - mouse.y;
+ }
+ oldY = mouse.y;
+ }
+ onReleased: {
+ if (root.state == "app" || root.state == "zooming") {
+ if (mainFlickable.scale < 0.7) {
+ root.state = "switcher"
+ } else {
+ root.state = "app"
+ }
+ } else {
+ if (mainFlickable.contentY < root.height) {
+ root.state = "homescreen"
+ } else {
+ root.state = "switcher"
+ }
+ }
+ }
+
+ Row {
+ PlasmaComponents.ToolButton {
+ height: bottomBar.height
+ width: height
+ iconSource: "applications-other"
+ onClicked: root.state = "switcher"
+ }
+ PlasmaComponents.ToolButton {
+ height: bottomBar.height
+ width: height
+ iconSource: "go-home"
+ onClicked: root.state = "homescreen"
+ }
+ }
+ }
+ }
+ states: [
+ State {
+ name: "switcher"
+ PropertyChanges {
+ target: mainFlickable
+ scale: 0.5
+ x: -root.width / 2
+ y: -root.height / 2
+ interactive: true
+ contentY: root.height*2 + (root.currentApp ? root.currentApp.y : 0)
+ visible: true
+ }
+ },
+ State {
+ name: "dragging"
+ PropertyChanges {
+ target: mainFlickable
+ scale: 0.5
+ x: -root.width / 2
+ y: -root.height / 2
+ interactive: true
+ contentY: contentY
+ visible: true
+ }
+ },
+ State {
+ name: "zooming"
+ PropertyChanges {
+ target: mainFlickable
+ scale: scale
+ x: (-root.currentApp.x * mainFlickable.zoomFactor ) + (1 - mainFlickable.zoomFactor) * (-root.width / 2)
+ y: (-root.height / 2) * (1 - mainFlickable.zoomFactor)
+ interactive: true
+ contentY: (root.height*2 + (root.currentApp ? root.currentApp.y : 0)) * (1 - mainFlickable.zoomFactor) + (root.height*2 + root.currentApp.y) * mainFlickable.zoomFactor
+ visible: true
+ }
+ },
+ State {
+ name: "app"
+ PropertyChanges {
+ target: mainFlickable
+ scale: 1
+ x: -root.currentApp.x
+ y: 0
+ interactive: false
+ contentY: root.height*2 + root.currentApp.y
+ visible: true
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/singlescrolling
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/singlescrolling/Card.qml
^
|
@@ -0,0 +1,13 @@
+
+import QtQuick 2.1
+
+Rectangle {
+ id: cardRoot
+ color: "red"
+ width: root.width
+ height: root.height
+ property int step: 0
+ property bool current: root.contentY == y
+
+
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/prototypes/singlescrolling/main.qml
^
|
@@ -0,0 +1,115 @@
+
+import QtQuick 2.1
+import org.kde.kquickcontrolsaddons 2.0
+
+Flickable {
+ id: root
+ width: 300
+ height: 500
+ contentWidth: width
+ contentHeight: mainColumn.height
+
+ onMovementEnded: {
+ if (contentY > root.height * 3) {
+ return;
+ }
+ slideAnim.enabled = true;
+ var newCurrent = mainColumn.childAt(10, contentY+root.height/2);
+ contentY = newCurrent.y
+ }
+ Behavior on contentY {
+ id: slideAnim
+ enabled: false
+ SequentialAnimation {
+ PropertyAnimation {
+ duration: 150
+ }
+ ScriptAction {
+ script: slideAnim.enabled = false;
+ }
+ }
+ }
+
+ Column {
+ id: mainColumn
+ Card {
+ Text {
+ anchors.centerIn: parent
+ text: "Settings stuff"
+ font.pointSize: 20
+ }
+ }
+ Card {
+ color: "blue"
+ Text {
+ anchors.centerIn: parent
+ text: "13:37"
+ font.pointSize: 40
+ }
+ }
+ Card {
+ id: tasksCard
+ z: 9
+ color: "green"
+ height: root.height - 64
+ property bool switching: true
+ onCurrentChanged: {
+ if (!current) {
+ switching = true;
+ }
+ }
+ Item {
+ scale: tasksCard.switching ? 0.333 : 1
+ anchors.fill: parent
+ ListView {
+ orientation: ListView.Horizontal
+ anchors {
+ fill: parent
+ leftMargin: -root.width
+ rightMargin: -root.width
+ }
+ model: 8
+ spacing: 4
+ delegate: Rectangle {
+ width: root.width
+ height: root.height
+ Text {
+ anchors.centerIn: parent
+ text: "App " + (modelData+1)
+ font.pointSize: 40
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tasksCard.switching = false;
+ }
+ }
+ }
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 150
+ }
+ }
+ }
+ }
+ Card {
+ height: appsFlow.height
+ Flow {
+ id: appsFlow
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.floor(parent.width/64) * 64
+ Repeater {
+ model: 40
+ delegate: Item {
+ width: 64
+ height: 64
+ Rectangle {
+ width: 48
+ height: 48
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/CMakeLists.txt
^
|
@@ -6,11 +6,18 @@
)
add_library(satellitecomponentsplugin SHARED ${satellitecomponents_SRCS})
-target_link_libraries(satellitecomponentsplugin Qt5::Core Qt5::Widgets Qt5::Qml Qt5::Quick KF5::Declarative KF5::I18n KF5::KIOCore KF5::KIOWidgets)
+target_link_libraries(satellitecomponentsplugin
+ Qt5::Core
+ Qt5::Widgets
+ Qt5::Qml
+ Qt5::Quick
+ KF5::Service
+ KF5::Declarative
+ KF5::I18n)
install(TARGETS satellitecomponentsplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/satellite/components)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/satellite/components)
-
+add_subdirectory(modeltest)
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/applicationlistmodel.cpp
^
|
@@ -27,17 +27,19 @@
// KDE
#include <KPluginInfo>
-#include <KRun>
#include <KService>
#include <KServiceGroup>
#include <KServiceTypeTrader>
+#include <KSycoca>
#include <KSycocaEntry>
#include <QDebug>
ApplicationListModel::ApplicationListModel(QObject *parent)
: QAbstractListModel(parent)
{
- loadApplications();
+ //can't use the new syntax as this signal is overloaded
+ connect(KSycoca::self(), SIGNAL(databaseChanged(const QStringList &)),
+ this, SLOT(sycocaDbChanged(const QStringList &)));
}
ApplicationListModel::~ApplicationListModel()
@@ -51,24 +53,45 @@
roleNames[ApplicationIconRole] = "ApplicationIconRole";
roleNames[ApplicationStorageIdRole] = "ApplicationStorageIdRole";
roleNames[ApplicationEntryPathRole] = "ApplicationEntryPathRole";
+ roleNames[ApplicationOriginalRowRole] = "ApplicationOriginalRowRole";
return roleNames;
}
+void ApplicationListModel::sycocaDbChanged(const QStringList &changes)
+{
+ if (!changes.contains("apps") && !changes.contains("xdgdata-apps")) {
+ return;
+ }
+
+ m_applicationList.clear();
+
+ loadApplications();
+}
+
+bool appNameLessThan(const ApplicationData &a1, const ApplicationData &a2)
+{
+ return a1.name.toLower() < a2.name.toLower();
+}
void ApplicationListModel::loadApplications()
{
beginResetModel();
+ m_applicationList.clear();
+
KServiceGroup::Ptr group = KServiceGroup::root();
if (!group || !group->isValid()) return;
KServiceGroup::List subGroupList = group->entries(true);
+ QMap<int, ApplicationData> orderedList;
+ QList<ApplicationData> unorderedList;
+
// Iterate over all entries in the group
for(KServiceGroup::List::ConstIterator it = subGroupList.begin();it != subGroupList.end(); it++) {
KSycocaEntry::Ptr groupEntry = (*it);
- if (groupEntry->isType(KST_KServiceGroup) && groupEntry->name() != "System") {
+ if (groupEntry->isType(KST_KServiceGroup) && groupEntry->name() != "System/" && groupEntry->name() != "Settingsmenu/") {
KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup* >(groupEntry.data()));
if (!serviceGroup->noDisplay()) {
@@ -77,15 +100,20 @@
for(KServiceGroup::List::ConstIterator it = entryGroupList.begin(); it != entryGroupList.end(); it++) {
KSycocaEntry::Ptr entry = (*it);
ApplicationData data;
- if (entry->isType(KST_KService)) {
+
+ if (entry->property("Exec").isValid()) {
KService::Ptr service(static_cast<KService* >(entry.data()));
if (service->isApplication()) {
- KPluginInfo plugin(service);
- data.name = plugin.name();
- data.icon = plugin.icon();
+ data.name = service->name();
+ data.icon = service->icon();
data.storageId = service->storageId();
- data.entryPath = plugin.entryPath();
- m_applicationList << data;
+ data.entryPath = service->exec();
+
+ if (m_appPositions.contains(service->storageId())) {
+ orderedList[m_appPositions.value(service->storageId())] = data;
+ } else {
+ unorderedList << data;
+ }
}
}
}
@@ -93,6 +121,10 @@
}
}
+ std::sort(unorderedList.begin(), unorderedList.end(), appNameLessThan);
+ m_applicationList << orderedList.values();
+ m_applicationList << unorderedList;
+
endResetModel();
emit countChanged();
}
@@ -113,12 +145,21 @@
return m_applicationList.at(index.row()).storageId;
case ApplicationEntryPathRole:
return m_applicationList.at(index.row()).entryPath;
+ case ApplicationOriginalRowRole:
+ return index.row();
default:
return QVariant();
}
}
+Qt::ItemFlags ApplicationListModel::flags(const QModelIndex &index) const
+{
+ if (!index.isValid())
+ return 0;
+ return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index);
+}
+
int ApplicationListModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
@@ -128,16 +169,77 @@
return m_applicationList.count();
}
-void ApplicationListModel::runApplication(const QString &storageId) {
+void ApplicationListModel::moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild)
+{
+ moveItem(sourceRow, destinationChild);
+}
+
+Q_INVOKABLE void ApplicationListModel::moveItem(int row, int destination)
+{
+ if (row < 0 || destination < 0 || row >= m_applicationList.length() ||
+ destination >= m_applicationList.length() || row == destination) {
+ return;
+ }
+ if (destination > row) {
+ ++destination;
+ }
+
+ beginMoveRows(QModelIndex(), row, row, QModelIndex(), destination);
+ if (destination > row) {
+ ApplicationData data = m_applicationList.at(row);
+ m_applicationList.insert(destination, data);
+ m_applicationList.takeAt(row);
+ } else {
+ ApplicationData data = m_applicationList.takeAt(row);
+ m_applicationList.insert(destination, data);
+ }
+
+
+ m_appOrder.clear();
+ m_appPositions.clear();
+ int i = 0;
+ for (auto app : m_applicationList) {
+ m_appOrder << app.storageId;
+ m_appPositions[app.storageId] = i;
+ ++i;
+ }
+
+
+ emit appOrderChanged();
+ endMoveRows();
+}
+
+void ApplicationListModel::runApplication(const QString &storageId)
+{
if (storageId.isEmpty()) {
return;
}
KService::Ptr service = KService::serviceByStorageId(storageId);
- //FIXME: port KRun::run to wayland
- QProcess::startDetached(service->exec());
- //KRun::run(*service, QList<QUrl>(), 0);
+ //ignore parameters like %u
+ QProcess::startDetached(service->exec().replace(QRegExp("%\\w"), ""));
+}
+
+QStringList ApplicationListModel::appOrder() const
+{
+ return m_appOrder;
+}
+
+void ApplicationListModel::setAppOrder(const QStringList &order)
+{
+ if (m_appOrder == order) {
+ return;
+ }
+
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/applicationlistmodel.h
^
|
@@ -38,6 +38,7 @@
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
+ Q_PROPERTY(QStringList appOrder READ appOrder WRITE setAppOrder NOTIFY appOrderChanged)
public:
ApplicationListModel(QObject *parent = 0);
@@ -45,27 +46,45 @@
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ void moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild);
+
int count() { return m_applicationList.count(); }
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
enum Roles {
ApplicationNameRole = Qt::UserRole + 1,
ApplicationIconRole = Qt::UserRole + 2,
ApplicationStorageIdRole = Qt::UserRole + 3,
- ApplicationEntryPathRole = Qt::UserRole + 4
+ ApplicationEntryPathRole = Qt::UserRole + 4,
+ ApplicationOriginalRowRole = Qt::UserRole + 6
};
+ QStringList appOrder() const;
+ void setAppOrder(const QStringList &order);
+
+ Q_INVOKABLE void moveItem(int row, int order);
+
Q_INVOKABLE void runApplication(const QString &storageId);
+ Q_INVOKABLE void loadApplications();
+
+public Q_SLOTS:
+ void sycocaDbChanged(const QStringList &change);
+
Q_SIGNALS:
void countChanged();
+ void appOrderChanged();
private:
QList<ApplicationData> m_applicationList;
- void loadApplications();
+
+ QStringList m_appOrder;
+ QHash<QString, int> m_appPositions;
};
#endif // APPLICATIONLISTMODEL_H
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/modeltest
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/modeltest/CMakeLists.txt
^
|
@@ -0,0 +1,15 @@
+
+set(applicationlistmodeltest_SRCS
+ main.cpp
+ modeltest.cpp
+ ../applicationlistmodel.cpp
+ )
+
+add_executable(applicationlistmodeltest ${applicationlistmodeltest_SRCS})
+target_link_libraries(applicationlistmodeltest
+ Qt5::Core
+ Qt5::Test
+ Qt5::Widgets
+ KF5::Service
+ )
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/modeltest/main.cpp
^
|
@@ -0,0 +1,54 @@
+#include <QAction>
+#include <QApplication>
+#include <QDialog>
+#include <QPushButton>
+#include <QTreeView>
+#include <QVBoxLayout>
+#include <QDebug>
+
+
+#include "../applicationlistmodel.h"
+#include "modeltest.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QWidget *widget = new QWidget;
+ QVBoxLayout *layout = new QVBoxLayout(widget);
+
+ ApplicationListModel *applicationListModel = new ApplicationListModel(widget);
+ ModelTest *test = new ModelTest(applicationListModel, widget);
+
+ QTreeView *view = new QTreeView(widget);
+ QPushButton *upButton = new QPushButton(widget);
+ upButton->setText("Move Up");
+ QObject::connect(upButton, &QPushButton::clicked, [=](){
+ QModelIndex idx = view->currentIndex();
+ if (idx.row() > 0) {
+ applicationListModel->moveItem(idx.row(), idx.row()-1);
+ }
+ });
+ QPushButton *downButton = new QPushButton(widget);
+ downButton->setText("Move Down");
+ QObject::connect(downButton, &QPushButton::clicked, [=](){
+ QModelIndex idx = view->currentIndex();
+ if (idx.row() > 0) {
+ applicationListModel->moveItem(idx.row(), idx.row()+1);
+ }
+ });
+ layout->addWidget(upButton);
+ layout->addWidget(downButton);
+
+ view->setDragDropMode(QAbstractItemView::InternalMove);
+ view->setModel(applicationListModel);
+ applicationListModel->loadApplications();
+ layout->addWidget(view);
+
+ QAction *quit = new QAction(widget);
+ quit->setShortcut(Qt::CTRL + Qt::Key_Q);
+ QObject::connect(quit, SIGNAL(triggered()), &app, SLOT(quit()));
+
+ widget->addAction(quit);
+ widget->show();
+ return app.exec();
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/modeltest/modeltest.cpp
^
|
@@ -0,0 +1,592 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "modeltest.h"
+
+#include <QtCore/QtCore>
+#include <QtTest/QtTest>
+
+/*!
+ Connect to all of the models signals. Whenever anything happens recheck everything.
+*/
+ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject ( parent ), model ( _model ), fetchingMore ( false )
+{
+ if (!model)
+ qFatal("%s: model must not be null", Q_FUNC_INFO);
+
+ connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(runAllTests()) );
+
+ // Special checks for changes
+ connect(model, SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(layoutAboutToBeChanged()) );
+ connect(model, SIGNAL(layoutChanged()),
+ this, SLOT(layoutChanged()) );
+
+ connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(rowsInserted(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)) );
+ connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(dataChanged(QModelIndex,QModelIndex)) );
+ connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(headerDataChanged(Qt::Orientation,int,int)) );
+
+ runAllTests();
+}
+
+void ModelTest::runAllTests()
+{
+ if ( fetchingMore )
+ return;
+ nonDestructiveBasicTest();
+ rowCount();
+ columnCount();
+ hasIndex();
+ index();
+ parent();
+ data();
+}
+
+/*!
+ nonDestructiveBasicTest tries to call a number of the basic functions (not all)
+ to make sure the model doesn't outright segfault, testing the functions that makes sense.
+*/
+void ModelTest::nonDestructiveBasicTest()
+{
+ QVERIFY( model->buddy ( QModelIndex() ) == QModelIndex() );
+ model->canFetchMore ( QModelIndex() );
+ QVERIFY( model->columnCount ( QModelIndex() ) >= 0 );
+ QVERIFY( model->data ( QModelIndex() ) == QVariant() );
+ fetchingMore = true;
+ model->fetchMore ( QModelIndex() );
+ fetchingMore = false;
+ Qt::ItemFlags flags = model->flags ( QModelIndex() );
+ QVERIFY( flags == Qt::ItemIsDropEnabled || flags == 0 );
+ model->hasChildren ( QModelIndex() );
+ model->hasIndex ( 0, 0 );
+ model->headerData ( 0, Qt::Horizontal );
+ model->index ( 0, 0 );
+ model->itemData ( QModelIndex() );
+ QVariant cache;
+ model->match ( QModelIndex(), -1, cache );
+ model->mimeTypes();
+ QVERIFY( model->parent ( QModelIndex() ) == QModelIndex() );
+ QVERIFY( model->rowCount() >= 0 );
+ QVariant variant;
+ model->setData ( QModelIndex(), variant, -1 );
+ model->setHeaderData ( -1, Qt::Horizontal, QVariant() );
+ model->setHeaderData ( 999999, Qt::Horizontal, QVariant() );
+ QMap<int, QVariant> roles;
+ model->sibling ( 0, 0, QModelIndex() );
+ model->span ( QModelIndex() );
+ model->supportedDropActions();
+}
+
+/*!
+ Tests model's implementation of QAbstractItemModel::rowCount() and hasChildren()
+
+ Models that are dynamically populated are not as fully tested here.
+ */
+void ModelTest::rowCount()
+{
+// qDebug() << "rc";
+ // check top row
+ QModelIndex topIndex = model->index ( 0, 0, QModelIndex() );
+ int rows = model->rowCount ( topIndex );
+ QVERIFY( rows >= 0 );
+ if ( rows > 0 )
+ QVERIFY( model->hasChildren ( topIndex ) );
+
+ QModelIndex secondLevelIndex = model->index ( 0, 0, topIndex );
+ if ( secondLevelIndex.isValid() ) { // not the top level
+ // check a row count where parent is valid
+ rows = model->rowCount ( secondLevelIndex );
+ QVERIFY( rows >= 0 );
+ if ( rows > 0 )
+ QVERIFY( model->hasChildren ( secondLevelIndex ) );
+ }
+
+ // The models rowCount() is tested more extensively in checkChildren(),
+ // but this catches the big mistakes
+}
+
+/*!
+ Tests model's implementation of QAbstractItemModel::columnCount() and hasChildren()
+ */
+void ModelTest::columnCount()
+{
+ // check top row
+ QModelIndex topIndex = model->index ( 0, 0, QModelIndex() );
+ QVERIFY( model->columnCount ( topIndex ) >= 0 );
+
+ // check a column count where parent is valid
+ QModelIndex childIndex = model->index ( 0, 0, topIndex );
+ if ( childIndex.isValid() )
+ QVERIFY( model->columnCount ( childIndex ) >= 0 );
+
+ // columnCount() is tested more extensively in checkChildren(),
+ // but this catches the big mistakes
+}
+
+/*!
+ Tests model's implementation of QAbstractItemModel::hasIndex()
+ */
+void ModelTest::hasIndex()
+{
+// qDebug() << "hi";
+ // Make sure that invalid values returns an invalid index
+ QVERIFY( !model->hasIndex ( -2, -2 ) );
+ QVERIFY( !model->hasIndex ( -2, 0 ) );
+ QVERIFY( !model->hasIndex ( 0, -2 ) );
+
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/qmlcomponents/modeltest/modeltest.h
^
|
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef MODELTEST_H
+#define MODELTEST_H
+
+#include <QtCore/QObject>
+#include <QtCore/QAbstractItemModel>
+#include <QtCore/QStack>
+
+class ModelTest : public QObject
+{
+ Q_OBJECT
+
+public:
+ ModelTest( QAbstractItemModel *model, QObject *parent = 0 );
+
+private Q_SLOTS:
+ void nonDestructiveBasicTest();
+ void rowCount();
+ void columnCount();
+ void hasIndex();
+ void index();
+ void parent();
+ void data();
+
+protected Q_SLOTS:
+ void runAllTests();
+ void layoutAboutToBeChanged();
+ void layoutChanged();
+ void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end );
+ void rowsInserted( const QModelIndex & parent, int start, int end );
+ void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end );
+ void rowsRemoved( const QModelIndex & parent, int start, int end );
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+ void headerDataChanged(Qt::Orientation orientation, int start, int end);
+
+private:
+ void checkChildren( const QModelIndex &parent, int currentDepth = 0 );
+
+ QAbstractItemModel *model;
+
+ struct Changing {
+ QModelIndex parent;
+ int oldSize;
+ QVariant last;
+ QVariant next;
+ };
+ QStack<Changing> insert;
+ QStack<Changing> remove;
+
+ bool fetchingMore;
+
+ QList<QPersistentModelIndex> changing;
+};
+
+#endif
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/shell/contents/applet
^
|
+(directory)
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/shell/contents/applet/AppletError.qml
^
|
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2013 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+RowLayout {
+ id: root
+ Layout.minimumWidth: units.gridUnit * 20
+ Layout.minimumHeight: units.gridUnit * 8
+
+ property alias reason: messageText.text
+
+ clip: true
+
+ PlasmaCore.IconItem {
+ id: icon
+ anchors.verticalCenter: parent.verticalCenter
+ Layout.minimumWidth: units.iconSizes.huge
+ Layout.minimumHeight: units.iconSizes.huge
+ source: "dialog-error"
+ }
+
+ PlasmaComponents.TextArea {
+ id: messageText
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ verticalAlignment: TextEdit.AlignVCenter
+ backgroundVisible: false
+ readOnly: true
+ width: parent.width - icon.width
+ wrapMode: Text.Wrap
+ }
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/shell/contents/applet/CompactApplet.qml
^
|
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2013 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+import QtQuick 2.4
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.kquickcontrolsaddons 2.0
+
+PlasmaCore.ToolTipArea {
+ id: root
+ objectName: "org.kde.desktop-CompactApplet"
+ anchors.fill: parent
+
+ icon: plasmoid.icon
+ mainText: plasmoid.toolTipMainText
+ subText: plasmoid.toolTipSubText
+ location: plasmoid.location
+ active: !plasmoid.expanded
+ property Item fullRepresentation
+ property Item compactRepresentation
+ property Item expandedFeedback: expandedItem
+
+ onCompactRepresentationChanged: {
+ if (compactRepresentation) {
+ compactRepresentation.parent = root;
+ compactRepresentation.anchors.fill = root;
+ compactRepresentation.visible = true;
+ }
+ root.visible = true;
+ }
+
+ onFullRepresentationChanged: {
+
+ if (!fullRepresentation) {
+ return;
+ }
+ /* //if the fullRepresentation size was restored to a stored size, or if is dragged from the desktop, restore popup size
+ if (fullRepresentation.width > 0) {
+ appletParent.width = fullRepresentation.width;
+ } else if (fullRepresentation.Layout && fullRepresentation.Layout.preferredWidth > 0) {
+ appletParent.width = fullRepresentation.Layout.preferredWidth
+ } else if (fullRepresentation.implicitWidth > 0) {
+ appletParent.width = fullRepresentation.implicitWidth
+ } else {
+ appletParent.width = theme.mSize(theme.defaultFont).width * 35
+ }
+
+ if (fullRepresentation.height > 0) {
+ appletParent.height = fullRepresentation.height;
+ } else if (fullRepresentation.Layout && fullRepresentation.Layout.preferredHeight > 0) {
+ appletParent.height = fullRepresentation.Layout.preferredHeight
+ } else if (fullRepresentation.implicitHeight > 0) {
+ appletParent.height = fullRepresentation.implicitHeight
+ } else {
+ appletParent.height = theme.mSize(theme.defaultFont).height * 25
+ }*/
+
+ fullRepresentation.parent = appletParent;
+ fullRepresentation.anchors.fill = fullRepresentation.parent;
+ }
+
+ Rectangle {
+ id: expandedItem
+ anchors.fill: parent
+ color: PlasmaCore.ColorScope.highlightColor
+ opacity: plasmoid.expanded ? 0.3 : 0
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ Timer {
+ id: expandedSync
+ interval: 100
+ onTriggered: plasmoid.expanded = popupWindow.visible;
+ }
+
+ Item {
+ id: appletParent
+ opacity: plasmoid.expanded ? 1 : 0
+ anchors.top: parent.bottom
+ Layout.minimumWidth: (fullRepresentation && fullRepresentation.Layout) ? fullRepresentation.Layout.minimumWidth : 0
+ Layout.minimumHeight: (fullRepresentation && fullRepresentation.Layout) ? fullRepresentation.Layout.minimumHeight: 0
+ Layout.maximumWidth: (fullRepresentation && fullRepresentation.Layout) ? fullRepresentation.Layout.maximumWidth : Infinity
+ Layout.maximumHeight: (fullRepresentation && fullRepresentation.Layout) ? fullRepresentation.Layout.maximumHeight: Infinity
+ width: Math.max(parent.width, Layout.minimumWidth)
+ height: Layout.minimumHeight
+
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/shell/contents/applet/DefaultCompactRepresentation.qml
^
|
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2013 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Layouts 1.1
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+
+Row {
+ id: main
+ spacing: units.largeSpacing
+
+ Layout.minimumWidth: {
+ switch (plasmoid.formFactor) {
+ case PlasmaCore.Types.Vertical:
+ return 0;
+ case PlasmaCore.Types.Horizontal:
+ return height;
+ default:
+ return units.gridUnit * 3;
+ }
+ }
+
+ Layout.minimumHeight: {
+ switch (plasmoid.formFactor) {
+ case PlasmaCore.Types.Vertical:
+ return width;
+ case PlasmaCore.Types.Horizontal:
+ return 0;
+ default:
+ return units.gridUnit * 3;
+ }
+ }
+
+ PlasmaCore.IconItem {
+ id: icon
+ source: plasmoid.icon ? plasmoid.icon : "plasma"
+ active: mouseArea.containsMouse
+ colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ PlasmaCore.SvgItem {
+ svg: PlasmaCore.Svg {
+ id: arrowSvg
+ imagePath: "widgets/arrows"
+ colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+ }
+ width: units.iconSizes.smallMedium
+ height: width
+ elementId: plasmoid.expanded ? "up-arrow" : "down-arrow"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ PlasmaComponents.Label {
+ text: plasmoid.title
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ property bool wasExpanded: false
+
+ anchors.fill: parent
+ hoverEnabled: true
+ onPressed: wasExpanded = plasmoid.expanded
+ onClicked: plasmoid.expanded = !wasExpanded
+ }
+}
\ No newline at end of file
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/shell/contents/components/HomeLauncherSvg.qml
^
|
@@ -21,8 +21,7 @@
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
- drag.target: stripe
- drag.axis: Drag.YAxis
+
onClicked: {
if (callback) {
callback();
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/shell/contents/components/SatelliteStripe.qml
^
|
@@ -1,10 +1,16 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
-Rectangle {
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#FFEDDF00" }
- GradientStop { position: 3.0; color: "#00EDDF00" }
+Item {
+ PlasmaCore.FrameSvgItem {
+ z: -1
+ imagePath: "widgets/background"
+ enabledBorders: PlasmaCore.FrameSvgItem.TopBorder | PlasmaCore.FrameSvgItem.BottomBorder
+ anchors {
+ fill: parent
+ topMargin: -margins.top
+ bottomMargin: -margins.bottom
+ }
}
opacity: 0.6
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/shell/contents/defaults
^
|
@@ -2,7 +2,7 @@
LookAndFeelPackage=org.kde.satellite.phone
[Desktop]
-Containment=org.kde.desktopcontainment
+Containment=org.kde.phone.homescreen
ToolBox=
[Desktop][ContainmentActions]
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/shell/contents/layout.js
^
|
@@ -14,3 +14,7 @@
desktopsArray[j].writeConfig("Image", "org.kde.satellite.lockers");
}
+desktopsForActivity(id)[0].addWidget("org.kde.phone.notifications");
+
+var panel = new Panel("org.kde.phone.panel");
+panel.addWidget("org.kde.phone.quicksettings");
|
[-]
[+]
|
Changed |
plasma-phone-components-0.2.4.tar.xz/shell/contents/views/Desktop.qml
^
|
@@ -30,7 +30,7 @@
import MeeGo.QOfono 0.2
import "../components"
-MouseEventListener {
+Item {
id: homescreen
width: 1080
height: 1920
@@ -39,59 +39,22 @@
property Item wallpaper;
property var pendingRemovals: [];
property int notificationId: 0;
+ property int buttonHeight: width/4
- /*
- Notificadtion data object has the following properties:
- appIcon
- image
- appName
- summary
- body
- isPersistent
- expireTimeout
- urgency
- appRealName
- configurable
- */
- function addNotification(source, data, actions) {
- // Do not show duplicated notifications
- // Remove notifications that are sent again (odd, but true)
- for (var i = 0; i < notificationsModel.count; ++i) {
- var tmp = notificationsModel.get(i);
- var matches = (tmp.appName == data.appName &&
- tmp.summary == data.summary &&
- tmp.body == data.body);
- var sameSource = tmp.source == source;
+ onContainmentChanged: {
+ containment.parent = homescreen;
- if (sameSource && matches) {
- return;
- }
-
- if (sameSource || matches) {
- notificationsModel.remove(i)
- break;
- }
+ if (containment != null) {
+ containment.visible = true;
}
-
- data["id"] = ++notificationId;
- data["source"] = source;
- if (data["summary"].length < 1) {
- data["summary"] = data["body"];
- data["body"] = '';
- }
- data["actions"] = actions;
-
- notificationsModel.insert(0, data);
- if (!data["isPersistent"]) {
- pendingRemovals.push(notificationId);
- pendingTimer.start();
+ if (containment != null) {
+ containment.anchors.left = homescreen.left;
+ containment.anchors.top = homescreen.top;
+ containment.anchors.right = homescreen.right;
+ containment.anchors.bottom = homescreen.bottom;
}
}
- onPressAndHold: {
- containment.action("configure").trigger();
- }
-
OfonoManager {
id: ofonoManager
onAvailableChanged: {
@@ -134,39 +97,6 @@
modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : ""
}
- OfonoNetworkRegistration {
- id: netreg
- Component.onCompleted: {
- netreg.scan()
- updateStrengthIcon()
- }
-
- onNetworkOperatorsChanged : {
- console.log("operators :"+netreg.currentOperator["Name"].toString())
- }
- modemPath: ofonoManager.modems.length ? ofonoManager.modems[0] : ""
- function updateStrengthIcon() {
- if (netreg.strength >= 100) {
- strengthIcon.source = "network-mobile-100";
- } else if (netreg.strength >= 80) {
- strengthIcon.source = "network-mobile-80";
- } else if (netreg.strength >= 60) {
- strengthIcon.source = "network-mobile-60";
- } else if (netreg.strength >= 40) {
- strengthIcon.source = "network-mobile-40";
- } else if (netreg.strength >= 20) {
- strengthIcon.source = "network-mobile-20";
- } else {
- strengthIcon.source = "network-mobile-0";
- }
- }
-
- onStrengthChanged: {
- console.log("Strength changed to " + netreg.strength)
- updateStrengthIcon()
- }
- }
-
OfonoNetworkOperator {
id: netop
}
@@ -193,76 +123,11 @@
}
}
- Timer {
- id: pendingTimer
- interval: 5000
- repeat: false
- onTriggered: {
- for (var i = 0; i < pendingRemovals.length; ++i) {
- var id = pendingRemovals[i];
- for (var j = 0; j < notificationsModel.count; ++j) {
- if (notificationsModel.get(j).id == id) {
- notificationsModel.remove(j);
- }
- }
- }
- pendingRemovals = [];
- }
- }
-
- PlasmaCore.DataSource {
- id: notificationsSource
-
- engine: "notifications"
- interval: 0
-
- onSourceAdded: {
- connectSource(source);
- }
-
- onSourceRemoved: {
- for (var i = 0; i < notificationsModel.count; ++i) {
- if (notificationsModel.get(i) == source) {
- notificationsModel.remove(i);
- break;
- }
- }
- }
-
- onNewData: {
- var actions = new Array()
- if (data["actions"] && data["actions"].length % 2 == 0) {
- for (var i = 0; i < data["actions"].length; i += 2) {
- var action = new Object();
- action["id"] = data["actions"][i];
- action["text"] = data["actions"][i+1];
- actions.push(action);
- }
- }
-
- homescreen.addNotification(
- sourceName,
- data,
- actions);
- }
-
- }
-
- ListModel {
- id: notificationsModel
-
- ListElement {
- appIcon: "call-start"
- summary: "Missed call from Joe"
- body: "Called at 8:42 from +41 56 373 37 31"
- }
- ListElement {
- appIcon: "im-google"
- summary: "July: Hey! Are you around?"
- }
- ListElement {
- appIcon: "im-google"
- summary: "July: Hello?"
+ //pass the focus to the containment, so it can react to homescreen activate/inactivate
+ Connections {
+ target: desktop
+ onActiveChanged: {
+ containment.focus = desktop.active;
}
}
|
[-]
[+]
|
Added |
plasma-phone-components-0.2.4.tar.xz/shell/contents/views/Panel.qml
^
|
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2012 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Layouts 1.1
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+
+
+PlasmaCore.FrameSvgItem {
+ id: root
+
+ visible: false //adjust borders is run during setup. We want to avoid painting till completed
+
+ property Item containment
+
+ onContainmentChanged: {
+ containment.parent = root;
+ containment.visible = true;
+ containment.anchors.fill = root;
+ }
+
+ Component.onCompleted: {
+ visible = true
+ }
+}
|
|
Added |
plasma-phone-components-0.2.4.tar.xz/wallpaper/contents/images/1080x1920.png
^
|
|
Added |
plasma-phone-components-0.2.4.tar.xz/wallpaper/contents/images/1375x2432.png
^
|
[-]
[+]
|
Changed |
plasma-phone-components.yaml
^
|
@@ -1,5 +1,5 @@
Name : plasma-phone-components
-Version : 0.2.3
+Version : 0.2.4
Release : 0
Group : System/GUI/Other
License : GPLv2+
@@ -52,7 +52,9 @@
- "%config %{_kf5_configdir}/kdeglobals"
- "%config %{_kf5_configdir}/kded5rc"
- "%{_bindir}/plasma-phone"
+ - "%{_bindir}/plasmaphonedialer"
- "%{_kf5_sharedir}/plasma/*"
+ - "%{_kf5_sharedir}/kpackage/*"
- "%{_kf5_sharedir}/greenisland/*"
- "%{_kf5_sharedir}/wallpapers/*"
- "%{_kf5_servicesdir}/*.desktop"
@@ -61,3 +63,6 @@
- "%{_libdir}/systemd/user/*"
- "%{_libdir}/systemd/user/user-session.target.wants/*"
- "%{_libdir}/qt5/qml/*"
+ - "%{_libdir}/qt5/plugins/*"
+ - "%{_kf5_sharedir}/applications/*"
+ - "%{_kf5_sharedir}/knotifications5/*"
|