~larryprice/libertine/deb-filepicker

« back to all changes in this revision

Viewing changes to qml/common/ManageContainer.qml

  • Committer: Larry Price
  • Date: 2017-03-08 15:07:57 UTC
  • mfrom: (388.2.44 devel)
  • Revision ID: larry.price@canonical.com-20170308150757-glgl6bjs6qjtqoys
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    }
31
31
    property bool isDefaultContainer: null
32
32
    property bool isMultiarchEnabled: null
 
33
    property bool showFreezeOption: false
 
34
    property bool freezeOnStop: null
33
35
    property string currentContainer: null
34
36
 
35
37
    Flickable {
69
71
                text: i18n.tr("i386 multiarch support")
70
72
            }
71
73
 
 
74
            ListItem.Standard {
 
75
                visible: showFreezeOption
 
76
                control: CheckBox {
 
77
                    checked: freezeOnStop
 
78
                    onClicked: {
 
79
                        var worker = Qt.createComponent("ContainerManager.qml").createObject(parent)
 
80
 
 
81
                        worker.updateOperationDetails.connect(containerOperationDetails.update)
 
82
                        worker.operationFinished.connect(containerOperationDetails.clear)
 
83
 
 
84
                        if (checked) {
 
85
                            worker.configureContainer(currentContainer,
 
86
                                                      containerConfigList.getContainerName(currentContainer),
 
87
                                                      ["--freeze", "enable"])
 
88
                        } else {
 
89
                            worker.configureContainer(currentContainer,
 
90
                                                      containerConfigList.getContainerName(currentContainer),
 
91
                                                      ["--freeze", "disable"])
 
92
                        }
 
93
                    }
 
94
                }
 
95
                text: i18n.tr("Freeze on stop")
 
96
            }
 
97
 
72
98
            ListItem.SingleValue {
73
99
                text: i18n.tr("Additional archives and PPAs")
74
100
                progression: true
108
134
                text: i18n.tr("Update container")
109
135
            }
110
136
 
111
 
 
112
137
            ListItem.Standard {
113
138
                control: CheckBox {
114
139
                    checked: isDefaultContainer
152
177
        updateStatus()
153
178
        isDefaultContainer = containerConfigList.defaultContainerId === currentContainer
154
179
        isMultiarchEnabled = containerConfigList.getContainerMultiarchSupport(currentContainer) === 'enabled'
 
180
        var containerType = containerConfigList.getContainerType(currentContainer)
 
181
 
 
182
        if (containerType === 'lxc' || containerType === 'lxd') {
 
183
            showFreezeOption = true
 
184
            freezeOnStop = containerConfigList.getFreezeOnStop(currentContainer)
 
185
        }
155
186
    }
156
187
 
157
188
    function updateStatus() {