17690N/A@@ -479,6 +479,70 @@ gsm_consolekit_attempt_stop (GsmConsolek
17690N/A+gsm_consolekit_get_available_systems (GsmConsolekit *manager, GPtrArray **array)
17690N/A+ if (!gsm_consolekit_ensure_ck_connection (manager, &error)) {
17690N/A+ g_warning ("Could not connect to ConsoleKit: %s",
17690N/A+ emit_stop_complete (manager, error);
17690N/A+ res = dbus_g_proxy_call_with_timeout (manager->priv->ck_proxy,
17690N/A+ "GetAvailableOperatingSystems",
17690N/A+ dbus_g_type_get_collection ("GPtrArray", OS_STRUCT_TYPE),
17690N/A+ g_warning ("Unable to get available operating system: %s", error->message);
17690N/A+gsm_consolekit_restart_with_parameters (GsmConsolekit *manager,
17690N/A+ if (!gsm_consolekit_ensure_ck_connection (manager, &error)) {
17690N/A+ g_warning ("Could not connect to ConsoleKit: %s",
17690N/A+ emit_stop_complete (manager, error);
17690N/A+ res = dbus_g_proxy_call_with_timeout (manager->priv->ck_proxy,
17690N/A+ g_warning ("Unable to restart system: %s", error->message);
17690N/A+ emit_restart_complete (manager, error);
17690N/A get_current_session_id (DBusConnection *connection,
17690N/A@@ -94,6 +94,18 @@ void gsm_consolekit_set_sess
17690N/A gchar *gsm_consolekit_get_current_session_type (GsmConsolekit *manager);
17690N/A+#define OS_STRUCT_TYPE (dbus_g_type_get_struct ("GValueArray", \
17690N/A+void gsm_consolekit_get_available_systems (GsmConsolekit *manager, GPtrArray **array);
17690N/A+void gsm_consolekit_with_with_parameters (GsmConsolekit *manager, const gchar *parameters);
17690N/A GsmConsolekit *gsm_get_consolekit (void);
17690N/A@@ -59,6 +59,9 @@ struct _GsmLogoutDialogPrivate
17690N/A static GsmLogoutDialog *current_dialog = NULL;
17690N/A@@ -140,6 +143,9 @@ gsm_logout_dialog_init (GsmLogoutDialog
17690N/A logout_dialog->priv->timeout = 0;
17690N/A logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL;
17690N/A+ logout_dialog->priv->fast = 1;
17690N/A gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE);
17690N/A gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE);
17690N/A gtk_window_stick (GTK_WINDOW (logout_dialog));
17787N/A@@ -352,6 +358,237 @@ gsm_logout_dialog_set_timeout (GsmLogout
17690N/A+#if defined(__x86) || defined(__x86__)
17690N/A+fast_reboot_cb (GtkWidget *button, gpointer data)
17690N/A+ GsmLogoutDialog *logout_dialog = (GsmLogoutDialog *)data;
17690N/A+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
17690N/A+ logout_dialog->priv->fast = 1;
17690N/A+ logout_dialog->priv->fast = 0;
17690N/A+/* Option to skip boot menu on restart. */
17690N/A+get_fast_reboot_option (GsmLogoutDialog *logout_dialog)
17690N/A+ check = gtk_check_button_new_with_mnemonic (_("S_kip boot menu on restart"));
17690N/A+ g_signal_connect (GTK_WIDGET (check),
17690N/A+ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (check), TRUE);
17690N/A+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
17690N/A+boot_environment_cb (GtkWidget *button, gpointer data)
17690N/A+ GsmLogoutDialog *logout_dialog = (GsmLogoutDialog *)data;
17690N/A+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
17690N/A+ id = (gint)g_object_get_data (G_OBJECT (button), "id");
16959N/A+ hbox = gtk_hbox_new (FALSE, 0);
16959N/A+ image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
16959N/A+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
17885N/A+ gtk_label_set_markup (GTK_LABEL (label),
16959N/A+ _("<span style=\"italic\" size=\"smaller\">Options apply only after Restart, not after Shut Down</span>"));
16959N/A+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
17690N/A+get_be_option (GsmLogoutDialog *logout_dialog)
17690N/A+ label = gtk_label_new_with_mnemonic (_("_Default boot environment at next restart:"));
17690N/A+ vbox = gtk_vbox_new (FALSE, 2);
17690N/A+ gsm_consolekit_get_available_systems (logout_dialog->priv->consolekit,
17690N/A+ for (int i = 0; i < array->len; i++) {
17690N/A+ g_value_init (&elem, OS_STRUCT_TYPE);
17690N/A+ g_value_set_static_boxed (&elem, g_ptr_array_index (array, i));
17690N/A+ dbus_g_type_struct_get (&elem,
17690N/A+ radio = gtk_radio_button_new_with_label (group, name);
17690N/A+ g_object_set_data (G_OBJECT (radio), "id", (gpointer)id);
17690N/A+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio),
17690N/A+ gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
17690N/A+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
17690N/A+ g_signal_connect (GTK_WIDGET (radio),
17690N/A+ G_CALLBACK (boot_environment_cb),
17690N/A+ scroll = gtk_scrolled_window_new (NULL, NULL);
17690N/A+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
17690N/A+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
17690N/A+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll),
17690N/A+ /* a new vbox to put label, scrolled window and warning in */
17690N/A+ vbox = gtk_vbox_new (FALSE, 2);
17690N/A+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
17690N/A+ gtk_box_pack_start (GTK_BOX (vbox), scroll, FALSE, FALSE, 0);
17690N/A+ gtk_box_pack_start (GTK_BOX (vbox), warning, FALSE, FALSE, 0);
17690N/A+ g_ptr_array_free (array, TRUE);
16959N/A+create_fastreboot_options (GsmLogoutDialog *logout_dialog)
16959N/A+ expander = gtk_expander_new_with_mnemonic (_("_More Options"));
16959N/A+ gtk_widget_style_get (expander, "expander-size", &size,
16959N/A+ "expander-spacing", &spacing, NULL);
16959N/A+ vbox = gtk_vbox_new (FALSE, 0);
17690N/A+ check = get_fast_reboot_option (logout_dialog);
16959N/A+ align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
16959N/A+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0,
16959N/A+ gtk_container_add (GTK_CONTAINER (align), check);
16959N/A+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 10);
17690N/A+ be = get_be_option (logout_dialog);
17690N/A+ align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
17690N/A+ gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0,
17690N/A+ gtk_container_add (GTK_CONTAINER (align), be);
17690N/A+ gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
16959N/A+ gtk_container_add (GTK_CONTAINER (expander), vbox);
16959N/A+ * Find the right container to put the expander in.
16959N/A+ * This is gtk dialog imeplementation specific.
16959N/A+ * So if there is something wrong with the layout
16959N/A+ vbox = gtk_dialog_get_content_area (GTK_DIALOG
16959N/A+ list = gtk_container_get_children (GTK_CONTAINER (vbox));
16959N/A+ for (GList *l = list; l != NULL; l = g_list_next (l)) {
16959N/A+ list = gtk_container_get_children (GTK_CONTAINER (hbox));
16959N/A+ for (GList *l = list; l != NULL; l = g_list_next (l)) {
16959N/A+ gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE,
16959N/A+ gtk_widget_destroy (expander);
16959N/A gsm_get_dialog (GsmDialogLogoutType type,
17772N/A@@ -418,6 +653,10 @@ gsm_get_dialog (GsmDialogLogoutType type
16959N/A if (gsm_logout_supports_reboot (logout_dialog)) {
17772N/A+#if defined(__x86) || defined(__x86__)
16959N/A+ create_fastreboot_options(logout_dialog);
16959N/A gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
17690N/A@@ -454,6 +691,21 @@ gsm_get_dialog (GsmDialogLogoutType type
17690N/A return GTK_WIDGET (logout_dialog);
17690N/A+gsm_logout_dialog_get_restart_parameters (GsmLogoutDialog *logout_dialog)
17690N/A+ if (logout_dialog->priv->id < 0)
17690N/A+ param = g_strdup_printf("id:%d fast:%d",
17690N/A gsm_get_shutdown_dialog (GdkScreen *screen,
17690N/A@@ -68,6 +68,8 @@ GtkWidget *gsm_get_logout_dialog
17690N/A GtkWidget *gsm_get_shutdown_dialog (GdkScreen *screen,
17690N/A+gchar *gsm_logout_dialog_get_restart_parameters (GsmLogoutDialog *logout_dialog);
17690N/A #endif /* __GSM_LOGOUT_DIALOG_H__ */
17690N/A@@ -132,6 +132,8 @@ struct GsmManagerPrivate
17690N/A@@ -416,7 +418,8 @@ gsm_manager_quit (GsmManager *manager)
17690N/A G_CALLBACK (quit_request_completed),
17690N/A GINT_TO_POINTER (GDM_LOGOUT_ACTION_REBOOT));
17690N/A- gsm_consolekit_attempt_restart (consolekit);
17690N/A+ gsm_consolekit_restart_with_parameters (consolekit,
17690N/A case GSM_MANAGER_LOGOUT_REBOOT_GDM:
17690N/A gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
17690N/A@@ -2176,6 +2179,11 @@ gsm_manager_dispose (GObject *object)
17690N/A manager->priv->gconf_client = NULL;
17690N/A+ if (manager->priv->parameters) {
17690N/A+ g_free (manager->priv->parameters);
17690N/A+ manager->priv->parameters = NULL;
17690N/A G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
17690N/A@@ -2800,6 +2808,8 @@ logout_dialog_response (GsmLogoutDialog
17690N/A case GSM_LOGOUT_RESPONSE_REBOOT:
17690N/A+ gsm_logout_dialog_get_restart_parameters (logout_dialog);
17690N/A case GSM_LOGOUT_RESPONSE_LOGOUT:
17690N/A@@ -132,6 +132,8 @@ struct GsmManagerPrivate
17690N/A@@ -416,7 +418,8 @@ gsm_manager_quit (GsmManager *manager)
17690N/A G_CALLBACK (quit_request_completed),
17690N/A GINT_TO_POINTER (GDM_LOGOUT_ACTION_REBOOT));
17690N/A- gsm_consolekit_attempt_restart (consolekit);
17690N/A+ gsm_consolekit_restart_with_parameters (consolekit,
17690N/A case GSM_MANAGER_LOGOUT_REBOOT_GDM:
17690N/A gdm_set_logout_action (GDM_LOGOUT_ACTION_REBOOT);
17690N/A@@ -2176,6 +2179,11 @@ gsm_manager_dispose (GObject *object)
17690N/A manager->priv->gconf_client = NULL;
17690N/A+ if (manager->priv->parameters) {
17690N/A+ g_free (manager->priv->parameters);
17690N/A+ manager->priv->parameters = NULL;
17690N/A G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
17690N/A@@ -2800,6 +2808,8 @@ logout_dialog_response (GsmLogoutDialog
17690N/A case GSM_LOGOUT_RESPONSE_REBOOT:
17690N/A+ gsm_logout_dialog_get_restart_parameters (logout_dialog);
17690N/A case GSM_LOGOUT_RESPONSE_LOGOUT: