on xenial help sign in
Make the Unity 8 session dialogs behave in the same fashion as Unity 7.
e048bd0Chris Townsend
qml/Components/Dialogs.qml+20−4
@@ -19,6 +19,7 @@ import QtQuick 2.0
19import Unity.Application 0.1
19import Unity.Application 0.1
20import Unity.Session 0.1
20import Unity.Session 0.1
21import Ubuntu.Components 1.1
21import Ubuntu.Components 1.1
22+import LightDM 0.1 as LightDM
22
23
23Item {
24Item {
24 id: root
25 id: root
@@ -86,18 +87,25 @@ Item {
86 title: i18n.tr("Log out")
87 title: i18n.tr("Log out")
87 text: i18n.tr("Are you sure you want to log out?")
88 text: i18n.tr("Are you sure you want to log out?")
88 Button {
89 Button {
89− text: i18n.tr("No")
90+ text: i18n.tr("Lock")
90 onClicked: {
91 onClicked: {
92+ LightDM.Greeter.showGreeter()
91 logoutDialog.hide();
93 logoutDialog.hide();
92 }
94 }
93 }
95 }
94 Button {
96 Button {
95− text: i18n.tr("Yes")
97+ text: i18n.tr("Log Out")
96 onClicked: {
98 onClicked: {
97 unitySessionService.logout();
99 unitySessionService.logout();
98 logoutDialog.hide();
100 logoutDialog.hide();
99 }
101 }
100 }
102 }
103+ Button {
104+ text: i18n.tr("Cancel")
105+ onClicked: {
106+ logoutDialog.hide();
107+ }
108+ }
101 }
109 }
102 }
110 }
103
111
@@ -108,19 +116,27 @@ Item {
108 title: i18n.tr("Shut down")
116 title: i18n.tr("Shut down")
109 text: i18n.tr("Are you sure you want to shut down?")
117 text: i18n.tr("Are you sure you want to shut down?")
110 Button {
118 Button {
111− text: i18n.tr("No")
119+ text: i18n.tr("Reboot")
112 onClicked: {
120 onClicked: {
121+ root.closeAllApps();
122+ unitySessionService.reboot();
113 shutdownDialog.hide();
123 shutdownDialog.hide();
114 }
124 }
115 }
125 }
116 Button {
126 Button {
117− text: i18n.tr("Yes")
127+ text: i18n.tr("Shutdown")
118 onClicked: {
128 onClicked: {
119 root.closeAllApps();
129 root.closeAllApps();
120 unitySessionService.shutdown();
130 unitySessionService.shutdown();
121 shutdownDialog.hide();
131 shutdownDialog.hide();
122 }
132 }
123 }
133 }
134+ Button {
135+ text: i18n.tr("Cancel")
136+ onClicked: {
137+ shutdownDialog.hide();
138+ }
139+ }
124 }
140 }
125 }
141 }
126
142