@@ -222,11 +222,13 @@ MouseArea {
222 focus: true
222 focus: true
223 text: i18n.tr("Yes")
223 text: i18n.tr("Yes")
224 onClicked: {
224 onClicked: {
225+ doOnClosedAllWindows = function(unitySessionService, rebootDialog) {
227+ unitySessionService.reboot();
228+ rebootDialog.hide();
230+ }(unitySessionService, rebootDialog);
225 topLevelSurfaceList.closeAllWindows();
231 topLevelSurfaceList.closeAllWindows();
226− doOnClosedAllWindows = function() {
227− unitySessionService.reboot();
228− rebootDialog.hide();
231 color: theme.palette.normal.negative
233 color: theme.palette.normal.negative
232 Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
234 Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
@@ -245,11 +247,13 @@ MouseArea {
245 focus: true
247 focus: true
246 text: i18n.ctr("Button: Power off the system", "Power off")
248 text: i18n.ctr("Button: Power off the system", "Power off")
247 onClicked: {
249 onClicked: {
250+ doOnClosedAllWindows = function(root, powerDialog) {
253+ root.powerOffClicked();
255+ }(root, powerDialog);
248 topLevelSurfaceList.closeAllWindows();
256 topLevelSurfaceList.closeAllWindows();
249− doOnClosedAllWindows = function() {
251− root.powerOffClicked();
254 color: theme.palette.normal.negative
258 color: theme.palette.normal.negative
255 Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
259 Component.onCompleted: if (root.hasKeyboard) forceActiveFocus(Qt.TabFocusReason)
@@ -258,11 +262,13 @@ MouseArea {
258 width: parent.width
262 width: parent.width
259 text: i18n.ctr("Button: Restart the system", "Restart")
263 text: i18n.ctr("Button: Restart the system", "Restart")
260 onClicked: {
264 onClicked: {
265+ doOnClosedAllWindows = function(unitySessionService, powerDialog) {
267+ unitySessionService.reboot();
270+ }(unitySessionService, powerDialog);
261 topLevelSurfaceList.closeAllWindows();
271 topLevelSurfaceList.closeAllWindows();
262− doOnClosedAllWindows = function() {
263− unitySessionService.reboot();
@@ -302,11 +308,13 @@ MouseArea {
304 onLogoutReady: {
310 onLogoutReady: {
311+ doOnClosedAllWindows = function(unitySessionService) {
314+ unitySessionService.endSession();
316+ }(unitySessionService);
305 topLevelSurfaceList.closeAllWindows();
317 topLevelSurfaceList.closeAllWindows();
306− doOnClosedAllWindows = function() {
308− unitySessionService.endSession();