Merge lp:~mitya57/url-dispatcher/qtquickcontrols into lp:url-dispatcher

Proposed by Dmitry Shachnev
Status: Merged
Merged at revision: 122
Proposed branch: lp:~mitya57/url-dispatcher/qtquickcontrols
Merge into: lp:url-dispatcher
Diff against target: 154 lines (+38/-78)
3 files modified
data/bad-url.qml (+9/-25)
debian/control (+4/-1)
gui/url-dispatcher-gui.qml (+25/-52)
To merge this branch: bzr merge lp:~mitya57/url-dispatcher/qtquickcontrols
Reviewer Review Type Date Requested Status
Dimitri John Ledkov yolo Approve
Steve Langasek Pending
Sebastien Bacher Pending
dobey Pending
Indicator Applet Developers Pending
Review via email: mp+329302@code.launchpad.net

Commit message

Ported the GUI from Ubuntu UI Toolkit to Qt Quick Controls.

Description of the change

Ported away from Ubuntu UI Toolkit, which is going to be removed.

I used Qt Quick Controls 1, as in Controls 2 the dialogs support is still in beta and API will change in the future.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) :
review: Approve (yolo)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/bad-url.qml'
2--- data/bad-url.qml 2016-08-18 02:11:21 +0000
3+++ data/bad-url.qml 2017-08-21 13:04:24 +0000
4@@ -14,29 +14,13 @@
5 * along with this program. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8-import QtQuick 2.0
9-import Ubuntu.Components 1.0
10-import Ubuntu.Components.Popups 1.0
11-
12-MainView {
13- applicationName: "com.canonical.url-dispatcher.bad-url-prompt"
14- automaticOrientation: true
15- backgroundColor: "transparent"
16- anchors.fill: parent
17-
18- Component {
19- id: dialog
20- Dialog {
21- title: i18n.tr("Unrecognized Address")
22- text: i18n.tr("Ubuntu can't open addresses of type “%1”.").arg(Qt.application.arguments[2].split(':')[0])
23-
24- Button {
25- text: i18n.tr("OK")
26- color: UbuntuColors.orange
27- onClicked: Qt.quit()
28- }
29- }
30- }
31-
32- Component.onCompleted: PopupUtils.open(dialog)
33+import QtQuick 2.2
34+import QtQuick.Dialogs 1.1
35+
36+MessageDialog {
37+ id: dialog
38+ title: qsTr("Unrecognized Address")
39+ text: qsTr("Ubuntu can't open addresses of type “%1”.").arg(Qt.application.arguments[2].split(':')[0])
40+ onAccepted: Qt.quit()
41+ Component.onCompleted: visible = true
42 }
43
44=== modified file 'debian/control'
45--- debian/control 2017-03-28 18:28:11 +0000
46+++ debian/control 2017-08-21 13:04:24 +0000
47@@ -45,7 +45,7 @@
48 ${shlibs:Depends},
49 # For the bad URL dialog
50 qtchooser,
51- qtdeclarative5-ubuntu-ui-toolkit-plugin,
52+ qml-module-qtquick-dialogs,
53 Description: service to allow sending of URLs and get handlers started
54 Allows applications to request a URL to be opened and handled by another
55 process without seeing the list of other applications on the system or
56@@ -71,6 +71,9 @@
57 ${misc:Depends},
58 ${shlibs:Depends},
59 qtchooser,
60+ qml-module-qtquick-controls,
61+ qml-module-qtquick-layouts,
62+ qml-module-qtquick-window2,
63 Description: GUI tools for working with the URL Dispatcher.
64 Allows applications to request a URL to be opened and handled by another
65 process without seeing the list of other applications on the system or
66
67=== modified file 'gui/url-dispatcher-gui.qml'
68--- gui/url-dispatcher-gui.qml 2016-08-17 22:00:22 +0000
69+++ gui/url-dispatcher-gui.qml 2017-08-21 13:04:24 +0000
70@@ -1,59 +1,32 @@
71 import QtQuick 2.4
72-import Ubuntu.Components 1.3
73-import Ubuntu.Components.ListItems 1.3
74-
75-MainView {
76- applicationName: "url-dispatcher-gui"
77-
78- Page {
79- header: PageHeader {
80- title: "URL Dispatcher GUI"
81- flickable: flickme
82+import QtQuick.Window 2.2
83+import QtQuick.Controls 1.4
84+import QtQuick.Layouts 1.3
85+
86+Window {
87+ visible: true
88+ title: "URL Dispatcher GUI"
89+ width: 360
90+ height: 100
91+
92+ ColumnLayout {
93+ anchors.fill: parent
94+
95+ TextField {
96+ anchors.left: parent.left
97+ anchors.right: parent.right
98+ id: textbox
99+ placeholderText: "URL (e.g. 'http://ubuntu.com')"
100 }
101
102- Flickable {
103- id: flickme
104- anchors.fill: parent
105-
106- Column {
107- anchors.fill: parent
108-
109- ListItem {
110- contentItem.anchors {
111- leftMargin: units.gu(2)
112- rightMargin: units.gu(2)
113- topMargin: units.gu(1)
114- bottomMargin: units.gu(1)
115- }
116-
117- TextField {
118- id: textbox
119- anchors.fill: parent
120- placeholderText: "URL (e.g. 'http://ubuntu.com')"
121- }
122- }
123-
124- ListItem {
125- contentItem.anchors {
126- leftMargin: units.gu(2)
127- rightMargin: units.gu(2)
128- topMargin: units.gu(1)
129- bottomMargin: units.gu(1)
130- }
131-
132- Button {
133- anchors.fill: parent
134- text: "Send URL"
135- onClicked: {
136- console.log("Sending URL: " + textbox.text)
137- Qt.openUrlExternally(textbox.text)
138- }
139- }
140- }
141+ Button {
142+ anchors.left: parent.left
143+ anchors.right: parent.right
144+ text: "Send URL"
145+ onClicked: {
146+ console.log("Sending URL: " + textbox.text)
147+ Qt.openUrlExternally(textbox.text)
148 }
149 }
150-
151 }
152-
153-
154 }

Subscribers

People subscribed via source and target branches