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
=== modified file 'plugins/Aethercast/aethercastmanager.cpp'
--- plugins/Aethercast/aethercastmanager.cpp 2016-05-04 14:38:19 +0000
+++ plugins/Aethercast/aethercastmanager.cpp 2016-05-04 14:38:19 +0000
@@ -28,7 +28,8 @@
28 m_manager(new ManagerInterface(QStringLiteral("org.aethercast"), QStringLiteral("/org/aethercast"), QDBusConnection::systemBus(), this)),28 m_manager(new ManagerInterface(QStringLiteral("org.aethercast"), QStringLiteral("/org/aethercast"), QDBusConnection::systemBus(), this)),
29 m_inputProvider(new InputProvider(this))29 m_inputProvider(new InputProvider(this))
30{30{
31 QDBusConnection::systemBus().registerObject(MANAGER_PATH, QStringLiteral("org.aethercast.InputProvider"), m_inputProvider);31// QDBusConnection::systemBus().registerObject(MANAGER_PATH, QStringLiteral("org.aethercast.InputProvider"), m_inputProvider);
32 QDBusConnection::systemBus().registerObject(MANAGER_PATH, m_inputProvider);
32 m_manager->RegisterInputProvider(QDBusObjectPath(MANAGER_PATH), QVariantMap());33 m_manager->RegisterInputProvider(QDBusObjectPath(MANAGER_PATH), QVariantMap());
3334
34 connect(m_inputProvider, &InputProvider::cursorChanged, this, &AethercastManager::cursorChanged);35 connect(m_inputProvider, &InputProvider::cursorChanged, this, &AethercastManager::cursorChanged);
@@ -74,3 +75,8 @@
74{75{
75 m_inputProvider->setCursorSource(cursor);76 m_inputProvider->setCursorSource(cursor);
76}77}
78
79void AethercastManager::disconnectAll()
80{
81 m_manager->DisconnectAll();
82}
7783
=== modified file 'plugins/Aethercast/aethercastmanager.h'
--- plugins/Aethercast/aethercastmanager.h 2016-05-04 14:38:19 +0000
+++ plugins/Aethercast/aethercastmanager.h 2016-05-04 14:38:19 +0000
@@ -43,6 +43,9 @@
43 QString cursor() const;43 QString cursor() const;
44 void setCursor(const QString &cursor);44 void setCursor(const QString &cursor);
4545
46public Q_SLOTS:
47 void disconnectAll();
48
46//public Q_SLOTS:49//public Q_SLOTS:
47// void sendMousePosition(int x, int y);50// void sendMousePosition(int x, int y);
4851
4952
=== modified file 'plugins/Aethercast/managerinterface.h'
--- plugins/Aethercast/managerinterface.h 2016-05-04 14:38:19 +0000
+++ plugins/Aethercast/managerinterface.h 2016-05-04 14:38:19 +0000
@@ -48,6 +48,12 @@
48 { return qvariant_cast< QString >(property("State")); }48 { return qvariant_cast< QString >(property("State")); }
4949
50public Q_SLOTS: // METHODS50public Q_SLOTS: // METHODS
51 inline QDBusPendingReply<> DisconnectAll()
52 {
53 QList<QVariant> argumentList;
54 return asyncCallWithArgumentList(QStringLiteral("DisconnectAll"), argumentList);
55 }
56
51 inline QDBusPendingReply<> RegisterInputProvider(const QDBusObjectPath &path, const QVariantMap &options)57 inline QDBusPendingReply<> RegisterInputProvider(const QDBusObjectPath &path, const QVariantMap &options)
52 {58 {
53 QList<QVariant> argumentList;59 QList<QVariant> argumentList;
5460
=== modified file 'plugins/Aethercast/org.aethercast.xml'
--- plugins/Aethercast/org.aethercast.xml 2016-05-04 14:38:19 +0000
+++ plugins/Aethercast/org.aethercast.xml 2016-05-04 14:38:19 +0000
@@ -9,6 +9,7 @@
9 <arg name="path" type="o" direction="in"/>9 <arg name="path" type="o" direction="in"/>
10 </method>10 </method>
11 <method name="Scan"/>11 <method name="Scan"/>
12 <method name="DisconnectAll"/>
12 <method name="RegisterInputProvider">13 <method name="RegisterInputProvider">
13 <arg name="path" type="o" direction="in"/>14 <arg name="path" type="o" direction="in"/>
14 <arg name="options" type="a{sv}" direction="in"/>15 <arg name="options" type="a{sv}" direction="in"/>
1516
=== modified file 'qml/DisabledScreenNotice.qml'
--- qml/DisabledScreenNotice.qml 2016-02-03 14:45:58 +0000
+++ qml/DisabledScreenNotice.qml 2016-05-04 14:38:19 +0000
@@ -17,9 +17,11 @@
17import QtQuick 2.417import QtQuick 2.4
18import QtQuick.Layouts 1.118import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Ubuntu.Gestures 0.1
20import Unity.Session 0.121import Unity.Session 0.1
21import QtQuick.Window 2.222import QtQuick.Window 2.2
22import "Components"23import "Components"
24import Aethercast 0.1
2325
24Item {26Item {
25 id: root27 id: root
@@ -123,4 +125,75 @@
123 anchors.fill: parent125 anchors.fill: parent
124 }126 }
125 }127 }
128
129 MouseArea {
130 anchors.fill: parent
131 visible: topPanel.y > -topPanel.height
132 onClicked: {
133 topPanel.collapse()
134 }
135 }
136
137 Rectangle {
138 id: topPanel
139 anchors { left: parent.left; right: parent.right }
140 height: units.gu(10)
141 color: "#292929"
142 y: -height
143
144 RowLayout {
145 anchors.fill: parent
146 anchors.margins: units.gu(2)
147
148 Label {
149 text: "External display"
150 Layout.fillWidth: true
151 color: "white"
152 }
153 Button {
154 text: "Disconnect"
155 color: UbuntuColors.green
156 onClicked: {
157 AethercastManager.disconnectAll()
158 topPanel.collapse();
159 }
160 }
161 }
162
163 function collapse() {
164 snapAnimation.targetY = -topPanel.height;
165 snapAnimation.start();
166 }
167
168 function expand() {
169 snapAnimation.targetY = 0
170 snapAnimation.start();
171 }
172
173 UbuntuNumberAnimation {
174 id: snapAnimation
175 property int targetY
176 target: topPanel
177 property: "y"
178 to: targetY
179 }
180 }
181
182 DirectionalDragArea {
183 id: topDragArea
184 direction: Direction.Downwards
185 width: parent.width
186 height: units.gu(1)
187 onDistanceChanged: topPanel.y = Math.min(-topPanel.height + distance, 0)
188 onDraggingChanged: {
189 print("dragging changed")
190 if (!dragging) {
191 if (topPanel.y > -topPanel.height / 2) {
192 topPanel.expand()
193 } else {
194 topPanel.collapse()
195 }
196 }
197 }
198 }
126}199}
127200
=== modified file 'tests/qmltests/tst_DisabledScreenNotice.qml'
--- tests/qmltests/tst_DisabledScreenNotice.qml 2016-02-12 11:16:31 +0000
+++ tests/qmltests/tst_DisabledScreenNotice.qml 2016-05-04 14:38:19 +0000
@@ -27,6 +27,12 @@
27 width: units.gu(80)27 width: units.gu(80)
28 height: units.gu(70)28 height: units.gu(70)
2929
30 Binding {
31 target: MouseTouchAdaptor
32 property: "enabled"
33 value: true
34 }
35
30 DisabledScreenNotice {36 DisabledScreenNotice {
31 id: touchScreenPad37 id: touchScreenPad
32 anchors.fill: parent38 anchors.fill: parent

Subscribers

People subscribed via source and target branches