~aacid/unity8/fix_testDash

« back to all changes in this revision

Viewing changes to wizard/ubuntu-system-settings-wizard.conf

  • Committer: CI Train Bot
  • Author(s): Michael Terry
  • Date: 2014-12-04 20:54:46 UTC
  • mfrom: (1432.3.19 wizard-plugin)
  • Revision ID: ci-train-bot@canonical.com-20141204205446-pbuftf6d5yt854oj
Convert the welcome wizard from a separate executable into a qml plugin (with a small C++ plugin for support).

- This changes the path for adding customized wizard pages (drops system-settings namespacing).  I checked with cwayne, that support isn't being used yet.  So that's safe to adjust while we're here.

- I did not change the path for the 'has the wizard run yet' marker, since that is being used in the wild.  But I added a comment as to why we're using the phrase "ubuntu-system-settings" in that filename.

- I fleshed out unity8's support for changing the language on the fly, since that's now done in-process.  I believe I caught all cases (anything that used a qml binding to i18n worked automatically, just had to catch the cases that were pulling from outside sources like infographics).

- If an incoming call happens during the wizard, we just bail out of it and the edge demo. I'm not sure what the ideal behavior is, but this is at least reasonable. There's nothing in the wizard that *needs* to be done.

- Making the wizard a plugin lets us drop the gap between the end of the wizard and the start of the shell.  Yay! 
Approved by: Andrea Cimitan

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
description "Welcome to Ubuntu"
2
 
author "Michael Terry <michael.terry@canonical.com>"
3
 
 
4
 
start on starting unity8
5
 
task
6
 
 
7
 
expect stop
8
 
 
9
 
# If you change this, also change it in the cleanup upstart job
10
 
env RUN_FILE=".config/ubuntu-system-settings/wizard-has-run"
11
 
 
12
 
pre-start script
13
 
    if [ -e "$HOME/$RUN_FILE" ]; then
14
 
        initctl set-env WIZARD_SKIPPED=true
15
 
        stop
16
 
    else
17
 
        # Stop unity8, we'll start it again in post-stop (this avoids a race
18
 
        # between post-stop and unity8 unpausing)
19
 
        stop --no-wait $JOB
20
 
 
21
 
        # Tell unity-mir to raise SIGSTOP after we start
22
 
        initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
23
 
 
24
 
        if [ -n "$MIR_SOCKET" ]; then
25
 
            initctl set-env --global WIZARD_ORIG_MIR_SOCKET=$MIR_SOCKET
26
 
 
27
 
            # Point wizard at unity-system-compositor
28
 
            MIR_SERVER_FILE=$XDG_RUNTIME_DIR/wizard_socket
29
 
            initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE
30
 
            initctl set-env MIR_SERVER_HOST_SOCKET=$MIR_SOCKET
31
 
 
32
 
            # Remove the socket if still there
33
 
            if [ -S "$MIR_SERVER_FILE" ]; then
34
 
                rm "$MIR_SERVER_FILE"
35
 
            fi
36
 
 
37
 
            # Point future jobs in this session to our Mir socket instead of
38
 
            # unity-system-compositor's socket.
39
 
            initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
40
 
            gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
41
 
        fi
42
 
    fi
43
 
end script
44
 
 
45
 
exec system-settings-wizard
46
 
 
47
 
post-stop script
48
 
    if [ -n "$WIZARD_SKIPPED" ]; then
49
 
        exit
50
 
    fi
51
 
 
52
 
    setenv() {
53
 
        initctl set-env --global $1=$2
54
 
        gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'$1': '$2'}"
55
 
    }
56
 
 
57
 
    echo "Ending wizard"
58
 
 
59
 
    if [ -S "$MIR_SERVER_FILE" ]; then
60
 
        rm -f "$MIR_SERVER_FILE"
61
 
    fi
62
 
 
63
 
    # Undo changes to global variables
64
 
    if [ -n "$WIZARD_ORIG_MIR_SOCKET" ]; then
65
 
        echo "Resetting MIR_SOCKET to $WIZARD_ORIG_MIR_SOCKET"
66
 
        setenv MIR_SOCKET $WIZARD_ORIG_MIR_SOCKET
67
 
    fi
68
 
 
69
 
    # Stop any indicators and OSK so they will be restarted with new environment
70
 
    initctl emit indicator-services-end
71
 
    stop maliit-server || true
72
 
 
73
 
    # And finally, resume unity8
74
 
    start --no-wait $JOB || true
75
 
end script