Merge lp:~mterry/phablet-tools/tutorial-redesign into lp:phablet-tools

Proposed by Michael Terry
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 354
Merged at revision: 355
Proposed branch: lp:~mterry/phablet-tools/tutorial-redesign
Merge into: lp:phablet-tools
Diff against target: 39 lines (+11/-18)
1 file modified
phablet-config (+11/-18)
To merge this branch: bzr merge lp:~mterry/phablet-tools/tutorial-redesign
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+277764@code.launchpad.net

Commit message

Be more forgiving about current edge-intro state before setting it.

Description of the change

Don't worry about current state of the edge-intro property before setting it.

I'm implementing a redesign of the edge tutorial right now [1]. And it uses a more granular approach to storing how much has been completed.

So if a user runs "phablet-config edges-intro --enable", they probably expect a complete reset of the tutorial state. And since it's no longer a simple binary, it doesn't make sense to check the current state anymore.

This is a companion piece to a dbus-property-service MP that handles the more granular setting. But this can land separately if we want.

[1] https://code.launchpad.net/~mterry/unity8/tutorial-redesign/+merge/271342

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
354. By Michael Terry

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Tested it, worked fine. Upon enabling, I got a hint for the left edge (launcher swipe), after starting the Dialer app, I got hinted for the bottom edge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-config'
2--- phablet-config 2015-11-02 15:06:50 +0000
3+++ phablet-config 2016-02-22 14:53:32 +0000
4@@ -236,24 +236,17 @@
5
6
7 def _handle_edges_intro(adb, args):
8- fmt = 'dbus-send --system --print-reply --dest=org.freedesktop.Accounts ' \
9- '/org/freedesktop/Accounts/User32011 %s ' \
10- 'string:com.canonical.unity.AccountsService string:demo-edges'
11- getter = fmt % 'org.freedesktop.DBus.Properties.Get'
12-
13- enabled = adb.shell(getter).find('true') != -1
14- if args.enable and enabled:
15- print('already enabled')
16- elif not args.enable and not enabled:
17- print('already disabled')
18- else:
19- setter = 'true' if args.enable else 'false'
20- dbus_call = 'dbus-send --system --print-reply ' \
21- '--dest=com.canonical.PropertyService ' \
22- '/com/canonical/PropertyService ' \
23- 'com.canonical.PropertyService.SetProperty ' \
24- 'string:edge boolean:%s' % setter
25- adb.shell(dbus_call, False)
26+ # Don't try to detect if edges are already enabled or not, since it's
27+ # actually a spectrum (some edges might have been completed, others may
28+ # not be) and rather than figure out exactly what the current state is,
29+ # just set our preferred state.
30+ setter = 'true' if args.enable else 'false'
31+ dbus_call = 'dbus-send --system --print-reply ' \
32+ '--dest=com.canonical.PropertyService ' \
33+ '/com/canonical/PropertyService ' \
34+ 'com.canonical.PropertyService.SetProperty ' \
35+ 'string:edge boolean:%s' % setter
36+ adb.shell(dbus_call, False)
37
38
39 def _handle_welcome_wizard(adb, args):

Subscribers

People subscribed via source and target branches