Merge lp:~stolowski/unity-scopes-shell/activation-progress into lp:unity-scopes-shell

Proposed by Paweł Stołowski on 2016-01-29
Status: Merged
Approved by: Albert Astals Cid on 2016-02-03
Approved revision: 282
Merged at revision: 292
Proposed branch: lp:~stolowski/unity-scopes-shell/activation-progress
Merge into: lp:unity-scopes-shell
Diff against target: 127 lines (+26/-2)
4 files modified
CMakeLists.txt (+1/-1)
debian/control.in (+2/-1)
src/Unity/scope.cpp (+20/-0)
src/Unity/scope.h (+3/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/activation-progress
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2016-01-29 Approve on 2016-02-03
Review via email: mp+284425@code.launchpad.net

Commit Message

Show activation progress bar when activate is called on scope proxy.

Description of the Change

Show activation progress bar when activate is called on scope proxy.

To post a comment you must log in.
Albert Astals Cid (aacid) wrote :

Code looks good to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-11-30 09:23:32 +0000
3+++ CMakeLists.txt 2016-01-29 11:02:44 +0000
4@@ -51,7 +51,7 @@
5 find_package(Boost COMPONENTS regex REQUIRED)
6
7 pkg_check_modules(SCOPESLIB REQUIRED libunity-scopes>=1.0.1)
8-pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=9)
9+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=10)
10
11 pkg_check_modules(GSETTINGSQT REQUIRED gsettings-qt)
12 pkg_check_modules(UBUNTU_LOCATION_SERVICE REQUIRED ubuntu-location-service)
13
14=== modified file 'debian/control.in'
15--- debian/control.in 2015-12-15 15:22:10 +0000
16+++ debian/control.in 2016-01-29 11:02:44 +0000
17@@ -8,7 +8,7 @@
18 dh-python,
19 libboost-python-dev,
20 libboost-regex-dev,
21- libunity-api-dev (>= 7.105),
22+ libunity-api-dev (>= 7.106),
23 libunity-scopes-dev (>= 1.0.1~),
24 libgsettings-qt-dev (>= 0.1),
25 libqtdbustest1-dev (>= 0.2),
26@@ -50,6 +50,7 @@
27 unity-scopes-impl-7,
28 unity-scopes-impl-8,
29 unity-scopes-impl-9,
30+ unity-scopes-impl-10,
31 Breaks: unity8-private (<< 7.84),
32 unity8 (<< 8.11)
33 Replaces: unity8-private (<< 7.84)
34
35=== modified file 'src/Unity/scope.cpp'
36--- src/Unity/scope.cpp 2015-11-30 09:23:32 +0000
37+++ src/Unity/scope.cpp 2016-01-29 11:02:44 +0000
38@@ -83,6 +83,7 @@
39 , m_formFactor(QStringLiteral("phone"))
40 , m_isActive(false)
41 , m_searchInProgress(false)
42+ , m_activationInProgress(false)
43 , m_resultsDirty(false)
44 , m_delayedSearchProcessing(false)
45 , m_hasNavigation(false)
46@@ -207,6 +208,8 @@
47
48 void Scope::handleActivation(std::shared_ptr<scopes::ActivationResponse> const& response, scopes::Result::SPtr const& result, QString const& categoryId)
49 {
50+ setActivationInProgress(false);
51+
52 switch (response->status()) {
53 case scopes::ActivationResponse::NotHandled:
54 activateUri(QString::fromStdString(result->uri()));
55@@ -675,6 +678,14 @@
56 }
57 }
58
59+void Scope::setActivationInProgress(bool activationInProgress)
60+{
61+ if (m_activationInProgress != activationInProgress) {
62+ m_activationInProgress = activationInProgress;
63+ Q_EMIT activationInProgressChanged();
64+ }
65+}
66+
67 void Scope::setStatus(shell::scopes::ScopeInterface::Status status)
68 {
69 if (m_status != status) {
70@@ -864,6 +875,11 @@
71 return m_searchInProgress;
72 }
73
74+bool Scope::activationInProgress() const
75+{
76+ return m_activationInProgress;
77+}
78+
79 unity::shell::scopes::ScopeInterface::Status Scope::status() const
80 {
81 return m_status;
82@@ -1205,13 +1221,17 @@
83 scopes::ActivationListenerBase::SPtr listener(new ActivationReceiver(this, result));
84 m_activationController->setListener(listener);
85
86+ setActivationInProgress(true);
87+
88 auto proxy = proxy_for_result(result);
89 unity::scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), m_formFactor.toStdString());
90 scopes::QueryCtrlProxy controller = proxy->activate(*(result.get()), metadata, listener);
91 m_activationController->setController(controller);
92 } catch (std::exception& e) {
93+ setActivationInProgress(false);
94 qWarning("Caught an error from activate(): %s", e.what());
95 } catch (...) {
96+ setActivationInProgress(false);
97 qWarning("Caught an error from activate()");
98 }
99 }
100
101=== modified file 'src/Unity/scope.h'
102--- src/Unity/scope.h 2015-11-30 09:23:32 +0000
103+++ src/Unity/scope.h 2016-01-29 11:02:44 +0000
104@@ -125,6 +125,7 @@
105 bool favorite() const override;
106 QString shortcut() const override;
107 bool searchInProgress() const override;
108+ bool activationInProgress() const override;
109 unity::shell::scopes::ScopeInterface::Status status() const override;
110 unity::shell::scopes::CategoriesInterface* categories() const override;
111 unity::shell::scopes::SettingsModelInterface* settings() const override;
112@@ -177,6 +178,7 @@
113 void invalidateResults();
114 virtual void dispatchSearch();
115 void setSearchInProgress(bool searchInProgress);
116+ void setActivationInProgress(bool activationInProgress);
117
118 Q_SIGNALS:
119 void resultsDirtyChanged();
120@@ -230,6 +232,7 @@
121 std::unique_ptr<unity::scopes::Variant> m_queryUserData;
122 bool m_isActive;
123 bool m_searchInProgress;
124+ bool m_activationInProgress;
125 bool m_resultsDirty;
126 bool m_delayedSearchProcessing;
127 bool m_hasNavigation;

Subscribers

People subscribed via source and target branches

to all changes: