[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:45 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=d6eb2d0
The following commit has been merged in the master branch:
commit d6eb2d07bc26613468815de0af17a3cdfc1fcfc6
Author: Aleix Pol <aleixpol at kde.org>
Date: Sun Jun 5 22:42:19 2016 +0200
Port the experimental application to kirigami
---
app/qml/Device.qml | 93 +++++++++++++++++++++++++++++++++++++++
app/qml/DeviceDelegate.qml | 56 ------------------------
app/qml/main.qml | 107 ++++++---------------------------------------
app/qml/mousepad.qml | 67 +++++++++++++++-------------
app/qml/mpris.qml | 73 +++++++++++++++++--------------
app/resources.qrc | 2 +-
6 files changed, 184 insertions(+), 214 deletions(-)
diff --git a/app/qml/Device.qml b/app/qml/Device.qml
new file mode 100644
index 0000000..1b3d8e1
--- /dev/null
+++ b/app/qml/Device.qml
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2015 Aleix Pol Gonzalez <aleixpol at 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) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQuick.Controls 1.1
+import QtQuick.Layouts 1.1
+import org.kde.kirigami 1.0 as Kirigami
+import org.kde.kdeconnect 1.0
+
+Kirigami.Page
+{
+ id: deviceView
+ property QtObject currentDevice
+ title: currentDevice.name
+
+ Loader {
+ anchors.fill: parent
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ sourceComponent: deviceView.currentDevice.isTrusted ? trustedDevice : untrustedDevice
+ Component {
+ id: trustedDevice
+ ColumnLayout {
+ id: trustedView
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ Kirigami.BasicListItem {
+ label: i18n("Un-Pair")
+ onClicked: deviceView.currentDevice.unpair()
+ }
+ Kirigami.BasicListItem {
+ label: i18n("Send Ping")
+ onClicked: deviceView.currentDevice.pluginCall("ping", "sendPing");
+ }
+ Kirigami.BasicListItem {
+ label: i18n("Open Multimedia Remote Control")
+ onClicked: pageStack.push(
+ "qrc:/qml/mpris.qml",
+ { mprisInterface: MprisDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
+ );
+ }
+ Kirigami.BasicListItem {
+ label: i18n("Mouse Pad")
+ onClicked: pageStack.push(
+ "qrc:/qml/mousepad.qml",
+ { remoteControlInterface: RemoteControlDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
+ );
+ }
+ Kirigami.BasicListItem {
+ property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
+ label: lockIface.isLocked ? i18n("Unlock") : i18n("Lock")
+ onClicked: {
+ lockIface.isLocked = !lockIface.isLocked;
+ }
+ }
+
+ Item { Layout.fillHeight: true }
+ }
+ }
+ Component {
+ id: untrustedDevice
+ ColumnLayout {
+ id: untrustedView
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ Kirigami.BasicListItem {
+ label: i18n("Pair")
+ onClicked: deviceView.currentDevice.requestPair()
+ }
+ }
+ }
+ }
+}
diff --git a/app/qml/DeviceDelegate.qml b/app/qml/DeviceDelegate.qml
deleted file mode 100644
index 2b528ca..0000000
--- a/app/qml/DeviceDelegate.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2015 Aleix Pol Gonzalez <aleixpol at 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) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.1
-import org.kde.kquickcontrolsaddons 2.0
-import org.kde.kdeconnect 1.0
-
-Item
-{
- height: info.height
- signal clicked
- QIconItem {
- id: icon
- width: 40
- height: parent.height
- icon: iconName
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: parent.clicked()
- }
- ColumnLayout {
- id: info
- anchors {
- left: icon.right
- top: parent.top
- right: parent.right
- }
- property bool expand: false
- Label {
- Layout.fillWidth: true
- horizontalAlignment: Text.AlignHCenter
- text: display + "
" + toolTip
- }
- }
-}
diff --git a/app/qml/main.qml b/app/qml/main.qml
index c9050a6..132b08f 100644
--- a/app/qml/main.qml
+++ b/app/qml/main.qml
@@ -21,36 +21,20 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
+import org.kde.kirigami 1.0 as Kirigami
import org.kde.kdeconnect 1.0
-ApplicationWindow
+Kirigami.ApplicationWindow
{
id: root
visible: true
width: 400
height: 500
- title: i18n("KDE Connect")
- toolBar: RowLayout {
- Button {
- iconName: "go-previous"
- enabled: stack.depth>1
- onClicked: stack.pop()
- }
- Label {
- Layout.fillWidth: true
- text: i18n("KDE Connect")
- font.pointSize: 20
- }
- }
- StackView {
- id: stack
- anchors {
- fill: parent
- margins: 5
- }
- initialItem: ScrollView {
- Layout.fillHeight: true
+ pageStack.initialPage: Kirigami.Page {
+ title: i18n("KDE Connect")
+ ScrollView {
+ anchors.fill: parent
ListView {
id: devicesView
@@ -70,86 +54,21 @@ ApplicationWindow
}
}
- spacing: 5
model: DevicesSortProxyModel {
sourceModel: DevicesModel {
id: connectDeviceModel
displayFilter: DevicesModel.Reachable
}
}
- delegate: DeviceDelegate {
+ delegate: Kirigami.BasicListItem {
width: ListView.view.width
+ icon: iconName
+ label: display + "
" + toolTip
onClicked: {
- var data = {
- item: deviceViewComponent,
- properties: {currentDevice: device}
- };
- stack.push(data);
- }
- }
- }
- }
- }
-
- Component {
- id: deviceViewComponent
- Loader {
- id: deviceView
- property QtObject currentDevice
- Layout.fillHeight: true
- Layout.fillWidth: true
-
- sourceComponent: currentDevice.isTrusted ? trustedDevice : untrustedDevice
- Component {
- id: trustedDevice
- ColumnLayout {
- id: trustedView
- Layout.fillHeight: true
- Layout.fillWidth: true
-
- Button {
- text: i18n("Un-Pair")
- onClicked: deviceView.currentDevice.unpair()
- }
- Button {
- text: i18n("Send Ping")
- onClicked: deviceView.currentDevice.pluginCall("ping", "sendPing");
- }
- Button {
- text: i18n("Open Multimedia Remote Control")
- onClicked: stack.push( {
- item: "qrc:/qml/mpris.qml",
- properties: { mprisInterface: MprisDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
- } );
- }
- Button {
- text: i18n("Mouse Pad")
- onClicked: stack.push( {
- item: "qrc:/qml/mousepad.qml",
- properties: { remoteControlInterface: RemoteControlDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
- } );
- }
- Button {
- property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
- text: lockIface.isLocked ? i18n("Unlock") : i18n("Lock")
- onClicked: {
- lockIface.isLocked = !lockIface.isLocked;
- }
- }
-
- Item { Layout.fillHeight: true }
- }
- }
- Component {
- id: untrustedDevice
- ColumnLayout {
- id: untrustedView
- Layout.fillHeight: true
- Layout.fillWidth: true
-
- Button {
- text: i18n("Pair")
- onClicked: deviceView.currentDevice.requestPair()
+ root.pageStack.push(
+ "qrc:/qml/Device.qml",
+ {currentDevice: device}
+ );
}
}
}
diff --git a/app/qml/mousepad.qml b/app/qml/mousepad.qml
index 302d16d..a3b1f02 100644
--- a/app/qml/mousepad.qml
+++ b/app/qml/mousepad.qml
@@ -21,47 +21,54 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
+import org.kde.kirigami 1.0 as Kirigami
-ColumnLayout
+Kirigami.Page
{
id: mousepad
+ title: i18n("Remote Control")
property QtObject remoteControlInterface
- MouseArea {
- id: area
- Layout.fillWidth: true
- Layout.fillHeight: true
- property var lastPos: Qt.point(-1, -1)
+ ColumnLayout
+ {
+ anchors.fill: parent
- onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
+ MouseArea {
+ id: area
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ property var lastPos: Qt.point(-1, -1)
- onPositionChanged: {
- if (lastPos.x > -1) {
-// console.log("move", mouse.x, mouse.y, lastPos)
- var delta = Qt.point(mouse.x-lastPos.x, mouse.y-lastPos.y);
+ onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
- remoteControlInterface.moveCursor(delta);
- }
- lastPos = Qt.point(mouse.x, mouse.y);
- }
- onReleased: {
- lastPos = Qt.point(-1, -1)
- }
- }
- RowLayout {
- Layout.fillWidth: true
+ onPositionChanged: {
+ if (lastPos.x > -1) {
+ // console.log("move", mouse.x, mouse.y, lastPos)
+ var delta = Qt.point(mouse.x-lastPos.x, mouse.y-lastPos.y);
- Button {
- Layout.fillWidth: true
- onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
- }
- Button {
- Layout.fillWidth: true
- onClicked: mousepad.remoteControlInterface.sendCommand("middleclick", true);
+ remoteControlInterface.moveCursor(delta);
+ }
+ lastPos = Qt.point(mouse.x, mouse.y);
+ }
+ onReleased: {
+ lastPos = Qt.point(-1, -1)
+ }
}
- Button {
+ RowLayout {
Layout.fillWidth: true
- onClicked: mousepad.remoteControlInterface.sendCommand("rightclick", true);
+
+ Button {
+ Layout.fillWidth: true
+ onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
+ }
+ Button {
+ Layout.fillWidth: true
+ onClicked: mousepad.remoteControlInterface.sendCommand("middleclick", true);
+ }
+ Button {
+ Layout.fillWidth: true
+ onClicked: mousepad.remoteControlInterface.sendCommand("rightclick", true);
+ }
}
}
}
diff --git a/app/qml/mpris.qml b/app/qml/mpris.qml
index 0dd66f2..7c2f6ba 100644
--- a/app/qml/mpris.qml
+++ b/app/qml/mpris.qml
@@ -21,52 +21,59 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
+import org.kde.kirigami 1.0 as Kirigami
-ColumnLayout
+Kirigami.Page
{
id: root
property QtObject mprisInterface
+ title: i18n("Multimedia Controls")
- Component.onCompleted: {
- mprisInterface.requestPlayerList();
- }
+ ColumnLayout
+ {
+ anchors.fill: parent
- Item { Layout.fillHeight: true }
- ComboBox {
- Layout.fillWidth: true
- model: root.mprisInterface.playerList
- onCurrentTextChanged: root.mprisInterface.player = currentText
- }
- Label {
- Layout.fillWidth: true
- text: root.mprisInterface.nowPlaying
- }
- RowLayout {
- Layout.fillWidth: true
- Button {
+ Component.onCompleted: {
+ mprisInterface.requestPlayerList();
+ }
+
+ Item { Layout.fillHeight: true }
+ ComboBox {
Layout.fillWidth: true
- iconName: "media-skip-backward"
- onClicked: root.mprisInterface.sendAction("Previous")
+ model: root.mprisInterface.playerList
+ onCurrentTextChanged: root.mprisInterface.player = currentText
}
- Button {
+ Label {
Layout.fillWidth: true
- iconName: root.mprisInterface.isPlaying ? "media-playback-pause" : "media-playback-start"
- onClicked: root.mprisInterface.sendAction("PlayPause");
+ text: root.mprisInterface.nowPlaying
}
- Button {
+ RowLayout {
Layout.fillWidth: true
- iconName: "media-skip-forward"
- onClicked: root.mprisInterface.sendAction("Next")
+ Button {
+ Layout.fillWidth: true
+ iconName: "media-skip-backward"
+ onClicked: root.mprisInterface.sendAction("Previous")
+ }
+ Button {
+ Layout.fillWidth: true
+ iconName: root.mprisInterface.isPlaying ? "media-playback-pause" : "media-playback-start"
+ onClicked: root.mprisInterface.sendAction("PlayPause");
+ }
+ Button {
+ Layout.fillWidth: true
+ iconName: "media-skip-forward"
+ onClicked: root.mprisInterface.sendAction("Next")
+ }
}
- }
- RowLayout {
- Layout.fillWidth: true
- Label { text: i18n("Volume:") }
- Slider {
- value: root.mprisInterface.volume
- maximumValue: 100
+ RowLayout {
Layout.fillWidth: true
+ Label { text: i18n("Volume:") }
+ Slider {
+ value: root.mprisInterface.volume
+ maximumValue: 100
+ Layout.fillWidth: true
+ }
}
+ Item { Layout.fillHeight: true }
}
- Item { Layout.fillHeight: true }
}
diff --git a/app/resources.qrc b/app/resources.qrc
index 225f851..df128d2 100644
--- a/app/resources.qrc
+++ b/app/resources.qrc
@@ -1,8 +1,8 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>qml/main.qml</file>
- <file>qml/DeviceDelegate.qml</file>
<file>qml/mpris.qml</file>
<file>qml/mousepad.qml</file>
+ <file>qml/Device.qml</file>
</qresource>
</RCC>
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list