Merge lp:~larryprice/libertine/system-settings-plugin into lp:libertine
- system-settings-plugin
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Christopher Townsend | ||||
Approved revision: | 337 | ||||
Merged at revision: | 311 | ||||
Proposed branch: | lp:~larryprice/libertine/system-settings-plugin | ||||
Merge into: | lp:libertine | ||||
Diff against target: |
1951 lines (+786/-286) 52 files modified
CMakeLists.txt (+11/-4) common/CMakeLists.txt (+13/-0) common/ContainerAppsList.cpp (+4/-2) common/ContainerAppsList.h (+2/-3) common/ContainerArchivesList.cpp (+4/-2) common/ContainerArchivesList.h (+0/-2) common/ContainerConfig.cpp (+2/-2) common/ContainerConfigList.cpp (+6/-7) common/ContainerManager.cpp (+12/-1) common/LibertineConfig.cpp (+2/-27) common/LibertineConfig.h (+3/-7) common/PackageOperationDetails.cpp (+78/-0) common/PackageOperationDetails.h (+43/-0) data/CMakeLists.txt (+1/-1) data/libertine-manager-app.desktop (+2/-2) debian/control (+47/-6) debian/libertine-manager-app.install (+3/-4) debian/libertine-qt-common.install (+2/-0) debian/libertine-tools.install (+1/-1) debian/python3-libertine-chroot.install (+1/-1) debian/python3-libertine-lxc.install (+3/-3) debian/python3-libertine.install (+2/-2) debian/ubuntu-system-settings-libertine.install (+4/-0) libertine/CMakeLists.txt (+10/-5) libertine/config.h.in (+1/-1) libertine/libertine.cpp (+27/-14) libertine/libertine.h (+2/-0) liblibertine/CMakeLists.txt (+12/-13) liblibertine/libertine.cpp (+3/-2) qml/CMakeLists.txt (+3/-0) qml/common/AddExtraArchiveView.qml (+4/-2) qml/common/ContainerEditView.qml (+7/-8) qml/common/ContainerInfoView.qml (+5/-7) qml/common/ContainerOptionsDialog.qml (+5/-5) qml/common/ContainersList.qml (+131/-0) qml/common/ExtraArchivesView.qml (+1/-1) qml/common/ManageContainer.qml (+12/-10) qml/common/PackageInfoView.qml (+12/-13) qml/common/SearchPackagesDialog.qml (+3/-2) qml/common/SearchResults.qml (+3/-1) qml/common/SearchResultsView.qml (+11/-9) qml/gui/ContainersView.qml (+8/-103) qml/gui/WelcomeView.qml (+3/-2) qml/gui/libertine.qml (+10/-9) qml/plugin/MainSettingsPage.qml (+58/-0) system-settings-plugin/CMakeLists.txt (+38/-0) system-settings-plugin/config.h.in (+16/-0) system-settings-plugin/libertine.settings.in (+14/-0) system-settings-plugin/plugin.cpp (+105/-0) system-settings-plugin/plugin.h (+34/-0) tests/unit/ContainerConfigListTests.cpp (+1/-1) tests/unit/ContainerConfigTests.cpp (+1/-1) |
||||
To merge this branch: | bzr merge lp:~larryprice/libertine/system-settings-plugin | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christopher Townsend | Approve | ||
Libertine CI Bot | continuous-integration | Approve | |
Stephen M. Webb (community) | Approve | ||
Review via email: mp+306926@code.launchpad.net |
Commit message
Add implementation for libertine gui as a system-settings plugin.
Description of the change
Port the libertine gui to also be available as an ubuntu-
This involved moving around the QML files, moving the common libertine code, and adding a package for the plugin. There was substantial refactoring of the QML to utilize a central PackageOperatio
To test the system-settings plugin, you'll have to run `make install` from the root dir or the `system-
Libertine CI Bot (libertine-ci-bot) wrote : | # |
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:317
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:319
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 320. By Larry Price
-
Use LIBRARIES var from SS
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:320
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 321. By Larry Price
-
Hopefully fixing packaging issues by linking to Quick instead of Core, which works with local pdebuild
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:321
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 322. By Larry Price
-
errorOccurred is from Qt5.6, which is not available in vivid+overlay
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:322
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 323. By Larry Price
-
Need to perform static cast to use lambda syntax on error signal
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:323
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 324. By Larry Price
-
Manually adding /usr/include to the include dirs when using automoc
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:324
https:/
Executed test runs:
FAILURE: https:/
None: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 325. By Larry Price
-
Merge with trunk
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:325
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 326. By Larry Price
-
merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:326
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
As discussed on IRC, the "libertine" binary package should be renamed to "libertine-
The current "libertine" binary package should be made into a dummy transitional package that depends on the new package.
Christopher Townsend (townsend) wrote : | # |
Another thing discussed on IRC is to make a common qt package shared by both ubuntu-
- 327. By Larry Price
-
Add common qml module
- 328. By Larry Price
-
This should take care of the common code better
- 329. By Larry Price
-
rename libertine to l-m-a
- 330. By Larry Price
-
merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:330
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 331. By Larry Price
-
dummy
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:331
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Ok, I'm good with this. I've asked bregma to also give this a review, particularly the packaging changes. Will wait on his feedback before TA'ing.
- 332. By Larry Price
-
renaming libertine -> libertine-
manager- app - 333. By Larry Price
-
merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:333
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 334. By Larry Price
-
Update .desktop file as well
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:334
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Stephen M. Webb (bregma) wrote : | # |
Packaging looks OK but please run "wrap-and-sort -a" to keep the formatting and ordering in the control files.
- 335. By Larry Price
-
Fix bad link
- 336. By Larry Price
-
Apply wrap-and-sort
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:335
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:336
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 337. By Larry Price
-
Commonize the ListView used to show containers
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:337
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Ok, this all looks good to me. Thanks!
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-09-13 18:17:52 +0000 |
3 | +++ CMakeLists.txt 2016-10-11 17:13:48 +0000 |
4 | @@ -1,7 +1,7 @@ |
5 | cmake_minimum_required(VERSION 3.0.2) |
6 | cmake_policy(SET CMP0048 NEW) |
7 | |
8 | -project(libertine |
9 | +project(libertine |
10 | VERSION 1.4.1) |
11 | |
12 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}") |
13 | @@ -32,13 +32,21 @@ |
14 | |
15 | set(CMAKE_AUTOMOC ON) |
16 | |
17 | +set(LIBERTINE_COMMON libertine-common) |
18 | +set(LIBERTINE_CORE libertine) |
19 | +set(LIBERTINE_EXE_NAME libertine-manager-app) |
20 | +set(LIBERTINE_QML_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}/qml) |
21 | + |
22 | +add_subdirectory(qml) |
23 | +add_subdirectory(liblibertine) |
24 | +add_subdirectory(common) |
25 | add_subdirectory(libertine) |
26 | +add_subdirectory(system-settings-plugin) |
27 | add_subdirectory(python) |
28 | add_subdirectory(data) |
29 | add_subdirectory(tools) |
30 | -add_subdirectory(liblibertine) |
31 | +add_subdirectory(pasted) |
32 | add_subdirectory(po) |
33 | -add_subdirectory(pasted) |
34 | |
35 | include(CTest) |
36 | add_subdirectory(tests) |
37 | @@ -50,4 +58,3 @@ |
38 | | xz >${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.xz |
39 | && rm .gitattributes |
40 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
41 | - |
42 | |
43 | === added directory 'common' |
44 | === added file 'common/CMakeLists.txt' |
45 | --- common/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
46 | +++ common/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
47 | @@ -0,0 +1,13 @@ |
48 | +add_library(${LIBERTINE_COMMON} |
49 | + ContainerAppsList.cpp |
50 | + ContainerArchivesList.cpp |
51 | + ContainerConfig.cpp |
52 | + ContainerConfigList.cpp |
53 | + ContainerManager.cpp |
54 | + LibertineConfig.cpp |
55 | + PackageOperationDetails.cpp |
56 | +) |
57 | + |
58 | +target_link_libraries(${LIBERTINE_COMMON} ${LIBERTINE_CORE} Qt5::Core) |
59 | + |
60 | +install(TARGETS ${LIBERTINE_COMMON_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
61 | |
62 | === renamed file 'libertine/ContainerAppsList.cpp' => 'common/ContainerAppsList.cpp' |
63 | --- libertine/ContainerAppsList.cpp 2016-08-12 19:39:50 +0000 |
64 | +++ common/ContainerAppsList.cpp 2016-10-11 17:13:48 +0000 |
65 | @@ -16,8 +16,10 @@ |
66 | * You should have received a copy of the GNU General Public License |
67 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
68 | */ |
69 | -#include "libertine/ContainerAppsList.h" |
70 | -#include "libertine/ContainerConfigList.h" |
71 | +#include "common/ContainerAppsList.h" |
72 | + |
73 | +#include "common/ContainerConfig.h" |
74 | +#include "common/ContainerConfigList.h" |
75 | |
76 | ContainerAppsList:: |
77 | ContainerAppsList(ContainerConfigList* container_config_list, |
78 | |
79 | === renamed file 'libertine/ContainerAppsList.h' => 'common/ContainerAppsList.h' |
80 | --- libertine/ContainerAppsList.h 2016-08-12 19:39:50 +0000 |
81 | +++ common/ContainerAppsList.h 2016-10-11 17:13:48 +0000 |
82 | @@ -3,7 +3,7 @@ |
83 | * @brief Libertine Manager list of container applications |
84 | */ |
85 | /* |
86 | - * Copyright 2015 Canonical Ltd |
87 | + * Copyright 2015-2016 Canonical Ltd |
88 | * |
89 | * Libertine is free software: you can redistribute it and/or modify it under |
90 | * the terms of the GNU General Public License, version 3, as published by the |
91 | @@ -19,8 +19,6 @@ |
92 | #ifndef _CONTAINER_APPS_LIST_H_ |
93 | #define _CONTAINER_APPS_LIST_H_ |
94 | |
95 | -#include "libertine/ContainerConfig.h" |
96 | - |
97 | #include <QtCore/QAbstractListModel> |
98 | #include <QtCore/QList> |
99 | #include <QtCore/QObject> |
100 | @@ -30,6 +28,7 @@ |
101 | class ContainerApps; |
102 | class ContainerConfigList; |
103 | |
104 | + |
105 | class ContainerAppsList |
106 | : public QAbstractListModel |
107 | { |
108 | |
109 | === renamed file 'libertine/ContainerArchivesList.cpp' => 'common/ContainerArchivesList.cpp' |
110 | --- libertine/ContainerArchivesList.cpp 2016-08-12 19:39:50 +0000 |
111 | +++ common/ContainerArchivesList.cpp 2016-10-11 17:13:48 +0000 |
112 | @@ -16,8 +16,10 @@ |
113 | * You should have received a copy of the GNU General Public License |
114 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
115 | */ |
116 | -#include "libertine/ContainerArchivesList.h" |
117 | -#include "libertine/ContainerConfigList.h" |
118 | +#include "common/ContainerArchivesList.h" |
119 | + |
120 | +#include "common/ContainerConfig.h" |
121 | +#include "common/ContainerConfigList.h" |
122 | |
123 | ContainerArchivesList:: |
124 | ContainerArchivesList(ContainerConfigList* container_config_list, |
125 | |
126 | === renamed file 'libertine/ContainerArchivesList.h' => 'common/ContainerArchivesList.h' |
127 | --- libertine/ContainerArchivesList.h 2016-08-12 19:39:50 +0000 |
128 | +++ common/ContainerArchivesList.h 2016-10-11 17:13:48 +0000 |
129 | @@ -19,8 +19,6 @@ |
130 | #ifndef _CONTAINER_ARCHIVES_LIST_H_ |
131 | #define _CONTAINER_ARCHIVES_LIST_H_ |
132 | |
133 | -#include "libertine/ContainerConfig.h" |
134 | - |
135 | #include <QtCore/QAbstractListModel> |
136 | #include <QtCore/QList> |
137 | #include <QtCore/QObject> |
138 | |
139 | === renamed file 'libertine/ContainerConfig.cpp' => 'common/ContainerConfig.cpp' |
140 | --- libertine/ContainerConfig.cpp 2016-04-13 18:02:56 +0000 |
141 | +++ common/ContainerConfig.cpp 2016-10-11 17:13:48 +0000 |
142 | @@ -16,7 +16,7 @@ |
143 | * You should have received a copy of the GNU General Public License |
144 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
145 | */ |
146 | -#include "libertine/ContainerConfig.h" |
147 | +#include "common/ContainerConfig.h" |
148 | |
149 | #include <QtCore/QDebug> |
150 | #include <QtCore/QJsonArray> |
151 | @@ -73,7 +73,7 @@ |
152 | } |
153 | } |
154 | } |
155 | - |
156 | + |
157 | return name; |
158 | } |
159 | |
160 | |
161 | === renamed file 'libertine/ContainerConfig.h' => 'common/ContainerConfig.h' |
162 | === renamed file 'libertine/ContainerConfigList.cpp' => 'common/ContainerConfigList.cpp' |
163 | --- libertine/ContainerConfigList.cpp 2016-08-22 18:20:43 +0000 |
164 | +++ common/ContainerConfigList.cpp 2016-10-11 17:13:48 +0000 |
165 | @@ -16,12 +16,11 @@ |
166 | * You should have received a copy of the GNU General Public License |
167 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
168 | */ |
169 | -#include "libertine/ContainerManager.h" |
170 | -#include "libertine/ContainerConfigList.h" |
171 | -#include "libertine/LibertineConfig.h" |
172 | +#include "common/ContainerConfigList.h" |
173 | |
174 | +#include "common/ContainerConfig.h" |
175 | +#include "common/LibertineConfig.h" |
176 | #include <algorithm> |
177 | -#include "libertine/ContainerConfig.h" |
178 | #include <QtCore/QDebug> |
179 | #include <QtCore/QDir> |
180 | #include <QtCore/QFile> |
181 | @@ -95,7 +94,7 @@ |
182 | reloadContainerList() |
183 | { |
184 | beginResetModel(); |
185 | - endResetModel(); |
186 | + endResetModel(); |
187 | } |
188 | |
189 | |
190 | @@ -128,7 +127,7 @@ |
191 | deleteContainer() |
192 | { |
193 | beginResetModel(); |
194 | - endResetModel(); |
195 | + endResetModel(); |
196 | } |
197 | |
198 | |
199 | @@ -360,7 +359,7 @@ |
200 | getHostDistroDescription() |
201 | { |
202 | QSettings distro_info("/etc/lsb-release", QSettings::NativeFormat); |
203 | - |
204 | + |
205 | return distro_info.value("DISTRIB_DESCRIPTION").toString().section(' ', 0, 2); |
206 | } |
207 | |
208 | |
209 | === renamed file 'libertine/ContainerConfigList.h' => 'common/ContainerConfigList.h' |
210 | === renamed file 'libertine/ContainerManager.cpp' => 'common/ContainerManager.cpp' |
211 | --- libertine/ContainerManager.cpp 2016-09-30 18:55:22 +0000 |
212 | +++ common/ContainerManager.cpp 2016-10-11 17:13:48 +0000 |
213 | @@ -16,7 +16,8 @@ |
214 | * You should have received a copy of the GNU General Public License |
215 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
216 | */ |
217 | -#include "libertine/ContainerManager.h" |
218 | +#include "common/ContainerManager.h" |
219 | + |
220 | #include <QTemporaryFile> |
221 | |
222 | |
223 | @@ -32,6 +33,7 @@ |
224 | static const QString RUN_COMMAND_FAILED = QObject::tr("Running command %1 failed"); |
225 | static const QString CONTAINER_CONFIGURE_FAILED = QObject::tr("Attempt to configure container %1 failed"); |
226 | static const QString SET_DEFAULT_CONTAINER_FAILED = QObject::tr("Attempt to set container as default failed"); |
227 | +static const QString GENERAL_ERROR = QObject::tr("An error occurred"); |
228 | constexpr auto libertine_container_manager_tool = "libertine-container-manager"; |
229 | |
230 | |
231 | @@ -66,6 +68,15 @@ |
232 | ContainerManagerWorker() |
233 | { |
234 | connect(&process_, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &QObject::deleteLater); |
235 | + connect(&process_, |
236 | +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) |
237 | + &QProcess::errorOccurred, |
238 | +#else |
239 | + static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error), |
240 | +#endif |
241 | + [=](QProcess::ProcessError) { |
242 | + emit error(GENERAL_ERROR, process_.errorString()); |
243 | + }); |
244 | } |
245 | |
246 | |
247 | |
248 | === renamed file 'libertine/ContainerManager.h' => 'common/ContainerManager.h' |
249 | === renamed file 'libertine/LibertineConfig.cpp' => 'common/LibertineConfig.cpp' |
250 | --- libertine/LibertineConfig.cpp 2016-04-06 19:14:10 +0000 |
251 | +++ common/LibertineConfig.cpp 2016-10-11 17:13:48 +0000 |
252 | @@ -16,38 +16,13 @@ |
253 | * You should have received a copy of the GNU General Public License |
254 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
255 | */ |
256 | -#include "libertine/LibertineConfig.h" |
257 | +#include "common/LibertineConfig.h" |
258 | |
259 | -#include "libertine/libertine.h" |
260 | -#include <QtCore/QCommandLineParser> |
261 | #include <QtCore/QDir> |
262 | #include <QtCore/QFile> |
263 | #include <QtCore/QStandardPaths> |
264 | |
265 | |
266 | -LibertineConfig:: |
267 | -LibertineConfig(Libertine const& libertine) |
268 | -{ |
269 | - QCommandLineParser commandlineParser; |
270 | - commandlineParser.setApplicationDescription("manage sandboxes for running legacy DEB-packaged X11-based applications"); |
271 | - commandlineParser.addHelpOption(); |
272 | - commandlineParser.addVersionOption(); |
273 | - commandlineParser.process(libertine); |
274 | -} |
275 | - |
276 | - |
277 | -LibertineConfig:: |
278 | -LibertineConfig() |
279 | -{ |
280 | -} |
281 | - |
282 | - |
283 | -LibertineConfig:: |
284 | -~LibertineConfig() |
285 | -{ |
286 | -} |
287 | - |
288 | - |
289 | QString LibertineConfig:: |
290 | containers_config_file_name() const |
291 | { |
292 | @@ -67,6 +42,6 @@ |
293 | file.open(QIODevice::WriteOnly); |
294 | file.close(); |
295 | } |
296 | - |
297 | + |
298 | return file_name; |
299 | } |
300 | |
301 | === renamed file 'libertine/LibertineConfig.h' => 'common/LibertineConfig.h' |
302 | --- libertine/LibertineConfig.h 2015-06-22 12:31:13 +0000 |
303 | +++ common/LibertineConfig.h 2016-10-11 17:13:48 +0000 |
304 | @@ -3,7 +3,7 @@ |
305 | * @brief Libertine Manager application-wide configuration module |
306 | */ |
307 | /* |
308 | - * Copyright 2015 Canonical Ltd |
309 | + * Copyright 2015-2016 Canonical Ltd |
310 | * |
311 | * Libertine is free software: you can redistribute it and/or modify it under |
312 | * the terms of the GNU General Public License, version 3, as published by the |
313 | @@ -22,18 +22,14 @@ |
314 | #include <QtCore/QString> |
315 | |
316 | |
317 | -class Libertine; |
318 | - |
319 | - |
320 | /** |
321 | * The runtime configuration of the Libertine tools. |
322 | */ |
323 | class LibertineConfig |
324 | { |
325 | public: |
326 | - LibertineConfig(Libertine const& libertine); |
327 | - LibertineConfig(); |
328 | - ~LibertineConfig(); |
329 | + explicit LibertineConfig() = default; |
330 | + virtual ~LibertineConfig() = default; |
331 | |
332 | QString |
333 | containers_config_file_name() const; |
334 | |
335 | === added file 'common/PackageOperationDetails.cpp' |
336 | --- common/PackageOperationDetails.cpp 1970-01-01 00:00:00 +0000 |
337 | +++ common/PackageOperationDetails.cpp 2016-10-11 17:13:48 +0000 |
338 | @@ -0,0 +1,78 @@ |
339 | +/* |
340 | + * Copyright 2016 Canonical Ltd |
341 | + * |
342 | + * Libertine is free software: you can redistribute it and/or modify it under |
343 | + * the terms of the GNU General Public License, version 3, as published by the |
344 | + * Free Software Foundation. |
345 | + * |
346 | + * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY |
347 | + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
348 | + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
349 | + * |
350 | + * You should have received a copy of the GNU General Public License |
351 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
352 | + */ |
353 | + |
354 | + |
355 | +#include "PackageOperationDetails.h" |
356 | + |
357 | +namespace |
358 | +{ |
359 | +static bool has_key(QMap<QString, QMap<QString, QString> > details, |
360 | + QString const& container_id, QString const& package_id) |
361 | +{ |
362 | + return details.constFind(container_id) != details.constEnd() && |
363 | + details[container_id].constFind(package_id) != details[container_id].constEnd(); |
364 | +} |
365 | +} |
366 | + |
367 | + |
368 | +PackageOperationDetails:: |
369 | +PackageOperationDetails(QObject* parent) |
370 | + : QObject(parent) |
371 | +{ |
372 | +} |
373 | + |
374 | + |
375 | +QString PackageOperationDetails:: |
376 | +details(QString const& container_id, QString const& package_id) const |
377 | +{ |
378 | + if (has_key(details_, container_id, package_id)) |
379 | + { |
380 | + return details_[container_id][package_id]; |
381 | + } |
382 | + return ""; |
383 | +} |
384 | + |
385 | + |
386 | +void PackageOperationDetails:: |
387 | +clear(QString const& container_id, QString const& package_id) |
388 | +{ |
389 | + if (has_key(details_, container_id, package_id)) |
390 | + { |
391 | + details_[container_id].remove(package_id); |
392 | + if (details_[container_id].empty()) |
393 | + { |
394 | + details_.remove(container_id); |
395 | + } |
396 | + } |
397 | +} |
398 | + |
399 | + |
400 | +void PackageOperationDetails:: |
401 | +update(QString const& container_id, QString const& package_id, QString const& new_details) |
402 | +{ |
403 | + if (has_key(details_, container_id, package_id)) |
404 | + { |
405 | + details_[container_id][package_id] += new_details; |
406 | + } |
407 | + else |
408 | + { |
409 | + if (details_.constFind(container_id) == details_.constEnd()) |
410 | + { |
411 | + details_[container_id] = QMap<QString, QString>{{package_id, new_details}}; |
412 | + } |
413 | + } |
414 | + |
415 | + emit updated(container_id, package_id, new_details); |
416 | +} |
417 | |
418 | === added file 'common/PackageOperationDetails.h' |
419 | --- common/PackageOperationDetails.h 1970-01-01 00:00:00 +0000 |
420 | +++ common/PackageOperationDetails.h 2016-10-11 17:13:48 +0000 |
421 | @@ -0,0 +1,43 @@ |
422 | +/* |
423 | + * Copyright 2016 Canonical Ltd |
424 | + * |
425 | + * Libertine is free software: you can redistribute it and/or modify it under |
426 | + * the terms of the GNU General Public License, version 3, as published by the |
427 | + * Free Software Foundation. |
428 | + * |
429 | + * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY |
430 | + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
431 | + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
432 | + * |
433 | + * You should have received a copy of the GNU General Public License |
434 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
435 | + */ |
436 | + |
437 | +#pragma once |
438 | + |
439 | +#include <QObject> |
440 | +#include <QMap> |
441 | + |
442 | + |
443 | +class PackageOperationDetails : public QObject |
444 | +{ |
445 | + Q_OBJECT |
446 | + |
447 | +public: |
448 | + explicit PackageOperationDetails(QObject* parent = nullptr); |
449 | + virtual ~PackageOperationDetails() = default; |
450 | + |
451 | + Q_INVOKABLE QString details(QString const& container_id, QString const& package_id) const; |
452 | + Q_INVOKABLE void clear(QString const& container_id, QString const& package_id); |
453 | + |
454 | +public slots: |
455 | + void update(QString const& container_id, QString const& package_id, QString const& new_details); |
456 | + |
457 | +signals: |
458 | + void updated(QString const& container_id, QString const& package_id, QString const& new_details); |
459 | + void send(QString const& input); |
460 | + void error(QString const& short_description, QString const& details); |
461 | + |
462 | +private: |
463 | + QMap<QString, QMap<QString, QString> > details_; |
464 | +}; |
465 | |
466 | === modified file 'data/CMakeLists.txt' |
467 | --- data/CMakeLists.txt 2016-09-06 12:36:47 +0000 |
468 | +++ data/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
469 | @@ -1,6 +1,6 @@ |
470 | set(CMAKE_INSTALL_SYSCONFDIR "/etc") |
471 | |
472 | -install(FILES libertine.desktop |
473 | +install(FILES libertine-manager-app.desktop |
474 | DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) |
475 | install(FILES libertine_64.png libertine-lxc.conf |
476 | DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}) |
477 | |
478 | === renamed file 'data/libertine.desktop' => 'data/libertine-manager-app.desktop' |
479 | --- data/libertine.desktop 2016-02-20 22:23:41 +0000 |
480 | +++ data/libertine-manager-app.desktop 2016-10-11 17:13:48 +0000 |
481 | @@ -1,8 +1,8 @@ |
482 | [Desktop Entry] |
483 | Version=1.0 |
484 | -Name=Libertine |
485 | +Name=Libertine Manager |
486 | Comment=Legacy Application Sandbox |
487 | -Exec=libertine |
488 | +Exec=libertine-manager-app |
489 | Terminal=false |
490 | Type=Application |
491 | Icon=/usr/share/libertine/libertine_64.png |
492 | |
493 | === modified file 'debian/control' |
494 | --- debian/control 2016-09-12 17:59:56 +0000 |
495 | +++ debian/control 2016-10-11 17:13:48 +0000 |
496 | @@ -13,9 +13,12 @@ |
497 | libgirepository1.0-dev, |
498 | libglib2.0-dev, |
499 | libgtest-dev, |
500 | + libsystemsettings-dev, |
501 | libx11-dev, |
502 | lsb-release, |
503 | + pkg-config, |
504 | python3-apt, |
505 | + python3-dbus, |
506 | python3-dev, |
507 | python3-distro-info, |
508 | python3-gi, |
509 | @@ -23,23 +26,61 @@ |
510 | python3-psutil, |
511 | python3-testtools, |
512 | python3-xdg, |
513 | - python3-dbus, |
514 | qtdeclarative5-dev |
515 | -Standards-Version: 3.9.6 |
516 | +Standards-Version: 3.9.8 |
517 | Homepage: https://launchpad.net/libertine |
518 | |
519 | -Package: libertine |
520 | +Package: libertine-manager-app |
521 | Architecture: any |
522 | -Depends: libertine-tools, |
523 | +Replaces: libertine (<< 1.4.2-1~) |
524 | +Breaks: libertine (<< 1.4.2-1~) |
525 | +Depends: libertine-qt-common, |
526 | + libertine-tools, |
527 | python3-libertine-lxc, |
528 | qml-module-qtquick2, |
529 | qtdeclarative5-ubuntu-ui-toolkit-plugin, |
530 | ${misc:Depends}, |
531 | ${shlibs:Depends} |
532 | Description: sandbox for running deb-packaged X11 apps on Ubuntu Personal |
533 | - Provides a container and releated tools to be able to create, maintain, and |
534 | + Provides a container and related tools to be able to create, maintain, and |
535 | integrate legacy deb-packaged applications generally based around the X11 |
536 | - display manager on a Ubuntu "Snappy Personal" system. |
537 | + display manager on an Ubuntu "Snappy Personal" system. |
538 | + |
539 | +Package: libertine |
540 | +Depends: libertine-manager-app, |
541 | + ${misc:Depends} |
542 | +Architecture: all |
543 | +Priority: extra |
544 | +Section: oldlibs |
545 | +Description: transitional dummy package for libertine-manager-app |
546 | + This is a transitional package to rename libertine as libertine-manager-app. |
547 | + It can safely be removed. |
548 | + |
549 | +Package: ubuntu-system-settings-libertine |
550 | +Architecture: any |
551 | +Depends: libertine-qt-common, |
552 | + libertine-tools, |
553 | + python3-libertine-lxc, |
554 | + qml-module-qtquick2, |
555 | + qtdeclarative5-ubuntu-ui-toolkit-plugin, |
556 | + ${misc:Depends}, |
557 | + ${shlibs:Depends} |
558 | +Enhances: ubuntu-system-settings |
559 | +Description: system settings plugin for managing container-based applications |
560 | + System Settings graphical interface to assist in the maintenance of legacy |
561 | + deb-packaged applications generally based around the X11 display manager on |
562 | + an Ubuntu "Snappy Personal" system. |
563 | + |
564 | +Package: libertine-qt-common |
565 | +Architecture: any |
566 | +Depends: qml-module-qtquick2, |
567 | + qtdeclarative5-ubuntu-ui-toolkit-plugin, |
568 | + ${misc:Depends}, |
569 | + ${shlibs:Depends} |
570 | +Description: common files for qt-based libertine applications |
571 | + Common QML source files and translations for managing libertine containers |
572 | + and packages used in the standalone libertine application and system settings |
573 | + plugin. |
574 | |
575 | Package: libertine-tools |
576 | Architecture: any |
577 | |
578 | === renamed file 'debian/libertine.install' => 'debian/libertine-manager-app.install' |
579 | --- debian/libertine.install 2016-05-02 20:45:21 +0000 |
580 | +++ debian/libertine-manager-app.install 2016-10-11 17:13:48 +0000 |
581 | @@ -1,5 +1,4 @@ |
582 | -usr/bin/libertine |
583 | -usr/share/applications/libertine.desktop |
584 | +usr/bin/libertine-manager-app |
585 | +usr/share/applications/libertine-manager-app.desktop |
586 | usr/share/libertine/libertine_64.png |
587 | -usr/share/libertine/qml/* |
588 | -usr/share/locale/*/LC_MESSAGES |
589 | +usr/share/libertine/qml/gui/* |
590 | |
591 | === added file 'debian/libertine-qt-common.install' |
592 | --- debian/libertine-qt-common.install 1970-01-01 00:00:00 +0000 |
593 | +++ debian/libertine-qt-common.install 2016-10-11 17:13:48 +0000 |
594 | @@ -0,0 +1,2 @@ |
595 | +usr/share/libertine/qml/common/* |
596 | +usr/share/locale/*/LC_MESSAGES |
597 | |
598 | === modified file 'debian/libertine-tools.install' |
599 | --- debian/libertine-tools.install 2016-09-06 12:36:47 +0000 |
600 | +++ debian/libertine-tools.install 2016-10-11 17:13:48 +0000 |
601 | @@ -1,5 +1,5 @@ |
602 | +usr/bin/libertine-container-manager |
603 | usr/bin/libertine-launch |
604 | -usr/bin/libertine-container-manager |
605 | usr/bin/libertine-xmir |
606 | usr/bin/pasted |
607 | usr/share/bash-completion/completions/libertine-container-manager |
608 | |
609 | === modified file 'debian/python3-libertine-chroot.install' |
610 | --- debian/python3-libertine-chroot.install 2016-09-06 12:36:47 +0000 |
611 | +++ debian/python3-libertine-chroot.install 2016-10-11 17:13:48 +0000 |
612 | @@ -1,2 +1,2 @@ |
613 | +usr/lib/*/libertine/update-puritine-containers |
614 | usr/lib/python*/*/libertine/ChrootContainer.py |
615 | -usr/lib/*/libertine/update-puritine-containers |
616 | |
617 | === modified file 'debian/python3-libertine-lxc.install' |
618 | --- debian/python3-libertine-lxc.install 2016-08-19 13:33:27 +0000 |
619 | +++ debian/python3-libertine-lxc.install 2016-10-11 17:13:48 +0000 |
620 | @@ -1,6 +1,6 @@ |
621 | +etc/sudoers.d/libertine-lxc-sudo |
622 | +usr/bin/libertine-lxc-manager |
623 | +usr/bin/libertine-lxc-setup |
624 | usr/lib/python*/*/libertine/LxcContainer.py |
625 | -usr/bin/libertine-lxc-manager |
626 | usr/share/dbus-1/services/com.canonical.libertine.LxcManager.service |
627 | usr/share/libertine/libertine-lxc.conf |
628 | -etc/sudoers.d/libertine-lxc-sudo |
629 | -usr/bin/libertine-lxc-setup |
630 | |
631 | === modified file 'debian/python3-libertine.install' |
632 | --- debian/python3-libertine.install 2016-06-28 14:30:01 +0000 |
633 | +++ debian/python3-libertine.install 2016-10-11 17:13:48 +0000 |
634 | @@ -1,6 +1,6 @@ |
635 | usr/lib/python*/*/libertine/AppDiscovery.py |
636 | -usr/lib/python*/*/libertine/Libertine.py |
637 | usr/lib/python*/*/libertine/ContainersConfig.py |
638 | usr/lib/python*/*/libertine/HostInfo.py |
639 | +usr/lib/python*/*/libertine/Libertine.py |
640 | +usr/lib/python*/*/libertine/__init__.py |
641 | usr/lib/python*/*/libertine/utils.py |
642 | -usr/lib/python*/*/libertine/__init__.py |
643 | |
644 | === added file 'debian/ubuntu-system-settings-libertine.install' |
645 | --- debian/ubuntu-system-settings-libertine.install 1970-01-01 00:00:00 +0000 |
646 | +++ debian/ubuntu-system-settings-libertine.install 2016-10-11 17:13:48 +0000 |
647 | @@ -0,0 +1,4 @@ |
648 | +usr/lib/*/ubuntu-system-settings/liblibertine-plugin.so* |
649 | +usr/share/libertine/qml/plugin/* |
650 | +usr/share/ubuntu/settings/system/icons/libertine-plugin.png |
651 | +usr/share/ubuntu/settings/system/libertine.settings |
652 | |
653 | === modified file 'libertine/CMakeLists.txt' |
654 | --- libertine/CMakeLists.txt 2015-10-07 18:59:50 +0000 |
655 | +++ libertine/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
656 | @@ -1,14 +1,19 @@ |
657 | configure_file(config.h.in config.h) |
658 | |
659 | -file(GLOB_RECURSE QML_SRC *.qml *.js *.json) |
660 | +file(GLOB_RECURSE QML_SRC |
661 | + ${CMAKE_SOURCE_DIR}/qml/common/*.qml |
662 | + ${CMAKE_SOURCE_DIR}/qml/gui/*.qml |
663 | +) |
664 | set(libertine_SRC |
665 | libertine.cpp |
666 | main.cpp |
667 | - ${QML_SRC} |
668 | + |
669 | + ${QML_SRC} # so the QML files show up in Qt Creator |
670 | ) |
671 | |
672 | -add_executable(libertine ${libertine_SRC}) |
673 | -target_link_libraries(libertine libertine-common Qt5::Core Qt5::Quick Qt5::Gui) |
674 | +add_executable(${LIBERTINE_EXE_NAME} ${libertine_SRC}) |
675 | +target_link_libraries(${LIBERTINE_EXE_NAME} ${LIBERTINE_COMMON} ${LIBERTINE_CORE} Qt5::Core Qt5::Quick Qt5::Gui) |
676 | |
677 | install(DIRECTORY qml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}) |
678 | -install(TARGETS libertine RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
679 | + |
680 | +install(TARGETS ${LIBERTINE_EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
681 | |
682 | === modified file 'libertine/config.h.in' |
683 | --- libertine/config.h.in 2015-06-02 02:33:28 +0000 |
684 | +++ libertine/config.h.in 2016-10-11 17:13:48 +0000 |
685 | @@ -19,6 +19,6 @@ |
686 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
687 | */ |
688 | |
689 | -#define LIBERTINE_APPLICATION_NAME "@PROJECT_NAME@" |
690 | +#define LIBERTINE_APPLICATION_NAME "@LIBERTINE_EXE_NAME@" |
691 | #define LIBERTINE_VERSION "@PROJECT_VERSION@" |
692 | |
693 | |
694 | === modified file 'libertine/libertine.cpp' |
695 | --- libertine/libertine.cpp 2016-10-03 15:54:26 +0000 |
696 | +++ libertine/libertine.cpp 2016-10-11 17:13:48 +0000 |
697 | @@ -3,7 +3,7 @@ |
698 | * @brief Libertine app wrapper |
699 | */ |
700 | /* |
701 | - * Copyright 2015 Canonical Ltd |
702 | + * Copyright 2015-2016 Canonical Ltd |
703 | * |
704 | * Libertine is free software: you can redistribute it and/or modify it under |
705 | * the terms of the GNU General Public License, version 3, as published by the |
706 | @@ -16,16 +16,18 @@ |
707 | * You should have received a copy of the GNU General Public License |
708 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
709 | */ |
710 | +#include "libertine/libertine.h" |
711 | + |
712 | +#include "common/ContainerManager.h" |
713 | +#include "common/ContainerAppsList.h" |
714 | +#include "common/ContainerArchivesList.h" |
715 | +#include "common/ContainerConfig.h" |
716 | +#include "common/ContainerConfigList.h" |
717 | +#include "common/LibertineConfig.h" |
718 | +#include "common/PackageOperationDetails.h" |
719 | #include "libertine/config.h" |
720 | - |
721 | #include <cstdlib> |
722 | -#include "libertine/ContainerManager.h" |
723 | -#include "libertine/ContainerAppsList.h" |
724 | -#include "libertine/ContainerArchivesList.h" |
725 | -#include "libertine/ContainerConfig.h" |
726 | -#include "libertine/ContainerConfigList.h" |
727 | -#include "libertine/libertine.h" |
728 | -#include "libertine/LibertineConfig.h" |
729 | +#include <QtCore/QCommandLineParser> |
730 | #include <QtCore/QDebug> |
731 | #include <QtCore/QDir> |
732 | #include <QtCore/QFile> |
733 | @@ -38,7 +40,7 @@ |
734 | |
735 | namespace |
736 | { |
737 | -static QString const s_main_QML_source_file = "qml/libertine.qml"; |
738 | +static QString const s_main_QML_source_file = "qml/gui/libertine.qml"; |
739 | |
740 | /** |
741 | * Searches for the main QML source file. |
742 | @@ -55,7 +57,7 @@ |
743 | find_main_qml_source_file() |
744 | { |
745 | static const QStringList sub_paths = { "", "libertine/" }; |
746 | - QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation); |
747 | + auto paths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); |
748 | paths.prepend(QDir::currentPath()); |
749 | paths.prepend(QCoreApplication::applicationDirPath()); |
750 | for (auto const& path: paths) |
751 | @@ -88,11 +90,20 @@ |
752 | : QGuiApplication(argc, argv) |
753 | , main_qml_source_file_(find_main_qml_source_file()) |
754 | { |
755 | + qmlRegisterType<ContainerConfig>("Libertine", 1, 0, "ContainerConfig"); |
756 | + qmlRegisterType<ContainerManagerWorker>("Libertine", 1, 0, "ContainerManagerWorker"); |
757 | + qmlRegisterType<PackageOperationDetails>("Libertine", 1, 0, "PackageOperationDetails"); |
758 | + |
759 | setApplicationName(LIBERTINE_APPLICATION_NAME); |
760 | setApplicationVersion(LIBERTINE_VERSION); |
761 | - config_.reset(new LibertineConfig(*this)); |
762 | - qmlRegisterType<ContainerConfig>("Libertine", 1, 0, "ContainerConfig"); |
763 | - qmlRegisterType<ContainerManagerWorker>("Libertine", 1, 0, "ContainerManagerWorker"); |
764 | + |
765 | + QCommandLineParser commandlineParser; |
766 | + commandlineParser.setApplicationDescription("manage sandboxes for running legacy DEB-packaged X11-based applications"); |
767 | + commandlineParser.addHelpOption(); |
768 | + commandlineParser.addVersionOption(); |
769 | + commandlineParser.process(*this); |
770 | + |
771 | + config_.reset(new LibertineConfig()); |
772 | |
773 | watcher_.addPath(config_.data()->containers_config_file_name()); |
774 | connect(&watcher_, SIGNAL(fileChanged(QString)), SLOT(reload_config(QString))); |
775 | @@ -105,6 +116,7 @@ |
776 | containers_ = new ContainerConfigList(config_.data(), this); |
777 | container_apps_ = new ContainerAppsList(containers_, this); |
778 | container_archives_ = new ContainerArchivesList(containers_, this); |
779 | + package_operation_details_ = new PackageOperationDetails(this); |
780 | |
781 | initialize_view(); |
782 | view_.show(); |
783 | @@ -131,6 +143,7 @@ |
784 | ctxt->setContextProperty("containerConfigList", containers_); |
785 | ctxt->setContextProperty("containerAppsList", container_apps_); |
786 | ctxt->setContextProperty("containerArchivesList", container_archives_); |
787 | + ctxt->setContextProperty("packageOperationDetails", package_operation_details_); |
788 | |
789 | view_.setSource(QUrl::fromLocalFile(main_qml_source_file_)); |
790 | connect(view_.engine(), SIGNAL(quit()), SLOT(quit())); |
791 | |
792 | === modified file 'libertine/libertine.h' |
793 | --- libertine/libertine.h 2016-10-03 15:48:22 +0000 |
794 | +++ libertine/libertine.h 2016-10-11 17:13:48 +0000 |
795 | @@ -30,6 +30,7 @@ |
796 | class LibertineConfig; |
797 | class ContainerAppsList; |
798 | class ContainerArchivesList; |
799 | +class PackageOperationDetails; |
800 | |
801 | |
802 | class Libertine |
803 | @@ -56,6 +57,7 @@ |
804 | ContainerConfigList* containers_; |
805 | ContainerAppsList* container_apps_; |
806 | ContainerArchivesList* container_archives_; |
807 | + PackageOperationDetails* package_operation_details_; |
808 | QQuickView view_; |
809 | }; |
810 | |
811 | |
812 | === modified file 'liblibertine/CMakeLists.txt' |
813 | --- liblibertine/CMakeLists.txt 2016-09-06 12:36:47 +0000 |
814 | +++ liblibertine/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
815 | @@ -1,32 +1,31 @@ |
816 | set(API_VERSION 1) |
817 | set(ABI_VERSION 1) |
818 | |
819 | -set(libertine_src ${CMAKE_SOURCE_DIR}/libertine) |
820 | +set(COMMON_DIR ${CMAKE_SOURCE_DIR}/common) |
821 | |
822 | add_library( |
823 | - libertine-common SHARED |
824 | + ${LIBERTINE_CORE} SHARED |
825 | libertine.cpp |
826 | - ${libertine_src}/ContainerConfigList.cpp |
827 | - ${libertine_src}/LibertineConfig.cpp |
828 | - ${libertine_src}/ContainerConfig.cpp |
829 | - ${libertine_src}/ContainerManager.cpp |
830 | - ${libertine_src}/ContainerAppsList.cpp |
831 | - ${libertine_src}/ContainerArchivesList.cpp |
832 | + |
833 | + ${COMMON_DIR}/ContainerConfig.cpp |
834 | + ${COMMON_DIR}/ContainerConfigList.cpp |
835 | + ${COMMON_DIR}/LibertineConfig.cpp |
836 | ) |
837 | -set_target_properties(libertine-common PROPERTIES |
838 | + |
839 | +set_target_properties(${LIBERTINE_CORE} PROPERTIES |
840 | VERSION ${ABI_VERSION}.0.0 |
841 | SOVERSION ${ABI_VERSION} |
842 | OUTPUT_NAME "libertine" |
843 | ) |
844 | -target_link_libraries(libertine-common |
845 | + |
846 | +target_link_libraries(${LIBERTINE_CORE} |
847 | ${GLIB2_LIBRARIES} |
848 | ${PYTHON3_LIBRARIES} |
849 | Qt5::Core |
850 | ) |
851 | |
852 | -set(liblibertine_headers_path "${CMAKE_INSTALL_FULL_INCLUDEDIR}/liblibertine") |
853 | -install(FILES libertine.h DESTINATION ${liblibertine_headers_path}) |
854 | -install(TARGETS libertine-common LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
855 | +install(FILES libertine.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/liblibertine") |
856 | +install(TARGETS ${LIBERTINE_CORE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
857 | |
858 | configure_file(libertine.pc.in ${CMAKE_BINARY_DIR}/libertine.pc @ONLY) |
859 | install(FILES ${CMAKE_BINARY_DIR}/libertine.pc |
860 | |
861 | === modified file 'liblibertine/libertine.cpp' |
862 | --- liblibertine/libertine.cpp 2016-09-06 12:36:47 +0000 |
863 | +++ liblibertine/libertine.cpp 2016-10-11 17:13:48 +0000 |
864 | @@ -18,8 +18,9 @@ |
865 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
866 | */ |
867 | #include "liblibertine/libertine.h" |
868 | -#include "libertine/ContainerConfigList.h" |
869 | -#include "libertine/LibertineConfig.h" |
870 | + |
871 | +#include "common/ContainerConfigList.h" |
872 | +#include "common/LibertineConfig.h" |
873 | |
874 | |
875 | namespace |
876 | |
877 | === added directory 'qml' |
878 | === added file 'qml/CMakeLists.txt' |
879 | --- qml/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
880 | +++ qml/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
881 | @@ -0,0 +1,3 @@ |
882 | +install(DIRECTORY common DESTINATION ${LIBERTINE_QML_PATH}) |
883 | +install(DIRECTORY gui DESTINATION ${LIBERTINE_QML_PATH}) |
884 | +install(DIRECTORY plugin DESTINATION ${LIBERTINE_QML_PATH}) |
885 | |
886 | === added directory 'qml/common' |
887 | === renamed file 'libertine/qml/AddExtraArchiveView.qml' => 'qml/common/AddExtraArchiveView.qml' |
888 | --- libertine/qml/AddExtraArchiveView.qml 2016-07-13 19:48:48 +0000 |
889 | +++ qml/common/AddExtraArchiveView.qml 2016-10-11 17:13:48 +0000 |
890 | @@ -28,6 +28,8 @@ |
891 | } |
892 | property string currentContainer: "" |
893 | |
894 | + signal error(string short_description, string details) |
895 | + |
896 | Column { |
897 | spacing: units.gu(2) |
898 | |
899 | @@ -96,9 +98,9 @@ |
900 | } |
901 | |
902 | function addArchive() { |
903 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
904 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
905 | worker.finishedConfigure.connect(finishedConfigure) |
906 | - worker.error.connect(mainView.error) |
907 | + worker.error.connect(addExtraArchiveView.error) |
908 | worker.addArchive(currentContainer, containerConfigList.getContainerName(currentContainer), |
909 | extraArchiveString.text, publicSigningKey.text.trim()) |
910 | |
911 | |
912 | === renamed file 'libertine/qml/HomeView.qml' => 'qml/common/ContainerEditView.qml' |
913 | --- libertine/qml/HomeView.qml 2016-07-06 14:17:46 +0000 |
914 | +++ qml/common/ContainerEditView.qml 2016-10-11 17:13:48 +0000 |
915 | @@ -26,7 +26,7 @@ |
916 | id: homeView |
917 | header: PageHeader { |
918 | id: pageHeader |
919 | - title: i18n.tr("Classic Apps - %1").arg(containerConfigList.getContainerName(currentContainer)) |
920 | + title: i18n.tr("%1 - All Apps").arg(containerConfigList.getContainerName(currentContainer)) |
921 | trailingActionBar.actions: [ |
922 | Action { |
923 | id: settingsButton |
924 | @@ -153,7 +153,7 @@ |
925 | width: parent.width |
926 | onClicked: { |
927 | PopupUtils.close(addAppsDialog) |
928 | - PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml")) |
929 | + PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml"), {currentContainer: currentContainer}) |
930 | } |
931 | } |
932 | } |
933 | @@ -249,12 +249,11 @@ |
934 | } |
935 | |
936 | function operationSetup() { |
937 | - var comp = Qt.createComponent("ContainerManager.qml") |
938 | - var worker = comp.createObject(mainView) |
939 | - worker.error.connect(mainView.error) |
940 | - worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
941 | - mainView.packageOperationInteraction.connect(worker.packageOperationInteraction) |
942 | - worker.operationFinished.connect(mainView.resetOperationDetails) |
943 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
944 | + worker.error.connect(packageOperationDetails.error) |
945 | + worker.updateOperationDetails.connect(packageOperationDetails.update) |
946 | + packageOperationDetails.send.connect(worker.packageOperationInteraction) |
947 | + worker.operationFinished.connect(packageOperationDetails.clear) |
948 | return worker |
949 | } |
950 | |
951 | |
952 | === renamed file 'libertine/qml/ContainerInfoView.qml' => 'qml/common/ContainerInfoView.qml' |
953 | --- libertine/qml/ContainerInfoView.qml 2016-06-09 18:20:19 +0000 |
954 | +++ qml/common/ContainerInfoView.qml 2016-10-11 17:13:48 +0000 |
955 | @@ -27,7 +27,7 @@ |
956 | id: containerInfoView |
957 | header: PageHeader { |
958 | id: pageHeader |
959 | - title: i18n.tr("Container information for %1").arg(containerConfigList.getContainerName(currentContainer)) |
960 | + title: i18n.tr("Container Info: %1").arg(containerConfigList.getContainerName(currentContainer)) |
961 | } |
962 | |
963 | property string currentContainer: null |
964 | @@ -114,19 +114,17 @@ |
965 | Component.onCompleted: { |
966 | containerConfigList.configChanged.connect(reloadStatus) |
967 | |
968 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
969 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
970 | + operationDetails = packageOperationDetails.details(currentContainer, "") |
971 | + packageOperationDetails.updated.connect(updateDetails) |
972 | |
973 | - operationDetails = mainView.getOperationDetails(currentContainer) |
974 | operationDetailsView.cursorPosition = operationDetailsView.length |
975 | - if (operationDetails != "") { |
976 | + if (operationDetails !== "") { |
977 | showDetails = !showDetails |
978 | } |
979 | - |
980 | - mainView.operationDetailsUpdated.connect(updateDetails) |
981 | } |
982 | |
983 | Component.onDestruction: { |
984 | - mainView.operationDetailsUpdated.disconnect(updateDetails) |
985 | containerConfigList.configChanged.disconnect(reloadStatus) |
986 | } |
987 | |
988 | |
989 | === renamed file 'libertine/qml/ContainerManager.qml' => 'qml/common/ContainerManager.qml' |
990 | === renamed file 'libertine/qml/ContainerOptionsDialog.qml' => 'qml/common/ContainerOptionsDialog.qml' |
991 | --- libertine/qml/ContainerOptionsDialog.qml 2016-09-02 18:26:25 +0000 |
992 | +++ qml/common/ContainerOptionsDialog.qml 2016-10-11 17:13:48 +0000 |
993 | @@ -30,7 +30,7 @@ |
994 | signal onCreateInitialized() |
995 | |
996 | Row { |
997 | - visible: containerConfigList.getHostArchitecture() == 'x86_64' ? true : false |
998 | + visible: containerConfigList.getHostArchitecture() === 'x86_64' ? true : false |
999 | spacing: units.gu(1) |
1000 | CheckBox { |
1001 | id: enableMultiarchCheckbox |
1002 | @@ -97,11 +97,11 @@ |
1003 | |
1004 | function createContainer() { |
1005 | var container_id = containerConfigList.addNewContainer("lxc", containerNameInput.text) |
1006 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1007 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1008 | |
1009 | - worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
1010 | - worker.operationFinished.connect(mainView.resetOperationDetails) |
1011 | - worker.error.connect(mainView.error) |
1012 | + worker.updateOperationDetails.connect(packageOperationDetails.update) |
1013 | + worker.operationFinished.connect(packageOperationDetails.clear) |
1014 | + worker.error.connect(packageOperationDetails.error) |
1015 | |
1016 | worker.createContainer(container_id, |
1017 | containerConfigList.getContainerName(container_id), |
1018 | |
1019 | === added file 'qml/common/ContainersList.qml' |
1020 | --- qml/common/ContainersList.qml 1970-01-01 00:00:00 +0000 |
1021 | +++ qml/common/ContainersList.qml 2016-10-11 17:13:48 +0000 |
1022 | @@ -0,0 +1,131 @@ |
1023 | +/** |
1024 | + * @file ContainersListView.qml |
1025 | + * @brief Libertine containers view |
1026 | + */ |
1027 | +/* |
1028 | + * Copyright 2016 Canonical Ltd |
1029 | + * |
1030 | + * Libertine is free software: you can redistribute it and/or modify it under |
1031 | + * the terms of the GNU General Public License, version 3, as published by the |
1032 | + * Free Software Foundation. |
1033 | + * |
1034 | + * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY |
1035 | + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
1036 | + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
1037 | + * |
1038 | + * You should have received a copy of the GNU General Public License |
1039 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1040 | + */ |
1041 | +import Libertine 1.0 |
1042 | +import QtQuick 2.4 |
1043 | +import Ubuntu.Components 1.3 |
1044 | +import Ubuntu.Components.Popups 1.3 |
1045 | + |
1046 | + |
1047 | +/** |
1048 | + * Component providing a list of available containers and their (possibly animated) |
1049 | + * states. |
1050 | + */ |
1051 | +Item { |
1052 | + property string currentContainer |
1053 | + |
1054 | + UbuntuListView { |
1055 | + id: containersList |
1056 | + anchors { |
1057 | + fill: parent |
1058 | + } |
1059 | + model: containerConfigList |
1060 | + |
1061 | + function edit(id, status) { |
1062 | + if (status === "removing") { |
1063 | + packageOperationDetails.error(i18n.tr("Container Unavailable"), i18n.tr("Container is being destroyed and is no longer editable.")) |
1064 | + return |
1065 | + } |
1066 | + currentContainer = id |
1067 | + containerAppsList.setContainerApps(currentContainer) |
1068 | + pageStack.push(Qt.resolvedUrl("../common/ContainerEditView.qml"), {currentContainer: currentContainer}) |
1069 | + } |
1070 | + |
1071 | + delegate: ListItem { |
1072 | + Label { |
1073 | + text: name |
1074 | + anchors { |
1075 | + verticalCenter: parent.verticalCenter |
1076 | + left: parent.left |
1077 | + leftMargin: units.gu(2) |
1078 | + } |
1079 | + } |
1080 | + ActivityIndicator { |
1081 | + id: containerActivity |
1082 | + anchors { |
1083 | + verticalCenter: parent.verticalCenter |
1084 | + right: parent.right |
1085 | + rightMargin: units.gu(2) |
1086 | + } |
1087 | + visible: installStatus === i18n.tr("installing") || |
1088 | + installStatus === i18n.tr("removing") |
1089 | + running: containerActivity.visible |
1090 | + } |
1091 | + |
1092 | + onClicked: { containersList.edit(containerId, installStatus) } |
1093 | + |
1094 | + leadingActions: ListItemActions { |
1095 | + actions: [ |
1096 | + Action { |
1097 | + iconName: "delete" |
1098 | + text: i18n.tr("delete") |
1099 | + description: i18n.tr("Delete Container") |
1100 | + onTriggered: { |
1101 | + var worker = Qt.createComponent("../common/ContainerManager.qml").createObject(parent) |
1102 | + worker.error.connect(packageOperationDetails.error) |
1103 | + worker.destroyContainer(containerId) |
1104 | + } |
1105 | + } |
1106 | + ] |
1107 | + } |
1108 | + |
1109 | + trailingActions: ListItemActions { |
1110 | + actions: [ |
1111 | + Action { |
1112 | + iconName: "info" |
1113 | + text: i18n.tr("info") |
1114 | + description: i18n.tr("Container Info") |
1115 | + onTriggered: { |
1116 | + currentContainer = containerId |
1117 | + pageStack.push(Qt.resolvedUrl("../common/ContainerInfoView.qml"), {currentContainer: containerId}) |
1118 | + } |
1119 | + }, |
1120 | + Action { |
1121 | + iconName: "edit" |
1122 | + text: i18n.tr("edit") |
1123 | + description: i18n.tr("Container Apps") |
1124 | + visible: installStatus === i18n.tr("ready") || |
1125 | + installStatus === i18n.tr("updating") |
1126 | + onTriggered: { |
1127 | + containersList.edit(containerId, installStatus) |
1128 | + } |
1129 | + } |
1130 | + ] |
1131 | + } |
1132 | + } |
1133 | + } |
1134 | + |
1135 | + Component.onCompleted: { |
1136 | + containerConfigList.configChanged.connect(updateContainerList) |
1137 | + } |
1138 | + |
1139 | + Component.onDestruction: { |
1140 | + containerConfigList.configChanged.disconnect(updateContainerList) |
1141 | + } |
1142 | + |
1143 | + function updateContainerList() { |
1144 | + containerConfigList.reloadContainerList() |
1145 | + |
1146 | + if (currentContainer && !containerConfigList.getContainerStatus(currentContainer) && pageStack.currentPage !== containersView) { |
1147 | + pageStack.pop() |
1148 | + currentContainer = "" |
1149 | + packageOperationDetails.error(i18n.tr("Container Unavailable"), |
1150 | + i18n.tr("This container has been destroyed and is no longer valid. You have been returned to the containers overview.")) |
1151 | + } |
1152 | + } |
1153 | +} |
1154 | |
1155 | === renamed file 'libertine/qml/DebianPackagePicker.qml' => 'qml/common/DebianPackagePicker.qml' |
1156 | === renamed file 'libertine/qml/ExtraArchivesView.qml' => 'qml/common/ExtraArchivesView.qml' |
1157 | --- libertine/qml/ExtraArchivesView.qml 2016-09-29 15:40:02 +0000 |
1158 | +++ qml/common/ExtraArchivesView.qml 2016-10-11 17:13:48 +0000 |
1159 | @@ -96,7 +96,7 @@ |
1160 | function deleteArchive(archive) { |
1161 | var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1162 | worker.finishedConfigure.connect(finishedConfigure) |
1163 | - worker.error.connect(mainView.error) |
1164 | + worker.error.connect(packageOperationDetails.error) |
1165 | worker.configureContainer(currentContainer, containerConfigList.getContainerName(currentContainer), ["--archive", "remove", "--archive-name", "\"" + archive + "\""]) |
1166 | } |
1167 | |
1168 | |
1169 | === renamed file 'libertine/qml/GenericErrorDialog.qml' => 'qml/common/GenericErrorDialog.qml' |
1170 | === renamed file 'libertine/qml/ManageContainer.qml' => 'qml/common/ManageContainer.qml' |
1171 | --- libertine/qml/ManageContainer.qml 2016-07-11 14:35:11 +0000 |
1172 | +++ qml/common/ManageContainer.qml 2016-10-11 17:13:48 +0000 |
1173 | @@ -46,14 +46,14 @@ |
1174 | anchors.right: parent.right |
1175 | |
1176 | ListItem.Standard { |
1177 | - visible: containerConfigList.getHostArchitecture() == 'x86_64' ? true : false |
1178 | + visible: containerConfigList.getHostArchitecture() === 'x86_64' ? true : false |
1179 | control: CheckBox { |
1180 | checked: isMultiarchEnabled |
1181 | onClicked: { |
1182 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1183 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1184 | |
1185 | - worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
1186 | - worker.operationFinished.connect(mainView.resetOperationDetails) |
1187 | + worker.updateOperationDetails.connect(packageOperationDetails.update) |
1188 | + worker.operationFinished.connect(packageOperationDetails.clear) |
1189 | |
1190 | if (checked) { |
1191 | worker.configureContainer(currentContainer, |
1192 | @@ -105,12 +105,14 @@ |
1193 | control: CheckBox { |
1194 | checked: isDefaultContainer |
1195 | onClicked: { |
1196 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1197 | - worker.error.connect(mainView.error) |
1198 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1199 | + worker.error.connect(packageOperationDetails.error) |
1200 | + |
1201 | var fallback = checked |
1202 | worker.error.connect(function() { |
1203 | checked = fallback |
1204 | }) |
1205 | + |
1206 | worker.setDefaultContainer(currentContainer, !checked) |
1207 | } |
1208 | } |
1209 | @@ -129,11 +131,11 @@ |
1210 | } |
1211 | |
1212 | function updateContainer() { |
1213 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1214 | - worker.error.connect(mainView.error); |
1215 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1216 | + worker.error.connect(packageOperationDetails.error); |
1217 | |
1218 | - worker.updateOperationDetails.connect(mainView.updateOperationDetails) |
1219 | - worker.operationFinished.connect(mainView.resetOperationDetails) |
1220 | + worker.updateOperationDetails.connect(packageOperationDetails.update) |
1221 | + worker.operationFinished.connect(packageOperationDetails.clear) |
1222 | |
1223 | worker.updateContainer(currentContainer, containerConfigList.getContainerName(currentContainer)) |
1224 | } |
1225 | |
1226 | === renamed file 'libertine/qml/PackageExistsDialog.qml' => 'qml/common/PackageExistsDialog.qml' |
1227 | === renamed file 'libertine/qml/PackageInfoView.qml' => 'qml/common/PackageInfoView.qml' |
1228 | --- libertine/qml/PackageInfoView.qml 2016-06-10 13:22:16 +0000 |
1229 | +++ qml/common/PackageInfoView.qml 2016-10-11 17:13:48 +0000 |
1230 | @@ -27,19 +27,18 @@ |
1231 | id: packageInfoView |
1232 | header: PageHeader { |
1233 | id: pageHeader |
1234 | - title: i18n.tr("Information for the %1 package").arg(currentPackage) |
1235 | + title: i18n.tr("%1 - %2").arg(currentContainer).arg(currentPackage) |
1236 | } |
1237 | property string currentContainer: null |
1238 | property var currentPackage: null |
1239 | property var statusText: containerConfigList.getAppStatus(currentContainer, currentPackage) |
1240 | property var packageVersionText: i18n.tr("Obtaining package version…") |
1241 | - property string packageOperationDetails: "" |
1242 | + property string currentDetails: "" |
1243 | property var worker: null |
1244 | property bool showDetails: false |
1245 | |
1246 | signal sendOperationInteraction(string text) |
1247 | |
1248 | - |
1249 | Flickable { |
1250 | anchors { |
1251 | topMargin: pageHeader.height |
1252 | @@ -77,7 +76,7 @@ |
1253 | text: enabled ? |
1254 | showDetails ? i18n.tr('Hide') : i18n.tr('Show') |
1255 | : i18n.tr('None') |
1256 | - enabled: packageOperationDetails != "" |
1257 | + enabled: currentDetails != "" |
1258 | onClicked: { |
1259 | showDetails = !showDetails |
1260 | } |
1261 | @@ -92,7 +91,7 @@ |
1262 | anchors.right: parent.right |
1263 | height: Math.max(packageInfoView.height - pageHeader.height - packageListItem.height - showDetailsView.height - statusListItem.height - 35, units.gu(35)) |
1264 | readOnly: true |
1265 | - text: packageOperationDetails |
1266 | + text: currentDetails |
1267 | } |
1268 | |
1269 | TextField { |
1270 | @@ -112,17 +111,17 @@ |
1271 | Component.onCompleted: { |
1272 | containerConfigList.configChanged.connect(reloadStatus) |
1273 | var command = "apt-cache policy " + currentPackage |
1274 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1275 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1276 | worker.finishedCommand.connect(getPackageVersion) |
1277 | |
1278 | - packageOperationDetails = mainView.getOperationDetails(currentContainer, currentPackage) |
1279 | + currentDetails = packageOperationDetails.details(currentContainer, currentPackage) |
1280 | packageDetailsView.cursorPosition = packageDetailsView.length |
1281 | - if (packageOperationDetails != "") { |
1282 | + if (currentDetails != "") { |
1283 | showDetails = !showDetails |
1284 | } |
1285 | |
1286 | - mainView.operationDetailsUpdated.connect(updatePackageDetails) |
1287 | - sendOperationInteraction.connect(mainView.packageOperationInteraction) |
1288 | + packageOperationDetails.updated.connect(updatePackageDetails) |
1289 | + sendOperationInteraction.connect(packageOperationDetails.send) |
1290 | |
1291 | worker.error.connect(onError) |
1292 | worker.runCommand(currentContainer, containerConfigList.getContainerName(currentContainer), command) |
1293 | @@ -130,13 +129,13 @@ |
1294 | |
1295 | Component.onDestruction: { |
1296 | containerConfigList.configChanged.disconnect(reloadStatus) |
1297 | - mainView.operationDetailsUpdated.disconnect(updatePackageDetails) |
1298 | - sendOperationInteraction.disconnect(mainView.packageOperationInteraction) |
1299 | + packageOperationDetails.updated.disconnect(updatePackageDetails) |
1300 | + sendOperationInteraction.disconnect(packageOperationDetails.send) |
1301 | } |
1302 | |
1303 | function updatePackageDetails(container_id, package_name, details) { |
1304 | if (container_id === currentContainer && package_name === currentPackage) { |
1305 | - packageOperationDetails += details |
1306 | + currentDetails += details |
1307 | packageDetailsView.cursorPosition = packageDetailsView.length |
1308 | } |
1309 | } |
1310 | |
1311 | === renamed file 'libertine/qml/SearchPackagesDialog.qml' => 'qml/common/SearchPackagesDialog.qml' |
1312 | --- libertine/qml/SearchPackagesDialog.qml 2016-05-06 21:13:01 +0000 |
1313 | +++ qml/common/SearchPackagesDialog.qml 2016-10-11 17:13:48 +0000 |
1314 | @@ -25,6 +25,7 @@ |
1315 | id: searchPackageDialog |
1316 | title: i18n.tr("Search for packages") |
1317 | text: i18n.tr("Search archives for packages") |
1318 | + property string currentContainer: null |
1319 | |
1320 | TextField { |
1321 | id: searchPackageInput |
1322 | @@ -42,11 +43,11 @@ |
1323 | onClicked: { |
1324 | if (searchPackageInput.text != "") { |
1325 | PopupUtils.close(searchPackageDialog) |
1326 | - if (pageStack.currentPage.objectName == "searchResultsView") { |
1327 | + if (pageStack.currentPage.objectName === "searchResultsView") { |
1328 | pageStack.currentPage.searchForPackages(searchPackageInput.text) |
1329 | } |
1330 | else { |
1331 | - pageStack.push(Qt.resolvedUrl("SearchResultsView.qml"), {search_string : searchPackageInput.text}) |
1332 | + pageStack.push(Qt.resolvedUrl("SearchResultsView.qml"), {search_string : searchPackageInput.text, currentContainer: currentContainer}) |
1333 | } |
1334 | } |
1335 | } |
1336 | |
1337 | === renamed file 'libertine/qml/SearchResults.qml' => 'qml/common/SearchResults.qml' |
1338 | --- libertine/qml/SearchResults.qml 2016-05-10 19:26:22 +0000 |
1339 | +++ qml/common/SearchResults.qml 2016-10-11 17:13:48 +0000 |
1340 | @@ -28,8 +28,10 @@ |
1341 | fill: parent |
1342 | } |
1343 | |
1344 | + property var currentContainer: null |
1345 | + |
1346 | function install(packageName) { |
1347 | - if (!containerConfigList.isAppInstalled(mainView.currentContainer, packageName)) { |
1348 | + if (!containerConfigList.isAppInstalled(currentContainer, packageName)) { |
1349 | pageStack.pop() |
1350 | pageStack.currentPage.installPackage(packageName) |
1351 | } |
1352 | |
1353 | === renamed file 'libertine/qml/SearchResultsView.qml' => 'qml/common/SearchResultsView.qml' |
1354 | --- libertine/qml/SearchResultsView.qml 2016-05-19 17:56:43 +0000 |
1355 | +++ qml/common/SearchResultsView.qml 2016-10-11 17:13:48 +0000 |
1356 | @@ -43,6 +43,8 @@ |
1357 | property var search_string: null |
1358 | property var search_comp: null |
1359 | property var search_obj: null |
1360 | + property var currentContainer: null |
1361 | + |
1362 | signal doSearch |
1363 | |
1364 | Component { |
1365 | @@ -50,7 +52,7 @@ |
1366 | Dialog { |
1367 | id: noResultsDialog |
1368 | title: i18n.tr("No Search Results Found") |
1369 | - property var returnHome: false |
1370 | + property bool returnHome: false |
1371 | |
1372 | Button { |
1373 | id: searchAgain |
1374 | @@ -58,7 +60,7 @@ |
1375 | color: UbuntuColors.green |
1376 | onClicked: { |
1377 | PopupUtils.close(noResultsDialog) |
1378 | - PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml")) |
1379 | + PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml"), {currentContainer: currentContainer}) |
1380 | } |
1381 | } |
1382 | |
1383 | @@ -118,11 +120,11 @@ |
1384 | } |
1385 | packageListModel.clear() |
1386 | |
1387 | - var comp = Qt.createComponent("ContainerManager.qml") |
1388 | - var worker = comp.createObject() |
1389 | + var worker = Qt.createComponent("ContainerManager.qml").createObject(parent) |
1390 | worker.finishedSearch.connect(finishedSearch) |
1391 | - worker.error.connect(mainView.error) |
1392 | - worker.searchPackageCache(mainView.currentContainer, search_string) |
1393 | + worker.error.connect(packageOperationDetails.error) |
1394 | + |
1395 | + worker.searchPackageCache(currentContainer, search_string) |
1396 | } |
1397 | |
1398 | function finishedSearch(packageList) { |
1399 | @@ -133,14 +135,14 @@ |
1400 | packageListModel.append({"package_desc": packageList[i], "package_name": packageList[i].split(' ')[0]}) |
1401 | } |
1402 | if (!search_comp) { |
1403 | - search_comp = Qt.createComponent("SearchResults.qml") |
1404 | + search_comp = Qt.createComponent("SearchResults.qml", {currentContainer: currentContainer}) |
1405 | } |
1406 | - search_obj = search_comp.createObject(searchResultsView, {"model": packageListModel}) |
1407 | + search_obj = search_comp.createObject(parent, {"model": packageListModel}) |
1408 | } |
1409 | else { |
1410 | PopupUtils.open(noResultsPopup) |
1411 | } |
1412 | } |
1413 | |
1414 | - onDoSearch: PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml")) |
1415 | + onDoSearch: PopupUtils.open(Qt.resolvedUrl("SearchPackagesDialog.qml"), {currentContainer: currentContainer}) |
1416 | } |
1417 | |
1418 | === added directory 'qml/gui' |
1419 | === renamed file 'libertine/qml/ContainersView.qml' => 'qml/gui/ContainersView.qml' |
1420 | --- libertine/qml/ContainersView.qml 2016-08-22 18:20:43 +0000 |
1421 | +++ qml/gui/ContainersView.qml 2016-10-11 17:13:48 +0000 |
1422 | @@ -20,6 +20,7 @@ |
1423 | import QtQuick 2.4 |
1424 | import Ubuntu.Components 1.3 |
1425 | import Ubuntu.Components.Popups 1.3 |
1426 | +import "../common" |
1427 | |
1428 | |
1429 | /** |
1430 | @@ -35,115 +36,19 @@ |
1431 | Action { |
1432 | iconName: "add" |
1433 | onTriggered: { |
1434 | - PopupUtils.open(Qt.resolvedUrl("ContainerOptionsDialog.qml")) |
1435 | + PopupUtils.open(Qt.resolvedUrl("../common/ContainerOptionsDialog.qml")) |
1436 | } |
1437 | } |
1438 | ] |
1439 | - leadingActionBar.actions: [ |
1440 | - Action { |
1441 | - iconName: "back" |
1442 | - visible: false |
1443 | - } |
1444 | - ] |
1445 | } |
1446 | + property string currentContainer |
1447 | |
1448 | - UbuntuListView { |
1449 | - id: containersList |
1450 | + ContainersList { |
1451 | anchors { |
1452 | topMargin: pageHeader.height |
1453 | - fill: parent |
1454 | - } |
1455 | - model: containerConfigList |
1456 | - |
1457 | - function edit(id, status) { |
1458 | - if (status === "removing") { |
1459 | - mainView.error(i18n.tr("Container Unavailable"), i18n.tr("Container is being destroyed and is no longer editable.")) |
1460 | - return |
1461 | - } |
1462 | - mainView.currentContainer = id |
1463 | - containerAppsList.setContainerApps(mainView.currentContainer) |
1464 | - pageStack.push(Qt.resolvedUrl("HomeView.qml"), {"currentContainer": mainView.currentContainer}) |
1465 | - } |
1466 | - |
1467 | - delegate: ListItem { |
1468 | - Label { |
1469 | - text: name |
1470 | - anchors { |
1471 | - verticalCenter: parent.verticalCenter |
1472 | - left: parent.left |
1473 | - leftMargin: units.gu(2) |
1474 | - } |
1475 | - } |
1476 | - ActivityIndicator { |
1477 | - id: containerActivity |
1478 | - anchors { |
1479 | - verticalCenter: parent.verticalCenter |
1480 | - right: parent.right |
1481 | - rightMargin: units.gu(2) |
1482 | - } |
1483 | - visible: (installStatus === i18n.tr("installing") || |
1484 | - installStatus === i18n.tr("removing")) ? true : false |
1485 | - running: containerActivity.visible |
1486 | - } |
1487 | - |
1488 | - onClicked: { containersList.edit(containerId, installStatus) } |
1489 | - |
1490 | - leadingActions: ListItemActions { |
1491 | - actions: [ |
1492 | - Action { |
1493 | - iconName: "delete" |
1494 | - text: i18n.tr("delete") |
1495 | - description: i18n.tr("Delete Container") |
1496 | - onTriggered: { |
1497 | - var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView) |
1498 | - worker.error.connect(mainView.error) |
1499 | - worker.destroyContainer(containerId) |
1500 | - } |
1501 | - } |
1502 | - ] |
1503 | - } |
1504 | - |
1505 | - trailingActions: ListItemActions { |
1506 | - actions: [ |
1507 | - Action { |
1508 | - iconName: "info" |
1509 | - text: i18n.tr("info") |
1510 | - description: i18n.tr("Container Info") |
1511 | - onTriggered: { |
1512 | - mainView.currentContainer = containerId |
1513 | - pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml"), {currentContainer: containerId}) |
1514 | - } |
1515 | - }, |
1516 | - Action { |
1517 | - iconName: "edit" |
1518 | - text: i18n.tr("edit") |
1519 | - description: i18n.tr("Container Apps") |
1520 | - visible: (installStatus === i18n.tr("ready") || |
1521 | - installStatus === i18n.tr("updating")) ? true : false |
1522 | - onTriggered: { |
1523 | - containersList.edit(containerId, installStatus) |
1524 | - } |
1525 | - } |
1526 | - ] |
1527 | - } |
1528 | - } |
1529 | - } |
1530 | - |
1531 | - Component.onCompleted: { |
1532 | - containerConfigList.configChanged.connect(updateContainerList) |
1533 | - } |
1534 | - |
1535 | - Component.onDestruction: { |
1536 | - containerConfigList.configChanged.disconnect(updateContainerList) |
1537 | - } |
1538 | - |
1539 | - function updateContainerList() { |
1540 | - containerConfigList.reloadContainerList() |
1541 | - |
1542 | - if (mainView.currentContainer && !containerConfigList.getContainerStatus(mainView.currentContainer) && pageStack.currentPage !== containersView) { |
1543 | - pageStack.pop() |
1544 | - mainView.currentContainer = "" |
1545 | - mainView.error(i18n.tr("Container Unavailable"), i18n.tr("This container has been destroyed and is no longer valid. You have been returned to the containers overview.")) |
1546 | - } |
1547 | + fill: containersView |
1548 | + } |
1549 | + |
1550 | + currentContainer: containersView.currentContainer |
1551 | } |
1552 | } |
1553 | |
1554 | === renamed file 'libertine/qml/WelcomeView.qml' => 'qml/gui/WelcomeView.qml' |
1555 | --- libertine/qml/WelcomeView.qml 2016-09-07 20:43:08 +0000 |
1556 | +++ qml/gui/WelcomeView.qml 2016-10-11 17:13:48 +0000 |
1557 | @@ -49,6 +49,7 @@ |
1558 | |
1559 | text: i18n.tr("Welcome to the Ubuntu Legacy Application Support Manager.") |
1560 | } |
1561 | + |
1562 | Label { |
1563 | id: warningMessage |
1564 | Layout.fillWidth: true |
1565 | @@ -67,13 +68,13 @@ |
1566 | color: UbuntuColors.green |
1567 | |
1568 | onClicked: { |
1569 | - var dialog = PopupUtils.open(Qt.resolvedUrl("ContainerOptionsDialog.qml")) |
1570 | + var dialog = PopupUtils.open(Qt.resolvedUrl("../common/ContainerOptionsDialog.qml")) |
1571 | dialog.onCreateInitialized.connect(createInitialized) |
1572 | } |
1573 | } |
1574 | } |
1575 | |
1576 | function createInitialized() { |
1577 | - pageStack.push(Qt.resolvedUrl("ContainersView.qml")) |
1578 | + pageStack.push(Qt.resolvedUrl("ContainersView.qml"), {currentContainer: ""}) |
1579 | } |
1580 | } |
1581 | |
1582 | === renamed file 'libertine/qml/libertine.qml' => 'qml/gui/libertine.qml' |
1583 | --- libertine/qml/libertine.qml 2016-06-09 18:20:19 +0000 |
1584 | +++ qml/gui/libertine.qml 2016-10-11 17:13:48 +0000 |
1585 | @@ -28,7 +28,6 @@ |
1586 | applicationName: "libertine" |
1587 | width: units.gu(90) |
1588 | height: units.gu(75) |
1589 | - property var currentContainer: undefined |
1590 | property var operationDetails: undefined |
1591 | |
1592 | signal error(string short_description, string details) |
1593 | @@ -40,15 +39,17 @@ |
1594 | } |
1595 | |
1596 | Component.onCompleted: { |
1597 | - Qt.createComponent("ContainerManager.qml").createObject(mainView).fixIntegrity() |
1598 | - |
1599 | - mainView.currentContainer = containerConfigList.defaultContainerId |
1600 | + packageOperationDetails.error.connect(error) |
1601 | + |
1602 | + Qt.createComponent("../common/ContainerManager.qml").createObject(mainView).fixIntegrity() |
1603 | + |
1604 | + var currentContainer = containerConfigList.defaultContainerId |
1605 | |
1606 | if (!containerConfigList.empty()) { |
1607 | - pageStack.push(Qt.resolvedUrl("ContainersView.qml")) |
1608 | - if (mainView.currentContainer) { |
1609 | - containerAppsList.setContainerApps(mainView.currentContainer) |
1610 | - pageStack.push(Qt.resolvedUrl("HomeView.qml"), {currentContainer: mainView.currentContainer}) |
1611 | + pageStack.push(Qt.resolvedUrl("ContainersView.qml"), {currentContainer: currentContainer}) |
1612 | + if (currentContainer) { |
1613 | + containerAppsList.setContainerApps(currentContainer) |
1614 | + pageStack.push(Qt.resolvedUrl("../common/ContainerEditView.qml"), {currentContainer: currentContainer}) |
1615 | } |
1616 | } |
1617 | else { |
1618 | @@ -57,7 +58,7 @@ |
1619 | } |
1620 | |
1621 | onError: { |
1622 | - PopupUtils.open(Qt.resolvedUrl("GenericErrorDialog.qml"), null, |
1623 | + PopupUtils.open(Qt.resolvedUrl("../common/GenericErrorDialog.qml"), null, |
1624 | {"short_description": short_description, "details": details}) |
1625 | } |
1626 | |
1627 | |
1628 | === added directory 'qml/plugin' |
1629 | === added file 'qml/plugin/MainSettingsPage.qml' |
1630 | --- qml/plugin/MainSettingsPage.qml 1970-01-01 00:00:00 +0000 |
1631 | +++ qml/plugin/MainSettingsPage.qml 2016-10-11 17:13:48 +0000 |
1632 | @@ -0,0 +1,58 @@ |
1633 | +/* |
1634 | + * Copyright (C) 2016 Canonical Ltd. |
1635 | + * |
1636 | + * This program is free software: you can redistribute it and/or modify it |
1637 | + * under the terms of the GNU General Public License version 3, as published |
1638 | + * by the Free Software Foundation. |
1639 | + * |
1640 | + * This program is distributed in the hope that it will be useful, but |
1641 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
1642 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1643 | + * PURPOSE. See the GNU General Public License for more details. |
1644 | + * |
1645 | + * You should have received a copy of the GNU General Public License along |
1646 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
1647 | + */ |
1648 | + |
1649 | +import QtQuick 2.4 |
1650 | +import Ubuntu.Components 1.3 |
1651 | +import Ubuntu.Components.Popups 1.3 |
1652 | +import SystemSettings 1.0 |
1653 | +import Libertine 1.0 |
1654 | +import "../common" |
1655 | + |
1656 | +ItemPage { |
1657 | + id: mainView |
1658 | + |
1659 | + header: PageHeader { |
1660 | + id: pageHeader |
1661 | + title: i18n.tr("Manage Libertine Containers") |
1662 | + trailingActionBar.actions: [ |
1663 | + Action { |
1664 | + iconName: "add" |
1665 | + onTriggered: { |
1666 | + PopupUtils.open(Qt.resolvedUrl("../common/ContainerOptionsDialog.qml")) |
1667 | + } |
1668 | + } |
1669 | + ] |
1670 | + } |
1671 | + |
1672 | + property string currentContainer |
1673 | + property var operationDetails |
1674 | + |
1675 | + signal error(string short_description, string details) |
1676 | + |
1677 | + ContainersList { |
1678 | + anchors { |
1679 | + topMargin: pageHeader.height |
1680 | + fill: containersView |
1681 | + } |
1682 | + |
1683 | + currentContainer: mainView.currentContainer |
1684 | + } |
1685 | + |
1686 | + onError: { |
1687 | + PopupUtils.open(Qt.resolvedUrl("../common/GenericErrorDialog.qml"), null, |
1688 | + {"short_description": short_description, "details": details}) |
1689 | + } |
1690 | +} |
1691 | |
1692 | === added directory 'system-settings-plugin' |
1693 | === added file 'system-settings-plugin/CMakeLists.txt' |
1694 | --- system-settings-plugin/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1695 | +++ system-settings-plugin/CMakeLists.txt 2016-10-11 17:13:48 +0000 |
1696 | @@ -0,0 +1,38 @@ |
1697 | +set(PLUGIN_MANIFEST_DIR_BASE share/ubuntu/settings/system) |
1698 | +set(PLUGIN_MODULE_DIR_BASE ubuntu-system-settings) |
1699 | + |
1700 | +set(PLUGIN_MANIFEST_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_MANIFEST_DIR_BASE}") |
1701 | +set(PLUGIN_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${PLUGIN_MODULE_DIR_BASE}") |
1702 | +set(PLUGIN_QML_DIR "${CMAKE_INSTALL_PREFIX}/share/ubuntu/settings/system/qml-plugins/libertine") |
1703 | + |
1704 | +SET(CMAKE_INSTALL_RPATH "${PLUGIN_MODULE_DIR}") |
1705 | + |
1706 | +configure_file(config.h.in config.h) |
1707 | + |
1708 | +set(LIBERTINE_PLUGIN_ICON_PATH "${PLUGIN_MANIFEST_DIR}/icons") |
1709 | +set(PLUGIN_SETTINGS_TARGET libertine.settings) |
1710 | +configure_file(${PLUGIN_SETTINGS_TARGET}.in ${PLUGIN_SETTINGS_TARGET}) |
1711 | + |
1712 | +set (CMAKE_INCLUDE_CURRENT_DIR ON) |
1713 | +set (CMAKE_AUTOMOC ON) |
1714 | + |
1715 | +# For some reason, building on vivid seems to require that we manually |
1716 | +# add /usr/include to the include directories when using automoc here. |
1717 | +set (CMAKE_AUTOMOC_MOC_OPTIONS -I/usr/include) |
1718 | + |
1719 | +pkg_check_modules(SYSTEM_SETTINGS REQUIRED SystemSettings) |
1720 | + |
1721 | +file(GLOB_RECURSE PLUGIN_QML_SRC |
1722 | + ${CMAKE_SOURCE_DIR}/qml/common/*.qml |
1723 | + ${CMAKE_SOURCE_DIR}/qml/plugin/*.qml |
1724 | +) |
1725 | + |
1726 | +add_library(libertine-plugin MODULE plugin.cpp plugin.h ${PLUGIN_QML_SRC}) |
1727 | +qt5_use_modules(libertine-plugin Qml Quick) |
1728 | + |
1729 | +include_directories(${SYSTEM_SETTINGS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libertine) |
1730 | +target_link_libraries(libertine-plugin ${LIBERTINE_COMMON} ${SYSTEM_SETTINGS_LIBRARIES}) |
1731 | + |
1732 | +install(TARGETS libertine-plugin LIBRARY DESTINATION ${PLUGIN_MODULE_DIR} NAMELINK_SKIP) |
1733 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_SETTINGS_TARGET} DESTINATION ${PLUGIN_MANIFEST_DIR}) |
1734 | +install(FILES libertine-plugin.png DESTINATION ${LIBERTINE_PLUGIN_ICON_PATH}) |
1735 | |
1736 | === added file 'system-settings-plugin/config.h.in' |
1737 | --- system-settings-plugin/config.h.in 1970-01-01 00:00:00 +0000 |
1738 | +++ system-settings-plugin/config.h.in 2016-10-11 17:13:48 +0000 |
1739 | @@ -0,0 +1,16 @@ |
1740 | +/* |
1741 | + * Copyright 2016 Canonical Ltd |
1742 | + * |
1743 | + * Libertine is free software: you can redistribute it and/or modify it under |
1744 | + * the terms of the GNU General Public License, version 3, as published by the |
1745 | + * Free Software Foundation. |
1746 | + * |
1747 | + * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY |
1748 | + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
1749 | + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
1750 | + * |
1751 | + * You should have received a copy of the GNU General Public License |
1752 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1753 | + */ |
1754 | + |
1755 | +#define LIBERTINE_PLUGIN_QML_DIR "@LIBERTINE_QML_PATH@/plugin" |
1756 | |
1757 | === added file 'system-settings-plugin/libertine-plugin.png' |
1758 | Binary files system-settings-plugin/libertine-plugin.png 1970-01-01 00:00:00 +0000 and system-settings-plugin/libertine-plugin.png 2016-10-11 17:13:48 +0000 differ |
1759 | === added file 'system-settings-plugin/libertine.settings.in' |
1760 | --- system-settings-plugin/libertine.settings.in 1970-01-01 00:00:00 +0000 |
1761 | +++ system-settings-plugin/libertine.settings.in 2016-10-11 17:13:48 +0000 |
1762 | @@ -0,0 +1,14 @@ |
1763 | +{ |
1764 | + "name": "Libertine", |
1765 | + "icon": "${LIBERTINE_PLUGIN_ICON_PATH}/libertine-plugin.png", |
1766 | + "translations": "libertine", |
1767 | + "category": "system", |
1768 | + "keywords": [ |
1769 | + "libertine", |
1770 | + "legacy", |
1771 | + "x11" |
1772 | + ], |
1773 | + "has-dynamic-keywords": false, |
1774 | + "has-dynamic-visibility": false, |
1775 | + "plugin": "libertine-plugin" |
1776 | +} |
1777 | |
1778 | === added file 'system-settings-plugin/plugin.cpp' |
1779 | --- system-settings-plugin/plugin.cpp 1970-01-01 00:00:00 +0000 |
1780 | +++ system-settings-plugin/plugin.cpp 2016-10-11 17:13:48 +0000 |
1781 | @@ -0,0 +1,105 @@ |
1782 | +/* |
1783 | + * Copyright (C) 2016 Canonical Ltd. |
1784 | + * |
1785 | + * This program is free software: you can redistribute it and/or modify it |
1786 | + * under the terms of the GNU General Public License version 3, as published |
1787 | + * by the Free Software Foundation. |
1788 | + * |
1789 | + * This program is distributed in the hope that it will be useful, but |
1790 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
1791 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1792 | + * PURPOSE. See the GNU General Public License for more details. |
1793 | + * |
1794 | + * You should have received a copy of the GNU General Public License along |
1795 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
1796 | + */ |
1797 | + |
1798 | +#include "plugin.h" |
1799 | + |
1800 | +#include "config.h" |
1801 | +#include "common/ContainerManager.h" |
1802 | +#include "common/ContainerAppsList.h" |
1803 | +#include "common/ContainerArchivesList.h" |
1804 | +#include "common/ContainerConfigList.h" |
1805 | +#include "common/LibertineConfig.h" |
1806 | +#include "common/ContainerConfig.h" |
1807 | +#include "common/PackageOperationDetails.h" |
1808 | +#include <memory> |
1809 | +#include <QQmlEngine> |
1810 | +#include <QQmlContext> |
1811 | +#include <QFileSystemWatcher> |
1812 | +#include <SystemSettings/ItemBase> |
1813 | + |
1814 | +using namespace SystemSettings; |
1815 | + |
1816 | +class LibertineItem: public ItemBase |
1817 | +{ |
1818 | + Q_OBJECT |
1819 | + |
1820 | +public: |
1821 | + explicit LibertineItem(const QVariantMap &staticData, QObject *parent = 0); |
1822 | + virtual ~LibertineItem() = default; |
1823 | + |
1824 | + virtual QQmlComponent* pageComponent(QQmlEngine *engine, |
1825 | + QObject *parent = 0) override; |
1826 | + |
1827 | +private: |
1828 | + std::unique_ptr<LibertineConfig> config_; |
1829 | + ContainerConfigList* containers_; |
1830 | + ContainerAppsList* container_apps_; |
1831 | + ContainerArchivesList* container_archives_; |
1832 | + PackageOperationDetails* package_operation_details_; |
1833 | + QFileSystemWatcher watcher_; |
1834 | + |
1835 | +private slots: |
1836 | + void reload_config(QString const&); |
1837 | +}; |
1838 | + |
1839 | +LibertineItem:: |
1840 | +LibertineItem(const QVariantMap &staticData, QObject *parent) |
1841 | + : ItemBase(staticData, parent) |
1842 | + , config_(new LibertineConfig()) |
1843 | + , containers_(new ContainerConfigList(config_.get(), this)) |
1844 | + , container_apps_(new ContainerAppsList(containers_, this)) |
1845 | + , container_archives_(new ContainerArchivesList(containers_, this)) |
1846 | + , package_operation_details_(new PackageOperationDetails(this)) |
1847 | + , watcher_({config_->containers_config_file_name()}) |
1848 | +{ |
1849 | + qmlRegisterType<ContainerConfig>("Libertine", 1, 0, "ContainerConfig"); |
1850 | + qmlRegisterType<ContainerManagerWorker>("Libertine", 1, 0, "ContainerManagerWorker"); |
1851 | + qmlRegisterType<PackageOperationDetails>("Libertine", 1, 0, "PackageOperationDetails"); |
1852 | + |
1853 | + connect(&watcher_, &QFileSystemWatcher::fileChanged, this, &LibertineItem::reload_config); |
1854 | +} |
1855 | + |
1856 | +QQmlComponent *LibertineItem:: |
1857 | +pageComponent(QQmlEngine *engine, QObject *parent) |
1858 | +{ |
1859 | + auto ctxt = engine->rootContext(); |
1860 | + ctxt->setContextProperty("containerConfigList", containers_); |
1861 | + ctxt->setContextProperty("containerAppsList", container_apps_); |
1862 | + ctxt->setContextProperty("containerArchivesList", container_archives_); |
1863 | + ctxt->setContextProperty("packageOperationDetails", package_operation_details_); |
1864 | + |
1865 | + auto component = new QQmlComponent(engine, |
1866 | + QUrl(LIBERTINE_PLUGIN_QML_DIR "/MainSettingsPage.qml"), |
1867 | + parent); |
1868 | + return component; |
1869 | +} |
1870 | + |
1871 | + |
1872 | +void LibertineItem:: |
1873 | +reload_config(QString const&) |
1874 | +{ |
1875 | + containers_->reloadConfigs(); |
1876 | +} |
1877 | + |
1878 | + |
1879 | +ItemBase *LibertinePlugin:: |
1880 | +createItem(const QVariantMap &staticData, |
1881 | + QObject *parent) |
1882 | +{ |
1883 | + return new LibertineItem(staticData, parent); |
1884 | +} |
1885 | + |
1886 | +#include "plugin.moc" |
1887 | |
1888 | === added file 'system-settings-plugin/plugin.h' |
1889 | --- system-settings-plugin/plugin.h 1970-01-01 00:00:00 +0000 |
1890 | +++ system-settings-plugin/plugin.h 2016-10-11 17:13:48 +0000 |
1891 | @@ -0,0 +1,34 @@ |
1892 | +/* |
1893 | + * Copyright (C) 2016 Canonical Ltd. |
1894 | + * |
1895 | + * This program is free software: you can redistribute it and/or modify it |
1896 | + * under the terms of the GNU General Public License version 3, as published |
1897 | + * by the Free Software Foundation. |
1898 | + * |
1899 | + * This program is distributed in the hope that it will be useful, but |
1900 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
1901 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1902 | + * PURPOSE. See the GNU General Public License for more details. |
1903 | + * |
1904 | + * You should have received a copy of the GNU General Public License along |
1905 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
1906 | + */ |
1907 | +#pragma once |
1908 | + |
1909 | +#include <QObject> |
1910 | +#include <SystemSettings/PluginInterface> |
1911 | + |
1912 | +class LibertinePlugin: |
1913 | + public QObject, |
1914 | + public SystemSettings::PluginInterface2 |
1915 | +{ |
1916 | + Q_OBJECT |
1917 | + Q_PLUGIN_METADATA(IID "com.ubuntu.SystemSettings.PluginInterface/2.0") |
1918 | + Q_INTERFACES(SystemSettings::PluginInterface2) |
1919 | + |
1920 | +public: |
1921 | + explicit LibertinePlugin() = default; |
1922 | + |
1923 | + SystemSettings::ItemBase *createItem(const QVariantMap &staticData, |
1924 | + QObject *parent = 0); |
1925 | +}; |
1926 | |
1927 | === modified file 'tests/unit/ContainerConfigListTests.cpp' |
1928 | --- tests/unit/ContainerConfigListTests.cpp 2015-09-15 15:03:38 +0000 |
1929 | +++ tests/unit/ContainerConfigListTests.cpp 2016-10-11 17:13:48 +0000 |
1930 | @@ -19,7 +19,7 @@ |
1931 | */ |
1932 | #include <gtest/gtest.h> |
1933 | |
1934 | -#include "libertine/ContainerConfigList.h" |
1935 | +#include "common/ContainerConfigList.h" |
1936 | #include <QtCore/QByteArray> |
1937 | #include <QtCore/QJsonDocument> |
1938 | #include <QtCore/QJsonParseError> |
1939 | |
1940 | === modified file 'tests/unit/ContainerConfigTests.cpp' |
1941 | --- tests/unit/ContainerConfigTests.cpp 2016-01-21 21:42:28 +0000 |
1942 | +++ tests/unit/ContainerConfigTests.cpp 2016-10-11 17:13:48 +0000 |
1943 | @@ -19,7 +19,7 @@ |
1944 | */ |
1945 | #include <gtest/gtest.h> |
1946 | |
1947 | -#include "libertine/ContainerConfig.h" |
1948 | +#include "common/ContainerConfig.h" |
1949 | #include <QtCore/QByteArray> |
1950 | #include <QtCore/QJsonDocument> |
1951 | #include <QtCore/QJsonParseError> |
FAILED: Continuous integration, rev:316 /jenkins. canonical. com/libertine/ job/lp- libertine- ci/131/ /jenkins. canonical. com/libertine/ job/build/ 358/console /jenkins. canonical. com/libertine/ job/lp- generic- update- mp/272/ console /jenkins. canonical. com/libertine/ job/build- 0-fetch/ 360 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= vivid+overlay/ 343 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= xenial+ overlay/ 343 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= yakkety/ 343 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= vivid+overlay/ 342/console /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= xenial+ overlay/ 342/console /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= yakkety/ 342/console /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= vivid+overlay/ 342/console /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= xenial+ overlay/ 342/console /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= yakkety/ 342/console
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/libertine/ job/lp- libertine- ci/131/ rebuild
https:/