16939
|
1 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-consolekit.c gnome-session-2.28.0-new/gnome-session/gsm-consolekit.c
|
|
2 |
--- gnome-session-2.28.0/gnome-session/gsm-consolekit.c 2009-09-09 19:16:53.000000000 +0800
|
|
3 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-consolekit.c 2009-11-10 16:58:17.029348387 +0800
|
|
4 |
@@ -479,6 +479,70 @@ gsm_consolekit_attempt_stop (GsmConsolek
|
|
5 |
}
|
|
6 |
}
|
|
7 |
|
|
8 |
+void
|
|
9 |
+gsm_consolekit_get_available_systems (GsmConsolekit *manager, GPtrArray **array)
|
|
10 |
+{
|
|
11 |
+ gboolean res;
|
|
12 |
+ GError *error;
|
|
13 |
+
|
|
14 |
+ error = NULL;
|
|
15 |
+
|
|
16 |
+ if (!gsm_consolekit_ensure_ck_connection (manager, &error)) {
|
|
17 |
+ g_warning ("Could not connect to ConsoleKit: %s",
|
|
18 |
+ error->message);
|
|
19 |
+ emit_stop_complete (manager, error);
|
|
20 |
+ g_error_free (error);
|
|
21 |
+ return;
|
|
22 |
+ }
|
|
23 |
+
|
|
24 |
+ res = dbus_g_proxy_call_with_timeout (manager->priv->ck_proxy,
|
|
25 |
+ "GetAvailableOperatingSystems",
|
|
26 |
+ INT_MAX,
|
|
27 |
+ &error,
|
|
28 |
+ G_TYPE_INVALID,
|
|
29 |
+ dbus_g_type_get_collection ("GPtrArray", OS_STRUCT_TYPE),
|
|
30 |
+ array,
|
|
31 |
+ G_TYPE_INVALID);
|
|
32 |
+
|
|
33 |
+ if (!res) {
|
|
34 |
+ g_warning ("Unable to get available operating system: %s", error->message);
|
|
35 |
+ g_error_free (error);
|
|
36 |
+ }
|
|
37 |
+}
|
|
38 |
+
|
|
39 |
+void
|
|
40 |
+gsm_consolekit_restart_with_parameters (GsmConsolekit *manager,
|
|
41 |
+ const gchar *parameters)
|
|
42 |
+{
|
|
43 |
+ gboolean res;
|
|
44 |
+ GError *error;
|
|
45 |
+
|
|
46 |
+ error = NULL;
|
|
47 |
+
|
|
48 |
+ if (!gsm_consolekit_ensure_ck_connection (manager, &error)) {
|
|
49 |
+ g_warning ("Could not connect to ConsoleKit: %s",
|
|
50 |
+ error->message);
|
|
51 |
+ emit_stop_complete (manager, error);
|
|
52 |
+ g_error_free (error);
|
|
53 |
+ return;
|
|
54 |
+ }
|
|
55 |
+
|
|
56 |
+ res = dbus_g_proxy_call_with_timeout (manager->priv->ck_proxy,
|
|
57 |
+ "RestartWithParameters",
|
|
58 |
+ INT_MAX,
|
|
59 |
+ &error,
|
|
60 |
+ G_TYPE_STRING,
|
|
61 |
+ parameters,
|
|
62 |
+ G_TYPE_INVALID,
|
|
63 |
+ G_TYPE_INVALID);
|
|
64 |
+
|
|
65 |
+ if (!res) {
|
|
66 |
+ g_warning ("Unable to restart system: %s", error->message);
|
|
67 |
+ emit_restart_complete (manager, error);
|
|
68 |
+ g_error_free (error);
|
|
69 |
+ }
|
|
70 |
+}
|
|
71 |
+
|
|
72 |
static gboolean
|
|
73 |
get_current_session_id (DBusConnection *connection,
|
|
74 |
char **session_id)
|
|
75 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-consolekit.h gnome-session-2.28.0-new/gnome-session/gsm-consolekit.h
|
|
76 |
--- gnome-session-2.28.0/gnome-session/gsm-consolekit.h 2009-04-20 02:26:52.000000000 +0800
|
|
77 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-consolekit.h 2009-11-10 16:58:17.029557135 +0800
|
|
78 |
@@ -94,6 +94,18 @@ void gsm_consolekit_set_sess
|
|
79 |
|
|
80 |
gchar *gsm_consolekit_get_current_session_type (GsmConsolekit *manager);
|
|
81 |
|
|
82 |
+#define OS_STRUCT_TYPE (dbus_g_type_get_struct ("GValueArray", \
|
|
83 |
+ G_TYPE_INT, \
|
|
84 |
+ G_TYPE_STRING, \
|
|
85 |
+ G_TYPE_STRING, \
|
|
86 |
+ G_TYPE_STRING, \
|
|
87 |
+ G_TYPE_BOOLEAN, \
|
|
88 |
+ G_TYPE_INVALID))
|
|
89 |
+
|
|
90 |
+
|
|
91 |
+void gsm_consolekit_get_available_systems (GsmConsolekit *manager, GPtrArray **array);
|
|
92 |
+void gsm_consolekit_with_with_parameters (GsmConsolekit *manager, const gchar *parameters);
|
|
93 |
+
|
|
94 |
GsmConsolekit *gsm_get_consolekit (void);
|
|
95 |
|
|
96 |
G_END_DECLS
|
|
97 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-logout-dialog.c gnome-session-2.28.0-new/gnome-session/gsm-logout-dialog.c
|
|
98 |
--- gnome-session-2.28.0/gnome-session/gsm-logout-dialog.c 2009-11-10 17:44:49.039510013 +0800
|
|
99 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-logout-dialog.c 2009-11-10 17:43:21.340885644 +0800
|
|
100 |
@@ -59,6 +59,9 @@ struct _GsmLogoutDialogPrivate
|
|
101 |
unsigned int timeout_id;
|
|
102 |
|
|
103 |
unsigned int default_response;
|
|
104 |
+
|
|
105 |
+ unsigned int fast;
|
|
106 |
+ int id;
|
|
107 |
};
|
|
108 |
|
|
109 |
static GsmLogoutDialog *current_dialog = NULL;
|
|
110 |
@@ -140,6 +143,9 @@ gsm_logout_dialog_init (GsmLogoutDialog
|
|
111 |
logout_dialog->priv->timeout = 0;
|
|
112 |
logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL;
|
|
113 |
|
|
114 |
+ logout_dialog->priv->fast = 1;
|
|
115 |
+ logout_dialog->priv->id = -1;
|
|
116 |
+
|
|
117 |
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE);
|
|
118 |
gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE);
|
|
119 |
gtk_window_stick (GTK_WINDOW (logout_dialog));
|
17036
|
120 |
@@ -352,6 +358,237 @@ gsm_logout_dialog_set_timeout (GsmLogout
|
16208
|
121 |
logout_dialog);
|
|
122 |
}
|
|
123 |
|
16939
|
124 |
+#if defined(__x86) || defined(__x86__)
|
|
125 |
+static void
|
|
126 |
+fast_reboot_cb (GtkWidget *button, gpointer data)
|
|
127 |
+{
|
|
128 |
+ GsmLogoutDialog *logout_dialog = (GsmLogoutDialog *)data;
|
|
129 |
+
|
|
130 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
|
|
131 |
+ logout_dialog->priv->fast = 1;
|
|
132 |
+ } else {
|
|
133 |
+ logout_dialog->priv->fast = 0;
|
|
134 |
+ }
|
|
135 |
+}
|
|
136 |
+
|
|
137 |
+/* Option to skip boot menu on restart. */
|
|
138 |
+static GtkWidget *
|
|
139 |
+get_fast_reboot_option (GsmLogoutDialog *logout_dialog)
|
|
140 |
+{
|
|
141 |
+ GtkWidget *check;
|
|
142 |
+ char *obuf = NULL;
|
|
143 |
+
|
17036
|
144 |
+ /* SUN_BRANDING */
|
16939
|
145 |
+ check = gtk_check_button_new_with_mnemonic (_("S_kip boot menu on restart"));
|
|
146 |
+ gtk_widget_show (check);
|
|
147 |
+ g_signal_connect (GTK_WIDGET (check),
|
|
148 |
+ "toggled",
|
|
149 |
+ G_CALLBACK (fast_reboot_cb),
|
|
150 |
+ logout_dialog);
|
|
151 |
+ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (check), TRUE);
|
|
152 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
|
|
153 |
+
|
|
154 |
+ return check;
|
|
155 |
+}
|
16208
|
156 |
+
|
|
157 |
+static void
|
16939
|
158 |
+boot_environment_cb (GtkWidget *button, gpointer data)
|
16208
|
159 |
+{
|
16939
|
160 |
+ GsmLogoutDialog *logout_dialog = (GsmLogoutDialog *)data;
|
16208
|
161 |
+
|
16939
|
162 |
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
|
|
163 |
+ gint id;
|
|
164 |
+
|
|
165 |
+ id = (gint)g_object_get_data (G_OBJECT (button), "id");
|
|
166 |
+ logout_dialog->priv->id = id;
|
16208
|
167 |
+ }
|
|
168 |
+}
|
|
169 |
+
|
|
170 |
+static GtkWidget *
|
|
171 |
+get_warning ()
|
|
172 |
+{
|
|
173 |
+ GtkBox *hbox;
|
|
174 |
+ GtkImage *image;
|
|
175 |
+ GtkWidget *label;
|
|
176 |
+
|
|
177 |
+ hbox = gtk_hbox_new (FALSE, 0);
|
|
178 |
+
|
|
179 |
+ image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
|
|
180 |
+ GTK_ICON_SIZE_SMALL_TOOLBAR);
|
|
181 |
+ gtk_widget_show (image);
|
|
182 |
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
|
183 |
+ label = gtk_label_new (NULL);
|
|
184 |
+ gtk_widget_show (label);
|
17134
|
185 |
+ gtk_label_set_markup (GTK_LABEL (label),
|
17036
|
186 |
+ /* SUN_BRANDING */
|
16208
|
187 |
+ _("<span style=\"italic\" size=\"smaller\">Options apply only after Restart, not after Shut Down</span>"));
|
|
188 |
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
189 |
+
|
|
190 |
+ return hbox;
|
|
191 |
+}
|
|
192 |
+
|
16939
|
193 |
+/* Options to choose BE. */
|
|
194 |
+static GtkWidget *
|
|
195 |
+get_be_option (GsmLogoutDialog *logout_dialog)
|
16208
|
196 |
+{
|
16939
|
197 |
+ GtkWidget *warning;
|
|
198 |
+ GtkWidget *label;
|
|
199 |
+ GtkWidget *radio;
|
|
200 |
+ GtkWidget *scroll;
|
|
201 |
+ GtkWidget *vbox;
|
|
202 |
+ GSList *group;
|
|
203 |
+ GPtrArray *array = NULL;
|
|
204 |
+
|
|
205 |
+ warning = get_warning ();
|
|
206 |
+ gtk_widget_show (warning);
|
16208
|
207 |
+
|
17036
|
208 |
+ /* SUN_BRANDING */
|
16939
|
209 |
+ label = gtk_label_new_with_mnemonic (_("_Default boot environment at next restart:"));
|
|
210 |
+ gtk_widget_show (label);
|
|
211 |
+
|
|
212 |
+ vbox = gtk_vbox_new (FALSE, 2);
|
|
213 |
+ gtk_widget_show (vbox);
|
|
214 |
+
|
|
215 |
+ gsm_consolekit_get_available_systems (logout_dialog->priv->consolekit,
|
|
216 |
+ &array);
|
|
217 |
+ group = NULL;
|
|
218 |
+ for (int i = 0; i < array->len; i++) {
|
|
219 |
+ GValue elem = {0};
|
|
220 |
+ gint id;
|
|
221 |
+ gchar *name;
|
|
222 |
+ gboolean is_default = FALSE;
|
16208
|
223 |
+
|
16939
|
224 |
+ g_value_init (&elem, OS_STRUCT_TYPE);
|
|
225 |
+ g_value_set_static_boxed (&elem, g_ptr_array_index (array, i));
|
|
226 |
+ dbus_g_type_struct_get (&elem,
|
|
227 |
+ 0, &id,
|
|
228 |
+ 3, &name,
|
|
229 |
+ 4, &is_default,
|
|
230 |
+ G_MAXUINT);
|
16208
|
231 |
+
|
16939
|
232 |
+ radio = gtk_radio_button_new_with_label (group, name);
|
|
233 |
+ gtk_widget_show (radio);
|
|
234 |
+ g_object_set_data (G_OBJECT (radio), "id", (gpointer)id);
|
|
235 |
+ if (is_default) {
|
|
236 |
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio),
|
|
237 |
+ TRUE);
|
|
238 |
+ logout_dialog->priv->id = id;
|
|
239 |
+ }
|
|
240 |
+ gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
|
|
241 |
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
|
|
242 |
+ g_signal_connect (GTK_WIDGET (radio),
|
|
243 |
+ "toggled",
|
|
244 |
+ G_CALLBACK (boot_environment_cb),
|
|
245 |
+ logout_dialog);
|
|
246 |
+ }
|
|
247 |
+ scroll = gtk_scrolled_window_new (NULL, NULL);
|
|
248 |
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
|
|
249 |
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
|
250 |
+ gtk_widget_show (scroll);
|
|
251 |
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll),
|
|
252 |
+ vbox);
|
16208
|
253 |
+
|
16939
|
254 |
+ /* a new vbox to put label, scrolled window and warning in */
|
|
255 |
+ vbox = gtk_vbox_new (FALSE, 2);
|
|
256 |
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
|
257 |
+ gtk_box_pack_start (GTK_BOX (vbox), scroll, FALSE, FALSE, 0);
|
|
258 |
+ gtk_box_pack_start (GTK_BOX (vbox), warning, FALSE, FALSE, 0);
|
|
259 |
+
|
|
260 |
+ if (array->len > 1)
|
|
261 |
+ gtk_widget_show (vbox);
|
|
262 |
+ g_ptr_array_free (array, TRUE);
|
|
263 |
+
|
|
264 |
+ return vbox;
|
16208
|
265 |
+}
|
|
266 |
+
|
|
267 |
+static void
|
|
268 |
+create_fastreboot_options (GsmLogoutDialog *logout_dialog)
|
|
269 |
+{
|
|
270 |
+ GtkWidget *expander;
|
|
271 |
+ GtkWidget *align;
|
|
272 |
+ GtkWidget *check;
|
|
273 |
+ GtkWidget *be;
|
|
274 |
+ GtkWidget *hbox;
|
|
275 |
+ GtkWidget *vbox;
|
|
276 |
+ GList *list;
|
|
277 |
+ gint spacing;
|
|
278 |
+ gint size;
|
|
279 |
+
|
17036
|
280 |
+ /* SUN_BRANDING */
|
16208
|
281 |
+ expander = gtk_expander_new_with_mnemonic (_("_More Options"));
|
|
282 |
+ gtk_widget_show (expander);
|
|
283 |
+ gtk_widget_style_get (expander, "expander-size", &size,
|
|
284 |
+ "expander-spacing", &spacing, NULL);
|
|
285 |
+
|
|
286 |
+ vbox = gtk_vbox_new (FALSE, 0);
|
|
287 |
+ gtk_widget_show (vbox);
|
|
288 |
+
|
16939
|
289 |
+ check = get_fast_reboot_option (logout_dialog);
|
16208
|
290 |
+ align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
|
|
291 |
+ gtk_widget_show (align);
|
|
292 |
+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0,
|
|
293 |
+ (size + 2 * spacing), 0);
|
|
294 |
+ gtk_container_add (GTK_CONTAINER (align), check);
|
|
295 |
+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 10);
|
16939
|
296 |
+
|
|
297 |
+ be = get_be_option (logout_dialog);
|
|
298 |
+ align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
|
|
299 |
+ gtk_widget_show (align);
|
|
300 |
+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0,
|
|
301 |
+ (size + 2 * spacing), 0);
|
|
302 |
+ gtk_container_add (GTK_CONTAINER (align), be);
|
|
303 |
+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
16208
|
304 |
+
|
|
305 |
+ gtk_container_add (GTK_CONTAINER (expander), vbox);
|
|
306 |
+
|
|
307 |
+ /*
|
|
308 |
+ * Find the right container to put the expander in.
|
|
309 |
+ * This is gtk dialog imeplementation specific.
|
|
310 |
+ * So if there is something wrong with the layout
|
|
311 |
+ * the code need to be udpated
|
|
312 |
+ */
|
|
313 |
+ hbox = NULL;
|
|
314 |
+ vbox = gtk_dialog_get_content_area (GTK_DIALOG
|
|
315 |
+ (logout_dialog));
|
|
316 |
+ list = gtk_container_get_children (GTK_CONTAINER (vbox));
|
|
317 |
+ for (GList *l = list; l != NULL; l = g_list_next (l)) {
|
|
318 |
+ GtkWidget *widget;
|
|
319 |
+
|
|
320 |
+ widget = l->data;
|
|
321 |
+ if (GTK_IS_HBOX(widget)) {
|
|
322 |
+ hbox = widget;
|
|
323 |
+ break;
|
|
324 |
+ }
|
|
325 |
+ }
|
|
326 |
+ g_list_free (list);
|
|
327 |
+ g_assert (hbox != NULL);
|
|
328 |
+
|
|
329 |
+ vbox = NULL;
|
|
330 |
+ list = gtk_container_get_children (GTK_CONTAINER (hbox));
|
|
331 |
+ for (GList *l = list; l != NULL; l = g_list_next (l)) {
|
|
332 |
+ GtkWidget *widget;
|
|
333 |
+
|
|
334 |
+ widget = l->data;
|
|
335 |
+ if (GTK_IS_VBOX(widget)) {
|
|
336 |
+ vbox = widget;
|
|
337 |
+ break;
|
|
338 |
+ }
|
|
339 |
+ }
|
|
340 |
+ g_list_free (list);
|
|
341 |
+ g_assert (vbox != NULL);
|
|
342 |
+
|
|
343 |
+ if (vbox) {
|
|
344 |
+ gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE,
|
|
345 |
+ FALSE, 10);
|
|
346 |
+ } else {
|
|
347 |
+ gtk_widget_destroy (expander);
|
|
348 |
+ }
|
|
349 |
+
|
|
350 |
+ return;
|
|
351 |
+}
|
17021
|
352 |
+#endif
|
16208
|
353 |
+
|
|
354 |
+
|
|
355 |
static GtkWidget *
|
|
356 |
gsm_get_dialog (GsmDialogLogoutType type,
|
|
357 |
GdkScreen *screen,
|
17021
|
358 |
@@ -418,6 +653,10 @@ gsm_get_dialog (GsmDialogLogoutType type
|
16208
|
359 |
}
|
|
360 |
|
|
361 |
if (gsm_logout_supports_reboot (logout_dialog)) {
|
17021
|
362 |
+#if defined(__x86) || defined(__x86__)
|
16208
|
363 |
+ /* fast reboot support */
|
|
364 |
+ create_fastreboot_options(logout_dialog);
|
17021
|
365 |
+#endif
|
16208
|
366 |
gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
|
|
367 |
_("_Restart"),
|
|
368 |
GSM_LOGOUT_RESPONSE_REBOOT);
|
16939
|
369 |
@@ -454,6 +691,21 @@ gsm_get_dialog (GsmDialogLogoutType type
|
|
370 |
return GTK_WIDGET (logout_dialog);
|
|
371 |
}
|
|
372 |
|
|
373 |
+gchar *
|
|
374 |
+gsm_logout_dialog_get_restart_parameters (GsmLogoutDialog *logout_dialog)
|
|
375 |
+{
|
|
376 |
+ gchar *param = NULL;
|
|
377 |
+
|
|
378 |
+ if (logout_dialog->priv->id < 0)
|
|
379 |
+ return NULL;
|
|
380 |
+
|
|
381 |
+ param = g_strdup_printf("id:%d fast:%d",
|
|
382 |
+ logout_dialog->priv->id,
|
|
383 |
+ logout_dialog->priv->fast);
|
|
384 |
+
|
|
385 |
+ return param;
|
|
386 |
+}
|
|
387 |
+
|
|
388 |
GtkWidget *
|
|
389 |
gsm_get_shutdown_dialog (GdkScreen *screen,
|
|
390 |
guint32 activate_time)
|
|
391 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-logout-dialog.h gnome-session-2.28.0-new/gnome-session/gsm-logout-dialog.h
|
|
392 |
--- gnome-session-2.28.0/gnome-session/gsm-logout-dialog.h 2009-04-20 02:26:52.000000000 +0800
|
|
393 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-logout-dialog.h 2009-11-10 16:58:17.030235487 +0800
|
|
394 |
@@ -68,6 +68,8 @@ GtkWidget *gsm_get_logout_dialog
|
|
395 |
GtkWidget *gsm_get_shutdown_dialog (GdkScreen *screen,
|
|
396 |
guint32 activate_time);
|
|
397 |
|
|
398 |
+gchar *gsm_logout_dialog_get_restart_parameters (GsmLogoutDialog *logout_dialog);
|
|
399 |
+
|
|
400 |
G_END_DECLS
|
|
401 |
|
|
402 |
#endif /* __GSM_LOGOUT_DIALOG_H__ */
|
|
403 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-manager.c gnome-session-2.28.0-new/gnome-session/gsm-manager.c
|
|
404 |
--- gnome-session-2.28.0/gnome-session/gsm-manager.c 2009-11-10 17:44:49.071472976 +0800
|
|
405 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-manager.c 2009-11-10 16:58:17.035407219 +0800
|
|
406 |
@@ -132,6 +132,8 @@ struct GsmManagerPrivate
|
|
407 |
|
|
408 |
DBusGProxy *bus_proxy;
|
|
409 |
DBusGConnection *connection;
|
|
410 |
+
|
|
411 |
+ gchar *parameters;
|
|
412 |
};
|
|
413 |
|
|
414 |
enum {
|
|
415 |
@@ -416,7 +418,8 @@ gsm_manager_quit (GsmManager *manager)
|
|
416 |
"request-completed",
|
|
417 |
G_CALLBACK (quit_request_completed),
|
|
418 |
GINT_TO_POINTER (GDM_LOGOUT_ACTION_REBOOT));
|
|
419 |
- gsm_consolekit_attempt_restart (consolekit);
|
|
420 |
+ gsm_consolekit_restart_with_parameters (consolekit,
|
|
421 |
+ manager->priv->parameters);
|
|
422 |
break;
|
|
423 |
case GSM_MANAGER_LOGOUT_REBOOT_GDM:
|
|
424 |
gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
|
|
425 |
@@ -2176,6 +2179,11 @@ gsm_manager_dispose (GObject *object)
|
|
426 |
manager->priv->gconf_client = NULL;
|
|
427 |
}
|
|
428 |
|
|
429 |
+ if (manager->priv->parameters) {
|
|
430 |
+ g_free (manager->priv->parameters);
|
|
431 |
+ manager->priv->parameters = NULL;
|
|
432 |
+ }
|
|
433 |
+
|
|
434 |
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
|
|
435 |
}
|
|
436 |
|
|
437 |
@@ -2800,6 +2808,8 @@ logout_dialog_response (GsmLogoutDialog
|
|
438 |
request_shutdown (manager);
|
|
439 |
break;
|
|
440 |
case GSM_LOGOUT_RESPONSE_REBOOT:
|
|
441 |
+ manager->priv->parameters =
|
|
442 |
+ gsm_logout_dialog_get_restart_parameters (logout_dialog);
|
|
443 |
request_reboot (manager);
|
|
444 |
break;
|
|
445 |
case GSM_LOGOUT_RESPONSE_LOGOUT:
|
|
446 |
diff -uprN gnome-session-2.28.0/gnome-session/gsm-manager.c.orig gnome-session-2.28.0-new/gnome-session/gsm-manager.c.orig
|
|
447 |
--- gnome-session-2.28.0/gnome-session/gsm-manager.c.orig 2009-11-10 17:44:49.055937229 +0800
|
|
448 |
+++ gnome-session-2.28.0-new/gnome-session/gsm-manager.c.orig 2009-11-10 16:58:17.031615520 +0800
|
|
449 |
@@ -132,6 +132,8 @@ struct GsmManagerPrivate
|
|
450 |
|
|
451 |
DBusGProxy *bus_proxy;
|
|
452 |
DBusGConnection *connection;
|
|
453 |
+
|
|
454 |
+ gchar *parameters;
|
|
455 |
};
|
|
456 |
|
|
457 |
enum {
|
|
458 |
@@ -416,7 +418,8 @@ gsm_manager_quit (GsmManager *manager)
|
|
459 |
"request-completed",
|
|
460 |
G_CALLBACK (quit_request_completed),
|
|
461 |
GINT_TO_POINTER (GDM_LOGOUT_ACTION_REBOOT));
|
|
462 |
- gsm_consolekit_attempt_restart (consolekit);
|
|
463 |
+ gsm_consolekit_restart_with_parameters (consolekit,
|
|
464 |
+ manager->priv->parameters);
|
|
465 |
break;
|
|
466 |
case GSM_MANAGER_LOGOUT_REBOOT_GDM:
|
|
467 |
gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
|
|
468 |
@@ -2176,6 +2179,11 @@ gsm_manager_dispose (GObject *object)
|
|
469 |
manager->priv->gconf_client = NULL;
|
|
470 |
}
|
|
471 |
|
|
472 |
+ if (manager->priv->parameters) {
|
|
473 |
+ g_free (manager->priv->parameters);
|
|
474 |
+ manager->priv->parameters = NULL;
|
|
475 |
+ }
|
|
476 |
+
|
|
477 |
G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
|
|
478 |
}
|
|
479 |
|
|
480 |
@@ -2800,6 +2808,8 @@ logout_dialog_response (GsmLogoutDialog
|
|
481 |
request_shutdown (manager);
|
|
482 |
break;
|
|
483 |
case GSM_LOGOUT_RESPONSE_REBOOT:
|
|
484 |
+ manager->priv->parameters =
|
|
485 |
+ gsm_logout_dialog_get_restart_parameters (logout_dialog);
|
|
486 |
request_reboot (manager);
|
|
487 |
break;
|
|
488 |
case GSM_LOGOUT_RESPONSE_LOGOUT:
|