on xenial help sign in
Merge unity8 trunk
commit9c4b7e7b93b52c158bc5d8274dd1bc2a927477dd authorGerry Boland <gerry.boland@canonical.com> dateThu 3 Jul 2014, 21:28 (12 years ago) parent97b41f210ed250
95 files changed+4614−175
.bazaar/plugins/makecheck_unity_phablet.py+16−8 build.sh+1 cmake/modules/QmlPlugins.cmake+29−22 debian/changelog+78 debian/control+4 debian/unity8-private.install+1 plugins/AccountsService/AccountsService.qmltypes+22 plugins/CMakeLists.txt+1 plugins/Dash/Dash.qmltypes+95 plugins/HudClient/HudClient.qmltypes+91 plugins/LightDM/LightDM.qmltypes+241 plugins/Lights/CMakeLists.txt+18 plugins/Lights/Lights.cpp+182 plugins/Lights/Lights.h+75 plugins/Lights/plugin.cpp+35 plugins/Lights/plugin.h+34 plugins/Lights/qmldir+3 plugins/Powerd/Powerd.qmltypes+46 plugins/SessionBroadcast/SessionBroadcast.qmltypes+19 plugins/Ubuntu/CMakeLists.txt+1 plugins/Ubuntu/DownloadDaemonListener/DownloadDaemonListener.qmltypes+60 plugins/Ubuntu/Gestures/Gestures.qmltypes+153 plugins/Ubuntu/Payments/CMakeLists.txt+20 plugins/Ubuntu/Payments/Payments.cpp+118 plugins/Ubuntu/Payments/Payments.h+65 plugins/Ubuntu/Payments/Payments.qmltypes+42 plugins/Ubuntu/Payments/plugin.cpp+28 plugins/Ubuntu/Payments/plugin.h+31 plugins/Ubuntu/Payments/qmldir+3 plugins/Unity/Indicators/CMakeLists.txt+1−4 plugins/Unity/Indicators/qml/CachedUnityMenuModel.qml → plugins/Unity/Indicators/CachedUnityMenuModel.qml plugins/Unity/Indicators/Indicators.qmltypes+278 plugins/Unity/Indicators/qml/qmldir → plugins/Unity/Indicators/qmldir−4 plugins/Unity/Launcher/Launcher.qmltypes+174 plugins/Unity/Launcher/launcheritem.cpp+2−2 plugins/Unity/Session/Session.qmltypes+25 plugins/Utils/Utils.qmltypes+143 plugins/Utils/easingcurve.cpp+3−1 qml/Dash/Previews/PreviewPayments.qml+56 qml/Dash/Previews/PreviewWidgetFactory.qml+1 qml/Launcher/LauncherPanel.qml−1 qml/Panel/Indicators/DefaultIndicatorPage.qml+2−2 qml/Panel/Indicators/DefaultIndicatorWidget.qml+9−2 plugins/Unity/Indicators/qml/IndicatorBase.qml → qml/Panel/Indicators/IndicatorBase.qml+2−3 qml/Panel/Indicators/IndicatorDelegate.qml+1−2 tests/mocks/Unity/Indicators/MenuItemFactory.qml → qml/Panel/Indicators/IndicatorsLight.qml+14−14 plugins/Unity/Indicators/qml/MenuItemFactory.qml → qml/Panel/Indicators/MenuItemFactory.qml plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml → qml/Panel/Indicators/MessageMenuItemFactory.qml plugins/Unity/Indicators/qml/RemoveBackground.qml → qml/Panel/Indicators/RemoveBackground.qml src/CMakeLists.txt+1 src/CachingNetworkManagerFactory.cpp+62 src/CachingNetworkManagerFactory.h+50 src/main.cpp+5−1 tests/autopilot/unity8/process_helpers.py+4−3 tests/autopilot/unity8/shell/tests/__init__.py+1−2 tests/autopilot/unity8/shell/tests/disabled_test_hud.py+44−13 tests/autopilot/unity8/shell/tests/test_emulators.py−2 tests/autopilot/unity8/shell/tests/test_lock_screen.py+4−5 tests/autopilot/unity8/shell/tests/test_notifications.py+15−10 tests/autopilot/unity8/shell/tests/test_system_integration.py+10−5 tests/autopilot/unity8/shell/tests/test_upstart.py+20−11 tests/mocks/AccountsService/AccountsService.qmltypes+22 tests/mocks/GSettings.1.0/GSettings.qmltypes+42 tests/mocks/HudClient/HudClient.qmltypes+113 tests/mocks/LightDM/LightDM.qmltypes+241 tests/mocks/Powerd/Powerd.qmltypes+46 tests/mocks/QMenuModel/QMenuModel.qmltypes+77 tests/mocks/QtMultimedia/QtMultimedia.qmltypes+52 tests/mocks/Ubuntu/CMakeLists.txt+1 tests/mocks/Ubuntu/DownloadDaemonListener/DownloadDaemonListener.qmltypes+60 tests/mocks/Ubuntu/Payments/CMakeLists.txt+10 tests/mocks/Ubuntu/Payments/MockPayments.cpp+89 tests/mocks/Ubuntu/Payments/MockPayments.h+60 tests/mocks/Ubuntu/Payments/Payments.qmltypes+42 tests/mocks/Ubuntu/Payments/plugin.cpp+28 tests/mocks/Ubuntu/Payments/plugin.h+31 tests/mocks/Ubuntu/Payments/qmldir+3 tests/mocks/Ubuntu/Thumbnailer/Thumbnailer.qmltypes+17 tests/mocks/Unity/Application/Application.qmltypes+313 tests/mocks/Unity/Application/CMakeLists.txt+2−1 tests/mocks/Unity/Indicators/IndicatorBase.qml−38 tests/mocks/Unity/Indicators/Indicators.qmltypes+210 tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp+1−1 tests/mocks/Unity/Indicators/qmldir−2 tests/mocks/Unity/Launcher/Launcher.qmltypes+171 tests/mocks/Unity/Notifications/Notifications.qmltypes+10 tests/mocks/Unity/Unity.qmltypes+345 tests/qmltests/CMakeLists.txt+1 tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+100 tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml+1 tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml+1 tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+3−2 tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml+2−2 tests/utils/modules/Unity/Test/Test.qmltypes+59 tests/whitespace/check_whitespace.py+22−12
.bazaar/plugins/makecheck_unity_phablet.py+16−8
@@ -1,5 +1,5 @@
11#!/usr/bin/python
2−# Copyright 2013 Canonical Ltd.
2+# Copyright 2013, 2014 Canonical Ltd.
33#
44# This program is free software; you can redistribute it and/or modify
55# it under the terms of the GNU Lesser General Public License as published by
@@ -13,11 +13,15 @@
1313# You should have received a copy of the GNU Lesser General Public License
1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
16−import os, subprocess
17−from bzrlib import branch, errors
18−from bzrlib.urlutils import dirname, local_path_from_url
16+import os
17+import subprocess
18+from bzrlib import branch
19+from bzrlib.urlutils import local_path_from_url
1920
20−def execute_makecheck(local_branch, master_branch, old_revision_number, old_revision_id, future_revision_number, future_revision_id, tree_delta, future_tree):
21+
22+def execute_makecheck(
23+ local_branch, master_branch, old_revision_number, old_revision_id,
24+ future_revision_number, future_revision_id, tree_delta, future_tree):
2125 if not master_branch.basis_tree().has_filename("qml/Shell.qml"):
2226 return
2327
@@ -27,7 +31,9 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
2731 os.environ['CTEST_OUTPUT_ON_FAILURE'] = "1"
2832 if (subprocess.call("make -C builddir test", shell=True) != 0):
2933
30− print("\n\n*** Warning ***\n\nBasic tests failed. This commit will not pass continuous integration.")
34+ print("\n\n*** Warning ***\n\n"
35+ "Basic tests failed. This commit will not pass continuous "
36+ "integration.")
3137
3238 branch = local_branch or master_branch
3339 revision = branch.repository.get_revision(future_revision_id)
@@ -36,8 +42,10 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
3642 msg_file.close()
3743
3844 print("\n\nSaved commit message to $SRC_DIR/message.txt.")
39− print("You can uncommit this revision, fix the tests and reuse your message running:\n\nbzr commit -F message.txt\n\n")
45+ print("You can uncommit this revision, fix the tests and reuse your "
46+ "message running:\n\nbzr commit -F message.txt\n\n")
4047 elif os.path.isfile("message.txt"):
4148 os.remove("message.txt")
4249
43−branch.Branch.hooks.install_named_hook('pre_commit', execute_makecheck, 'make check pre-commit')
50+branch.Branch.hooks.install_named_hook(
51+ 'pre_commit', execute_makecheck, 'make check pre-commit')
build.sh+1
@@ -42,6 +42,7 @@ install_dependencies() {
4242 equivs \
4343 gsettings-desktop-schemas \
4444 gsettings-ubuntu-schemas \
45+ pay-service \
4546 qmenumodel-qml \
4647 qml-module-qtquick-xmllistmodel \
4748 qtdeclarative5-gsettings1.0 \
cmake/modules/QmlPlugins.cmake+29−22
@@ -12,6 +12,12 @@ if(NOT TARGET qmlplugindump)
1212 set_target_properties(qmlplugindump PROPERTIES IMPORTED_LOCATION ${qmlplugindump_exe})
1313endif()
1414
15+#
16+# A custom target for building the qmltypes files manually.
17+#
18+if (NOT TARGET qmltypes)
19+ add_custom_target(qmltypes)
20+endif()
1521
1622# Creates a target for copying resource files into build dir and optionally installing them.
1723#
@@ -51,6 +57,7 @@ macro(export_qmlfiles PLUGIN PATH)
5157 ${QMLFILES_SEARCH_PATH}/*.png
5258 ${QMLFILES_SEARCH_PATH}/*.sci
5359 ${QMLFILES_SEARCH_PATH}/*.svg
60+ ${QMLFILES_SEARCH_PATH}/*.qmltypes
5461 ${QMLFILES_SEARCH_PATH}/qmldir
5562 )
5663
@@ -69,14 +76,14 @@ macro(export_qmlfiles PLUGIN PATH)
6976 DESTINATION ${QMLFILES_DESTINATION}/${PATH}
7077 )
7178 endif()
72−endmacro(export_qmlfiles)
79+endmacro()
7380
7481
75−# Creates a target for generating the typeinfo file for a QML plugin and optionally installs it
76−# and additional targets.
82+# Creates a target for generating the typeinfo file for a QML plugin and/or installs the plugin
83+# targets.
7784#
7885# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
79−# into ${DESTINATION}/${path}. If you don't pass BINARY_DIR, it's assumed that current source
86+# into ${DESTINATION}/${path}. If you don't pass BINARY_DIR, it's assumed that current source
8087# path ends with ${path}.
8188#
8289# The generated file will be named after the last segment of the plugin name, e.g. Foo.qmltypes.
@@ -87,15 +94,18 @@ endmacro(export_qmlfiles)
8794# [TARGET_PREFIX string] # Will be prefixed to the target name
8895# [ENVIRONMENT string] # Will be added to qmlplugindump's env
8996# [TARGETS target1 [target2 ...]] # Targets to depend on and install (e.g. the plugin shared object)
97+# [NO_TYPES] # Do not create the qmltypes target
9098# )
9199#
92100# Created target:
93−# - ${TARGET_PREFIX}${plugin}-qmltypes - Generates the qmltypes file in the binary dir.
101+# - ${TARGET_PREFIX}${plugin}-qmltypes - Generates the qmltypes file in the source dir.
102+# It will be made a dependency of the "qmltypes" target.
94103
95104macro(export_qmlplugin PLUGIN VERSION PATH)
105+ set(options NO_TYPES)
96106 set(single BINARY_DIR DESTINATION TARGET_PREFIX ENVIRONMENT)
97107 set(multi TARGETS)
98− cmake_parse_arguments(QMLPLUGIN "" "${single}" "${multi}" ${ARGN})
108+ cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
99109
100110 get_target_property(qmlplugindump_executable qmlplugindump LOCATION)
101111
@@ -103,29 +113,26 @@ macro(export_qmlplugin PLUGIN VERSION PATH)
103113 set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
104114 else()
105115 # Find import path to point qmlplugindump at
106− string(REGEX REPLACE "${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
116+ string(REGEX REPLACE "/${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
107117 set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
108118 endif()
109119
110− # Find the last segment of the plugin name to use as qmltypes basename
111− string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
112− set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
113− set(qmltypes_path ${qmlplugin_dir}/${plugin_suffix}.qmltypes)
120+ if(NOT QMLPLUGIN_NO_TYPES)
121+ # Relative path for the module
122+ string(REPLACE "${CMAKE_BINARY_DIR}/" "" QMLPLUGIN_MODULE_DIR "${QMLPLUGIN_BINARY_DIR}")
123+
124+ # Find the last segment of the plugin name to use as qmltypes basename
125+ string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
126+ set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
127+ set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
114128
115− # Only generate typeinfo if not cross compiling
116− if(NOT CMAKE_CROSSCOMPILING)
117− add_custom_target(${target_prefix}-qmltypes ALL
129+ add_custom_target(${target_prefix}-qmltypes
118130 COMMAND env ${QMLPLUGIN_ENVIRONMENT} ${qmlplugindump_executable} -notrelocatable
119− ${PLUGIN} ${VERSION} ${QMLPLUGIN_BINARY_DIR} > ${qmltypes_path}
131+ ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
132+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
120133 )
121134 add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
122−
123− if (QMLPLUGIN_DESTINATION)
124− # Install the typeinfo file
125− install(FILES ${qmltypes_path}
126− DESTINATION ${QMLPLUGIN_DESTINATION}/${PATH}
127− )
128− endif()
135+ add_dependencies(qmltypes ${target_prefix}-qmltypes)
129136 endif()
130137
131138 set_target_properties(${QMLPLUGIN_TARGETS} PROPERTIES
debian/changelog+78
@@ -1,3 +1,81 @@
1+unity8 (7.90+14.10.20140703.1-0ubuntu1) utopic; urgency=low
2+
3+ [ Michał Sawicz ]
4+ * Initial code for a payment button widget, to handle purchasing apps
5+ from the click scope.
6+
7+ [ Nick Dedekind ]
8+ * Moved [Message]MenuItemFacotory from Unity.Indicators plugin to qml
9+ folder.
10+
11+ [ Albert Astals ]
12+ * EasingCurve: Initialize members
13+ * Fix valgrind warning by not emitting reset on model destructor That
14+ won't be supported until Qt 5.4 More info at https://bugreports.qt-
15+ project.org/browse/QTBUG-39780 Warning was ==16693== Invalid read of
16+ size 8 ==16693== at 0x72B19A0: QQmlContext::isValid() const
17+ (qqmlcontext.cpp:231) ==16693== by 0x736C82B:
18+ QQmlDelegateModelPrivate::emitChanges() (qqmldelegatemodel.cpp:1412)
19+ ==16693== by 0x7372AE6: QQmlDelegateModel::_q_modelReset()
20+ (qqmldelegatemodel.cpp:1463) ==16693== by 0x7397224:
21+ QQmlDelegateModel::qt_static_metacall(QObject*, QMetaObject::Call,
22+ int, void**) (moc_qqmldelegatemodel_p.cpp:196) ==16693== by
23+ 0x739769E: QQmlDelegateModel::qt_metacall(QMetaObject::Call, int,
24+ void**) (moc_qqmldelegatemodel_p.cpp:292) ==16693== by 0x66379CC:
25+ QMetaObject::activate(QObject*, int, int, void**) (in
26+ /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0) ==16693== by
27+ 0x65AEEFD: QAbstractItemModel::endResetModel() (in /usr/lib/x86_64-
28+ linux-gnu/libQt5Core.so.5.3.0) ==16693== by 0x23461EFD:
29+ FakeIndicatorsModel::unload() (fakeindicatorsmodel.cpp:53) ==16693==
30+ by 0x23461E13: FakeIndicatorsModel::~FakeIndicatorsModel()
31+ (fakeindicatorsmodel.cpp:34) ==16693== by 0x2345C073:
32+ QQmlPrivate::QQmlElement<FakeIndicatorsModel>::~QQmlElement() (in
33+ /home/tsdgeos_work/phablet/unity8/investigate_test_shell_crash/build
34+ dir/tests/mocks/Unity/Indicators/libIndicatorsFakeQml.so) ==16693==
35+ by 0x2345C0A3:
36+ QQmlPrivate::QQmlElement<FakeIndicatorsModel>::~QQmlElement()
37+ (qqmlprivate.h:106) ==16693== by 0x663636B:
38+ QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-
39+ gnu/libQt5Core.so.5.3.0) ==16693== Address 0x1862d448 is 8 bytes
40+ inside a block of size 16 free'd ==16693== at 0x4C2C2BC: operator
41+ delete(void*) (vg_replace_malloc.c:503) ==16693== by 0x72B21B8:
42+ QQmlContextData::destroy() (qqmlcontext.cpp:647) ==16693== by
43+ 0x7293458: QQmlPrivate::qdeclarativeelement_destructor(QObject*)
44+ (qqmlengine.cpp:612) ==16693== by 0x6C0CADD:
45+ QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement()
46+ (qqmlprivate.h:105) ==16693== by 0x663636B:
47+ QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-
48+ gnu/libQt5Core.so.5.3.0) ==16693== by 0x663F0EB: QObject::~QObject()
49+ (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0) ==16693== by
50+ 0x6BF64B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064) ==16693==
51+ by 0x6C0CAE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement()
52+ (qqmlprivate.h:106) ==16693== by 0x663636B:
53+ QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-
54+ gnu/libQt5Core.so.5.3.0) ==16693== by 0x663F0EB: QObject::~QObject()
55+ (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0) ==16693== by
56+ 0x6BF64B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064) ==16693==
57+ by 0x6C0CAE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement()
58+ (qqmlprivate.h:106) (LP: #1332598)
59+
60+ [ Michael Zanetti ]
61+ * drop launcher item spacing (LP: #1332022)
62+ * change wording in launcher quicklist (LP: #1332035)
63+
64+ [ Alejandro J. Cura ]
65+ * Initial code for a payment button widget, to handle purchasing apps
66+ from the click scope.
67+
68+ [ Rodney Dawes ]
69+ * Initial code for a payment button widget, to handle purchasing apps
70+ from the click scope.
71+
72+ [ Renato Araujo Oliveira Filho ]
73+ * Create IndicatorsLight.qml component used to control indicator led.
74+ A blue led will pulse if the message indicator is blue and screen is
75+ off.
76+
77+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 03 Jul 2014 14:47:46 +0000
78+
179unity8 (7.90+14.10.20140701.2-0ubuntu2) utopic; urgency=medium
280
381 * debian/control:
debian/control+4
@@ -13,7 +13,9 @@ Build-Depends: cmake,
1313 libgles2-mesa-dev[armhf],
1414 libglib2.0-dev,
1515 libgsettings-qt-dev,
16+ libhardware-dev,
1617 libhud-client2-dev,
18+ libpay1-dev,
1719 libpulse-dev,
1820 libqmenumodel-dev (>= 0.2.7),
1921 libqt5xmlpatterns5-dev,
@@ -158,7 +160,9 @@ Architecture: any
158160Multi-Arch: same
159161Pre-Depends: ${misc:Pre-Depends},
160162Depends: gsettings-ubuntu-schemas,
163+ libhardware2,
161164 libunity-core-6.0-9,
165+ pay-service,
162166 ${misc:Depends},
163167 ${shlibs:Depends},
164168Provides: unity-launcher-impl,
debian/unity8-private.install+1
@@ -2,6 +2,7 @@ usr/lib/*/unity8/qml/AccountsService
22usr/lib/*/unity8/qml/Dash
33usr/lib/*/unity8/qml/HudClient
44usr/lib/*/unity8/qml/LightDM
5+usr/lib/*/unity8/qml/Lights
56usr/lib/*/unity8/qml/Powerd
67usr/lib/*/unity8/qml/SessionBroadcast
78usr/lib/*/unity8/qml/Ubuntu
plugins/AccountsService/AccountsService.qmltypesnew file+22
@@ -0,0 +1,22 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable AccountsService 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "AccountsService"
12+ prototype: "QObject"
13+ exports: ["AccountsService/AccountsService 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Property { name: "user"; type: "string" }
18+ Property { name: "demoEdges"; type: "bool" }
19+ Property { name: "backgroundFile"; type: "string"; isReadonly: true }
20+ Property { name: "statsWelcomeScreen"; type: "bool"; isReadonly: true }
21+ }
22+}
plugins/CMakeLists.txt+1
@@ -14,6 +14,7 @@ endmacro()
1414add_subdirectory(AccountsService)
1515add_subdirectory(HudClient)
1616add_subdirectory(LightDM)
17+add_subdirectory(Lights)
1718add_subdirectory(Dash)
1819add_subdirectory(Powerd)
1920add_subdirectory(SessionBroadcast)
plugins/Dash/Dash.qmltypesnew file+95
@@ -0,0 +1,95 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Dash 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "AbstractDashView"
12+ defaultProperty: "data"
13+ prototype: "QQuickItem"
14+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
15+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
16+ Property { name: "columnSpacing"; type: "double" }
17+ Property { name: "rowSpacing"; type: "double" }
18+ Property { name: "displayMarginBeginning"; type: "double" }
19+ Property { name: "displayMarginEnd"; type: "double" }
20+ }
21+ Component {
22+ name: "HorizontalJournal"
23+ defaultProperty: "data"
24+ prototype: "AbstractDashView"
25+ exports: ["Dash/HorizontalJournal 0.1"]
26+ exportMetaObjectRevisions: [0]
27+ Property { name: "rowHeight"; type: "double" }
28+ }
29+ Component {
30+ name: "ListViewWithPageHeader"
31+ defaultProperty: "flickableData"
32+ prototype: "QQuickFlickable"
33+ exports: ["Dash/ListViewWithPageHeader 0.1"]
34+ exportMetaObjectRevisions: [0]
35+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
36+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
37+ Property { name: "pageHeader"; type: "QQuickItem"; isPointer: true }
38+ Property { name: "sectionDelegate"; type: "QQmlComponent"; isPointer: true }
39+ Property { name: "sectionProperty"; type: "string" }
40+ Property { name: "forceNoClip"; type: "bool" }
41+ Property { name: "stickyHeaderHeight"; type: "int"; isReadonly: true }
42+ Signal { name: "headerChanged" }
43+ Method { name: "positionAtBeginning" }
44+ Method { name: "showHeader" }
45+ Method {
46+ name: "item"
47+ type: "QQuickItem*"
48+ Parameter { name: "modelIndex"; type: "int" }
49+ }
50+ Method {
51+ name: "maximizeVisibleArea"
52+ type: "bool"
53+ Parameter { name: "modelIndex"; type: "int" }
54+ }
55+ Method {
56+ name: "maximizeVisibleArea"
57+ type: "bool"
58+ Parameter { name: "modelIndex"; type: "int" }
59+ Parameter { name: "itemHeight"; type: "int" }
60+ }
61+ }
62+ Component {
63+ name: "OrganicGrid"
64+ defaultProperty: "data"
65+ prototype: "AbstractDashView"
66+ exports: ["Dash/OrganicGrid 0.1"]
67+ exportMetaObjectRevisions: [0]
68+ Property { name: "smallDelegateSize"; type: "QSizeF" }
69+ Property { name: "bigDelegateSize"; type: "QSizeF" }
70+ }
71+ Component {
72+ name: "VerticalJournal"
73+ defaultProperty: "data"
74+ prototype: "AbstractDashView"
75+ exports: ["Dash/VerticalJournal 0.1"]
76+ exportMetaObjectRevisions: [0]
77+ Property { name: "columnWidth"; type: "double" }
78+ }
79+ Component {
80+ prototype: "QObject"
81+ name: "CardCreatorCache"
82+ exports: ["CardCreatorCache -1.-1"]
83+ exportMetaObjectRevisions: [-1]
84+ isComposite: true
85+ isCreatable: false
86+ isSingleton: true
87+ Property { name: "cache"; type: "QVariant" }
88+ Method {
89+ name: "getCardComponent"
90+ type: "QVariant"
91+ Parameter { name: "template"; type: "QVariant" }
92+ Parameter { name: "components"; type: "QVariant" }
93+ }
94+ }
95+}
plugins/HudClient/HudClient.qmltypesnew file+91
@@ -0,0 +1,91 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable HudClient 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "DeeListModel"
12+ prototype: "QAbstractListModel"
13+ Property { name: "name"; type: "string" }
14+ Property { name: "synchronized"; type: "bool"; isReadonly: true }
15+ Property { name: "count"; type: "int"; isReadonly: true }
16+ Signal {
17+ name: "nameChanged"
18+ Parameter { type: "string" }
19+ }
20+ Signal {
21+ name: "synchronizedChanged"
22+ Parameter { type: "bool" }
23+ }
24+ Signal {
25+ name: "roleNamesChanged"
26+ Parameter { type: "QHash<int,QByteArray>" }
27+ }
28+ Method {
29+ name: "get"
30+ type: "QVariantMap"
31+ Parameter { name: "row"; type: "int" }
32+ }
33+ Method { name: "count"; type: "int" }
34+ }
35+ Component {
36+ name: "HudClient"
37+ prototype: "QObject"
38+ exports: ["HudClient/HudClient 0.1"]
39+ exportMetaObjectRevisions: [0]
40+ Property { name: "results"; type: "DeeListModel"; isReadonly: true; isPointer: true }
41+ Property { name: "toolBarModel"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
42+ Signal { name: "voiceQueryLoading" }
43+ Signal { name: "voiceQueryListening" }
44+ Signal { name: "voiceQueryHeardSomething" }
45+ Signal { name: "voiceQueryFailed" }
46+ Signal {
47+ name: "voiceQueryFinished"
48+ Parameter { name: "query"; type: "string" }
49+ }
50+ Signal { name: "commandExecuted" }
51+ Signal {
52+ name: "showParametrizedAction"
53+ Parameter { name: "action"; type: "string" }
54+ Parameter { name: "items"; type: "QVariant" }
55+ }
56+ Method {
57+ name: "executeCommand"
58+ Parameter { name: "index"; type: "int" }
59+ }
60+ Method {
61+ name: "setQuery"
62+ Parameter { name: "new_query"; type: "string" }
63+ }
64+ Method { name: "startVoiceQuery" }
65+ Method {
66+ name: "executeParametrizedAction"
67+ Parameter { name: "values"; type: "QVariant" }
68+ }
69+ Method {
70+ name: "updateParametrizedAction"
71+ Parameter { name: "values"; type: "QVariant" }
72+ }
73+ Method { name: "cancelParametrizedAction" }
74+ Method {
75+ name: "executeToolBarAction"
76+ Parameter { name: "action"; type: "HudClientQueryToolbarItems" }
77+ }
78+ }
79+ Component {
80+ name: "VolumePeakDetector"
81+ prototype: "QObject"
82+ exports: ["HudClient/VolumePeakDetector 0.1"]
83+ exportMetaObjectRevisions: [0]
84+ Property { name: "enabled"; type: "bool" }
85+ Property { name: "desiredInterval"; type: "int" }
86+ Signal {
87+ name: "newPeak"
88+ Parameter { name: "volume"; type: "float" }
89+ }
90+ }
91+}
plugins/LightDM/LightDM.qmltypesnew file+241
@@ -0,0 +1,241 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable LightDM 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "Greeter"
12+ prototype: "QObject"
13+ exports: ["LightDM/Greeter 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Property { name: "authenticated"; type: "bool"; isReadonly: true }
18+ Property { name: "authenticationUser"; type: "string"; isReadonly: true }
19+ Property { name: "promptless"; type: "bool"; isReadonly: true }
20+ Signal {
21+ name: "showMessage"
22+ Parameter { name: "text"; type: "string" }
23+ Parameter { name: "isError"; type: "bool" }
24+ }
25+ Signal {
26+ name: "showPrompt"
27+ Parameter { name: "text"; type: "string" }
28+ Parameter { name: "isSecret"; type: "bool" }
29+ }
30+ Signal { name: "authenticationComplete" }
31+ Signal {
32+ name: "authenticationUserChanged"
33+ Parameter { name: "user"; type: "string" }
34+ }
35+ Signal {
36+ name: "requestAuthenticationUser"
37+ Parameter { name: "user"; type: "string" }
38+ }
39+ Method {
40+ name: "authenticate"
41+ Parameter { name: "username"; type: "string" }
42+ }
43+ Method { name: "authenticate" }
44+ Method {
45+ name: "respond"
46+ Parameter { name: "response"; type: "string" }
47+ }
48+ Method {
49+ name: "startSessionSync"
50+ type: "bool"
51+ Parameter { name: "session"; type: "string" }
52+ }
53+ Method { name: "startSessionSync"; type: "bool" }
54+ }
55+ Component {
56+ name: "QAbstractProxyModel"
57+ prototype: "QAbstractItemModel"
58+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
59+ }
60+ Component {
61+ name: "QLightDM::UsersModel"
62+ prototype: "QAbstractListModel"
63+ exports: ["LightDM/UserRoles 0.1"]
64+ isCreatable: false
65+ exportMetaObjectRevisions: [0]
66+ Enum {
67+ name: "UserModelRoles"
68+ values: {
69+ "NameRole": 256,
70+ "RealNameRole": 257,
71+ "LoggedInRole": 258,
72+ "BackgroundRole": 259,
73+ "SessionRole": 260,
74+ "HasMessagesRole": 261,
75+ "ImagePathRole": 262,
76+ "BackgroundPathRole": 263
77+ }
78+ }
79+ }
80+ Component {
81+ name: "QSortFilterProxyModel"
82+ prototype: "QAbstractProxyModel"
83+ Property { name: "filterRegExp"; type: "QRegExp" }
84+ Property { name: "filterKeyColumn"; type: "int" }
85+ Property { name: "dynamicSortFilter"; type: "bool" }
86+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
87+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
88+ Property { name: "isSortLocaleAware"; type: "bool" }
89+ Property { name: "sortRole"; type: "int" }
90+ Property { name: "filterRole"; type: "int" }
91+ Method {
92+ name: "setFilterRegExp"
93+ Parameter { name: "pattern"; type: "string" }
94+ }
95+ Method {
96+ name: "setFilterWildcard"
97+ Parameter { name: "pattern"; type: "string" }
98+ }
99+ Method {
100+ name: "setFilterFixedString"
101+ Parameter { name: "pattern"; type: "string" }
102+ }
103+ Method { name: "clear" }
104+ Method { name: "invalidate" }
105+ }
106+ Component {
107+ name: "QSortFilterProxyModelQML"
108+ prototype: "QSortFilterProxyModel"
109+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
110+ Property { name: "totalCount"; type: "int"; isReadonly: true }
111+ Property { name: "count"; type: "int"; isReadonly: true }
112+ Property { name: "invertMatch"; type: "bool" }
113+ Signal {
114+ name: "invertMatchChanged"
115+ Parameter { type: "bool" }
116+ }
117+ Method {
118+ name: "get"
119+ type: "QVariantMap"
120+ Parameter { name: "row"; type: "int" }
121+ }
122+ Method {
123+ name: "data"
124+ type: "QVariant"
125+ Parameter { name: "row"; type: "int" }
126+ Parameter { name: "role"; type: "int" }
127+ }
128+ Method { name: "count"; type: "int" }
129+ Method {
130+ name: "findFirst"
131+ type: "int"
132+ Parameter { name: "role"; type: "int" }
133+ Parameter { name: "value"; type: "QVariant" }
134+ }
135+ Method {
136+ name: "mapRowToSource"
137+ type: "int"
138+ Parameter { name: "row"; type: "int" }
139+ }
140+ Method {
141+ name: "mapFromSource"
142+ type: "int"
143+ Parameter { name: "row"; type: "int" }
144+ }
145+ Method {
146+ name: "mapToSource"
147+ type: "int"
148+ Parameter { name: "row"; type: "int" }
149+ }
150+ }
151+ Component {
152+ name: "UserMetricsOutput::ColorTheme"
153+ prototype: "QObject"
154+ Property { name: "start"; type: "QColor"; isReadonly: true }
155+ Property { name: "main"; type: "QColor"; isReadonly: true }
156+ Property { name: "end"; type: "QColor"; isReadonly: true }
157+ Signal {
158+ name: "startChanged"
159+ Parameter { name: "color"; type: "QColor" }
160+ }
161+ Signal {
162+ name: "mainChanged"
163+ Parameter { name: "color"; type: "QColor" }
164+ }
165+ Signal {
166+ name: "endChanged"
167+ Parameter { name: "color"; type: "QColor" }
168+ }
169+ }
170+ Component {
171+ name: "UserMetricsOutput::UserMetrics"
172+ prototype: "QObject"
173+ exports: ["LightDM/Infographic 0.1"]
174+ isCreatable: false
175+ isSingleton: true
176+ exportMetaObjectRevisions: [0]
177+ Property { name: "label"; type: "string"; isReadonly: true }
178+ Property { name: "username"; type: "string" }
179+ Property {
180+ name: "firstColor"
181+ type: "UserMetricsOutput::ColorTheme"
182+ isReadonly: true
183+ isPointer: true
184+ }
185+ Property {
186+ name: "secondColor"
187+ type: "UserMetricsOutput::ColorTheme"
188+ isReadonly: true
189+ isPointer: true
190+ }
191+ Property { name: "firstMonth"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
192+ Property { name: "secondMonth"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
193+ Property { name: "currentDay"; type: "int"; isReadonly: true }
194+ Signal {
195+ name: "labelChanged"
196+ Parameter { name: "label"; type: "string" }
197+ }
198+ Signal {
199+ name: "usernameChanged"
200+ Parameter { name: "username"; type: "string" }
201+ }
202+ Signal {
203+ name: "firstColorChanged"
204+ Parameter { name: "color"; type: "ColorTheme"; isPointer: true }
205+ }
206+ Signal {
207+ name: "firstMonthChanged"
208+ Parameter { name: "firstMonth"; type: "QAbstractItemModel"; isPointer: true }
209+ }
210+ Signal {
211+ name: "currentDayChanged"
212+ Parameter { name: "currentDay"; type: "int" }
213+ }
214+ Signal {
215+ name: "secondColorChanged"
216+ Parameter { name: "color"; type: "ColorTheme"; isPointer: true }
217+ }
218+ Signal {
219+ name: "secondMonthChanged"
220+ Parameter { name: "secondMonth"; type: "QAbstractItemModel"; isPointer: true }
221+ }
222+ Signal { name: "nextDataSource" }
223+ Signal { name: "readyForDataChange" }
224+ Signal { name: "dataAboutToAppear" }
225+ Signal { name: "dataAppeared" }
226+ Signal { name: "dataAboutToChange" }
227+ Signal { name: "dataChanged" }
228+ Signal { name: "dataAboutToDisappear" }
229+ Signal { name: "dataDisappeared" }
230+ Method { name: "nextDataSourceSlot" }
231+ Method { name: "readyForDataChangeSlot" }
232+ }
233+ Component {
234+ name: "UsersModel"
235+ prototype: "QSortFilterProxyModelQML"
236+ exports: ["LightDM/Users 0.1"]
237+ isCreatable: false
238+ isSingleton: true
239+ exportMetaObjectRevisions: [0]
240+ }
241+}
plugins/Lights/CMakeLists.txtnew file+18
@@ -0,0 +1,18 @@
1+include(FindPkgConfig)
2+
3+pkg_check_modules(ANDROID_HEADERS REQUIRED android-headers)
4+pkg_check_modules(ANDROID_HARDWARE REQUIRED libhardware)
5+
6+include_directories(
7+ ${ANDROID_HEADERS_INCLUDE_DIRS}
8+)
9+
10+add_library(Lights-qml MODULE
11+ plugin.cpp
12+ Lights.cpp
13+ )
14+
15+qt5_use_modules(Lights-qml Qml Gui)
16+target_link_libraries(Lights-qml ${ANDROID_HARDWARE_LIBRARIES})
17+
18+add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
plugins/Lights/Lights.cppnew file+182
@@ -0,0 +1,182 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
17+ */
18+
19+#include "Lights.h"
20+#include <QtCore/QDebug>
21+
22+extern "C" {
23+#include <hardware/hardware.h>
24+#include <hardware/lights.h>
25+#include <string.h>
26+}
27+
28+Lights::Lights(QObject* parent)
29+ : QObject(parent),
30+ m_lightDevice(0),
31+ m_color("blue"),
32+ m_state(Lights::Off),
33+ m_onMs(1000),
34+ m_offMs(3000)
35+{
36+}
37+
38+Lights::~Lights()
39+{
40+ if (m_lightDevice) {
41+ hw_device_t* device = (hw_device_t*) m_lightDevice;
42+ device->close(device);
43+ }
44+}
45+
46+void Lights::setState(Lights::State newState)
47+{
48+ if (m_state != newState) {
49+ if (newState == Lights::On) {
50+ turnOn();
51+ } else {
52+ turnOff();
53+ }
54+ }
55+}
56+
57+Lights::State Lights::state() const
58+{
59+ return m_state;
60+}
61+
62+void Lights::setColor(const QColor &color)
63+{
64+ if (m_color != color) {
65+ m_color = color;
66+ Q_EMIT colorChanged(m_color);
67+ // FIXME: update the collor if the light is already on
68+ }
69+}
70+
71+QColor Lights::color() const
72+{
73+ return m_color;
74+}
75+
76+int Lights::onMillisec() const
77+{
78+ return m_onMs;
79+}
80+
81+void Lights::setOnMillisec(int onMs)
82+{
83+ if (m_onMs != onMs) {
84+ m_onMs = onMs;
85+ Q_EMIT onMillisecChanged(m_onMs);
86+ // FIXME: update the property if the light is already on
87+ }
88+}
89+
90+int Lights::offMillisec() const
91+{
92+ return m_offMs;
93+}
94+
95+void Lights::setOffMillisec(int offMs)
96+{
97+ if (m_offMs != offMs) {
98+ m_offMs = offMs;
99+ Q_EMIT offMillisecChanged(m_offMs);
100+ // FIXME: update the property if the light is already on
101+ }
102+}
103+
104+bool Lights::init()
105+{
106+ if (m_lightDevice) {
107+ return true;
108+ }
109+
110+ int err;
111+ hw_module_t* module;
112+
113+ err = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
114+ if (err == 0) {
115+ hw_device_t* device;
116+ err = module->methods->open(module, LIGHT_ID_NOTIFICATIONS, &device);
117+ if (err == 0) {
118+ m_lightDevice = (light_device_t*)device;
119+ return true;
120+ } else {
121+ qWarning() << "Failed to access notification lights";
122+ }
123+ } else {
124+ qWarning() << "Failed to initialize lights hardware.";
125+ }
126+ return false;
127+}
128+
129+void Lights::turnOn()
130+{
131+ if (!init()) {
132+ qWarning() << "No lights device";
133+ return;
134+ }
135+
136+ if (m_state == Lights::On) {
137+ return;
138+ }
139+
140+ // pulse
141+ light_state_t state;
142+ memset(&state, 0, sizeof(light_state_t));
143+ state.color = m_color.rgba();
144+ state.flashMode = LIGHT_FLASH_TIMED;
145+ state.flashOnMS = m_onMs;
146+ state.flashOffMS = m_offMs;
147+ state.brightnessMode = BRIGHTNESS_MODE_USER;
148+
149+ if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
150+ qWarning() << "Failed to turn the light off";
151+ } else {
152+ m_state = Lights::On;
153+ Q_EMIT stateChanged(m_state);
154+ }
155+}
156+
157+void Lights::turnOff()
158+{
159+ if (!init()) {
160+ qWarning() << "No lights device";
161+ return;
162+ }
163+
164+ if (m_state == Lights::Off) {
165+ return;
166+ }
167+
168+ light_state_t state;
169+ memset(&state, 0, sizeof(light_state_t));
170+ state.color = 0x00000000;
171+ state.flashMode = LIGHT_FLASH_NONE;
172+ state.flashOnMS = 0;
173+ state.flashOffMS = 0;
174+ state.brightnessMode = 0;
175+
176+ if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
177+ qWarning() << "Failed to turn the light off";
178+ } else {
179+ m_state = Lights::Off;
180+ Q_EMIT stateChanged(m_state);
181+ }
182+}
plugins/Lights/Lights.hnew file+75
@@ -0,0 +1,75 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
17+ */
18+
19+#ifndef UNITY_LIGHTS_H
20+#define UNITY_LIGHTS_H
21+
22+#include <QtCore/QObject>
23+#include <QtGui/QColor>
24+
25+struct light_device_t;
26+
27+class Lights: public QObject
28+{
29+ Q_OBJECT
30+ Q_ENUMS(State)
31+ Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
32+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
33+ Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
34+ Q_PROPERTY(int offMillisec READ offMillisec WRITE setOffMillisec NOTIFY offMillisecChanged)
35+
36+public:
37+ enum State {
38+ Off,
39+ On,
40+ };
41+
42+ explicit Lights(QObject *parent = 0);
43+ ~Lights();
44+
45+ void setState(State newState);
46+ State state() const;
47+
48+ void setColor(const QColor &color);
49+ QColor color() const;
50+
51+ int onMillisec() const;
52+ void setOnMillisec(int onMs);
53+
54+ int offMillisec() const;
55+ void setOffMillisec(int offMs);
56+
57+Q_SIGNALS:
58+ void stateChanged(State newState);
59+ void colorChanged(const QColor &color);
60+ void onMillisecChanged(int onMs);
61+ void offMillisecChanged(int offMs);
62+
63+private:
64+ light_device_t* m_lightDevice;
65+ QColor m_color;
66+ State m_state;
67+ int m_onMs;
68+ int m_offMs;
69+
70+ bool init();
71+ void turnOff();
72+ void turnOn();
73+};
74+
75+#endif
plugins/Lights/plugin.cppnew file+35
@@ -0,0 +1,35 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
17+ */
18+
19+#include "plugin.h"
20+#include "Lights.h"
21+
22+#include <QtQml/qqml.h>
23+
24+static QObject *lights_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
25+{
26+ Q_UNUSED(engine)
27+ Q_UNUSED(scriptEngine)
28+ return new Lights();
29+}
30+
31+void LightsPlugin::registerTypes(const char *uri)
32+{
33+ Q_ASSERT(uri == QLatin1String("Lights"));
34+ qmlRegisterSingletonType<Lights>(uri, 0, 1, "Lights", lights_provider);
35+}
plugins/Lights/plugin.hnew file+34
@@ -0,0 +1,34 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
17+ */
18+
19+#ifndef LIGHTS_PLUGIN_H
20+#define LIGHTS_PLUGIN_H
21+
22+#include <QtQml/QQmlEngine>
23+#include <QtQml/QQmlExtensionPlugin>
24+
25+class LightsPlugin : public QQmlExtensionPlugin
26+{
27+ Q_OBJECT
28+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29+
30+public:
31+ void registerTypes(const char *uri);
32+};
33+
34+#endif
plugins/Lights/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module Lights
2+plugin Lights-qml
3+typeinfo Lights.qmltypes
plugins/Powerd/Powerd.qmltypesnew file+46
@@ -0,0 +1,46 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Powerd 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "Powerd"
12+ prototype: "QObject"
13+ exports: ["Powerd/Powerd 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Enum {
18+ name: "DisplayFlag"
19+ values: {
20+ "UseProximity": 1,
21+ "DisableAutoBrightness": 2,
22+ "Bright": 4
23+ }
24+ }
25+ Enum {
26+ name: "DisplayFlags"
27+ values: {
28+ "UseProximity": 1,
29+ "DisableAutoBrightness": 2,
30+ "Bright": 4
31+ }
32+ }
33+ Enum {
34+ name: "Status"
35+ values: {
36+ "Off": 0,
37+ "On": 1
38+ }
39+ }
40+ Signal {
41+ name: "displayPowerStateChange"
42+ Parameter { name: "status"; type: "int" }
43+ Parameter { name: "flags"; type: "uint" }
44+ }
45+ }
46+}
plugins/SessionBroadcast/SessionBroadcast.qmltypesnew file+19
@@ -0,0 +1,19 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable SessionBroadcast 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "SessionBroadcast"
12+ prototype: "QObject"
13+ exports: ["SessionBroadcast/SessionBroadcast 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Signal { name: "showHome" }
18+ }
19+}
plugins/Ubuntu/CMakeLists.txt+1
@@ -1,2 +1,3 @@
11add_subdirectory(Gestures)
22add_subdirectory(DownloadDaemonListener)
3+add_subdirectory(Payments)
plugins/Ubuntu/DownloadDaemonListener/DownloadDaemonListener.qmltypesnew file+60
@@ -0,0 +1,60 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.DownloadDaemonListener 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "DownloadTracker"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.DownloadDaemonListener/DownloadTracker 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "service"; type: "string" }
16+ Property { name: "dbusPath"; type: "string" }
17+ Property { name: "serviceReady"; type: "bool"; isReadonly: true }
18+ Signal {
19+ name: "serviceChanged"
20+ Parameter { name: "service"; type: "string" }
21+ }
22+ Signal {
23+ name: "dbusPathChanged"
24+ Parameter { name: "dbusPath"; type: "string" }
25+ }
26+ Signal {
27+ name: "serviceReadyChanged"
28+ Parameter { name: "serviceReady"; type: "bool" }
29+ }
30+ Signal {
31+ name: "canceled"
32+ Parameter { name: "success"; type: "bool" }
33+ }
34+ Signal {
35+ name: "error"
36+ Parameter { name: "error"; type: "string" }
37+ }
38+ Signal {
39+ name: "finished"
40+ Parameter { name: "path"; type: "string" }
41+ }
42+ Signal {
43+ name: "paused"
44+ Parameter { name: "success"; type: "bool" }
45+ }
46+ Signal {
47+ name: "progress"
48+ Parameter { name: "received"; type: "qulonglong" }
49+ Parameter { name: "total"; type: "qulonglong" }
50+ }
51+ Signal {
52+ name: "resumed"
53+ Parameter { name: "success"; type: "bool" }
54+ }
55+ Signal {
56+ name: "started"
57+ Parameter { name: "success"; type: "bool" }
58+ }
59+ }
60+}
plugins/Ubuntu/Gestures/Gestures.qmltypesnew file+153
@@ -0,0 +1,153 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.Gestures 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "AxisVelocityCalculator"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.Gestures/AxisVelocityCalculator 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "trackedPosition"; type: "double" }
16+ Signal {
17+ name: "trackedPositionChanged"
18+ Parameter { name: "value"; type: "double" }
19+ }
20+ Method { name: "calculate"; type: "double" }
21+ Method { name: "reset" }
22+ }
23+ Component {
24+ name: "Direction"
25+ prototype: "QObject"
26+ exports: ["Ubuntu.Gestures/Direction 0.1"]
27+ isCreatable: false
28+ isSingleton: true
29+ exportMetaObjectRevisions: [0]
30+ Enum {
31+ name: "Type"
32+ values: {
33+ "Rightwards": 0,
34+ "Leftwards": 1,
35+ "Downwards": 2,
36+ "Upwards": 3
37+ }
38+ }
39+ Method {
40+ name: "isHorizontal"
41+ type: "bool"
42+ Parameter { name: "type"; type: "Direction::Type" }
43+ }
44+ Method {
45+ name: "isVertical"
46+ type: "bool"
47+ Parameter { name: "type"; type: "Direction::Type" }
48+ }
49+ Method {
50+ name: "isPositive"
51+ type: "bool"
52+ Parameter { name: "type"; type: "Direction::Type" }
53+ }
54+ }
55+ Component {
56+ name: "DirectionalDragArea"
57+ defaultProperty: "data"
58+ prototype: "QQuickItem"
59+ exports: ["Ubuntu.Gestures/DirectionalDragArea 0.1"]
60+ exportMetaObjectRevisions: [0]
61+ Enum {
62+ name: "Status"
63+ values: {
64+ "WaitingForTouch": 0,
65+ "Undecided": 1,
66+ "Recognized": 2
67+ }
68+ }
69+ Property { name: "direction"; type: "Direction::Type" }
70+ Property { name: "distance"; type: "double"; isReadonly: true }
71+ Property { name: "sceneDistance"; type: "double"; isReadonly: true }
72+ Property { name: "touchX"; type: "double"; isReadonly: true }
73+ Property { name: "touchY"; type: "double"; isReadonly: true }
74+ Property { name: "touchSceneX"; type: "double"; isReadonly: true }
75+ Property { name: "touchSceneY"; type: "double"; isReadonly: true }
76+ Property { name: "status"; type: "Status"; isReadonly: true }
77+ Property { name: "dragging"; type: "bool"; isReadonly: true }
78+ Property { name: "maxDeviation"; type: "double" }
79+ Property { name: "wideningAngle"; type: "double" }
80+ Property { name: "distanceThreshold"; type: "double" }
81+ Property { name: "minSpeed"; type: "double" }
82+ Property { name: "maxSilenceTime"; type: "int" }
83+ Property { name: "compositionTime"; type: "int" }
84+ Signal {
85+ name: "directionChanged"
86+ Parameter { name: "direction"; type: "Direction::Type" }
87+ }
88+ Signal {
89+ name: "statusChanged"
90+ Parameter { name: "value"; type: "Status" }
91+ }
92+ Signal {
93+ name: "draggingChanged"
94+ Parameter { name: "value"; type: "bool" }
95+ }
96+ Signal {
97+ name: "distanceChanged"
98+ Parameter { name: "value"; type: "double" }
99+ }
100+ Signal {
101+ name: "sceneDistanceChanged"
102+ Parameter { name: "value"; type: "double" }
103+ }
104+ Signal {
105+ name: "maxDeviationChanged"
106+ Parameter { name: "value"; type: "double" }
107+ }
108+ Signal {
109+ name: "wideningAngleChanged"
110+ Parameter { name: "value"; type: "double" }
111+ }
112+ Signal {
113+ name: "distanceThresholdChanged"
114+ Parameter { name: "value"; type: "double" }
115+ }
116+ Signal {
117+ name: "minSpeedChanged"
118+ Parameter { name: "value"; type: "double" }
119+ }
120+ Signal {
121+ name: "maxSilenceTimeChanged"
122+ Parameter { name: "value"; type: "int" }
123+ }
124+ Signal {
125+ name: "compositionTimeChanged"
126+ Parameter { name: "value"; type: "int" }
127+ }
128+ Signal {
129+ name: "touchXChanged"
130+ Parameter { name: "value"; type: "double" }
131+ }
132+ Signal {
133+ name: "touchYChanged"
134+ Parameter { name: "value"; type: "double" }
135+ }
136+ Signal {
137+ name: "touchSceneXChanged"
138+ Parameter { name: "value"; type: "double" }
139+ }
140+ Signal {
141+ name: "touchSceneYChanged"
142+ Parameter { name: "value"; type: "double" }
143+ }
144+ }
145+ Component {
146+ name: "PressedOutsideNotifier"
147+ defaultProperty: "data"
148+ prototype: "QQuickItem"
149+ exports: ["Ubuntu.Gestures/PressedOutsideNotifier 0.1"]
150+ exportMetaObjectRevisions: [0]
151+ Signal { name: "pressedOutside" }
152+ }
153+}
plugins/Ubuntu/Payments/CMakeLists.txtnew file+20
@@ -0,0 +1,20 @@
1+include_directories(
2+ ${CMAKE_CURRENT_SOURCE_DIR}
3+ ${CMAKE_CURRENT_BINARY_DIR}
4+)
5+
6+set(PAYMENTS_SOURCES
7+ plugin.cpp
8+ Payments.cpp
9+)
10+
11+add_library(Payments MODULE ${PAYMENTS_SOURCES})
12+
13+qt5_use_modules(Payments Qml Quick DBus Core)
14+
15+add_unity8_plugin(Ubuntu.Payments 0.1 Ubuntu/Payments TARGETS Payments)
16+
17+pkg_check_modules(LIBPAY REQUIRED pay-1)
18+add_definitions(${LIBPAY_CFLAGS} ${LIBPAY_CFLAGS_OTHER})
19+
20+target_link_libraries(Payments ${LIBPAY_LDFLAGS})
plugins/Ubuntu/Payments/Payments.cppnew file+118
@@ -0,0 +1,118 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "Payments.h"
18+
19+#include <QLocale>
20+
21+#include <libpay/pay-package.h>
22+
23+
24+// The observer callback for the package we are watching.
25+static void observer(PayPackage* /* package */, const char* itemid, PayPackageItemStatus status, void* user_data) {
26+ // This function is called in libpay's thread, so be careful what you call
27+ // Emitting signals should be fine as long as they use Queued or Auto
28+ // connections (the default)
29+ // http://qt-project.org/doc/qt-5/threads-qobject.html#signals-and-slots-across-threads
30+
31+ Payments *self = static_cast<Payments*>(user_data);
32+
33+ // If the item ID is different, ignore it.
34+ if (itemid != self->storeItemId()) {
35+ return;
36+ }
37+
38+ // FIXME: No error reporting from libpay, but we need to show some
39+ // types of errors to the user. https://launchpad.net/bugs/1333403
40+ switch (status) {
41+ case PAY_PACKAGE_ITEM_STATUS_PURCHASED:
42+ Q_EMIT self->purchaseCompleted();
43+ break;
44+ default:
45+ break;
46+ }
47+}
48+
49+Payments::Payments(QObject *parent)
50+ : QObject(parent)
51+{
52+ m_package = pay_package_new("click-scope");
53+ pay_package_item_observer_install(m_package, observer, this);
54+}
55+
56+Payments::~Payments()
57+{
58+ pay_package_item_observer_uninstall(m_package, observer, this);
59+ pay_package_delete(m_package);
60+}
61+
62+QString Payments::currency() const
63+{
64+ return m_currency;
65+}
66+
67+double Payments::price() const
68+{
69+ return m_price;
70+}
71+
72+QString Payments::storeItemId() const
73+{
74+ return m_store_item_id;
75+}
76+
77+QString Payments::formattedPrice() const
78+{
79+ QLocale locale;
80+ return locale.toCurrencyString(m_price, m_currency);
81+}
82+
83+void Payments::setCurrency(const QString &currency)
84+{
85+ if(m_currency != currency) {
86+ m_currency = currency;
87+ Q_EMIT currencyChanged(currency);
88+ Q_EMIT formattedPriceChanged(formattedPrice());
89+ }
90+}
91+
92+void Payments::setPrice(const double price)
93+{
94+ if(m_price != price) {
95+ m_price = price;
96+ Q_EMIT priceChanged(price);
97+ Q_EMIT formattedPriceChanged(formattedPrice());
98+ }
99+}
100+
101+void Payments::setStoreItemId(const QString &store_item_id)
102+{
103+ if (m_store_item_id != store_item_id) {
104+ m_store_item_id = store_item_id;
105+ Q_EMIT storeItemIdChanged(m_store_item_id);
106+ }
107+
108+ if (m_store_item_id.isEmpty()) {
109+ return;
110+ }
111+
112+ pay_package_item_start_verification(m_package, m_store_item_id.toLocal8Bit().data());
113+}
114+
115+void Payments::start()
116+{
117+ pay_package_item_start_purchase(m_package, m_store_item_id.toLocal8Bit().data());
118+}
plugins/Ubuntu/Payments/Payments.hnew file+65
@@ -0,0 +1,65 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef PAYMENTS_H
18+#define PAYMENTS_H
19+
20+#include <QObject>
21+
22+#include <libpay/pay-package.h>
23+
24+
25+class Payments : public QObject
26+{
27+ Q_OBJECT
28+ Q_DISABLE_COPY(Payments)
29+ Q_PROPERTY(QString currency READ currency WRITE setCurrency NOTIFY currencyChanged)
30+ Q_PROPERTY(double price READ price WRITE setPrice NOTIFY priceChanged)
31+ Q_PROPERTY(QString storeItemId READ storeItemId WRITE setStoreItemId NOTIFY storeItemIdChanged)
32+ Q_PROPERTY(QString formattedPrice READ formattedPrice NOTIFY formattedPriceChanged)
33+
34+public:
35+ explicit Payments(QObject *parent = 0);
36+ virtual ~Payments();
37+
38+ QString currency() const;
39+ double price() const;
40+ QString storeItemId() const;
41+ QString formattedPrice() const;
42+
43+ void setCurrency(const QString& currency);
44+ void setPrice(const double price);
45+ void setStoreItemId(const QString& store_item_id);
46+ Q_INVOKABLE void start();
47+
48+Q_SIGNALS:
49+ void currencyChanged(const QString& currency);
50+ void priceChanged(const double price);
51+ void storeItemIdChanged(const QString &store_item_id);
52+ void formattedPriceChanged(const QString &formatted_price);
53+
54+ void purchaseError(const QString &error);
55+ void purchaseCompleted();
56+
57+private:
58+ QString m_currency;
59+ double m_price;
60+ QString m_store_item_id;
61+
62+ PayPackage *m_package;
63+};
64+
65+#endif // PAYMENTS_H
plugins/Ubuntu/Payments/Payments.qmltypesnew file+42
@@ -0,0 +1,42 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.Payments 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "Payments"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.Payments/Payments 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "currency"; type: "string" }
16+ Property { name: "price"; type: "double" }
17+ Property { name: "storeItemId"; type: "string" }
18+ Property { name: "formattedPrice"; type: "string"; isReadonly: true }
19+ Signal {
20+ name: "currencyChanged"
21+ Parameter { name: "currency"; type: "string" }
22+ }
23+ Signal {
24+ name: "priceChanged"
25+ Parameter { name: "price"; type: "double" }
26+ }
27+ Signal {
28+ name: "storeItemIdChanged"
29+ Parameter { name: "store_item_id"; type: "string" }
30+ }
31+ Signal {
32+ name: "formattedPriceChanged"
33+ Parameter { name: "formatted_price"; type: "string" }
34+ }
35+ Signal {
36+ name: "purchaseError"
37+ Parameter { name: "error"; type: "string" }
38+ }
39+ Signal { name: "purchaseCompleted" }
40+ Method { name: "start" }
41+ }
42+}
plugins/Ubuntu/Payments/plugin.cppnew file+28
@@ -0,0 +1,28 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "plugin.h"
18+#include "Payments.h"
19+
20+#include <QtQml>
21+
22+
23+void BackendPlugin::registerTypes(const char *uri)
24+{
25+ Q_ASSERT(uri == QLatin1String("Ubuntu.Payments"));
26+
27+ qmlRegisterType<Payments>(uri, 0, 1, "Payments");
28+}
plugins/Ubuntu/Payments/plugin.hnew file+31
@@ -0,0 +1,31 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef PAYMENTS_PLUGIN_H
18+#define PAYMENTS_PLUGIN_H
19+
20+#include <QQmlExtensionPlugin>
21+
22+class BackendPlugin : public QQmlExtensionPlugin
23+{
24+ Q_OBJECT
25+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26+
27+public:
28+ void registerTypes(const char *uri);
29+};
30+
31+#endif // PAYMENTS_PLUGIN_H
plugins/Ubuntu/Payments/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module Ubuntu.Payments
2+plugin Payments
3+typeinfo Payments.qmltypes
plugins/Unity/Indicators/CMakeLists.txt+1−4
@@ -51,7 +51,4 @@ target_link_libraries(IndicatorsQml
5151
5252qt5_use_modules(IndicatorsQml Core Qml Quick)
5353
54−add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators
55− SEARCH_PATH qml
56− TARGETS IndicatorsQml
57−)
54+add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsQml)
plugins/Unity/Indicators/qml/CachedUnityMenuModel.qml → plugins/Unity/Indicators/CachedUnityMenuModel.qmlrenamed

