@@ -354,6 +354,47 @@ FocusScope {
354354 }
355355 }
356356
357+ Component {
358+ id: powerDialog
359+ Dialog {
360+ id: dialoguePower
361+ title: "Power"
362+ text: "What do you want to do?"
363+ Button {
364+ text: "Cancel"
365+ onClicked: {
366+ PopupUtils.close(dialoguePower);
367+ stages.dialogShown = false;
368+ }
369+ }
370+ Button {
371+ text: "Shutdown"
372+ onClicked: {
373+ dBusUnitySessionServiceConnection.closeAllApps();
374+ DBusUnitySessionService.Shutdown();
375+ PopupUtils.close(dialoguePower);
376+ stages.dialogShown = false;
377+ }
378+ }
379+ Button {
380+ text: "Reboot"
381+ onClicked: {
382+ dBusUnitySessionServiceConnection.closeAllApps();
383+ DBusUnitySessionService.Reboot();
384+ PopupUtils.close(dialoguePower);
385+ stages.dialogShown = false;
386+ }
387+ }
388+ }
389+ }
390+
391+ function showPowerDialog() {
392+ if (!stages.dialogShown) {
393+ stages.dialogShown = true;
394+ PopupUtils.open(powerDialog);
395+ }
396+ }
397+
357398 Connections {
358399 id: dBusUnitySessionServiceConnection
359400 objectName: "dBusUnitySessionServiceConnection"
@@ -807,7 +848,7 @@ FocusScope {
807848 triggeredOnStart: false
808849
809850 onTriggered: {
810− DBusUnitySessionService.RequestShutdown();
851+ stages.showPowerDialog();
811852 }
812853 }
813854}