Merge lp:~mzanetti/unity8/aethercast-disconnect-all into lp:unity8

Proposed by Michael Zanetti
Status: Work in progress
Proposed branch: lp:~mzanetti/unity8/aethercast-disconnect-all
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/aethercast-cursor
Diff against target: 174 lines (+96/-1)
6 files modified
plugins/Aethercast/aethercastmanager.cpp (+7/-1)
plugins/Aethercast/aethercastmanager.h (+3/-0)
plugins/Aethercast/managerinterface.h (+6/-0)
plugins/Aethercast/org.aethercast.xml (+1/-0)
qml/DisabledScreenNotice.qml (+73/-0)
tests/qmltests/tst_DisabledScreenNotice.qml (+6/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/aethercast-disconnect-all
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Lukáš Tinkl (community) Abstain
Review via email: mp+286645@code.launchpad.net

Commit message

add a disconnect all button to the virtual touchpad

To post a comment you must log in.
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

+ text: "External display"
+ text: "Disconnect"

Needs some i18n()

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> + text: "External display"
> + text: "Disconnect"
>
> Needs some i18n()

this branch will be discarded after the demo

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

KK, I see

review: Abstain
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
2205. By Michael Zanetti

don't provide the path... the silo doesn't like it for some reason

2206. By Michael Zanetti

whitespace

2207. By Michael Zanetti

merge prereq

2208. By Michael Zanetti

merge prereq

Unmerged revisions

2208. By Michael Zanetti

merge prereq

2207. By Michael Zanetti

merge prereq

2206. By Michael Zanetti

whitespace

2205. By Michael Zanetti

don't provide the path... the silo doesn't like it for some reason

2204. By Michael Zanetti

add disconnectAll button to top panel in virtual touchpad

2203. By Michael Zanetti

base on ~mzanetti/unity8/aethercast-cursor

2202. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2201. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

2200. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Aethercast/aethercastmanager.cpp'
2--- plugins/Aethercast/aethercastmanager.cpp 2016-05-04 14:38:19 +0000
3+++ plugins/Aethercast/aethercastmanager.cpp 2016-05-04 14:38:19 +0000
4@@ -28,7 +28,8 @@
5 m_manager(new ManagerInterface(QStringLiteral("org.aethercast"), QStringLiteral("/org/aethercast"), QDBusConnection::systemBus(), this)),
6 m_inputProvider(new InputProvider(this))
7 {
8- QDBusConnection::systemBus().registerObject(MANAGER_PATH, QStringLiteral("org.aethercast.InputProvider"), m_inputProvider);
9+// QDBusConnection::systemBus().registerObject(MANAGER_PATH, QStringLiteral("org.aethercast.InputProvider"), m_inputProvider);
10+ QDBusConnection::systemBus().registerObject(MANAGER_PATH, m_inputProvider);
11 m_manager->RegisterInputProvider(QDBusObjectPath(MANAGER_PATH), QVariantMap());
12
13 connect(m_inputProvider, &InputProvider::cursorChanged, this, &AethercastManager::cursorChanged);
14@@ -74,3 +75,8 @@
15 {
16 m_inputProvider->setCursorSource(cursor);
17 }
18+
19+void AethercastManager::disconnectAll()
20+{
21+ m_manager->DisconnectAll();
22+}
23
24=== modified file 'plugins/Aethercast/aethercastmanager.h'
25--- plugins/Aethercast/aethercastmanager.h 2016-05-04 14:38:19 +0000
26+++ plugins/Aethercast/aethercastmanager.h 2016-05-04 14:38:19 +0000
27@@ -43,6 +43,9 @@
28 QString cursor() const;
29 void setCursor(const QString &cursor);
30
31+public Q_SLOTS:
32+ void disconnectAll();
33+
34 //public Q_SLOTS:
35 // void sendMousePosition(int x, int y);
36
37
38=== modified file 'plugins/Aethercast/managerinterface.h'
39--- plugins/Aethercast/managerinterface.h 2016-05-04 14:38:19 +0000
40+++ plugins/Aethercast/managerinterface.h 2016-05-04 14:38:19 +0000
41@@ -48,6 +48,12 @@
42 { return qvariant_cast< QString >(property("State")); }
43
44 public Q_SLOTS: // METHODS
45+ inline QDBusPendingReply<> DisconnectAll()
46+ {
47+ QList<QVariant> argumentList;
48+ return asyncCallWithArgumentList(QStringLiteral("DisconnectAll"), argumentList);
49+ }
50+
51 inline QDBusPendingReply<> RegisterInputProvider(const QDBusObjectPath &path, const QVariantMap &options)
52 {
53 QList<QVariant> argumentList;
54
55=== modified file 'plugins/Aethercast/org.aethercast.xml'
56--- plugins/Aethercast/org.aethercast.xml 2016-05-04 14:38:19 +0000
57+++ plugins/Aethercast/org.aethercast.xml 2016-05-04 14:38:19 +0000
58@@ -9,6 +9,7 @@
59 <arg name="path" type="o" direction="in"/>
60 </method>
61 <method name="Scan"/>
62+ <method name="DisconnectAll"/>
63 <method name="RegisterInputProvider">
64 <arg name="path" type="o" direction="in"/>
65 <arg name="options" type="a{sv}" direction="in"/>
66
67=== modified file 'qml/DisabledScreenNotice.qml'
68--- qml/DisabledScreenNotice.qml 2016-02-03 14:45:58 +0000
69+++ qml/DisabledScreenNotice.qml 2016-05-04 14:38:19 +0000
70@@ -17,9 +17,11 @@
71 import QtQuick 2.4
72 import QtQuick.Layouts 1.1
73 import Ubuntu.Components 1.3
74+import Ubuntu.Gestures 0.1
75 import Unity.Session 0.1
76 import QtQuick.Window 2.2
77 import "Components"
78+import Aethercast 0.1
79
80 Item {
81 id: root
82@@ -123,4 +125,75 @@
83 anchors.fill: parent
84 }
85 }
86+
87+ MouseArea {
88+ anchors.fill: parent
89+ visible: topPanel.y > -topPanel.height
90+ onClicked: {
91+ topPanel.collapse()
92+ }
93+ }
94+
95+ Rectangle {
96+ id: topPanel
97+ anchors { left: parent.left; right: parent.right }
98+ height: units.gu(10)
99+ color: "#292929"
100+ y: -height
101+
102+ RowLayout {
103+ anchors.fill: parent
104+ anchors.margins: units.gu(2)
105+
106+ Label {
107+ text: "External display"
108+ Layout.fillWidth: true
109+ color: "white"
110+ }
111+ Button {
112+ text: "Disconnect"
113+ color: UbuntuColors.green
114+ onClicked: {
115+ AethercastManager.disconnectAll()
116+ topPanel.collapse();
117+ }
118+ }
119+ }
120+
121+ function collapse() {
122+ snapAnimation.targetY = -topPanel.height;
123+ snapAnimation.start();
124+ }
125+
126+ function expand() {
127+ snapAnimation.targetY = 0
128+ snapAnimation.start();
129+ }
130+
131+ UbuntuNumberAnimation {
132+ id: snapAnimation
133+ property int targetY
134+ target: topPanel
135+ property: "y"
136+ to: targetY
137+ }
138+ }
139+
140+ DirectionalDragArea {
141+ id: topDragArea
142+ direction: Direction.Downwards
143+ width: parent.width
144+ height: units.gu(1)
145+ onDistanceChanged: topPanel.y = Math.min(-topPanel.height + distance, 0)
146+ onDraggingChanged: {
147+ print("dragging changed")
148+ if (!dragging) {
149+ if (topPanel.y > -topPanel.height / 2) {
150+ topPanel.expand()
151+ } else {
152+ topPanel.collapse()
153+ }
154+ }
155+ }
156+ }
157 }
158
159=== modified file 'tests/qmltests/tst_DisabledScreenNotice.qml'
160--- tests/qmltests/tst_DisabledScreenNotice.qml 2016-02-12 11:16:31 +0000
161+++ tests/qmltests/tst_DisabledScreenNotice.qml 2016-05-04 14:38:19 +0000
162@@ -27,6 +27,12 @@
163 width: units.gu(80)
164 height: units.gu(70)
165
166+ Binding {
167+ target: MouseTouchAdaptor
168+ property: "enabled"
169+ value: true
170+ }
171+
172 DisabledScreenNotice {
173 id: touchScreenPad
174 anchors.fill: parent

Subscribers

People subscribed via source and target branches