The content is the same.

plugins/Unity/Indicators/Indicators.qmltypesnew file+278
@@ -0,0 +1,278 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Indicators 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "ActionState"
12+ prototype: "QObject"
13+ exports: ["Unity.Indicators/ActionState 0.1"]
14+ isCreatable: false
15+ exportMetaObjectRevisions: [0]
16+ Enum {
17+ name: "ActionStates"
18+ values: {
19+ "Label": 0,
20+ "IconSource": 1,
21+ "AccessableName": 2,
22+ "Visible": 3
23+ }
24+ }
25+ }
26+ Component { name: "ActionStateParser"; prototype: "QObject" }
27+ Component {
28+ name: "FlatMenuProxyModelRole"
29+ prototype: "QObject"
30+ exports: ["Unity.Indicators/FlatMenuProxyModelRole 0.1"]
31+ isCreatable: false
32+ exportMetaObjectRevisions: [0]
33+ Enum {
34+ name: "Roles"
35+ values: {
36+ "Action": 1,
37+ "Label": 2,
38+ "Extra": 3,
39+ "Depth": 4,
40+ "hasSection": 5,
41+ "hasSubMenu": 6
42+ }
43+ }
44+ }
45+ Component {
46+ name: "IndicatorsManager"
47+ prototype: "QObject"
48+ exports: ["Unity.Indicators/IndicatorsManager 0.1"]
49+ exportMetaObjectRevisions: [0]
50+ Property { name: "loaded"; type: "bool"; isReadonly: true }
51+ Signal {
52+ name: "loadedChanged"
53+ Parameter { type: "bool" }
54+ }
55+ Signal {
56+ name: "indicatorLoaded"
57+ Parameter { name: "indicator_name"; type: "string" }
58+ }
59+ Signal {
60+ name: "indicatorAboutToBeUnloaded"
61+ Parameter { name: "indicator_name"; type: "string" }
62+ }
63+ Method {
64+ name: "load"
65+ Parameter { name: "profile"; type: "string" }
66+ }
67+ Method { name: "unload" }
68+ }
69+ Component {
70+ name: "IndicatorsModel"
71+ prototype: "QAbstractListModel"
72+ exports: ["Unity.Indicators/IndicatorsModel 0.1"]
73+ exportMetaObjectRevisions: [0]
74+ Property { name: "count"; type: "int"; isReadonly: true }
75+ Signal {
76+ name: "indicatorDataChanged"
77+ Parameter { name: "data"; type: "QVariant" }
78+ }
79+ Method {
80+ name: "load"
81+ Parameter { name: "profile"; type: "string" }
82+ }
83+ Method { name: "unload" }
84+ Method {
85+ name: "data"
86+ type: "QVariant"
87+ Parameter { name: "row"; type: "int" }
88+ Parameter { name: "role"; type: "int" }
89+ }
90+ }
91+ Component {
92+ name: "IndicatorsModelRole"
93+ prototype: "QObject"
94+ exports: ["Unity.Indicators/IndicatorsModelRole 0.1"]
95+ isCreatable: false
96+ exportMetaObjectRevisions: [0]
97+ Enum {
98+ name: "Roles"
99+ values: {
100+ "Identifier": 0,
101+ "Position": 1,
102+ "WidgetSource": 2,
103+ "PageSource": 3,
104+ "IndicatorProperties": 4,
105+ "IsVisible": 5
106+ }
107+ }
108+ }
109+ Component {
110+ name: "MenuContentActivator"
111+ prototype: "QObject"
112+ exports: ["Unity.Indicators/MenuContentActivator 0.1"]
113+ exportMetaObjectRevisions: [0]
114+ Property { name: "baseIndex"; type: "int" }
115+ Property { name: "running"; type: "bool" }
116+ Property { name: "count"; type: "int" }
117+ Property { name: "content"; type: "MenuContentState"; isList: true; isReadonly: true }
118+ Signal {
119+ name: "baseIndexChanged"
120+ Parameter { name: "baseIndex"; type: "int" }
121+ }
122+ Signal {
123+ name: "deltaChanged"
124+ Parameter { name: "delta"; type: "int" }
125+ }
126+ Signal {
127+ name: "runningChanged"
128+ Parameter { name: "running"; type: "bool" }
129+ }
130+ Signal {
131+ name: "countChanged"
132+ Parameter { name: "count"; type: "int" }
133+ }
134+ Method { name: "restart" }
135+ Method { name: "stop" }
136+ Method { name: "clear" }
137+ Method {
138+ name: "isMenuContentActive"
139+ type: "bool"
140+ Parameter { name: "index"; type: "int" }
141+ }
142+ }
143+ Component {
144+ name: "MenuContentState"
145+ prototype: "QObject"
146+ exports: ["Unity.Indicators/MenuContentState 0.1"]
147+ isCreatable: false
148+ exportMetaObjectRevisions: [0]
149+ Property { name: "active"; type: "bool"; isReadonly: true }
150+ }
151+ Component {
152+ name: "ModelPrinter"
153+ prototype: "QObject"
154+ exports: ["Unity.Indicators/ModelPrinter 0.1"]
155+ exportMetaObjectRevisions: [0]
156+ Property { name: "model"; type: "UnityMenuModel"; isPointer: true }
157+ Property { name: "text"; type: "string"; isReadonly: true }
158+ Method { name: "text"; type: "string" }
159+ }
160+ Component {
161+ name: "NetworkActionState"
162+ prototype: "QObject"
163+ exports: ["Unity.Indicators/NetworkActionState 0.1"]
164+ isCreatable: false
165+ exportMetaObjectRevisions: [0]
166+ Enum {
167+ name: "NetworkActionStates"
168+ values: {
169+ "Connection": 1,
170+ "SignalStrength": 2
171+ }
172+ }
173+ }
174+ Component {
175+ name: "NetworkConnection"
176+ prototype: "QObject"
177+ exports: ["Unity.Indicators/NetworkConnection 0.1"]
178+ isCreatable: false
179+ exportMetaObjectRevisions: [0]
180+ Enum {
181+ name: "NetworkConnectionStates"
182+ values: {
183+ "Initial": 0,
184+ "Activating": 1,
185+ "Activated": 2,
186+ "Deactivating": 3
187+ }
188+ }
189+ }
190+ Component {
191+ name: "QAbstractProxyModel"
192+ prototype: "QAbstractItemModel"
193+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
194+ }
195+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
196+ Component {
197+ name: "RootActionState"
198+ prototype: "ActionStateParser"
199+ exports: ["Unity.Indicators/RootActionState 0.1"]
200+ exportMetaObjectRevisions: [0]
201+ Property { name: "menu"; type: "UnityMenuModel"; isPointer: true }
202+ Property { name: "valid"; type: "bool"; isReadonly: true }
203+ Property { name: "title"; type: "string"; isReadonly: true }
204+ Property { name: "leftLabel"; type: "string"; isReadonly: true }
205+ Property { name: "rightLabel"; type: "string"; isReadonly: true }
206+ Property { name: "icons"; type: "QStringList"; isReadonly: true }
207+ Property { name: "accessibleName"; type: "string"; isReadonly: true }
208+ Property { name: "visible"; type: "bool"; isReadonly: true }
209+ Signal { name: "updated" }
210+ Signal { name: "indexChanged" }
211+ }
212+ Component {
213+ name: "UnityMenuModelCache"
214+ prototype: "QObject"
215+ exports: ["Unity.Indicators/UnityMenuModelCache 0.1"]
216+ isCreatable: false
217+ isSingleton: true
218+ exportMetaObjectRevisions: [0]
219+ Method {
220+ name: "model"
221+ type: "UnityMenuModel*"
222+ Parameter { name: "path"; type: "string" }
223+ }
224+ Method {
225+ name: "registerModel"
226+ Parameter { name: "path"; type: "string" }
227+ Parameter { name: "menuModel"; type: "UnityMenuModel"; isPointer: true }
228+ }
229+ }
230+ Component {
231+ name: "UnityMenuModelStack"
232+ prototype: "QObject"
233+ exports: ["Unity.Indicators/UnityMenuModelStack 0.1"]
234+ exportMetaObjectRevisions: [0]
235+ Property { name: "head"; type: "UnityMenuModel"; isPointer: true }
236+ Property { name: "tail"; type: "UnityMenuModel"; isReadonly: true; isPointer: true }
237+ Property { name: "count"; type: "int"; isReadonly: true }
238+ Signal {
239+ name: "headChanged"
240+ Parameter { name: "head"; type: "UnityMenuModel"; isPointer: true }
241+ }
242+ Signal {
243+ name: "tailChanged"
244+ Parameter { name: "tail"; type: "UnityMenuModel"; isPointer: true }
245+ }
246+ Signal {
247+ name: "countChanged"
248+ Parameter { name: "count"; type: "int" }
249+ }
250+ Method {
251+ name: "push"
252+ Parameter { name: "model"; type: "UnityMenuModel"; isPointer: true }
253+ Parameter { name: "menuIndex"; type: "int" }
254+ }
255+ Method { name: "pop"; type: "UnityMenuModel*" }
256+ }
257+ Component {
258+ name: "VisibleIndicatorsModel"
259+ prototype: "QIdentityProxyModel"
260+ exports: ["Unity.Indicators/VisibleIndicatorsModel 0.1"]
261+ exportMetaObjectRevisions: [0]
262+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
263+ Property { name: "visible"; type: "QVariantMap" }
264+ Signal { name: "totalCountChanged" }
265+ Method {
266+ name: "onBeginRowInserted"
267+ Parameter { type: "QModelIndex" }
268+ Parameter { name: "start"; type: "int" }
269+ Parameter { name: "end"; type: "int" }
270+ }
271+ Method {
272+ name: "onRowInserted"
273+ Parameter { type: "QModelIndex" }
274+ Parameter { name: "start"; type: "int" }
275+ Parameter { name: "end"; type: "int" }
276+ }
277+ }
278+}
plugins/Unity/Indicators/qml/qmldir → plugins/Unity/Indicators/qmldirrenamed−4
@@ -4,7 +4,3 @@ typeinfo Indicators.qmltypes
44
55CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
66IndicatorBase 0.1 IndicatorBase.qml
7−MenuItemFactory 0.1 MenuItemFactory.qml
8−MessageMenuItemFactory 0.1 MessageMenuItemFactory.qml
9−
10−internal RemoveBackground RemoveBackground.qml
plugins/Unity/Launcher/Launcher.qmltypesnew file+174
@@ -0,0 +1,174 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Launcher 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "LauncherItem"
12+ prototype: "unity::shell::launcher::LauncherItemInterface"
13+ exports: ["Unity.Launcher/LauncherItem 0.1"]
14+ isCreatable: false
15+ exportMetaObjectRevisions: [0]
16+ Signal {
17+ name: "favoriteChanged"
18+ Parameter { name: "favorite"; type: "bool" }
19+ }
20+ Signal {
21+ name: "runningChanged"
22+ Parameter { name: "running"; type: "bool" }
23+ }
24+ }
25+ Component {
26+ name: "LauncherModel"
27+ prototype: "unity::shell::launcher::LauncherModelInterface"
28+ exports: ["Unity.Launcher/LauncherModel 0.1"]
29+ isCreatable: false
30+ isSingleton: true
31+ exportMetaObjectRevisions: [0]
32+ Method {
33+ name: "get"
34+ type: "unity::shell::launcher::LauncherItemInterface*"
35+ Parameter { name: "index"; type: "int" }
36+ }
37+ Method {
38+ name: "move"
39+ Parameter { name: "oldIndex"; type: "int" }
40+ Parameter { name: "newIndex"; type: "int" }
41+ }
42+ Method {
43+ name: "pin"
44+ Parameter { name: "appId"; type: "string" }
45+ Parameter { name: "index"; type: "int" }
46+ }
47+ Method {
48+ name: "pin"
49+ Parameter { name: "appId"; type: "string" }
50+ }
51+ Method {
52+ name: "requestRemove"
53+ Parameter { name: "appId"; type: "string" }
54+ }
55+ Method {
56+ name: "quickListActionInvoked"
57+ Parameter { name: "appId"; type: "string" }
58+ Parameter { name: "actionIndex"; type: "int" }
59+ }
60+ Method {
61+ name: "setUser"
62+ Parameter { name: "username"; type: "string" }
63+ }
64+ Method {
65+ name: "getUrlForAppId"
66+ type: "string"
67+ Parameter { name: "appId"; type: "string" }
68+ }
69+ }
70+ Component {
71+ name: "QuickListModel"
72+ prototype: "unity::shell::launcher::QuickListModelInterface"
73+ exports: ["Unity.Launcher/QuickListModel 0.1"]
74+ isCreatable: false
75+ exportMetaObjectRevisions: [0]
76+ }
77+ Component {
78+ name: "unity::shell::launcher::LauncherItemInterface"
79+ prototype: "QObject"
80+ exports: ["Unity.Launcher/LauncherItemInterface 0.1"]
81+ isCreatable: false
82+ exportMetaObjectRevisions: [0]
83+ Property { name: "appId"; type: "string"; isReadonly: true }
84+ Property { name: "name"; type: "string"; isReadonly: true }
85+ Property { name: "icon"; type: "string"; isReadonly: true }
86+ Property { name: "pinned"; type: "bool"; isReadonly: true }
87+ Property { name: "running"; type: "bool"; isReadonly: true }
88+ Property { name: "recent"; type: "bool"; isReadonly: true }
89+ Property { name: "progress"; type: "int"; isReadonly: true }
90+ Property { name: "count"; type: "int"; isReadonly: true }
91+ Property { name: "focused"; type: "bool"; isReadonly: true }
92+ Property {
93+ name: "quickList"
94+ type: "unity::shell::launcher::QuickListModelInterface"
95+ isReadonly: true
96+ isPointer: true
97+ }
98+ Signal {
99+ name: "pinnedChanged"
100+ Parameter { name: "pinned"; type: "bool" }
101+ }
102+ Signal {
103+ name: "runningChanged"
104+ Parameter { name: "running"; type: "bool" }
105+ }
106+ Signal {
107+ name: "recentChanged"
108+ Parameter { name: "running"; type: "bool" }
109+ }
110+ Signal {
111+ name: "progressChanged"
112+ Parameter { name: "progress"; type: "int" }
113+ }
114+ Signal {
115+ name: "countChanged"
116+ Parameter { name: "count"; type: "int" }
117+ }
118+ Signal {
119+ name: "focusedChanged"
120+ Parameter { name: "focused"; type: "bool" }
121+ }
122+ }
123+ Component {
124+ name: "unity::shell::launcher::LauncherModelInterface"
125+ prototype: "QAbstractListModel"
126+ exports: ["Unity.Launcher/LauncherModelInterface 0.1"]
127+ isCreatable: false
128+ exportMetaObjectRevisions: [0]
129+ Property {
130+ name: "applicationManager"
131+ type: "unity::shell::application::ApplicationManagerInterface"
132+ isPointer: true
133+ }
134+ Method {
135+ name: "move"
136+ Parameter { name: "oldIndex"; type: "int" }
137+ Parameter { name: "newIndex"; type: "int" }
138+ }
139+ Method {
140+ name: "get"
141+ type: "unity::shell::launcher::LauncherItemInterface*"
142+ Parameter { name: "index"; type: "int" }
143+ }
144+ Method {
145+ name: "pin"
146+ Parameter { name: "appId"; type: "string" }
147+ Parameter { name: "index"; type: "int" }
148+ }
149+ Method {
150+ name: "pin"
151+ Parameter { name: "appId"; type: "string" }
152+ }
153+ Method {
154+ name: "requestRemove"
155+ Parameter { name: "appId"; type: "string" }
156+ }
157+ Method {
158+ name: "quickListActionInvoked"
159+ Parameter { name: "appId"; type: "string" }
160+ Parameter { name: "actionIndex"; type: "int" }
161+ }
162+ Method {
163+ name: "setUser"
164+ Parameter { name: "username"; type: "string" }
165+ }
166+ }
167+ Component {
168+ name: "unity::shell::launcher::QuickListModelInterface"
169+ prototype: "QAbstractListModel"
170+ exports: ["Unity.Launcher/QuickListInterface 0.1"]
171+ isCreatable: false
172+ exportMetaObjectRevisions: [0]
173+ }
174+}
plugins/Unity/Launcher/launcheritem.cpp+2−2
@@ -40,7 +40,7 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
4040 m_quickList->appendAction(nameAction);
4141 QuickListEntry pinningAction;
4242 pinningAction.setActionId("pin_item");
43− pinningAction.setText(gettext("Lock to Launcher"));
43+ pinningAction.setText(gettext("Pin shortcut"));
4444 m_quickList->appendAction(pinningAction);
4545}
4646
@@ -70,7 +70,7 @@ void LauncherItem::setPinned(bool pinned)
7070 m_pinned = pinned;
7171 QuickListEntry entry;
7272 entry.setActionId("pin_item");
73− entry.setText(pinned ? gettext("Unlock from Launcher") : gettext("Lock to Launcher"));
73+ entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
7474 m_quickList->updateAction(entry);
7575 Q_EMIT pinnedChanged(pinned);
7676 }
plugins/Unity/Session/Session.qmltypesnew file+25
@@ -0,0 +1,25 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Session 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "DBusUnitySessionService"
12+ prototype: "QObject"
13+ exports: ["Unity.Session/DBusUnitySessionService 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Signal {
18+ name: "logoutRequested"
19+ Parameter { name: "have_inhibitors"; type: "bool" }
20+ }
21+ Signal { name: "logoutReady" }
22+ Method { name: "Logout" }
23+ Method { name: "RequestLogout" }
24+ }
25+}
plugins/Utils/Utils.qmltypesnew file+143
@@ -0,0 +1,143 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Utils 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "EasingCurve"
12+ prototype: "QObject"
13+ exports: ["Utils/EasingCurve 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "type"; type: "QEasingCurve::Type" }
16+ Property { name: "period"; type: "double" }
17+ Property { name: "progress"; type: "double" }
18+ Property { name: "value"; type: "double"; isReadonly: true }
19+ }
20+ Component {
21+ name: "QAbstractProxyModel"
22+ prototype: "QAbstractItemModel"
23+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
24+ }
25+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
26+ Component {
27+ name: "QLimitProxyModelQML"
28+ prototype: "QIdentityProxyModel"
29+ exports: ["Utils/LimitProxyModel 0.1"]
30+ exportMetaObjectRevisions: [0]
31+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
32+ Property { name: "limit"; type: "int" }
33+ Property { name: "count"; type: "int"; isReadonly: true }
34+ Signal { name: "totalCountChanged" }
35+ }
36+ Component {
37+ name: "QSortFilterProxyModel"
38+ prototype: "QAbstractProxyModel"
39+ Property { name: "filterRegExp"; type: "QRegExp" }
40+ Property { name: "filterKeyColumn"; type: "int" }
41+ Property { name: "dynamicSortFilter"; type: "bool" }
42+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
43+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
44+ Property { name: "isSortLocaleAware"; type: "bool" }
45+ Property { name: "sortRole"; type: "int" }
46+ Property { name: "filterRole"; type: "int" }
47+ Method {
48+ name: "setFilterRegExp"
49+ Parameter { name: "pattern"; type: "string" }
50+ }
51+ Method {
52+ name: "setFilterWildcard"
53+ Parameter { name: "pattern"; type: "string" }
54+ }
55+ Method {
56+ name: "setFilterFixedString"
57+ Parameter { name: "pattern"; type: "string" }
58+ }
59+ Method { name: "clear" }
60+ Method { name: "invalidate" }
61+ }
62+ Component {
63+ name: "QSortFilterProxyModelQML"
64+ prototype: "QSortFilterProxyModel"
65+ exports: ["Utils/SortFilterProxyModel 0.1"]
66+ exportMetaObjectRevisions: [0]
67+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
68+ Property { name: "totalCount"; type: "int"; isReadonly: true }
69+ Property { name: "count"; type: "int"; isReadonly: true }
70+ Property { name: "invertMatch"; type: "bool" }
71+ Signal {
72+ name: "invertMatchChanged"
73+ Parameter { type: "bool" }
74+ }
75+ Method {
76+ name: "get"
77+ type: "QVariantMap"
78+ Parameter { name: "row"; type: "int" }
79+ }
80+ Method {
81+ name: "data"
82+ type: "QVariant"
83+ Parameter { name: "row"; type: "int" }
84+ Parameter { name: "role"; type: "int" }
85+ }
86+ Method { name: "count"; type: "int" }
87+ Method {
88+ name: "findFirst"
89+ type: "int"
90+ Parameter { name: "role"; type: "int" }
91+ Parameter { name: "value"; type: "QVariant" }
92+ }
93+ Method {
94+ name: "mapRowToSource"
95+ type: "int"
96+ Parameter { name: "row"; type: "int" }
97+ }
98+ Method {
99+ name: "mapFromSource"
100+ type: "int"
101+ Parameter { name: "row"; type: "int" }
102+ }
103+ Method {
104+ name: "mapToSource"
105+ type: "int"
106+ Parameter { name: "row"; type: "int" }
107+ }
108+ }
109+ Component {
110+ name: "TimeFormatter"
111+ prototype: "QObject"
112+ exports: ["Utils/GDateTimeFormatter 0.1", "Utils/TimeFormatter 0.1"]
113+ exportMetaObjectRevisions: [0, 0]
114+ Property { name: "format"; type: "string" }
115+ Property { name: "timeString"; type: "string"; isReadonly: true }
116+ Property { name: "time"; type: "qlonglong" }
117+ Signal {
118+ name: "formatChanged"
119+ Parameter { name: "format"; type: "string" }
120+ }
121+ Signal {
122+ name: "timeStringChanged"
123+ Parameter { name: "timeString"; type: "string" }
124+ }
125+ Signal {
126+ name: "timeChanged"
127+ Parameter { name: "time"; type: "qlonglong" }
128+ }
129+ }
130+ Component {
131+ name: "UnityMenuModelPaths"
132+ prototype: "QObject"
133+ exports: ["Utils/UnityMenuModelPaths 0.1"]
134+ exportMetaObjectRevisions: [0]
135+ Property { name: "source"; type: "QVariant" }
136+ Property { name: "busName"; type: "QByteArray"; isReadonly: true }
137+ Property { name: "actions"; type: "QVariantMap"; isReadonly: true }
138+ Property { name: "menuObjectPath"; type: "QByteArray"; isReadonly: true }
139+ Property { name: "busNameHint"; type: "QByteArray" }
140+ Property { name: "actionsHint"; type: "QByteArray" }
141+ Property { name: "menuObjectPathHint"; type: "QByteArray" }
142+ }
143+}
plugins/Utils/easingcurve.cpp+3−1
@@ -21,7 +21,9 @@
2121#include <QDebug>
2222
2323EasingCurve::EasingCurve(QObject *parent):
24− QObject(parent)
24+ QObject(parent),
25+ m_progress(0),
26+ m_value(0)
2527{
2628
2729}
qml/Dash/Previews/PreviewPayments.qmlnew file+56
@@ -0,0 +1,56 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.1
18+import Ubuntu.Components 0.1
19+import Ubuntu.Payments 0.1
20+
21+/*! \brief Preview widget for a purchase button.
22+ *
23+ * When clicked, this button starts the payments service.
24+ * Then it waits until the purchase finishes or fails.
25+ * Those events trigger the corresponding actions.
26+ */
27+
28+PreviewWidget {
29+ id: root
30+
31+ implicitHeight: paymentButton.implicitHeight
32+ implicitWidth: paymentButton.implicitWidth
33+
34+ Button {
35+ id: paymentButton
36+ objectName: "paymentButton"
37+
38+ color: Theme.palette.selected.foreground
39+ text: paymentClient.formattedPrice
40+ onClicked: paymentClient.start()
41+ anchors.right: parent.right
42+ width: (root.width - units.gu(1)) / 2
43+
44+ Payments {
45+ id: paymentClient
46+
47+ property var source: widgetData["source"]
48+
49+ price: source["price"]
50+ currency: source["currency"]
51+ storeItemId: source["store_item_id"]
52+ onPurchaseCompleted: root.triggered(widgetId, "purchaseCompleted", source)
53+ onPurchaseError: root.triggered(widgetId, "purchaseError", source)
54+ }
55+ }
56+}
qml/Dash/Previews/PreviewWidgetFactory.qml+1
@@ -48,6 +48,7 @@ Loader {
4848 case "header": return "PreviewHeader.qml";
4949 case "image": return "PreviewZoomableImage.qml";
5050 case "progress": return "PreviewProgress.qml";
51+ case "payments": return "PreviewPayments.qml";
5152 case "rating-input": return "PreviewRatingInput.qml";
5253 case "reviews": return "PreviewRatingDisplay.qml";
5354 case "text": return "PreviewTextSummary.qml";
qml/Launcher/LauncherPanel.qml−1
@@ -104,7 +104,6 @@ Item {
104104 highlightRangeMode: ListView.ApplyRange
105105 preferredHighlightBegin: (height - itemHeight) / 2
106106 preferredHighlightEnd: (height + itemHeight) / 2
107− spacing: units.gu(0.5)
108107
109108 // The size of the area the ListView is extended to make sure items are not
110109 // destroyed when dragging them outside the list. This needs to be at least
qml/Panel/Indicators/DefaultIndicatorPage.qml+2−2
@@ -22,7 +22,7 @@ import QtQuick 2.0
2222import Ubuntu.Components 0.1 as Components
2323import Unity.Indicators 0.1 as Indicators
2424
25−Indicators.IndicatorBase {
25+IndicatorBase {
2626 id: main
2727
2828 //const
@@ -174,7 +174,7 @@ Indicators.IndicatorBase {
174174 }
175175 }
176176
177− Indicators.MenuItemFactory {
177+ MenuItemFactory {
178178 id: factory
179179 menuModel: mainMenu.model ? mainMenu.model : null
180180 }
qml/Panel/Indicators/DefaultIndicatorWidget.qml+9−2
@@ -20,9 +20,8 @@
2020import QtQuick 2.0
2121import Ubuntu.Components 0.1
2222import Ubuntu.Settings.Components 0.1
23−import Unity.Indicators 0.1 as Indicators
2423
25−Indicators.IndicatorBase {
24+IndicatorBase {
2625 id: indicatorWidget
2726
2827 property int iconSize: units.gu(2)
@@ -33,6 +32,14 @@ Indicators.IndicatorBase {
3332 width: itemRow.width
3433 enabled: false
3534
35+ // FIXME: For now we will enable led indicator support only for messaging indicator
36+ // in the future we should export a led API insted of doing that,
37+ Loader {
38+ id: indicatorLed
39+ // only load source Component if the icons contains the new message icon
40+ source: (indicatorWidget.icons && (String(indicatorWidget.icons).indexOf("indicator-messages-new") != -1)) ? Qt.resolvedUrl("IndicatorsLight.qml") : ""
41+ }
42+
3643 Row {
3744 id: itemRow
3845 objectName: "itemRow"
plugins/Unity/Indicators/qml/IndicatorBase.qml → qml/Panel/Indicators/IndicatorBase.qmlrenamed+2−3
@@ -18,8 +18,7 @@
1818 */
1919
2020import QtQuick 2.0
21−import QMenuModel 0.1 as QMenuModel
22−import Unity.Indicators 0.1 as Indicators
21+import Unity.Indicators 0.1
2322
2423Item {
2524 id: indicatorItem
@@ -43,7 +42,7 @@ Item {
4342 menuObjectPath: indicatorItem.deviceMenuObjectPath
4443 }
4544
46− property var rootActionState: Indicators.RootActionState {
45+ property RootActionState rootActionState: RootActionState {
4746 menu: menuModel
4847 onUpdated: indicatorItem.rootActionStateChanged()
4948 }
qml/Panel/Indicators/IndicatorDelegate.qml+1−2
@@ -18,9 +18,8 @@
1818 */
1919
2020import QtQuick 2.0
21−import Unity.Indicators 0.1 as Indicators
2221
23−Indicators.IndicatorBase {
22+IndicatorBase {
2423 enabled: false
2524
2625 onRootActionStateChanged: {
tests/mocks/Unity/Indicators/MenuItemFactory.qml → qml/Panel/Indicators/IndicatorsLight.qmlrenamed+14−14
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -14,25 +14,25 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 *
1616 * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
17+ * Renato Araujo Oliveira Filho <renato@canonical.com>
1818 */
1919
2020import QtQuick 2.0
21−import Ubuntu.Components.ListItems 0.1 as ListItem
21+import Powerd 0.1
22+import Lights 0.1
2223
23−Item {
24− id: menuFactory
24+QtObject {
25+ id: root
2526
26− property var menuModel: null
27+ Component.onDestruction: Lights.state = Lights.Off
2728
28− Component {
29− id: standardMenu;
30− ListItem.Standard {
31− objectName: "standardMenu"
32− }
33− }
29+ // QtObject does not have children
30+ property var _connections: Connections {
31+ id: powerConnection
3432
35− function load(modelData) {
36− return standardMenu;
33+ target: Powerd
34+ onDisplayPowerStateChange: {
35+ Lights.state = (status === Powerd.Off) ? Lights.On : Lights.Off
36+ }
3737 }
3838}
plugins/Unity/Indicators/qml/MenuItemFactory.qml → qml/Panel/Indicators/MenuItemFactory.qmlrenamed

The content is the same.

plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml → qml/Panel/Indicators/MessageMenuItemFactory.qmlrenamed

The content is the same.

plugins/Unity/Indicators/qml/RemoveBackground.qml → qml/Panel/Indicators/RemoveBackground.qmlrenamed

The content is the same.

src/CMakeLists.txt+1
@@ -16,6 +16,7 @@ add_executable(${SHELL_APP}
1616 ApplicationArguments.h
1717 main.cpp
1818 MouseTouchAdaptor.cpp
19+ CachingNetworkManagerFactory.cpp
1920 ${QML_FILES} # This is to make qml and image files appear in the IDE's project tree
2021)
2122
src/CachingNetworkManagerFactory.cppnew file+62
@@ -0,0 +1,62 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ */
17+
18+#include "CachingNetworkManagerFactory.h"
19+
20+#include <QNetworkDiskCache>
21+#include <QNetworkAccessManager>
22+#include <QStandardPaths>
23+#include <QNetworkConfigurationManager>
24+
25+CachingNetworkAccessManager::CachingNetworkAccessManager(QObject *parent)
26+ : QNetworkAccessManager(parent)
27+{
28+ m_networkManager = new QNetworkConfigurationManager(this);
29+
30+ QObject::connect(m_networkManager, &QNetworkConfigurationManager::onlineStateChanged, this, &CachingNetworkAccessManager::onlineStateChanged);
31+ m_isOnline = m_networkManager->isOnline();
32+}
33+
34+void CachingNetworkAccessManager::onlineStateChanged(bool isOnline)
35+{
36+ m_isOnline = isOnline;
37+}
38+
39+QNetworkReply* CachingNetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
40+{
41+ if (!m_isOnline) {
42+ QNetworkRequest req(request);
43+ req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysCache);
44+ return QNetworkAccessManager::createRequest(op, req, outgoingData);
45+ }
46+
47+ return QNetworkAccessManager::createRequest(op, request, outgoingData);
48+}
49+
50+CachingNetworkManagerFactory::CachingNetworkManagerFactory()
51+{
52+}
53+
54+QNetworkAccessManager *CachingNetworkManagerFactory::create(QObject *parent) {
55+ QNetworkAccessManager *manager = new CachingNetworkAccessManager(parent);
56+
57+ QNetworkDiskCache* cache = new QNetworkDiskCache(manager);
58+ cache->setCacheDirectory(QString("%1/network").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)));
59+
60+ manager->setCache(cache);
61+ return manager;
62+}
src/CachingNetworkManagerFactory.hnew file+50
@@ -0,0 +1,50 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ */
17+
18+#ifndef CACHINGNETWORKMANAGERFACTORY_H
19+#define CACHINGNETWORKMANAGERFACTORY_H
20+
21+#include <QQmlNetworkAccessManagerFactory>
22+#include <QNetworkAccessManager>
23+
24+class QNetworkConfigurationManager;
25+
26+class CachingNetworkAccessManager : public QNetworkAccessManager
27+{
28+public:
29+ CachingNetworkAccessManager(QObject *parent = 0);
30+
31+protected:
32+ QNetworkReply* createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0) override;
33+
34+private Q_SLOTS:
35+ void onlineStateChanged(bool isOnline);
36+
37+private:
38+ QNetworkConfigurationManager* m_networkManager;
39+ bool m_isOnline;
40+};
41+
42+class CachingNetworkManagerFactory : public QQmlNetworkAccessManagerFactory
43+{
44+public:
45+ CachingNetworkManagerFactory();
46+
47+ QNetworkAccessManager *create(QObject *parent) override;
48+};
49+
50+#endif // CACHINGNETWORKMANAGERFACTORY_H
src/main.cpp+5−1
@@ -34,12 +34,13 @@
3434#include <paths.h>
3535#include "MouseTouchAdaptor.h"
3636#include "ApplicationArguments.h"
37+#include "CachingNetworkManagerFactory.h"
3738
3839int startShell(int argc, const char** argv)
3940{
4041 const bool isMirServer = qgetenv("QT_QPA_PLATFORM") == "mirserver";
4142
42− QGuiApplication::setApplicationName("Unity 8");
43+ QGuiApplication::setApplicationName("unity8");
4344 QGuiApplication *application;
4445
4546 QCommandLineParser parser;
@@ -140,6 +141,9 @@ Load the testability driver");
140141 }
141142 appendImportPaths(view->engine(), ::fallbackImportPaths());
142143
144+ CachingNetworkManagerFactory *managerFactory = new CachingNetworkManagerFactory();
145+ view->engine()->setNetworkAccessManagerFactory(managerFactory);
146+
143147 view->setSource(source);
144148 QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
145149
tests/autopilot/unity8/process_helpers.py+4−3
@@ -75,7 +75,7 @@ def unlock_unity(unity_proxy_obj=None):
7575 main_window_emulator.QQuickView)
7676
7777 greeter = main_window.get_greeter()
78− if greeter.created == False:
78+ if greeter.created is False:
7979 raise RuntimeWarning("Greeter appears to be already unlocked.")
8080
8181 # Because of potential input jerkiness under heavy load,
@@ -98,7 +98,8 @@ def unlock_unity(unity_proxy_obj=None):
9898
9999def lock_unity(unity_proxy_obj=None):
100100 """Helper function that attempts to lock the unity greeter."""
101− import evdev, time
101+ import evdev
102+ import time
102103 uinput = evdev.UInput(name='unity8-autopilot-power-button',
103104 devnode='/dev/autopilot-uinput')
104105 # One press and release to turn screen off (locking unity)
@@ -172,7 +173,7 @@ def _get_unity_status():
172173
173174def _get_unity_pid():
174175 status = _get_unity_status()
175− if not "start/" in status:
176+ if "start/" not in status:
176177 raise CannotAccessUnity("Unity is not in the running state.")
177178 return int(status.split()[-1])
178179
tests/autopilot/unity8/shell/tests/__init__.py+1−2
@@ -142,12 +142,11 @@ class UnityTestCase(AutopilotTestCase):
142142 self._data_dirs_mock_enabled = True
143143 self._environment = {}
144144
145− #### FIXME: This is a work around re: lp:1238417 ####
145+ # FIXME: This is a work around re: lp:1238417
146146 if model() != "Desktop":
147147 from autopilot.input import _uinput
148148 _uinput._touch_device = _uinput.create_touch_device()
149149 self.addCleanup(_uinput._touch_device.close)
150− ####
151150
152151 self.touch = Touch.create()
153152 self._setup_display_details()
tests/autopilot/unity8/shell/tests/disabled_test_hud.py+44−13
@@ -20,12 +20,13 @@
2020from __future__ import absolute_import
2121
2222from unity8.process_helpers import unlock_unity
23−from unity8.shell import with_lightdm_mock, DragMixin
23+from unity8.shell import DragMixin
2424from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2525
2626from testtools.matchers import Equals
2727from autopilot.matchers import Eventually
2828
29+
2930class TestHud(UnityTestCase, DragMixin):
3031
3132 """Tests the Shell HUD."""
@@ -33,10 +34,14 @@ class TestHud(UnityTestCase, DragMixin):
3334 scenarios = _get_device_emulation_scenarios()
3435
3536 def test_show_hud_button_appears(self):
36− """Swiping up while an app is active must show the 'show hud' button, following some behaviours.
37+ """Swiping up while an app is active must show the 'show hud' button.
38+
39+ It should follow some behaviours.
3740 The button must disappear not opening the HUD when releasing the
38− mouse again somewhere on the screen except on the button itself following a timeout.
39− The button must disappear when touching somewhere on the screen except the button itself.
41+ mouse again somewhere on the screen except on the button itself
42+ following a timeout.
43+ The button must disappear when touching somewhere on the screen
44+ except the button itself.
4045
4146 """
4247 unity_proxy = self.launch_unity()
@@ -55,29 +60,47 @@ class TestHud(UnityTestCase, DragMixin):
5560
5661 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
5762 self.addCleanup(self._maybe_release_finger)
58− self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
63+ self._drag(
64+ swipe_coords.start_x,
65+ swipe_coords.start_y,
66+ swipe_coords.start_x,
67+ swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5)
5968 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
60− self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(initialBottomMargin)))
61− self._drag(swipe_coords.start_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5, swipe_coords.end_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - int(edge_drag_area.commitDistance) - 5)
69+ self.assertThat(
70+ hud_show_button.bottomMargin,
71+ Eventually(Equals(initialBottomMargin)))
72+ self._drag(
73+ swipe_coords.start_x,
74+ swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5,
75+ swipe_coords.end_x,
76+ swipe_coords.start_y - int(edge_drag_area.distanceThreshold) -
77+ int(edge_drag_area.commitDistance) - 5)
6278 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
6379 self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
64− self.touch.release();
80+ self.touch.release()
6581 self.assertThat(hud.shown, Equals(False))
6682 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
6783
6884 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
69− self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
85+ self._drag(
86+ swipe_coords.start_x,
87+ swipe_coords.start_y,
88+ swipe_coords.start_x,
89+ swipe_coords.end_y - int(hud_show_button.height))
7090 self.assertThat(hud.shown, Equals(False))
7191 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
7292 self.touch.release()
7393 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
74− self.touch.tap(swipe_coords.end_x, swipe_coords.end_y - int(hud_show_button.height))
94+ self.touch.tap(
95+ swipe_coords.end_x,
96+ swipe_coords.end_y - int(hud_show_button.height))
7597 self.assertThat(hud.shown, Equals(False))
7698 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
7799
78100 def test_show_hud_appears(self):
79101 """Releasing the touch on the 'show hud' button must display the hud.
80− Test that the hud button stays on screen and tapping it opens the hud.
102+ Test that the hud button stays on screen and tapping it opens the
103+ hud.
81104
82105 """
83106 unity_proxy = self.launch_unity()
@@ -94,7 +117,11 @@ class TestHud(UnityTestCase, DragMixin):
94117
95118 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
96119 self.addCleanup(self._maybe_release_finger)
97− self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y)
120+ self._drag(
121+ swipe_coords.start_x,
122+ swipe_coords.start_y,
123+ swipe_coords.start_x,
124+ swipe_coords.end_y)
98125 self.assertThat(hud.shown, Eventually(Equals(False)))
99126 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
100127 self.touch.release()
@@ -105,7 +132,11 @@ class TestHud(UnityTestCase, DragMixin):
105132 self.assertThat(hud.shown, Eventually(Equals(False)))
106133
107134 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
108− self._drag(swipe_coords.start_x, swipe_coords.start_y, swipe_coords.start_x, swipe_coords.end_y - int(hud_show_button.height))
135+ self._drag(
136+ swipe_coords.start_x,
137+ swipe_coords.start_y,
138+ swipe_coords.start_x,
139+ swipe_coords.end_y - int(hud_show_button.height))
109140 self.assertThat(hud.shown, Equals(False))
110141 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
111142 self.touch.release()
tests/autopilot/unity8/shell/tests/test_emulators.py−2
@@ -32,8 +32,6 @@ try:
3232except ImportError:
3333 import mock
3434
35−from testtools.matchers import Contains, HasLength
36−
3735from unity8 import process_helpers
3836from unity8.shell import emulators, fixture_setup, tests
3937from unity8.shell.emulators import dash as dash_emulators
tests/autopilot/unity8/shell/tests/test_lock_screen.py+4−5
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2012-2013 Canonical
4+# Copyright (C) 2012, 2013, 2014 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -25,9 +25,7 @@ from unity8.shell import with_lightdm_mock
2525from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2626
2727from autopilot.matchers import Eventually
28−from autopilot.platform import model
2928import sys
30−from testtools import skipUnless
3129from testtools.matchers import Equals
3230import logging
3331
@@ -133,7 +131,7 @@ class TestLockscreen(UnityTestCase):
133131 if not isinstance(code, basestring):
134132 raise TypeError(
135133 "'code' parameter must be a string, not %r."
136− % type(passphrase)
134+ % type(code)
137135 )
138136 for num in code:
139137 if not num.isdigit():
@@ -190,7 +188,8 @@ class TestLockscreen(UnityTestCase):
190188 current_text = prompt.text
191189 self.keyboard.type(character)
192190 try:
193− self.assertThat(prompt.text, Eventually(Equals(current_text + character)))
191+ self.assertThat(
192+ prompt.text, Eventually(Equals(current_text + character)))
194193 except AssertionError:
195194 if retries > 0:
196195 self._type_character(character, prompt, retries-1)
tests/autopilot/unity8/shell/tests/test_notifications.py+15−10
@@ -211,8 +211,8 @@ class InteractiveNotificationBase(NotificationsBase):
211211 self.touch.tap_object(notification.select_single(objectName="button4"))
212212 self.assert_notification_action_id_was_called("action_decline_4")
213213
214− def test_modal_sd_without_greeter (self):
215− """A snap-decision on a phone should block input to shell beneath it when there's no greeter."""
214+ def test_modal_sd_without_greeter(self):
215+ """Snap-decision should block input to shell without greeter."""
216216 unity_proxy = self.launch_unity()
217217 unlock_unity(unity_proxy)
218218
@@ -238,7 +238,8 @@ class InteractiveNotificationBase(NotificationsBase):
238238 hints
239239 )
240240
241− # verify that we cannot reveal the launcher (no longer interact with the shell)
241+ # verify that we cannot reveal the launcher (no longer interact with
242+ # the shell)
242243 time.sleep(1)
243244 self.main_window.show_dash_swiping()
244245 launcher = self.main_window.get_launcher()
@@ -249,13 +250,14 @@ class InteractiveNotificationBase(NotificationsBase):
249250 get_notification = lambda: notify_list.wait_select_single(
250251 'Notification', objectName='notification1')
251252 notification = get_notification()
252− self._assert_notification(notification, summary, body, True, False, 1.0)
253+ self._assert_notification(
254+ notification, summary, body, True, False, 1.0)
253255 self.touch.tap_object(notification.select_single(objectName="button0"))
254256 self.assert_notification_action_id_was_called("action_accept")
255257
256− def test_modal_sd_with_greeter (self):
257− """A snap-decision on a phone should not block input to the greeter beneath it."""
258− unity_proxy = self.launch_unity()
258+ def test_modal_sd_with_greeter(self):
259+ """A snap-decision should not block input to the greeter beneath it."""
260+ self.launch_unity()
259261
260262 summary = "Incoming file"
261263 body = "Frank would like to send you the file: essay.pdf"
@@ -290,7 +292,8 @@ class InteractiveNotificationBase(NotificationsBase):
290292 get_notification = lambda: notify_list.wait_select_single(
291293 'Notification', objectName='notification1')
292294 notification = get_notification()
293− self._assert_notification(notification, summary, body, True, False, 1.0)
295+ self._assert_notification(
296+ notification, summary, body, True, False, 1.0)
294297 self.touch.tap_object(notification.select_single(objectName="button0"))
295298 self.assert_notification_action_id_was_called("action_accept")
296299
@@ -663,7 +666,8 @@ class EphemeralNotificationsTests(NotificationsBase):
663666 icon_path = self._get_icon_path('avatars/amanda.png')
664667 notification.update(summary, body, icon_path)
665668 notification.show()
666− self._assert_notification(get_notification(), summary, body, True, False, 1.0)
669+ self._assert_notification(
670+ get_notification(), summary, body, True, False, 1.0)
667671
668672 def test_update_notification_layout_change(self):
669673 """Notification must allow updating its contents and layout while
@@ -710,7 +714,8 @@ class EphemeralNotificationsTests(NotificationsBase):
710714 notification.show()
711715
712716 self.assertThat(get_notification, Eventually(NotEquals(None)))
713− self._assert_notification(get_notification(), summary, body, False, False, 1.0)
717+ self._assert_notification(
718+ get_notification(), summary, body, False, False, 1.0)
714719
715720 def test_append_hint(self):
716721 """Notification has to accumulate body-text using append-hint."""
tests/autopilot/unity8/shell/tests/test_system_integration.py+10−5
@@ -23,19 +23,24 @@ import subprocess
2323import unittest
2424
2525from autopilot import platform
26−from unity8.shell.emulators import UnityEmulatorBase
2726from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2827
29−from testtools.matchers._basic import Equals
3028
3129class SystemIntegrationTests(UnityTestCase):
3230
3331 scenarios = _get_device_emulation_scenarios()
3432
35− @unittest.skipIf(platform.model() == "Desktop", "Test is broken on otto, see bug 1281634.")
33+ @unittest.skipIf(
34+ platform.model() == "Desktop",
35+ "Test is broken on otto, see bug 1281634.")
3636 def test_networkmanager_integration(self):
3737 self.launch_unity()
3838
3939 # invoke policykit to check permissions
40− pid = subprocess.check_output(["pidof", "-s", "unity8"], universal_newlines=True)
41− subprocess.check_call("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process " + pid, shell=True)
40+ pid = subprocess.check_output(
41+ ["pidof", "-s", "unity8"], universal_newlines=True)
42+ subprocess.check_call(
43+ "pkcheck --action-id "
44+ "org.freedesktop.NetworkManager.enable-disable-network "
45+ "--process " + pid,
46+ shell=True)
tests/autopilot/unity8/shell/tests/test_upstart.py+20−11
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2013 Canonical
4+# Copyright (C) 2013, 2014 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -42,19 +42,24 @@ import sys
4242if sys.version_info < (3,):
4343 range = xrange
4444
45+
4546class UpstartIntegrationTests(UnityTestCase):
4647
4748 scenarios = _get_device_emulation_scenarios()
4849
4950 def _get_status(self):
50− pid, status = os.waitpid(self.process.pid, os.WUNTRACED | os.WCONTINUED | os.WNOHANG)
51− logger.debug("Got status: {0}; stopped: {1}; continued: {2}"\
52− .format(status, os.WIFSTOPPED(status), os.WIFCONTINUED(status)))
51+ pid, status = os.waitpid(
52+ self.process.pid, os.WUNTRACED | os.WCONTINUED | os.WNOHANG)
53+ logger.debug(
54+ "Got status: {0}; stopped: {1}; continued: {2}".format(
55+ status, os.WIFSTOPPED(status), os.WIFCONTINUED(status)))
5356 return status
5457
5558 def _launch_unity(self):
5659 self.patch_environment("QT_LOAD_TESTABILITY", "1")
57− self.process = subprocess.Popen([get_binary_path()] + self.unity_geometry_args)
60+ self.process = subprocess.Popen(
61+ [get_binary_path()] + self.unity_geometry_args)
62+
5863 def ensure_stopped():
5964 self.process.terminate()
6065 for i in range(10):
@@ -76,10 +81,10 @@ class UpstartIntegrationTests(UnityTestCase):
7681 self.addCleanup(ensure_stopped)
7782
7883 def _set_proxy(self):
79− super(UpstartIntegrationTests, self)._set_proxy(get_proxy_object_for_existing_process(
80− pid=self.process.pid,
81− emulator_base=UnityEmulatorBase,
82− ))
84+ super(UpstartIntegrationTests, self)._set_proxy(
85+ get_proxy_object_for_existing_process(
86+ pid=self.process.pid,
87+ emulator_base=UnityEmulatorBase,))
8388
8489 def test_no_sigstop(self):
8590 self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")
@@ -93,10 +98,14 @@ class UpstartIntegrationTests(UnityTestCase):
9398 def test_expect_sigstop(self):
9499 self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")
95100 self._launch_unity()
96− self.assertThat(lambda: os.WIFSTOPPED(self._get_status()), Eventually(Equals(True)), "Unity8 should raise SIGSTOP when ready")
101+ self.assertThat(
102+ lambda: os.WIFSTOPPED(self._get_status()),
103+ Eventually(Equals(True)), "Unity8 should raise SIGSTOP when ready")
97104
98105 self.process.send_signal(signal.SIGCONT)
99− self.assertThat(lambda: os.WIFCONTINUED(self._get_status()), Eventually(Equals(True)), "Unity8 should have resumed")
106+ self.assertThat(
107+ lambda: os.WIFCONTINUED(self._get_status()),
108+ Eventually(Equals(True)), "Unity8 should have resumed")
100109
101110 logger.debug("Unity started, waiting for it to be ready.")
102111 self._set_proxy()
tests/mocks/AccountsService/AccountsService.qmltypesnew file+22
@@ -0,0 +1,22 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable AccountsService 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "AccountsService"
12+ prototype: "QObject"
13+ exports: ["AccountsService/AccountsService 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Property { name: "user"; type: "string" }
18+ Property { name: "demoEdges"; type: "bool" }
19+ Property { name: "backgroundFile"; type: "string" }
20+ Property { name: "statsWelcomeScreen"; type: "bool" }
21+ }
22+}
tests/mocks/GSettings.1.0/GSettings.qmltypesnew file+42
@@ -0,0 +1,42 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable GSettings 1.0 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "GSettingsControllerQml"
12+ prototype: "QObject"
13+ exports: ["GSettings/GSettingsController 1.0"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Method {
18+ name: "setPictureUri"
19+ Parameter { name: "str"; type: "string" }
20+ }
21+ }
22+ Component {
23+ name: "GSettingsQml"
24+ prototype: "QObject"
25+ exports: ["GSettings/GSettings 1.0"]
26+ exportMetaObjectRevisions: [0]
27+ Property { name: "schema"; type: "GSettingsSchemaQml"; isReadonly: true; isPointer: true }
28+ Property { name: "pictureUri"; type: "string" }
29+ Signal {
30+ name: "pictureUriChanged"
31+ Parameter { type: "string" }
32+ }
33+ }
34+ Component {
35+ name: "GSettingsSchemaQml"
36+ prototype: "QObject"
37+ exports: ["GSettings/GSettingsSchema 1.0"]
38+ isCreatable: false
39+ exportMetaObjectRevisions: [0]
40+ Property { name: "id"; type: "QByteArray" }
41+ }
42+}
tests/mocks/HudClient/HudClient.qmltypesnew file+113
@@ -0,0 +1,113 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable HudClient 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "DeeListModel"
12+ prototype: "QAbstractListModel"
13+ Property { name: "name"; type: "string" }
14+ Property { name: "synchronized"; type: "bool"; isReadonly: true }
15+ Property { name: "count"; type: "int"; isReadonly: true }
16+ Signal {
17+ name: "nameChanged"
18+ Parameter { type: "string" }
19+ }
20+ Signal {
21+ name: "synchronizedChanged"
22+ Parameter { type: "bool" }
23+ }
24+ Signal {
25+ name: "roleNamesChanged"
26+ Parameter { type: "QHash<int,QByteArray>" }
27+ }
28+ Method {
29+ name: "get"
30+ type: "QVariantMap"
31+ Parameter { name: "row"; type: "int" }
32+ }
33+ Method { name: "count"; type: "int" }
34+ }
35+ Component {
36+ name: "HudClient"
37+ prototype: "QObject"
38+ exports: ["HudClient/HudClient 0.1"]
39+ exportMetaObjectRevisions: [0]
40+ Property { name: "results"; type: "DeeListModel"; isReadonly: true; isPointer: true }
41+ Property { name: "toolBarModel"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
42+ Signal { name: "voiceQueryLoading" }
43+ Signal { name: "voiceQueryListening" }
44+ Signal { name: "voiceQueryHeardSomething" }
45+ Signal { name: "voiceQueryFailed" }
46+ Signal {
47+ name: "voiceQueryFinished"
48+ Parameter { name: "query"; type: "string" }
49+ }
50+ Signal { name: "commandExecuted" }
51+ Signal {
52+ name: "showParametrizedAction"
53+ Parameter { name: "action"; type: "string" }
54+ Parameter { name: "items"; type: "QVariant" }
55+ }
56+ Method {
57+ name: "executeCommand"
58+ Parameter { name: "index"; type: "int" }
59+ }
60+ Method {
61+ name: "setQuery"
62+ Parameter { name: "new_query"; type: "string" }
63+ }
64+ Method { name: "startVoiceQuery" }
65+ Method {
66+ name: "executeParametrizedAction"
67+ Parameter { name: "values"; type: "QVariant" }
68+ }
69+ Method {
70+ name: "updateParametrizedAction"
71+ Parameter { name: "values"; type: "QVariant" }
72+ }
73+ Method { name: "cancelParametrizedAction" }
74+ Method {
75+ name: "executeToolBarAction"
76+ Parameter { name: "action"; type: "HudClientQueryToolbarItems" }
77+ }
78+ }
79+ Component {
80+ name: "HudClientStub"
81+ prototype: "QObject"
82+ exports: ["HudClient/HudClientStub 0.1"]
83+ exportMetaObjectRevisions: [0]
84+ Property { name: "lastExecutedToolbarItem"; type: "int"; isReadonly: true }
85+ Property { name: "lastSetQuery"; type: "string"; isReadonly: true }
86+ Property { name: "lastExecutedCommandRow"; type: "int"; isReadonly: true }
87+ Property { name: "lastExecutedParametrizedCommandRow"; type: "int"; isReadonly: true }
88+ Property { name: "lastParametrizedCommandCommited"; type: "bool"; isReadonly: true }
89+ Property { name: "activatedActions"; type: "QVariantMap"; isReadonly: true }
90+ Method { name: "reset" }
91+ Method { name: "fullScreenToolbarItemValue"; type: "int" }
92+ Method { name: "helpToolbarItemValue"; type: "int" }
93+ Method { name: "preferencesToolbarItemValue"; type: "int" }
94+ Method { name: "undoToolbarItemValue"; type: "int" }
95+ Method {
96+ name: "setHelpToolbarItemEnabled"
97+ Parameter { name: "enabled"; type: "bool" }
98+ }
99+ }
100+ Component { name: "HudToolBarModel"; prototype: "QAbstractListModel" }
101+ Component {
102+ name: "VolumePeakDetector"
103+ prototype: "QObject"
104+ exports: ["HudClient/VolumePeakDetector 0.1"]
105+ exportMetaObjectRevisions: [0]
106+ Property { name: "enabled"; type: "bool" }
107+ Property { name: "desiredInterval"; type: "int" }
108+ Signal {
109+ name: "newPeak"
110+ Parameter { name: "volume"; type: "float" }
111+ }
112+ }
113+}
tests/mocks/LightDM/LightDM.qmltypesnew file+241
@@ -0,0 +1,241 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable LightDM 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "Greeter"
12+ prototype: "QObject"
13+ exports: ["LightDM/Greeter 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Property { name: "authenticated"; type: "bool"; isReadonly: true }
18+ Property { name: "authenticationUser"; type: "string"; isReadonly: true }
19+ Property { name: "promptless"; type: "bool"; isReadonly: true }
20+ Signal {
21+ name: "showMessage"
22+ Parameter { name: "text"; type: "string" }
23+ Parameter { name: "isError"; type: "bool" }
24+ }
25+ Signal {
26+ name: "showPrompt"
27+ Parameter { name: "text"; type: "string" }
28+ Parameter { name: "isSecret"; type: "bool" }
29+ }
30+ Signal { name: "authenticationComplete" }
31+ Signal {
32+ name: "authenticationUserChanged"
33+ Parameter { name: "user"; type: "string" }
34+ }
35+ Signal {
36+ name: "requestAuthenticationUser"
37+ Parameter { name: "user"; type: "string" }
38+ }
39+ Method {
40+ name: "authenticate"
41+ Parameter { name: "username"; type: "string" }
42+ }
43+ Method { name: "authenticate" }
44+ Method {
45+ name: "respond"
46+ Parameter { name: "response"; type: "string" }
47+ }
48+ Method {
49+ name: "startSessionSync"
50+ type: "bool"
51+ Parameter { name: "session"; type: "string" }
52+ }
53+ Method { name: "startSessionSync"; type: "bool" }
54+ }
55+ Component {
56+ name: "QAbstractProxyModel"
57+ prototype: "QAbstractItemModel"
58+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
59+ }
60+ Component {
61+ name: "QLightDM::UsersModel"
62+ prototype: "QAbstractListModel"
63+ exports: ["LightDM/UserRoles 0.1"]
64+ isCreatable: false
65+ exportMetaObjectRevisions: [0]
66+ Enum {
67+ name: "UserModelRoles"
68+ values: {
69+ "NameRole": 256,
70+ "RealNameRole": 257,
71+ "LoggedInRole": 258,
72+ "BackgroundRole": 259,
73+ "SessionRole": 260,
74+ "HasMessagesRole": 261,
75+ "ImagePathRole": 262,
76+ "BackgroundPathRole": 263
77+ }
78+ }
79+ }
80+ Component {
81+ name: "QSortFilterProxyModel"
82+ prototype: "QAbstractProxyModel"
83+ Property { name: "filterRegExp"; type: "QRegExp" }
84+ Property { name: "filterKeyColumn"; type: "int" }
85+ Property { name: "dynamicSortFilter"; type: "bool" }
86+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
87+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
88+ Property { name: "isSortLocaleAware"; type: "bool" }
89+ Property { name: "sortRole"; type: "int" }
90+ Property { name: "filterRole"; type: "int" }
91+ Method {
92+ name: "setFilterRegExp"
93+ Parameter { name: "pattern"; type: "string" }
94+ }
95+ Method {
96+ name: "setFilterWildcard"
97+ Parameter { name: "pattern"; type: "string" }
98+ }
99+ Method {
100+ name: "setFilterFixedString"
101+ Parameter { name: "pattern"; type: "string" }
102+ }
103+ Method { name: "clear" }
104+ Method { name: "invalidate" }
105+ }
106+ Component {
107+ name: "QSortFilterProxyModelQML"
108+ prototype: "QSortFilterProxyModel"
109+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
110+ Property { name: "totalCount"; type: "int"; isReadonly: true }
111+ Property { name: "count"; type: "int"; isReadonly: true }
112+ Property { name: "invertMatch"; type: "bool" }
113+ Signal {
114+ name: "invertMatchChanged"
115+ Parameter { type: "bool" }
116+ }
117+ Method {
118+ name: "get"
119+ type: "QVariantMap"
120+ Parameter { name: "row"; type: "int" }
121+ }
122+ Method {
123+ name: "data"
124+ type: "QVariant"
125+ Parameter { name: "row"; type: "int" }
126+ Parameter { name: "role"; type: "int" }
127+ }
128+ Method { name: "count"; type: "int" }
129+ Method {
130+ name: "findFirst"
131+ type: "int"
132+ Parameter { name: "role"; type: "int" }
133+ Parameter { name: "value"; type: "QVariant" }
134+ }
135+ Method {
136+ name: "mapRowToSource"
137+ type: "int"
138+ Parameter { name: "row"; type: "int" }
139+ }
140+ Method {
141+ name: "mapFromSource"
142+ type: "int"
143+ Parameter { name: "row"; type: "int" }
144+ }
145+ Method {
146+ name: "mapToSource"
147+ type: "int"
148+ Parameter { name: "row"; type: "int" }
149+ }
150+ }
151+ Component {
152+ name: "UserMetricsOutput::ColorTheme"
153+ prototype: "QObject"
154+ Property { name: "start"; type: "QColor"; isReadonly: true }
155+ Property { name: "main"; type: "QColor"; isReadonly: true }
156+ Property { name: "end"; type: "QColor"; isReadonly: true }
157+ Signal {
158+ name: "startChanged"
159+ Parameter { name: "color"; type: "QColor" }
160+ }
161+ Signal {
162+ name: "mainChanged"
163+ Parameter { name: "color"; type: "QColor" }
164+ }
165+ Signal {
166+ name: "endChanged"
167+ Parameter { name: "color"; type: "QColor" }
168+ }
169+ }
170+ Component {
171+ name: "UserMetricsOutput::UserMetrics"
172+ prototype: "QObject"
173+ exports: ["LightDM/Infographic 0.1"]
174+ isCreatable: false
175+ isSingleton: true
176+ exportMetaObjectRevisions: [0]
177+ Property { name: "label"; type: "string"; isReadonly: true }
178+ Property { name: "username"; type: "string" }
179+ Property {
180+ name: "firstColor"
181+ type: "UserMetricsOutput::ColorTheme"
182+ isReadonly: true
183+ isPointer: true
184+ }
185+ Property {
186+ name: "secondColor"
187+ type: "UserMetricsOutput::ColorTheme"
188+ isReadonly: true
189+ isPointer: true
190+ }
191+ Property { name: "firstMonth"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
192+ Property { name: "secondMonth"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true }
193+ Property { name: "currentDay"; type: "int"; isReadonly: true }
194+ Signal {
195+ name: "labelChanged"
196+ Parameter { name: "label"; type: "string" }
197+ }
198+ Signal {
199+ name: "usernameChanged"
200+ Parameter { name: "username"; type: "string" }
201+ }
202+ Signal {
203+ name: "firstColorChanged"
204+ Parameter { name: "color"; type: "ColorTheme"; isPointer: true }
205+ }
206+ Signal {
207+ name: "firstMonthChanged"
208+ Parameter { name: "firstMonth"; type: "QAbstractItemModel"; isPointer: true }
209+ }
210+ Signal {
211+ name: "currentDayChanged"
212+ Parameter { name: "currentDay"; type: "int" }
213+ }
214+ Signal {
215+ name: "secondColorChanged"
216+ Parameter { name: "color"; type: "ColorTheme"; isPointer: true }
217+ }
218+ Signal {
219+ name: "secondMonthChanged"
220+ Parameter { name: "secondMonth"; type: "QAbstractItemModel"; isPointer: true }
221+ }
222+ Signal { name: "nextDataSource" }
223+ Signal { name: "readyForDataChange" }
224+ Signal { name: "dataAboutToAppear" }
225+ Signal { name: "dataAppeared" }
226+ Signal { name: "dataAboutToChange" }
227+ Signal { name: "dataChanged" }
228+ Signal { name: "dataAboutToDisappear" }
229+ Signal { name: "dataDisappeared" }
230+ Method { name: "nextDataSourceSlot" }
231+ Method { name: "readyForDataChangeSlot" }
232+ }
233+ Component {
234+ name: "UsersModel"
235+ prototype: "QSortFilterProxyModelQML"
236+ exports: ["LightDM/Users 0.1"]
237+ isCreatable: false
238+ isSingleton: true
239+ exportMetaObjectRevisions: [0]
240+ }
241+}
tests/mocks/Powerd/Powerd.qmltypesnew file+46
@@ -0,0 +1,46 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Powerd 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "Powerd"
12+ prototype: "QObject"
13+ exports: ["Powerd/Powerd 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Enum {
18+ name: "DisplayFlag"
19+ values: {
20+ "UseProximity": 1,
21+ "DisableAutoBrightness": 2,
22+ "Bright": 4
23+ }
24+ }
25+ Enum {
26+ name: "DisplayFlags"
27+ values: {
28+ "UseProximity": 1,
29+ "DisableAutoBrightness": 2,
30+ "Bright": 4
31+ }
32+ }
33+ Enum {
34+ name: "Status"
35+ values: {
36+ "Off": 0,
37+ "On": 1
38+ }
39+ }
40+ Signal {
41+ name: "displayPowerStateChange"
42+ Parameter { name: "status"; type: "int" }
43+ Parameter { name: "flags"; type: "uint" }
44+ }
45+ }
46+}
tests/mocks/QMenuModel/QMenuModel.qmltypesnew file+77
@@ -0,0 +1,77 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable QMenuModel 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "ActionStateParser"
12+ prototype: "QObject"
13+ exports: ["QMenuModel/ActionStateParser 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ }
16+ Component {
17+ name: "UnityMenuModel"
18+ prototype: "QAbstractListModel"
19+ exports: ["QMenuModel/UnityMenuModel 0.1"]
20+ exportMetaObjectRevisions: [0]
21+ Property { name: "modelData"; type: "QVariant" }
22+ Property { name: "busName"; type: "QByteArray" }
23+ Property { name: "actions"; type: "QVariantMap" }
24+ Property { name: "menuObjectPath"; type: "QByteArray" }
25+ Property { name: "actionStateParser"; type: "ActionStateParser"; isPointer: true }
26+ Method {
27+ name: "insertRow"
28+ Parameter { name: "row"; type: "int" }
29+ Parameter { name: "data"; type: "QVariant" }
30+ }
31+ Method {
32+ name: "appendRow"
33+ Parameter { name: "data"; type: "QVariant" }
34+ }
35+ Method {
36+ name: "removeRow"
37+ Parameter { name: "row"; type: "int" }
38+ }
39+ Method {
40+ name: "submenu"
41+ type: "QObject*"
42+ Parameter { name: "position"; type: "int" }
43+ Parameter { name: "actionStateParser"; type: "QQmlComponent"; isPointer: true }
44+ }
45+ Method {
46+ name: "submenu"
47+ type: "QObject*"
48+ Parameter { name: "position"; type: "int" }
49+ }
50+ Method {
51+ name: "loadExtendedAttributes"
52+ type: "bool"
53+ Parameter { name: "position"; type: "int" }
54+ Parameter { name: "schema"; type: "QVariantMap" }
55+ }
56+ Method {
57+ name: "get"
58+ type: "QVariant"
59+ Parameter { name: "row"; type: "int" }
60+ Parameter { name: "role"; type: "QByteArray" }
61+ }
62+ Method {
63+ name: "activate"
64+ Parameter { name: "index"; type: "int" }
65+ Parameter { name: "parameter"; type: "QVariant" }
66+ }
67+ Method {
68+ name: "activate"
69+ Parameter { name: "index"; type: "int" }
70+ }
71+ Method {
72+ name: "changeState"
73+ Parameter { name: "index"; type: "int" }
74+ Parameter { name: "parameter"; type: "QVariant" }
75+ }
76+ }
77+}
tests/mocks/QtMultimedia/QtMultimedia.qmltypesnew file+52
@@ -0,0 +1,52 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable QtMultimedia 5.0 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "Audio"
12+ prototype: "QObject"
13+ exports: ["QtMultimedia/Audio 5.0"]
14+ exportMetaObjectRevisions: [0]
15+ Enum {
16+ name: "PlaybackState"
17+ values: {
18+ "PlayingState": 0,
19+ "PausedState": 1,
20+ "StoppedState": 2
21+ }
22+ }
23+ Property { name: "source"; type: "QUrl" }
24+ Property { name: "playbackState"; type: "PlaybackState"; isReadonly: true }
25+ Property { name: "position"; type: "int"; isReadonly: true }
26+ Property { name: "duration"; type: "int"; isReadonly: true }
27+ Property { name: "errorString"; type: "string"; isReadonly: true }
28+ Signal {
29+ name: "sourceChanged"
30+ Parameter { name: "source"; type: "QUrl" }
31+ }
32+ Signal {
33+ name: "playbackStateChanged"
34+ Parameter { name: "playbackState"; type: "PlaybackState" }
35+ }
36+ Signal {
37+ name: "positionChanged"
38+ Parameter { name: "position"; type: "int" }
39+ }
40+ Signal {
41+ name: "durationChanged"
42+ Parameter { name: "duration"; type: "int" }
43+ }
44+ Signal {
45+ name: "errorStringChanged"
46+ Parameter { name: "errorString"; type: "string" }
47+ }
48+ Method { name: "pause" }
49+ Method { name: "play" }
50+ Method { name: "stop" }
51+ }
52+}
tests/mocks/Ubuntu/CMakeLists.txt+1
@@ -1,2 +1,3 @@
11add_subdirectory(DownloadDaemonListener)
2+add_subdirectory(Payments)
23add_subdirectory(Thumbnailer)
tests/mocks/Ubuntu/DownloadDaemonListener/DownloadDaemonListener.qmltypesnew file+60
@@ -0,0 +1,60 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.DownloadDaemonListener 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "MockDownloadTracker"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.DownloadDaemonListener/DownloadTracker 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "service"; type: "string" }
16+ Property { name: "dbusPath"; type: "string" }
17+ Property { name: "serviceReady"; type: "bool"; isReadonly: true }
18+ Signal {
19+ name: "serviceChanged"
20+ Parameter { name: "service"; type: "string" }
21+ }
22+ Signal {
23+ name: "dbusPathChanged"
24+ Parameter { name: "dbusPath"; type: "string" }
25+ }
26+ Signal {
27+ name: "serviceReadyChanged"
28+ Parameter { name: "serviceReady"; type: "bool" }
29+ }
30+ Signal {
31+ name: "canceled"
32+ Parameter { name: "success"; type: "bool" }
33+ }
34+ Signal {
35+ name: "error"
36+ Parameter { name: "error"; type: "string" }
37+ }
38+ Signal {
39+ name: "finished"
40+ Parameter { name: "path"; type: "string" }
41+ }
42+ Signal {
43+ name: "paused"
44+ Parameter { name: "success"; type: "bool" }
45+ }
46+ Signal {
47+ name: "progress"
48+ Parameter { name: "received"; type: "qulonglong" }
49+ Parameter { name: "total"; type: "qulonglong" }
50+ }
51+ Signal {
52+ name: "resumed"
53+ Parameter { name: "success"; type: "bool" }
54+ }
55+ Signal {
56+ name: "started"
57+ Parameter { name: "success"; type: "bool" }
58+ }
59+ }
60+}
tests/mocks/Ubuntu/Payments/CMakeLists.txtnew file+10
@@ -0,0 +1,10 @@
1+set(FakeUbuntuPaymentsQml_SOURCES
2+ plugin.cpp
3+ MockPayments.cpp
4+ )
5+
6+add_library(FakeUbuntuPaymentsQml MODULE ${FakeUbuntuPaymentsQml_SOURCES})
7+
8+qt5_use_modules(FakeUbuntuPaymentsQml Qml Quick Core)
9+
10+add_unity8_mock(Ubuntu.Payments 0.1 Ubuntu/Payments TARGETS FakeUbuntuPaymentsQml)
tests/mocks/Ubuntu/Payments/MockPayments.cppnew file+89
@@ -0,0 +1,89 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "MockPayments.h"
18+
19+#include <QLocale>
20+
21+
22+MockPayments::MockPayments(QObject *parent)
23+ : QObject(parent)
24+{
25+}
26+
27+QString MockPayments::currency() const
28+{
29+ return m_currency;
30+}
31+
32+double MockPayments::price() const
33+{
34+ return m_price;
35+}
36+
37+QString MockPayments::storeItemId() const
38+{
39+ return m_store_item_id;
40+}
41+
42+QString MockPayments::formattedPrice() const
43+{
44+ QLocale locale;
45+ return locale.toCurrencyString(m_price, m_currency);
46+}
47+
48+void MockPayments::setCurrency(const QString &currency)
49+{
50+ if(m_currency != currency) {
51+ m_currency = currency;
52+ Q_EMIT currencyChanged(currency);
53+ Q_EMIT formattedPriceChanged(formattedPrice());
54+ }
55+}
56+
57+void MockPayments::setPrice(const double price)
58+{
59+ if(m_price != price) {
60+ m_price = price;
61+ Q_EMIT priceChanged(price);
62+ Q_EMIT formattedPriceChanged(formattedPrice());
63+ }
64+}
65+
66+void MockPayments::setStoreItemId(const QString &store_item_id)
67+{
68+ if (m_store_item_id != store_item_id) {
69+ m_store_item_id = store_item_id;
70+ Q_EMIT storeItemIdChanged(m_store_item_id);
71+ }
72+
73+ if (m_store_item_id.isEmpty()) {
74+ return;
75+ }
76+}
77+
78+void MockPayments::start()
79+{
80+ if (!m_store_item_id.isEmpty()) {
81+ if (m_store_item_id == "com.example.invalid") {
82+ Q_EMIT purchaseError("Purchase failed.");
83+ } else {
84+ Q_EMIT purchaseCompleted();
85+ }
86+ } else {
87+ Q_EMIT purchaseError("No item ID supplied.");
88+ }
89+}
tests/mocks/Ubuntu/Payments/MockPayments.hnew file+60
@@ -0,0 +1,60 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef MOCK_PAYMENTS_H
18+#define MOCK_PAYMENTS_H
19+
20+#include <QObject>
21+
22+
23+class MockPayments : public QObject
24+{
25+ Q_OBJECT
26+ Q_DISABLE_COPY(MockPayments)
27+ Q_PROPERTY(QString currency READ currency WRITE setCurrency NOTIFY currencyChanged)
28+ Q_PROPERTY(double price READ price WRITE setPrice NOTIFY priceChanged)
29+ Q_PROPERTY(QString storeItemId READ storeItemId WRITE setStoreItemId NOTIFY storeItemIdChanged)
30+ Q_PROPERTY(QString formattedPrice READ formattedPrice NOTIFY formattedPriceChanged)
31+
32+public:
33+ explicit MockPayments(QObject *parent = 0);
34+
35+ QString currency() const;
36+ double price() const;
37+ QString storeItemId() const;
38+ QString formattedPrice() const;
39+
40+ void setCurrency(const QString& currency);
41+ void setPrice(const double price);
42+ void setStoreItemId(const QString& store_item_id);
43+ Q_INVOKABLE void start();
44+
45+Q_SIGNALS:
46+ void currencyChanged(const QString& currency);
47+ void priceChanged(const double price);
48+ void storeItemIdChanged(const QString &store_item_id);
49+ void formattedPriceChanged(const QString &formatted_price);
50+
51+ void purchaseError(const QString &error);
52+ void purchaseCompleted();
53+
54+private:
55+ QString m_currency;
56+ double m_price;
57+ QString m_store_item_id;
58+};
59+
60+#endif // MOCK_PAYMENTS_H
tests/mocks/Ubuntu/Payments/Payments.qmltypesnew file+42
@@ -0,0 +1,42 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.Payments 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "MockPayments"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.Payments/Payments 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "currency"; type: "string" }
16+ Property { name: "price"; type: "double" }
17+ Property { name: "storeItemId"; type: "string" }
18+ Property { name: "formattedPrice"; type: "string"; isReadonly: true }
19+ Signal {
20+ name: "currencyChanged"
21+ Parameter { name: "currency"; type: "string" }
22+ }
23+ Signal {
24+ name: "priceChanged"
25+ Parameter { name: "price"; type: "double" }
26+ }
27+ Signal {
28+ name: "storeItemIdChanged"
29+ Parameter { name: "store_item_id"; type: "string" }
30+ }
31+ Signal {
32+ name: "formattedPriceChanged"
33+ Parameter { name: "formatted_price"; type: "string" }
34+ }
35+ Signal {
36+ name: "purchaseError"
37+ Parameter { name: "error"; type: "string" }
38+ }
39+ Signal { name: "purchaseCompleted" }
40+ Method { name: "start" }
41+ }
42+}
tests/mocks/Ubuntu/Payments/plugin.cppnew file+28
@@ -0,0 +1,28 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "plugin.h"
18+#include "MockPayments.h"
19+
20+#include <QtQml>
21+
22+
23+void BackendPlugin::registerTypes(const char *uri)
24+{
25+ Q_ASSERT(uri == QLatin1String("Ubuntu.Payments"));
26+
27+ qmlRegisterType<MockPayments>(uri, 0, 1, "Payments");
28+}
tests/mocks/Ubuntu/Payments/plugin.hnew file+31
@@ -0,0 +1,31 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef PAYMENTS_PLUGIN_H
18+#define PAYMENTS_PLUGIN_H
19+
20+#include <QQmlExtensionPlugin>
21+
22+class BackendPlugin : public QQmlExtensionPlugin
23+{
24+ Q_OBJECT
25+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26+
27+public:
28+ void registerTypes(const char *uri);
29+};
30+
31+#endif // PAYMENTS_PLUGIN_H
tests/mocks/Ubuntu/Payments/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module Ubuntu.Payments
2+plugin FakeUbuntuPaymentsQml
3+typeinfo Payments.qmltypes
tests/mocks/Ubuntu/Thumbnailer/Thumbnailer.qmltypesnew file+17
@@ -0,0 +1,17 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Ubuntu.Thumbnailer 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "QQmlTypeNotAvailable"
12+ prototype: "QObject"
13+ exports: ["Ubuntu.Thumbnailer/__ThumbnailerIgnoreMe 0.1"]
14+ isCreatable: false
15+ exportMetaObjectRevisions: [0]
16+ }
17+}
tests/mocks/Unity/Application/Application.qmltypesnew file+313
@@ -0,0 +1,313 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Application 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "ApplicationImage"
12+ defaultProperty: "data"
13+ prototype: "QQuickItem"
14+ exports: ["Unity.Application/ApplicationImage 0.1"]
15+ exportMetaObjectRevisions: [0]
16+ Enum {
17+ name: "FillMode"
18+ values: {
19+ "Stretch": 0,
20+ "PreserveAspectCrop": 1
21+ }
22+ }
23+ Property { name: "source"; type: "ApplicationInfo"; isPointer: true }
24+ Property { name: "fillMode"; type: "FillMode" }
25+ Property { name: "ready"; type: "bool" }
26+ Method { name: "scheduleUpdate" }
27+ Method { name: "updateFromCache" }
28+ }
29+ Component {
30+ name: "ApplicationInfo"
31+ prototype: "unity::shell::application::ApplicationInfoInterface"
32+ exports: ["Unity.Application/ApplicationInfo 0.1"]
33+ exportMetaObjectRevisions: [0]
34+ Property { name: "fullscreen"; type: "bool" }
35+ Property { name: "stage"; type: "Stage" }
36+ Property { name: "imageQml"; type: "string" }
37+ Property { name: "windowQml"; type: "string" }
38+ Signal { name: "appIdChanged" }
39+ Signal { name: "nameChanged" }
40+ Signal { name: "commentChanged" }
41+ Signal { name: "iconChanged" }
42+ Signal { name: "stateChanged" }
43+ Signal { name: "focusedChanged" }
44+ Signal { name: "screenshotChanged" }
45+ }
46+ Component {
47+ name: "ApplicationManager"
48+ prototype: "unity::shell::application::ApplicationManagerInterface"
49+ exports: ["Unity.Application/ApplicationManager 0.1"]
50+ isCreatable: false
51+ isSingleton: true
52+ exportMetaObjectRevisions: [0]
53+ Enum {
54+ name: "Role"
55+ values: {
56+ "Dash": 0,
57+ "Default": 1,
58+ "Indicators": 2,
59+ "Notifications": 3,
60+ "Greeter": 4,
61+ "Launcher": 5,
62+ "OnScreenKeyboard": 6,
63+ "ShutdownDialog": 7
64+ }
65+ }
66+ Enum {
67+ name: "StageHint"
68+ values: {
69+ "MainStage": 0,
70+ "IntegrationStage": 1,
71+ "ShareStage": 2,
72+ "ContentPickingStage": 3,
73+ "SideStage": 4,
74+ "ConfigurationStage": 5
75+ }
76+ }
77+ Enum {
78+ name: "FormFactorHint"
79+ values: {
80+ "DesktopFormFactor": 0,
81+ "PhoneFormFactor": 1,
82+ "TabletFormFactor": 2
83+ }
84+ }
85+ Enum {
86+ name: "FavoriteApplication"
87+ values: {
88+ "CameraApplication": 0,
89+ "GalleryApplication": 1,
90+ "BrowserApplication": 2,
91+ "ShareApplication": 3,
92+ "PhoneApplication": 4,
93+ "DialerApplication": 5,
94+ "MessagingApplication": 6,
95+ "AddressbookApplication": 7
96+ }
97+ }
98+ Enum {
99+ name: "ExecFlags"
100+ values: {
101+ "NoFlag": 0,
102+ "ForceMainStage": 1
103+ }
104+ }
105+ Property { name: "keyboardHeight"; type: "int"; isReadonly: true }
106+ Property { name: "keyboardVisible"; type: "bool"; isReadonly: true }
107+ Property { name: "sideStageWidth"; type: "int"; isReadonly: true }
108+ Property { name: "stageHint"; type: "StageHint"; isReadonly: true }
109+ Property { name: "formFactorHint"; type: "FormFactorHint"; isReadonly: true }
110+ Property { name: "fake"; type: "bool"; isReadonly: true }
111+ Property { name: "rightMargin"; type: "int" }
112+ Signal {
113+ name: "focusRequested"
114+ Parameter { name: "favoriteApplication"; type: "FavoriteApplication" }
115+ }
116+ Signal {
117+ name: "focusRequested"
118+ Parameter { name: "appId"; type: "string" }
119+ }
120+ Method {
121+ name: "get"
122+ type: "ApplicationInfo*"
123+ Parameter { name: "index"; type: "int" }
124+ }
125+ Method {
126+ name: "findApplication"
127+ type: "ApplicationInfo*"
128+ Parameter { name: "appId"; type: "string" }
129+ }
130+ Method {
131+ name: "move"
132+ Parameter { name: "from"; type: "int" }
133+ Parameter { name: "to"; type: "int" }
134+ }
135+ Method {
136+ name: "requestFocusApplication"
137+ type: "bool"
138+ Parameter { name: "appId"; type: "string" }
139+ }
140+ Method {
141+ name: "focusApplication"
142+ type: "bool"
143+ Parameter { name: "appId"; type: "string" }
144+ }
145+ Method { name: "unfocusCurrentApplication" }
146+ Method {
147+ name: "startApplication"
148+ type: "ApplicationInfo*"
149+ Parameter { name: "appId"; type: "string" }
150+ Parameter { name: "arguments"; type: "QStringList" }
151+ }
152+ Method {
153+ name: "startApplication"
154+ type: "ApplicationInfo*"
155+ Parameter { name: "appId"; type: "string" }
156+ }
157+ Method {
158+ name: "startApplication"
159+ type: "ApplicationInfo*"
160+ Parameter { name: "appId"; type: "string" }
161+ Parameter { name: "flags"; type: "ExecFlags" }
162+ Parameter { name: "arguments"; type: "QStringList" }
163+ }
164+ Method {
165+ name: "startApplication"
166+ type: "ApplicationInfo*"
167+ Parameter { name: "appId"; type: "string" }
168+ Parameter { name: "flags"; type: "ExecFlags" }
169+ }
170+ Method {
171+ name: "stopApplication"
172+ type: "bool"
173+ Parameter { name: "appId"; type: "string" }
174+ }
175+ Method {
176+ name: "updateScreenshot"
177+ type: "bool"
178+ Parameter { name: "appId"; type: "string" }
179+ }
180+ Method { name: "availableApplications"; type: "QStringList" }
181+ }
182+ Component {
183+ name: "unity::shell::application::ApplicationInfoInterface"
184+ prototype: "QObject"
185+ exports: ["Unity.Application/ApplicationInfoInterface 0.1"]
186+ isCreatable: false
187+ exportMetaObjectRevisions: [0]
188+ Enum {
189+ name: "Stage"
190+ values: {
191+ "MainStage": 0,
192+ "SideStage": 1
193+ }
194+ }
195+ Enum {
196+ name: "State"
197+ values: {
198+ "Starting": 0,
199+ "Running": 1,
200+ "Suspended": 2,
201+ "Stopped": 3
202+ }
203+ }
204+ Property { name: "appId"; type: "string"; isReadonly: true }
205+ Property { name: "name"; type: "string"; isReadonly: true }
206+ Property { name: "comment"; type: "string"; isReadonly: true }
207+ Property { name: "icon"; type: "QUrl"; isReadonly: true }
208+ Property { name: "stage"; type: "Stage"; isReadonly: true }
209+ Property { name: "state"; type: "State"; isReadonly: true }
210+ Property { name: "focused"; type: "bool"; isReadonly: true }
211+ Property { name: "screenshot"; type: "QUrl"; isReadonly: true }
212+ Signal {
213+ name: "nameChanged"
214+ Parameter { name: "name"; type: "string" }
215+ }
216+ Signal {
217+ name: "commentChanged"
218+ Parameter { name: "comment"; type: "string" }
219+ }
220+ Signal {
221+ name: "iconChanged"
222+ Parameter { name: "icon"; type: "QUrl" }
223+ }
224+ Signal {
225+ name: "stageChanged"
226+ Parameter { name: "stage"; type: "Stage" }
227+ }
228+ Signal {
229+ name: "stateChanged"
230+ Parameter { name: "state"; type: "State" }
231+ }
232+ Signal {
233+ name: "focusedChanged"
234+ Parameter { name: "focused"; type: "bool" }
235+ }
236+ Signal {
237+ name: "screenshotChanged"
238+ Parameter { name: "screenshot"; type: "QUrl" }
239+ }
240+ }
241+ Component {
242+ name: "unity::shell::application::ApplicationManagerInterface"
243+ prototype: "QAbstractListModel"
244+ exports: ["Unity.Application/ApplicationManagerInterface 0.1"]
245+ isCreatable: false
246+ exportMetaObjectRevisions: [0]
247+ Enum {
248+ name: "Roles"
249+ values: {
250+ "RoleAppId": 256,
251+ "RoleName": 257,
252+ "RoleComment": 258,
253+ "RoleIcon": 259,
254+ "RoleStage": 260,
255+ "RoleState": 261,
256+ "RoleFocused": 262,
257+ "RoleScreenshot": 263
258+ }
259+ }
260+ Property { name: "count"; type: "int"; isReadonly: true }
261+ Property { name: "focusedApplicationId"; type: "string"; isReadonly: true }
262+ Property { name: "suspended"; type: "bool" }
263+ Signal {
264+ name: "focusRequested"
265+ Parameter { name: "appId"; type: "string" }
266+ }
267+ Signal {
268+ name: "applicationAdded"
269+ Parameter { name: "appId"; type: "string" }
270+ }
271+ Signal {
272+ name: "applicationRemoved"
273+ Parameter { name: "appId"; type: "string" }
274+ }
275+ Method {
276+ name: "get"
277+ type: "unity::shell::application::ApplicationInfoInterface*"
278+ Parameter { name: "index"; type: "int" }
279+ }
280+ Method {
281+ name: "findApplication"
282+ type: "unity::shell::application::ApplicationInfoInterface*"
283+ Parameter { name: "appId"; type: "string" }
284+ }
285+ Method {
286+ name: "requestFocusApplication"
287+ type: "bool"
288+ Parameter { name: "appId"; type: "string" }
289+ }
290+ Method {
291+ name: "focusApplication"
292+ type: "bool"
293+ Parameter { name: "appId"; type: "string" }
294+ }
295+ Method { name: "unfocusCurrentApplication" }
296+ Method {
297+ name: "startApplication"
298+ type: "unity::shell::application::ApplicationInfoInterface*"
299+ Parameter { name: "appId"; type: "string" }
300+ Parameter { name: "arguments"; type: "QStringList" }
301+ }
302+ Method {
303+ name: "stopApplication"
304+ type: "bool"
305+ Parameter { name: "appId"; type: "string" }
306+ }
307+ Method {
308+ name: "updateScreenshot"
309+ type: "bool"
310+ Parameter { name: "appId"; type: "string" }
311+ }
312+ }
313+}
tests/mocks/Unity/Application/CMakeLists.txt+2−1
@@ -22,4 +22,5 @@ add_unity8_mock(Unity.Application 0.1 Unity/Application PREFIX mocks TARGETS Fak
2222add_unity8_mock(Unity.Application 0.1 Unity/Application
2323 PREFIX nonmirplugins
2424 TARGETS NonMirUnityApplicationQml
25− BINARY_DIR ${CMAKE_BINARY_DIR}/nonmirplugins)
25+ BINARY_DIR ${CMAKE_BINARY_DIR}/nonmirplugins
26+ NO_TYPES)
tests/mocks/Unity/Indicators/IndicatorBase.qmldeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import QMenuModel 0.1
22−
23−Item {
24− id: indicatorBase
25−
26− //const
27− property string busName
28− property string actionsObjectPath
29− property string menuObjectPath
30− property string rootMenuType: "com.canonical.indicator.root"
31− property string deviceMenuObjectPath: menuObjectPath
32−
33− property var menuModel: UnityMenuModel {}
34−
35− property RootActionState rootActionState: RootActionState {
36− onUpdated: indicatorBase.rootActionStateChanged()
37− }
38−}
tests/mocks/Unity/Indicators/Indicators.qmltypesnew file+210
@@ -0,0 +1,210 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Indicators 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "ActionState"
12+ prototype: "QObject"
13+ exports: ["Unity.Indicators/ActionState 0.1"]
14+ isCreatable: false
15+ exportMetaObjectRevisions: [0]
16+ Enum {
17+ name: "ActionStates"
18+ values: {
19+ "Label": 0,
20+ "IconSource": 1,
21+ "AccessableName": 2,
22+ "Visible": 3
23+ }
24+ }
25+ }
26+ Component {
27+ name: "FakeIndicatorsModel"
28+ prototype: "QAbstractListModel"
29+ exports: ["Unity.Indicators/FakeIndicatorsModel 0.1"]
30+ exportMetaObjectRevisions: [0]
31+ Property { name: "count"; type: "int"; isReadonly: true }
32+ Method {
33+ name: "load"
34+ Parameter { name: "profile"; type: "string" }
35+ }
36+ Method { name: "unload" }
37+ Method {
38+ name: "append"
39+ Parameter { name: "row"; type: "QVariantMap" }
40+ }
41+ Method {
42+ name: "data"
43+ type: "QVariant"
44+ Parameter { name: "row"; type: "int" }
45+ Parameter { name: "role"; type: "int" }
46+ }
47+ }
48+ Component {
49+ name: "FlatMenuProxyModelRole"
50+ prototype: "QObject"
51+ exports: ["Unity.Indicators/FlatMenuProxyModelRole 0.1"]
52+ isCreatable: false
53+ exportMetaObjectRevisions: [0]
54+ Enum {
55+ name: "Roles"
56+ values: {
57+ "Action": 1,
58+ "Label": 2,
59+ "Extra": 3,
60+ "Depth": 4,
61+ "hasSection": 5,
62+ "hasSubMenu": 6
63+ }
64+ }
65+ }
66+ Component {
67+ name: "IndicatorsModelRole"
68+ prototype: "QObject"
69+ exports: ["Unity.Indicators/IndicatorsModelRole 0.1"]
70+ isCreatable: false
71+ exportMetaObjectRevisions: [0]
72+ Enum {
73+ name: "Roles"
74+ values: {
75+ "Identifier": 0,
76+ "Position": 1,
77+ "WidgetSource": 2,
78+ "PageSource": 3,
79+ "IndicatorProperties": 4,
80+ "IsVisible": 5
81+ }
82+ }
83+ }
84+ Component {
85+ name: "MenuContentActivator"
86+ prototype: "QObject"
87+ exports: ["Unity.Indicators/MenuContentActivator 0.1"]
88+ exportMetaObjectRevisions: [0]
89+ Property { name: "baseIndex"; type: "int" }
90+ Property { name: "running"; type: "bool" }
91+ Property { name: "count"; type: "int" }
92+ Property { name: "content"; type: "MenuContentState"; isList: true; isReadonly: true }
93+ Signal {
94+ name: "baseIndexChanged"
95+ Parameter { name: "baseIndex"; type: "int" }
96+ }
97+ Signal {
98+ name: "deltaChanged"
99+ Parameter { name: "delta"; type: "int" }
100+ }
101+ Signal {
102+ name: "runningChanged"
103+ Parameter { name: "running"; type: "bool" }
104+ }
105+ Signal {
106+ name: "countChanged"
107+ Parameter { name: "count"; type: "int" }
108+ }
109+ Method { name: "restart" }
110+ Method { name: "stop" }
111+ Method { name: "clear" }
112+ Method {
113+ name: "isMenuContentActive"
114+ type: "bool"
115+ Parameter { name: "index"; type: "int" }
116+ }
117+ }
118+ Component {
119+ name: "MenuContentState"
120+ prototype: "QObject"
121+ exports: ["Unity.Indicators/MenuContentState 0.1"]
122+ isCreatable: false
123+ exportMetaObjectRevisions: [0]
124+ Property { name: "active"; type: "bool"; isReadonly: true }
125+ }
126+ Component {
127+ name: "NetworkActionState"
128+ prototype: "QObject"
129+ exports: ["Unity.Indicators/NetworkActionState 0.1"]
130+ isCreatable: false
131+ exportMetaObjectRevisions: [0]
132+ Enum {
133+ name: "NetworkActionStates"
134+ values: {
135+ "Connection": 1,
136+ "SignalStrength": 2
137+ }
138+ }
139+ }
140+ Component {
141+ name: "NetworkConnection"
142+ prototype: "QObject"
143+ exports: ["Unity.Indicators/NetworkConnection 0.1"]
144+ isCreatable: false
145+ exportMetaObjectRevisions: [0]
146+ Enum {
147+ name: "NetworkConnectionStates"
148+ values: {
149+ "Initial": 0,
150+ "Activating": 1,
151+ "Activated": 2,
152+ "Deactivating": 3
153+ }
154+ }
155+ }
156+ Component {
157+ name: "QAbstractProxyModel"
158+ prototype: "QAbstractItemModel"
159+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
160+ }
161+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
162+ Component {
163+ name: "UnityMenuModelStack"
164+ prototype: "QObject"
165+ exports: ["Unity.Indicators/UnityMenuModelStack 0.1"]
166+ exportMetaObjectRevisions: [0]
167+ Property { name: "head"; type: "UnityMenuModel"; isPointer: true }
168+ Property { name: "tail"; type: "UnityMenuModel"; isReadonly: true; isPointer: true }
169+ Property { name: "count"; type: "int"; isReadonly: true }
170+ Signal {
171+ name: "headChanged"
172+ Parameter { name: "head"; type: "UnityMenuModel"; isPointer: true }
173+ }
174+ Signal {
175+ name: "tailChanged"
176+ Parameter { name: "tail"; type: "UnityMenuModel"; isPointer: true }
177+ }
178+ Signal {
179+ name: "countChanged"
180+ Parameter { name: "count"; type: "int" }
181+ }
182+ Method {
183+ name: "push"
184+ Parameter { name: "model"; type: "UnityMenuModel"; isPointer: true }
185+ Parameter { name: "menuIndex"; type: "int" }
186+ }
187+ Method { name: "pop"; type: "UnityMenuModel*" }
188+ }
189+ Component {
190+ name: "VisibleIndicatorsModel"
191+ prototype: "QIdentityProxyModel"
192+ exports: ["Unity.Indicators/VisibleIndicatorsModel 0.1"]
193+ exportMetaObjectRevisions: [0]
194+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
195+ Property { name: "visible"; type: "QVariantMap" }
196+ Signal { name: "totalCountChanged" }
197+ Method {
198+ name: "onBeginRowInserted"
199+ Parameter { type: "QModelIndex" }
200+ Parameter { name: "start"; type: "int" }
201+ Parameter { name: "end"; type: "int" }
202+ }
203+ Method {
204+ name: "onRowInserted"
205+ Parameter { type: "QModelIndex" }
206+ Parameter { name: "start"; type: "int" }
207+ Parameter { name: "end"; type: "int" }
208+ }
209+ }
210+}
tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp+1−1
@@ -31,7 +31,7 @@ FakeIndicatorsModel::FakeIndicatorsModel(QObject *parent)
3131/*! \internal */
3232FakeIndicatorsModel::~FakeIndicatorsModel()
3333{
34− unload();
34+ qDeleteAll(m_indicators);
3535}
3636
3737int FakeIndicatorsModel::count() const
tests/mocks/Unity/Indicators/qmldir−2
@@ -3,8 +3,6 @@ plugin IndicatorsFakeQml
33typeinfo Indicators.qmltypes
44
55CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
6−IndicatorBase 0.1 IndicatorBase.qml
76IndicatorsModel 0.1 IndicatorsModel.qml
87FakeMenuPage 0.1 FakeMenuPage.qml
9−MenuItemFactory 0.1 MenuItemFactory.qml
108RootActionState 0.1 RootActionState.qml
tests/mocks/Unity/Launcher/Launcher.qmltypesnew file+171
@@ -0,0 +1,171 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Launcher 0.1 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "MockLauncherItem"
12+ prototype: "unity::shell::launcher::LauncherItemInterface"
13+ exports: ["Unity.Launcher/LauncherItem 0.1"]
14+ isCreatable: false
15+ exportMetaObjectRevisions: [0]
16+ }
17+ Component {
18+ name: "MockLauncherModel"
19+ prototype: "unity::shell::launcher::LauncherModelInterface"
20+ exports: ["Unity.Launcher/LauncherModel 0.1"]
21+ isCreatable: false
22+ isSingleton: true
23+ exportMetaObjectRevisions: [0]
24+ Signal {
25+ name: "quickListTriggered"
26+ Parameter { name: "appId"; type: "string" }
27+ Parameter { name: "index"; type: "int" }
28+ }
29+ Method {
30+ name: "get"
31+ type: "unity::shell::launcher::LauncherItemInterface*"
32+ Parameter { name: "index"; type: "int" }
33+ }
34+ Method {
35+ name: "move"
36+ Parameter { name: "oldIndex"; type: "int" }
37+ Parameter { name: "newIndex"; type: "int" }
38+ }
39+ Method {
40+ name: "pin"
41+ Parameter { name: "appId"; type: "string" }
42+ Parameter { name: "index"; type: "int" }
43+ }
44+ Method {
45+ name: "pin"
46+ Parameter { name: "appId"; type: "string" }
47+ }
48+ Method {
49+ name: "requestRemove"
50+ Parameter { name: "appId"; type: "string" }
51+ }
52+ Method {
53+ name: "quickListActionInvoked"
54+ Parameter { name: "appId"; type: "string" }
55+ Parameter { name: "actionIndex"; type: "int" }
56+ }
57+ Method {
58+ name: "setUser"
59+ Parameter { name: "username"; type: "string" }
60+ }
61+ Method {
62+ name: "getUrlForAppId"
63+ type: "string"
64+ Parameter { name: "appId"; type: "string" }
65+ }
66+ }
67+ Component {
68+ name: "MockQuickListModel"
69+ prototype: "unity::shell::launcher::QuickListModelInterface"
70+ exports: ["Unity.Launcher/QuickListModel 0.1"]
71+ isCreatable: false
72+ exportMetaObjectRevisions: [0]
73+ }
74+ Component {
75+ name: "unity::shell::launcher::LauncherItemInterface"
76+ prototype: "QObject"
77+ exports: ["Unity.Launcher/LauncherItemInterface 0.1"]
78+ isCreatable: false
79+ exportMetaObjectRevisions: [0]
80+ Property { name: "appId"; type: "string"; isReadonly: true }
81+ Property { name: "name"; type: "string"; isReadonly: true }
82+ Property { name: "icon"; type: "string"; isReadonly: true }
83+ Property { name: "pinned"; type: "bool"; isReadonly: true }
84+ Property { name: "running"; type: "bool"; isReadonly: true }
85+ Property { name: "recent"; type: "bool"; isReadonly: true }
86+ Property { name: "progress"; type: "int"; isReadonly: true }
87+ Property { name: "count"; type: "int"; isReadonly: true }
88+ Property { name: "focused"; type: "bool"; isReadonly: true }
89+ Property {
90+ name: "quickList"
91+ type: "unity::shell::launcher::QuickListModelInterface"
92+ isReadonly: true
93+ isPointer: true
94+ }
95+ Signal {
96+ name: "pinnedChanged"
97+ Parameter { name: "pinned"; type: "bool" }
98+ }
99+ Signal {
100+ name: "runningChanged"
101+ Parameter { name: "running"; type: "bool" }
102+ }
103+ Signal {
104+ name: "recentChanged"
105+ Parameter { name: "running"; type: "bool" }
106+ }
107+ Signal {
108+ name: "progressChanged"
109+ Parameter { name: "progress"; type: "int" }
110+ }
111+ Signal {
112+ name: "countChanged"
113+ Parameter { name: "count"; type: "int" }
114+ }
115+ Signal {
116+ name: "focusedChanged"
117+ Parameter { name: "focused"; type: "bool" }
118+ }
119+ }
120+ Component {
121+ name: "unity::shell::launcher::LauncherModelInterface"
122+ prototype: "QAbstractListModel"
123+ exports: ["Unity.Launcher/LauncherModelInterface 0.1"]
124+ isCreatable: false
125+ exportMetaObjectRevisions: [0]
126+ Property {
127+ name: "applicationManager"
128+ type: "unity::shell::application::ApplicationManagerInterface"
129+ isPointer: true
130+ }
131+ Method {
132+ name: "move"
133+ Parameter { name: "oldIndex"; type: "int" }
134+ Parameter { name: "newIndex"; type: "int" }
135+ }
136+ Method {
137+ name: "get"
138+ type: "unity::shell::launcher::LauncherItemInterface*"
139+ Parameter { name: "index"; type: "int" }
140+ }
141+ Method {
142+ name: "pin"
143+ Parameter { name: "appId"; type: "string" }
144+ Parameter { name: "index"; type: "int" }
145+ }
146+ Method {
147+ name: "pin"
148+ Parameter { name: "appId"; type: "string" }
149+ }
150+ Method {
151+ name: "requestRemove"
152+ Parameter { name: "appId"; type: "string" }
153+ }
154+ Method {
155+ name: "quickListActionInvoked"
156+ Parameter { name: "appId"; type: "string" }
157+ Parameter { name: "actionIndex"; type: "int" }
158+ }
159+ Method {
160+ name: "setUser"
161+ Parameter { name: "username"; type: "string" }
162+ }
163+ }
164+ Component {
165+ name: "unity::shell::launcher::QuickListModelInterface"
166+ prototype: "QAbstractListModel"
167+ exports: ["Unity.Launcher/QuickListModelInterface 0.1"]
168+ isCreatable: false
169+ exportMetaObjectRevisions: [0]
170+ }
171+}
tests/mocks/Unity/Notifications/Notifications.qmltypesnew file+10
@@ -0,0 +1,10 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Notifications 1.0 tests/mocks'
8+
9+Module {
10+}
tests/mocks/Unity/Unity.qmltypesnew file+345
@@ -0,0 +1,345 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity 0.2 tests/mocks'
8+
9+Module {
10+ Component {
11+ name: "Categories"
12+ prototype: "unity::shell::scopes::CategoriesInterface"
13+ Method {
14+ name: "addSpecialCategory"
15+ Parameter { name: "categoryId"; type: "string" }
16+ Parameter { name: "name"; type: "string" }
17+ Parameter { name: "icon"; type: "string" }
18+ Parameter { name: "rawTemplate"; type: "string" }
19+ Parameter { name: "countObject"; type: "QObject"; isPointer: true }
20+ }
21+ Method {
22+ name: "overrideCategoryJson"
23+ type: "bool"
24+ Parameter { name: "categoryId"; type: "string" }
25+ Parameter { name: "json"; type: "string" }
26+ }
27+ }
28+ Component {
29+ name: "PreviewModel"
30+ prototype: "unity::shell::scopes::PreviewModelInterface"
31+ exports: ["Unity/FakePreviewModel 0.2"]
32+ exportMetaObjectRevisions: [0]
33+ }
34+ Component {
35+ name: "PreviewStack"
36+ prototype: "unity::shell::scopes::PreviewStackInterface"
37+ exports: ["Unity/PreviewStack 0.2"]
38+ isCreatable: false
39+ exportMetaObjectRevisions: [0]
40+ Method {
41+ name: "getPreviewModel"
42+ type: "unity::shell::scopes::PreviewModelInterface*"
43+ Parameter { name: "index"; type: "int" }
44+ }
45+ }
46+ Component {
47+ name: "PreviewWidgetModel"
48+ prototype: "unity::shell::scopes::PreviewWidgetModelInterface"
49+ exports: ["Unity/PreviewWidgetModel 0.2"]
50+ isCreatable: false
51+ exportMetaObjectRevisions: [0]
52+ }
53+ Component {
54+ name: "ResultsModel"
55+ prototype: "unity::shell::scopes::ResultsModelInterface"
56+ exports: ["Unity/ResultsModel 0.2"]
57+ isCreatable: false
58+ exportMetaObjectRevisions: [0]
59+ }
60+ Component {
61+ name: "Scope"
62+ prototype: "unity::shell::scopes::ScopeInterface"
63+ exports: ["Unity/MockScope 0.2"]
64+ exportMetaObjectRevisions: [0]
65+ Method {
66+ name: "setSearchInProgress"
67+ Parameter { name: "inProg"; type: "bool" }
68+ }
69+ Method {
70+ name: "activate"
71+ Parameter { name: "result"; type: "QVariant" }
72+ }
73+ Method {
74+ name: "preview"
75+ type: "PreviewStack*"
76+ Parameter { name: "result"; type: "QVariant" }
77+ }
78+ Method { name: "cancelActivation" }
79+ Method {
80+ name: "closeScope"
81+ Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
82+ }
83+ Method {
84+ name: "getDepartment"
85+ type: "unity::shell::scopes::DepartmentInterface*"
86+ Parameter { name: "id"; type: "string" }
87+ }
88+ Method {
89+ name: "loadDepartment"
90+ Parameter { name: "id"; type: "string" }
91+ }
92+ }
93+ Component {
94+ name: "Scopes"
95+ prototype: "unity::shell::scopes::ScopesInterface"
96+ exports: ["Unity/Scopes 0.2"]
97+ exportMetaObjectRevisions: [0]
98+ Method {
99+ name: "rowCount"
100+ type: "int"
101+ Parameter { name: "parent"; type: "QModelIndex" }
102+ }
103+ Method { name: "rowCount"; type: "int" }
104+ Method {
105+ name: "getScope"
106+ type: "unity::shell::scopes::ScopeInterface*"
107+ Parameter { name: "row"; type: "int" }
108+ }
109+ Method {
110+ name: "getScope"
111+ type: "unity::shell::scopes::ScopeInterface*"
112+ Parameter { name: "scope_id"; type: "string" }
113+ }
114+ Method {
115+ name: "addScope"
116+ Parameter { name: "scope"; type: "Scope"; isPointer: true }
117+ }
118+ Method { name: "clear" }
119+ Method { name: "load" }
120+ }
121+ Component {
122+ name: "unity::shell::scopes::CategoriesInterface"
123+ prototype: "QAbstractListModel"
124+ exports: ["Unity/Categories 0.2"]
125+ isCreatable: false
126+ exportMetaObjectRevisions: [0]
127+ Enum {
128+ name: "Roles"
129+ values: {
130+ "RoleCategoryId": 0,
131+ "RoleName": 1,
132+ "RoleIcon": 2,
133+ "RoleRawRendererTemplate": 3,
134+ "RoleRenderer": 4,
135+ "RoleComponents": 5,
136+ "RoleResults": 6,
137+ "RoleCount": 7
138+ }
139+ }
140+ Method {
141+ name: "overrideCategoryJson"
142+ type: "bool"
143+ Parameter { name: "categoryId"; type: "string" }
144+ Parameter { name: "json"; type: "string" }
145+ }
146+ Method {
147+ name: "addSpecialCategory"
148+ Parameter { name: "categoryId"; type: "string" }
149+ Parameter { name: "name"; type: "string" }
150+ Parameter { name: "icon"; type: "string" }
151+ Parameter { name: "rawTemplate"; type: "string" }
152+ Parameter { name: "countObject"; type: "QObject"; isPointer: true }
153+ }
154+ }
155+ Component {
156+ name: "unity::shell::scopes::DepartmentInterface"
157+ prototype: "QAbstractListModel"
158+ exports: ["Unity/Department 0.2"]
159+ isCreatable: false
160+ exportMetaObjectRevisions: [0]
161+ Enum {
162+ name: "Roles"
163+ values: {
164+ "RoleDepartmentId": 0,
165+ "RoleLabel": 1,
166+ "RoleHasChildren": 2,
167+ "RoleIsActive": 3
168+ }
169+ }
170+ Property { name: "departmentId"; type: "string"; isReadonly: true }
171+ Property { name: "label"; type: "string"; isReadonly: true }
172+ Property { name: "allLabel"; type: "string"; isReadonly: true }
173+ Property { name: "parentDepartmentId"; type: "string"; isReadonly: true }
174+ Property { name: "parentLabel"; type: "string"; isReadonly: true }
175+ Property { name: "loaded"; type: "bool"; isReadonly: true }
176+ Property { name: "isRoot"; type: "bool"; isReadonly: true }
177+ Property { name: "count"; type: "int"; isReadonly: true }
178+ }
179+ Component {
180+ name: "unity::shell::scopes::PreviewModelInterface"
181+ prototype: "QAbstractListModel"
182+ Enum {
183+ name: "Roles"
184+ values: {
185+ "RoleColumnModel": 0
186+ }
187+ }
188+ Property { name: "widgetColumnCount"; type: "int" }
189+ Property { name: "loaded"; type: "bool"; isReadonly: true }
190+ Property { name: "processingAction"; type: "bool"; isReadonly: true }
191+ Signal {
192+ name: "triggered"
193+ Parameter { type: "string" }
194+ Parameter { type: "string" }
195+ Parameter { type: "QVariantMap" }
196+ }
197+ }
198+ Component {
199+ name: "unity::shell::scopes::PreviewStackInterface"
200+ prototype: "QAbstractListModel"
201+ Enum {
202+ name: "Roles"
203+ values: {
204+ "RolePreviewModel": 0
205+ }
206+ }
207+ Property { name: "widgetColumnCount"; type: "int" }
208+ Method {
209+ name: "getPreviewModel"
210+ type: "unity::shell::scopes::PreviewModelInterface*"
211+ Parameter { name: "index"; type: "int" }
212+ }
213+ }
214+ Component {
215+ name: "unity::shell::scopes::PreviewWidgetModelInterface"
216+ prototype: "QAbstractListModel"
217+ Enum {
218+ name: "Roles"
219+ values: {
220+ "RoleWidgetId": 0,
221+ "RoleType": 1,
222+ "RoleProperties": 2
223+ }
224+ }
225+ }
226+ Component {
227+ name: "unity::shell::scopes::ResultsModelInterface"
228+ prototype: "QAbstractListModel"
229+ Enum {
230+ name: "Roles"
231+ values: {
232+ "RoleUri": 0,
233+ "RoleCategoryId": 1,
234+ "RoleDndUri": 2,
235+ "RoleResult": 3,
236+ "RoleTitle": 4,
237+ "RoleArt": 5,
238+ "RoleSubtitle": 6,
239+ "RoleMascot": 7,
240+ "RoleEmblem": 8,
241+ "RoleSummary": 9,
242+ "RoleAttributes": 10,
243+ "RoleBackground": 11
244+ }
245+ }
246+ Property { name: "categoryId"; type: "string" }
247+ Property { name: "count"; type: "int"; isReadonly: true }
248+ }
249+ Component {
250+ name: "unity::shell::scopes::ScopeInterface"
251+ prototype: "QObject"
252+ exports: ["Unity/Scope 0.2"]
253+ isCreatable: false
254+ exportMetaObjectRevisions: [0]
255+ Property { name: "id"; type: "string"; isReadonly: true }
256+ Property { name: "name"; type: "string"; isReadonly: true }
257+ Property { name: "iconHint"; type: "string"; isReadonly: true }
258+ Property { name: "description"; type: "string"; isReadonly: true }
259+ Property { name: "searchHint"; type: "string"; isReadonly: true }
260+ Property { name: "searchInProgress"; type: "bool"; isReadonly: true }
261+ Property { name: "visible"; type: "bool"; isReadonly: true }
262+ Property { name: "shortcut"; type: "string"; isReadonly: true }
263+ Property {
264+ name: "categories"
265+ type: "unity::shell::scopes::CategoriesInterface"
266+ isReadonly: true
267+ isPointer: true
268+ }
269+ Property { name: "searchQuery"; type: "string" }
270+ Property { name: "noResultsHint"; type: "string" }
271+ Property { name: "formFactor"; type: "string" }
272+ Property { name: "isActive"; type: "bool" }
273+ Property { name: "currentDepartmentId"; type: "string"; isReadonly: true }
274+ Property { name: "hasDepartments"; type: "bool"; isReadonly: true }
275+ Signal { name: "showDash" }
276+ Signal { name: "hideDash" }
277+ Signal {
278+ name: "gotoUri"
279+ Parameter { name: "uri"; type: "string" }
280+ }
281+ Signal {
282+ name: "previewRequested"
283+ Parameter { name: "result"; type: "QVariant" }
284+ }
285+ Signal {
286+ name: "gotoScope"
287+ Parameter { name: "scopeId"; type: "string" }
288+ }
289+ Signal {
290+ name: "openScope"
291+ Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
292+ }
293+ Signal {
294+ name: "activateApplication"
295+ Parameter { name: "desktop"; type: "string" }
296+ }
297+ Method {
298+ name: "activate"
299+ Parameter { name: "result"; type: "QVariant" }
300+ }
301+ Method {
302+ name: "preview"
303+ type: "unity::shell::scopes::PreviewStackInterface*"
304+ Parameter { name: "result"; type: "QVariant" }
305+ }
306+ Method { name: "cancelActivation" }
307+ Method {
308+ name: "closeScope"
309+ Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
310+ }
311+ Method {
312+ name: "getDepartment"
313+ type: "unity::shell::scopes::DepartmentInterface*"
314+ Parameter { name: "departmentId"; type: "string" }
315+ }
316+ Method {
317+ name: "loadDepartment"
318+ Parameter { name: "departmentId"; type: "string" }
319+ }
320+ }
321+ Component {
322+ name: "unity::shell::scopes::ScopesInterface"
323+ prototype: "QAbstractListModel"
324+ Enum {
325+ name: "Roles"
326+ values: {
327+ "RoleScope": 0,
328+ "RoleId": 1,
329+ "RoleVisible": 2,
330+ "RoleTitle": 3
331+ }
332+ }
333+ Property { name: "loaded"; type: "bool"; isReadonly: true }
334+ Method {
335+ name: "getScope"
336+ type: "unity::shell::scopes::ScopeInterface*"
337+ Parameter { name: "row"; type: "int" }
338+ }
339+ Method {
340+ name: "getScope"
341+ type: "unity::shell::scopes::ScopeInterface*"
342+ Parameter { name: "scopeId"; type: "string" }
343+ }
344+ }
345+}
tests/qmltests/CMakeLists.txt+1
@@ -46,6 +46,7 @@ add_qml_test(Dash/Previews PreviewActions)
4646add_qml_test(Dash/Previews PreviewAudioPlayback)
4747add_qml_test(Dash/Previews PreviewHeader)
4848add_qml_test(Dash/Previews PreviewImageGallery)
49+add_qml_test(Dash/Previews PreviewPayments)
4950add_qml_test(Dash/Previews PreviewProgress)
5051add_qml_test(Dash/Previews PreviewRatingDisplay)
5152add_qml_test(Dash/Previews PreviewRatingInput)
tests/qmltests/Dash/Previews/tst_PreviewPayments.qmlnew file+100
@@ -0,0 +1,100 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import "../../../../qml/Dash/Previews"
20+import Unity.Test 0.1 as UT
21+import Ubuntu.Components 0.1
22+
23+Rectangle {
24+ id: root
25+ width: units.gu(60)
26+ height: units.gu(80)
27+
28+ property var jsonPurchase: {
29+ "source": { "price" : 0.99, "currency": "USD", "store_item_id": "com.example.package" }
30+ }
31+
32+ property var jsonPurchaseError: {
33+ "source": { "price" : 0.99, "currency": "USD", "store_item_id": "com.example.invalid" }
34+ }
35+
36+ SignalSpy {
37+ id: spy
38+ target: previewPayments
39+ signalName: "triggered"
40+ }
41+
42+ PreviewPayments {
43+ id: previewPayments
44+ widgetId: "previewPayments"
45+ width: units.gu(30)
46+ }
47+
48+ UT.UnityTestCase {
49+ name: "PreviewPaymentsTest"
50+ when: windowShown
51+
52+ function cleanup()
53+ {
54+ spy.clear();
55+ }
56+
57+ function test_purchase_text_display() {
58+ previewPayments.widgetData = jsonPurchase;
59+
60+ var button = findChild(root, "paymentButton");
61+ verify(button != null, "Button not found.");
62+ compare(button.text, "0.99USD");
63+ }
64+
65+ function test_purchase_completed() {
66+ // Exercise the purchaseCompleted signal here.
67+ previewPayments.widgetData = jsonPurchase;
68+
69+ var button = findChild(root, "paymentButton");
70+ verify(button != null, "Button not found.");
71+
72+ mouseClick(button, button.width / 2, button.height / 2);
73+
74+ spy.wait();
75+
76+ var args = spy.signalArguments[0];
77+ compare(args[0], "previewPayments");
78+ compare(args[1], "purchaseCompleted");
79+ compare(args[2], jsonPurchase["source"]);
80+ }
81+
82+ function test_purchase_error() {
83+ // The mock Payments triggers an error when com.example.invalid is
84+ // passed to it as store_item_id. Exercise it here
85+ previewPayments.widgetData = jsonPurchaseError;
86+
87+ var button = findChild(root, "paymentButton");
88+ verify(button != null, "Button not found.");
89+
90+ mouseClick(button, button.width / 2, button.height / 2);
91+
92+ spy.wait();
93+
94+ var args = spy.signalArguments[0];
95+ compare(args[0], "previewPayments");
96+ compare(args[1], "purchaseError");
97+ compare(args[2], jsonPurchaseError["source"]);
98+ }
99+ }
100+}
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml+1
@@ -31,6 +31,7 @@ Item {
3131 anchors.fill: parent
3232 contentActive: true
3333
34+ menuModel: UnityMenuModel {}
3435 busName: "test"
3536 actionsObjectPath: "test"
3637 menuObjectPath: "test"
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml+1
@@ -33,6 +33,7 @@ Item {
3333 top: parent.top
3434 }
3535
36+ menuModel: UnityMenuModel {}
3637 busName: "test"
3738 actionsObjectPath: "test"
3839 deviceMenuObjectPath: "test"
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+3−2
@@ -18,15 +18,16 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import QMenuModel 0.1
21−import Unity.Indicators 0.1 as Indicators
2221import Utils 0.1 as Utils
22+import "../../../../qml/Panel/Indicators"
23+
2324
2425Item {
2526 id: testView
2627 width: units.gu(40)
2728 height: units.gu(70)
2829
29− Indicators.MenuItemFactory {
30+ MenuItemFactory {
3031 id: factory
3132 menuModel: UnityMenuModel {}
3233 }
tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml+2−2
@@ -18,15 +18,15 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import QMenuModel 0.1
21−import Unity.Indicators 0.1 as Indicators
2221import Utils 0.1 as Utils
22+import "../../../../qml/Panel/Indicators"
2323
2424Item {
2525 id: testView
2626 width: units.gu(40)
2727 height: units.gu(70)
2828
29− Indicators.MessageMenuItemFactory {
29+ MessageMenuItemFactory {
3030 id: factory
3131 menuModel: UnityMenuModel {}
3232 menuIndex: 0
tests/utils/modules/Unity/Test/Test.qmltypesnew file+59
@@ -0,0 +1,59 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Unity.Test 0.1 tests/utils/modules'
8+
9+Module {
10+ Component {
11+ name: "TestUtil"
12+ prototype: "QObject"
13+ exports: ["Unity.Test/Util 0.1"]
14+ isCreatable: false
15+ isSingleton: true
16+ exportMetaObjectRevisions: [0]
17+ Method {
18+ name: "isInstanceOf"
19+ type: "bool"
20+ Parameter { type: "QObject"; isPointer: true }
21+ Parameter { type: "string" }
22+ }
23+ Method { name: "touchEvent"; type: "TouchEventSequenceWrapper*" }
24+ }
25+ Component {
26+ name: "TouchEventSequenceWrapper"
27+ prototype: "QObject"
28+ exports: ["Unity.Test/TouchEventSequence 0.1"]
29+ isCreatable: false
30+ exportMetaObjectRevisions: [0]
31+ Method {
32+ name: "commit"
33+ Parameter { name: "processEvents"; type: "bool" }
34+ }
35+ Method { name: "commit" }
36+ Method {
37+ name: "move"
38+ Parameter { name: "touchId"; type: "int" }
39+ Parameter { name: "x"; type: "int" }
40+ Parameter { name: "y"; type: "int" }
41+ }
42+ Method {
43+ name: "press"
44+ Parameter { name: "touchId"; type: "int" }
45+ Parameter { name: "x"; type: "int" }
46+ Parameter { name: "y"; type: "int" }
47+ }
48+ Method {
49+ name: "release"
50+ Parameter { name: "touchId"; type: "int" }
51+ Parameter { name: "x"; type: "int" }
52+ Parameter { name: "y"; type: "int" }
53+ }
54+ Method {
55+ name: "stationary"
56+ Parameter { name: "touchId"; type: "int" }
57+ }
58+ }
59+}
tests/whitespace/check_whitespace.py+22−12
@@ -1,7 +1,7 @@
11#! /usr/bin/env python3
22
33#
4−# Copyright (C) 2013 Canonical Ltd
4+# Copyright (C) 2013, 2014 Canonical Ltd
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License version 3 as
@@ -19,8 +19,8 @@
1919#
2020
2121#
22−# Little helper program to test that source files do not contain trailing whitespace
23−# or tab indentation.
22+# Little helper program to test that source files do not contain trailing
23+# whitespace or tab indentation.
2424#
2525# Usage: check_whitespace.py directory [ignore_prefix]
2626#
@@ -31,18 +31,20 @@
3131# See the file_pat definition below for a list of files that are checked.
3232#
3333
34+from __future__ import print_function
35+
3436import argparse
3537import os
3638import re
3739import sys
3840
39−# Print msg on stderr, preceded by program name and followed by newline
4041
42+# Print msg on stderr, preceded by program name and followed by newline
4143def error(msg):
4244 print(os.path.basename(sys.argv[0]) + ": " + msg, file=sys.stderr)
4345
44−# Function to raise errors encountered by os.walk
4546
47+# Function to raise errors encountered by os.walk
4648def raise_error(e):
4749 raise e
4850
@@ -52,6 +54,7 @@ def raise_error(e):
5254whitespace_pat = re.compile(r'.*[ \t]$')
5355tab_indent_pat = re.compile(r'^ *\t')
5456
57+
5558def scan_for_bad_whitespace(file_path):
5659 global tab_indent_pat, whitespace_pat
5760 errors = []
@@ -69,7 +72,9 @@ def scan_for_bad_whitespace(file_path):
6972 plural = 's'
7073 else:
7174 plural = ''
72− print("%s: bad whitespace in line%s %s" % (file_path, plural, ", ".join((str(i) for i in errors))))
75+ print(
76+ "%s: bad whitespace in line%s %s" % (
77+ file_path, plural, ", ".join((str(i) for i in errors))))
7378 elif errors:
7479 print("%s: bad whitespace in multiple lines" % file_path)
7580 if newlines_at_end:
@@ -78,15 +83,20 @@ def scan_for_bad_whitespace(file_path):
7883
7984# Parse args
8085
81−parser = argparse.ArgumentParser(description = 'Test that source files do not contain trailing whitespace.')
82−parser.add_argument('dir', nargs = 1, help = 'The directory to (recursively) search for source files')
83−parser.add_argument('ignore_prefix', nargs = '?', default=None,
84− help = 'Ignore source files with a path that starts with the given prefix.')
86+parser = argparse.ArgumentParser(
87+ description='Test that source files do not contain trailing whitespace.')
88+parser.add_argument(
89+ 'dir', nargs=1,
90+ help='The directory to (recursively) search for source files')
91+parser.add_argument(
92+ 'ignore_prefix', nargs='?', default=None,
93+ help='Ignore source files with a path that starts with the given prefix.')
8594args = parser.parse_args()
8695
8796# Files we want to check for trailing whitespace.
8897
89−file_pat = r'(.*\.(c|cpp|h|hpp|hh|in|install|js|py|qml|sh)$)|(.*CMakeLists\.txt$)'
98+file_pat = (
99+ r'(.*\.(c|cpp|h|hpp|hh|in|install|js|py|qml|sh)$)|(.*CMakeLists\.txt$)')
90100pat = re.compile(file_pat)
91101
92102# Find all the files with matching file extension in the specified
@@ -97,7 +107,7 @@ ignore = args.ignore_prefix and os.path.abspath(args.ignore_prefix) or None
97107
98108found_whitespace = False
99109try:
100− for root, dirs, files in os.walk(directory, onerror = raise_error):
110+ for root, dirs, files in os.walk(directory, onerror=raise_error):
101111 for file in files:
102112 path = os.path.join(root, file)
103113 if not (ignore and path.startswith(ignore)) and pat.match(file):