~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-yakkety-landing-025

« back to all changes in this revision

Viewing changes to plugins/wifi/StandardMenuItem.qml

  • Committer: Bileto Bot
  • Author(s): Ken VanDine
  • Date: 2016-07-22 14:38:13 UTC
  • mfrom: (1556.3.32 slotsLayout)
  • Revision ID: ci-train-bot@canonical.com-20160722143813-ht9e4766lm0ie5fa
Ported to use Slots layout and updated visuals (LP: #1596529)

Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2013 Canonical Ltd.
 
2
 * Copyright 2013-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
28
28
 
29
29
    signal activate()
30
30
 
31
 
    onCheckedChanged: {
32
 
        // Can't rely on binding. Checked is assigned on click.
33
 
        if (checkable) {
34
 
            checkbox.checked = checked;
35
 
        }
36
 
    }
 
31
    layout.subtitle.text: checked ? i18n.tr("Connected") : ""
37
32
 
 
33
    progressionVisible: checked
38
34
    onClicked: {
39
 
        if (checkable) {
40
 
            checkbox.clicked();
41
 
        } else {
42
 
            menuItem.activate();
43
 
        }
44
 
    }
45
 
 
46
 
    control: CheckBox {
47
 
        id: checkbox
48
 
 
49
 
        Component.onCompleted: {
50
 
            checked = menuItem.checked;
51
 
        }
52
 
 
53
 
        // FIXME : should use Checkbox.toggled signal
54
 
        // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
55
 
        onClicked: {
56
 
            menuItem.activate();
57
 
        }
58
 
 
59
 
        visible: checkable
 
35
        if (!checked) {
 
36
            menuItem.activate();
 
37
        }
60
38
    }
61
39
}