@@ -166,40 +166,6 @@ Item {
166166 }
167167 }
168168
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−
203169 Component {
204170 id: rebootDialogComponent
205171 ShellDialog {
@@ -273,23 +239,16 @@ Item {
273239
274240 onShutdownRequested: {
275241 // Display a dialog to ask the user to confirm.
276− if (!dialogLoader.active) {
277− dialogLoader.sourceComponent = shutdownDialogComponent;
278− dialogLoader.focus = true;
279− dialogLoader.active = true;
280− }
242+ showPowerDialog();
281243 }
282244
283245 onRebootRequested: {
284246 // Display a dialog to ask the user to confirm.
285− if (!dialogLoader.active) {
286− // 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
288− // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
289− dialogLoader.sourceComponent = shutdownDialogComponent;
290− dialogLoader.focus = true;
291− dialogLoader.active = true;
292− }
247+
248+ // display a combined reboot/shutdown dialog, sadly the session indicator calls rather the "Reboot()" method
249+ // than shutdown when clicking on the "Shutdown..." menu item
250+ // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
251+ showPowerDialog();
293252 }
294253
295254 onLogoutReady: {