~pitti/ubuntu-system-settings/i18n

« back to all changes in this revision

Viewing changes to plugins/reset/ResetLauncherHome.qml

  • Committer: CI bot
  • Author(s): jonas-drange
  • Date: 2014-08-07 14:54:32 UTC
  • mfrom: (839.2.12 1219793-reset)
  • Revision ID: ps-jenkins@lists.canonical.com-20140807145432-gtnc8ebwrif3gq6m
[reset] bring back reset and hook it up to the backend. Added happy path tests. 
Approved by: Ken VanDine, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
Component {
26
26
    id: resetLauncherHome
27
 
 
28
27
    Dialog {
29
28
        id: dialog
30
 
        text: i18n.tr("The contents and layout of the launcher, and the filters in the home screen will be returned to their original settings.")
 
29
        states: State {
 
30
            name: "clicked"
 
31
            PropertyChanges {
 
32
                target: action
 
33
                enabled: false
 
34
            }
 
35
            PropertyChanges {
 
36
                target: cancel
 
37
                enabled: false
 
38
            }
 
39
        }
 
40
        text: i18n.tr("The Launcher will be returned to its original contents.")
 
41
        objectName: "resetLauncherDialog"
31
42
        Button {
32
 
            text: i18n.tr("Reset launcher & home screen")
 
43
            id: action
 
44
            text: i18n.tr("Reset Launcher")
 
45
            objectName: "resetLauncherAction"
33
46
            onClicked: {
34
 
                unitySettings.schema.reset("favorites")
35
 
                resetBackend.resetLauncher()
36
 
                PopupUtils.close(dialog)
 
47
                dialog.state = "clicked";
 
48
                unitySettings.schema.reset("favorites");
 
49
                resetBackend.resetLauncher();
 
50
                root.done();
37
51
            }
38
52
        }
39
53
        Button {
 
54
            id: cancel
40
55
            text: i18n.tr("Cancel")
41
56
            onClicked: PopupUtils.close(dialog)
42
57
        }
 
58
        Label {
 
59
            text: i18n.tr("The phone needs to restart for changes to take effect.")
 
60
            width: parent.width
 
61
            wrapMode: Text.Wrap
 
62
            horizontalAlignment: Text.AlignHCenter
 
63
        }
43
64
    }
44
65
}