Merge lp:~larryprice/libertine/deb-filepicker into lp:libertine

Proposed by Larry Price
Status: Needs review
Proposed branch: lp:~larryprice/libertine/deb-filepicker
Merge into: lp:libertine
Diff against target: 135 lines (+23/-79)
2 files modified
qml/common/ContainerEditView.qml (+6/-2)
qml/common/DebianPackagePicker.qml (+17/-77)
To merge this branch: bzr merge lp:~larryprice/libertine/deb-filepicker
Reviewer Review Type Date Requested Status
Christopher Townsend Needs Fixing
Libertine CI Bot continuous-integration Approve
Review via email: mp+320829@code.launchpad.net

Commit message

Use the QML FileDialog to pick debian packages for installation.

Description of the change

Use the QML FileDialog to pick debian packages for installation.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:410
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/490/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/887
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/731
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/731
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/731
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/731
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/897
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/888
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/888/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/888
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/888/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/888
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/888/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/888
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/888/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/490/rebuild

review: Approve (continuous-integration)
411. By Larry Price

merge

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:411
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/501/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/905
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/743
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/743
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/743
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/743
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/916
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/905
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/905/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/905
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/905/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/905
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/905/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/905
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/905/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/501/rebuild

review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

When I click "Choose Debian package to install", the filepicker does not show and this is what is in the systemd log:

Apr 05 14:50:46 Yoga2 libertine-manager-app[25271]: QQmlComponent: Component is not ready
Apr 05 14:50:46 Yoga2 libertine-manager-app[25271]: file:///usr/share/libertine/qml/common/ContainerEditView.qml:157: TypeError: Cannot call method 'open' of null

review: Needs Fixing
Revision history for this message
Larry Price (larryprice) wrote :

I see the same results. AddBindMountDialog has the same problem in Unity8. For some reason, the createObject() fails and doesn't give any specifics. Unfortunately, I'm not even able to get libertine-manager-app to run in Unity 7 right now (from the archive). Big Trouble in Little China. It's trying to use mir automatically, which is wrong. Might be recent U-A-L changes?

Unmerged revisions

411. By Larry Price

merge

410. By Larry Price

Seems to be mostly working

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/common/ContainerEditView.qml'
2--- qml/common/ContainerEditView.qml 2017-02-28 20:54:07 +0000
3+++ qml/common/ContainerEditView.qml 2017-03-31 20:18:19 +0000
4@@ -138,8 +138,7 @@
5 width: parent.width
6 onClicked: {
7 PopupUtils.close(addAppsDialog)
8- var packages = containerConfigList.getDebianPackageFiles()
9- pageStack.addPageToNextColumn(homeView, Qt.resolvedUrl("DebianPackagePicker.qml"), {packageList: packages})
10+ openDebianPackagePicker()
11 }
12 }
13 Button {
14@@ -153,6 +152,11 @@
15 }
16 }
17
18+ function openDebianPackagePicker() {
19+ var fileDialog = Qt.createComponent("DebianPackagePicker.qml").createObject(homeView)
20+ fileDialog.open()
21+ }
22+
23 property var searchResultsView: null
24 function openSearchDialog(container) {
25 var dialog = PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml"), null, {currentContainer: container})
26
27=== modified file 'qml/common/DebianPackagePicker.qml'
28--- qml/common/DebianPackagePicker.qml 2017-03-02 19:42:45 +0000
29+++ qml/common/DebianPackagePicker.qml 2017-03-31 20:18:19 +0000
30@@ -3,7 +3,7 @@
31 * @brief Libertine container Debian package picker view
32 */
33 /*
34- * Copyright 2016 Canonical Ltd
35+ * Copyright 2016-2017 Canonical Ltd
36 *
37 * Libertine is free software: you can redistribute it and/or modify it under
38 * the terms of the GNU General Public License, version 3, as published by the
39@@ -18,80 +18,20 @@
40 */
41
42 import QtQuick 2.4
43-import Ubuntu.Components 1.3
44-
45-
46-Page {
47- id: debianPackagePicker
48- header: PageHeader {
49- id: pageHeader
50- title: i18n.tr("Available Debian Packages to Install")
51- }
52-
53- property var packageList: null
54-
55- ListModel {
56- id: packageListModel
57- }
58-
59- UbuntuListView {
60- id: listView
61- anchors {
62- topMargin: pageHeader.height
63- fill: parent
64- }
65- model: packageListModel
66- visible: packageList.length > 0 ? true : false
67-
68- function install(fileName) {
69- pageStack.removePages(debianPackagePicker)
70- pageStack.currentPage.installPackage(containerConfigList.getDownloadsLocation() + "/" + fileName)
71- }
72-
73- delegate: ListItem {
74- id: packageItem
75- Label {
76- text: model.file_name
77- anchors {
78- verticalCenter: parent.verticalCenter
79- left: parent.left
80- leftMargin: units.gu(2)
81- }
82- }
83-
84- onClicked: {
85- listView.install(model.file_name)
86- }
87-
88- trailingActions: ListItemActions {
89- actions: [
90- Action {
91- iconName: "select"
92- description: i18n.tr("Install Package")
93- onTriggered: {
94- listView.install(model.file_name)
95- }
96- }
97- ]
98- }
99- }
100- }
101-
102- Label {
103- id: emptyLabel
104- anchors.centerIn: parent
105- visible: packageList.length == 0 ? true : false
106- wrapMode: Text.Wrap
107- width: parent.width
108- horizontalAlignment: Text.AlignHCenter
109- text: i18n.tr("No Debian packages available")
110- }
111-
112- Component.onCompleted: {
113- for (var i = 0; i < packageList.length; ++i)
114- {
115- packageListModel.append({"file_name": packageList[i]})
116- }
117- }
118-
119+import QtQuick.Dialogs 1.0
120+
121+FileDialog {
122+ id: debianPicker
123+ title: "Choose debian package to install"
124+ nameFilters: ["debian packages (*.deb)"]
125+ selectMultiple: true
126+ onAccepted: {
127+ if (debianPicker.fileUrls.length > 0) {
128+ var packages = ""
129+ for (var i = 0; i < fileUrls.length; ++i) {
130+ packages += fileUrls[i].toString().replace("file:///", "/") + " "
131+ }
132+ homeView.installPackage(packages)
133+ }
134+ }
135 }

Subscribers

People subscribed via source and target branches