on xenial help sign in
don§t confuse the user and show just one power/shutdown dialog
fdba5b4Lukáš Tinkl
qml/Components/Dialogs.qml+6−47
@@ -166,40 +166,6 @@ Item {
166 }
166 }
167 }
167 }
168
168
169− Component {
170− id: shutdownDialogComponent
171− ShellDialog {
172− id: shutdownDialog
173− title: i18n.ctr("Title: Reboot/Shut down dialog", "Shut down")
174− text: i18n.tr("Are you sure you want to shut down?")
175− Button {
176− text: i18n.ctr("Button: Reboot the system", "Reboot")
177− onClicked: {
178− root.closeAllApps();
179− unitySessionService.reboot();
180− shutdownDialog.hide();
181− }
182− color: UbuntuColors.lightGrey
183− }
184− Button {
185− text: i18n.ctr("Button: Shut down the system", "Shut down")
186− onClicked: {
187− root.closeAllApps();
188− unitySessionService.shutdown();
189− shutdownDialog.hide();
190− }
191− color: UbuntuColors.red
192− }
193− Button {
194− text: i18n.tr("Cancel")
195− onClicked: {
196− shutdownDialog.hide();
197− }
198− color: UbuntuColors.lightGrey
199− }
200− }
201− }
202−
203 Component {
169 Component {
204 id: rebootDialogComponent
170 id: rebootDialogComponent
205 ShellDialog {
171 ShellDialog {
@@ -273,23 +239,16 @@ Item {
273
239
274 onShutdownRequested: {
240 onShutdownRequested: {
275 // Display a dialog to ask the user to confirm.
241 // Display a dialog to ask the user to confirm.
276− if (!dialogLoader.active) {
242+ showPowerDialog();
277− dialogLoader.sourceComponent = shutdownDialogComponent;
278− dialogLoader.focus = true;
279− dialogLoader.active = true;
280− }
281 }
243 }
282
244
283 onRebootRequested: {
245 onRebootRequested: {
284 // Display a dialog to ask the user to confirm.
246 // Display a dialog to ask the user to confirm.
285− if (!dialogLoader.active) {
247+
286− // display a combined reboot/shutdown dialog, sadly the session indicator calls rather the "Reboot()" method
248+ // display a combined reboot/shutdown dialog, sadly the session indicator calls rather the "Reboot()" method
287− // than shutdown when clicking on the "Shutdown..." menu item
249+ // than shutdown when clicking on the "Shutdown..." menu item
288− // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
250+ // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
289− dialogLoader.sourceComponent = shutdownDialogComponent;
251+ showPowerDialog();
290− dialogLoader.focus = true;
291− dialogLoader.active = true;
292− }
293 }
252 }
294
253
295 onLogoutReady: {
254 onLogoutReady: {