18940N/A@@ -267,12 +267,112 @@ gdm_session_settings_is_loaded (GdmSessi
18940N/A+gdm_session_settings_first_time_load (GdmSessionSettings *settings,
18940N/A+ g_return_val_if_fail (settings != NULL, FALSE);
18940N/A+ g_return_val_if_fail (username != NULL, FALSE);
18940N/A+ if (settings->priv->session_name != NULL) {
18940N/A+ g_debug ("Freeing old session value %s", settings->priv->session_name);
18940N/A+ g_free (settings->priv->session_name);
18940N/A+ settings->priv->session_name = NULL;
18940N/A+ if (settings->priv->language_name != NULL) {
18940N/A+ g_debug ("Freeing old language value %s", settings->priv->language_name);
18940N/A+ g_free (settings->priv->language_name);
18940N/A+ settings->priv->language_name = NULL;
18940N/A+ if (settings->priv->layout_name != NULL) {
18940N/A+ g_debug ("Freeing old layout value %s", settings->priv->layout_name);
18940N/A+ g_free (settings->priv->layout_name);
18940N/A+ settings->priv->layout_name = NULL;
18940N/A+ filename = g_build_filename (GDM_CACHE_DIR, username, "dmrc", NULL);
18940N/A+ if (!g_key_file_load_from_file (key_file, filename,
18940N/A+ G_KEY_FILE_NONE, &load_error)) {
18940N/A+ g_propagate_error (error, load_error);
18940N/A+ session_name = g_key_file_get_string (key_file, "Desktop",
18940N/A+ g_debug ("Setting value to %s", session_name);
18940N/A+ gdm_session_settings_set_session_name (settings, session_name);
18940N/A+ } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
18940N/A+ g_propagate_error (error, load_error);
18940N/A+ language_name = g_key_file_get_string (key_file, "Desktop", "Language",
18940N/A+ gdm_session_settings_set_language_name (settings, language_name);
18940N/A+ } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
18940N/A+ g_propagate_error (error, load_error);
18940N/A+ layout_name = g_key_file_get_string (key_file, "Desktop", "Layout",
18940N/A+ gdm_session_settings_set_layout_name (settings, layout_name);
18940N/A+ } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
18940N/A+ g_propagate_error (error, load_error);
18940N/A gdm_session_settings_load (GdmSessionSettings *settings,
18940N/A@@ -281,7 +381,7 @@ gdm_session_settings_load (GdmSessionSet
18940N/A@@ -388,8 +488,10 @@ gdm_session_settings_load (GdmSessionSet
18940N/A@@ -53,6 +53,10 @@ struct _GdmSessionSettingsClass
18940N/A GType gdm_session_settings_get_type (void);
18940N/A GdmSessionSettings *gdm_session_settings_new (void);
18940N/A+gboolean gdm_session_settings_first_time_load (GdmSessionSettings *settings,
18940N/A gboolean gdm_session_settings_load (GdmSessionSettings *settings,
18940N/A@@ -1809,6 +1809,71 @@ _lookup_passwd_info (const char *usernam
18940N/A+run_gdm_first_time_login_helper (GdmSessionWorker *worker, char *session_name,
18940N/A+ char *language_name, char *layout_name)
18940N/A+ pwent = getpwnam (worker->priv->username);
18940N/A+ if (pwent != NULL && pwent->pw_dir != NULL) {
18940N/A+ filename = g_build_filename (pwent->pw_dir, ".dmrc", NULL);
18940N/A+ if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
18940N/A+ g_debug ("Running " LIBEXECDIR "/gdm-first-time-login-helper \"%s\" \"%s\" \"%s\" \"%s\"",
18940N/A+ worker->priv->username ? worker->priv->username : "",
18940N/A+ session_name ? session_name : "",
18940N/A+ layout_name ? layout_name : "",
18940N/A+ language_name ? language_name : "");
18940N/A+ char *argv[] = { LIBEXECDIR"/gdm-first-time-login-helper",
18940N/A+ worker->priv->username ? worker->priv->username : "",
18940N/A+ session_name ? session_name : "",
18940N/A+ layout_name ? layout_name : "",
18940N/A+ language_name ? language_name : "",
18940N/A+ /* Wait for the child to finish */
18940N/A+ if (waitpid (fpid, &status, 0) == -1) {
18940N/A+ g_debug("User aborted gdm-first-time-login-helper");
18940N/A+ g_debug("Cannot start gdm-first-time-login-helper");
18940N/A+ g_debug("Cannot start gdm-first-time-login-helper");
18940N/A+ g_debug ("Not running gdm-first-time-login-helper, user already has dmrc file");
18940N/A+ cachedir = gdm_session_worker_create_cachedir (worker);
18940N/A+ g_debug ("Copying user dmrc file to cache");
18940N/A+ cachefile = g_build_filename (cachedir, "dmrc", NULL);
18940N/A+ gdm_cache_copy_file (worker, filename, cachefile);
18940N/A+ g_debug ("Could not get user information for %s", worker->priv->username);
18940N/A gdm_session_worker_accredit_user (GdmSessionWorker *worker,
18940N/A@@ -1932,6 +1997,14 @@ gdm_session_worker_accredit_user (GdmSes
18940N/A attempt_to_load_user_settings (worker, worker->priv->username,
18940N/A+ if (!gdm_session_settings_is_loaded (worker->priv->user_settings) && run_gdm_first_time_login_helper (worker, session_name, language_name, layout_name)) {
18940N/A+ g_debug ("Now loading settings created by gdm-first-time-login-helper.");
18940N/A+ gdm_session_settings_first_time_load (worker->priv->user_settings, worker->priv->username, NULL);
18940N/A+ g_debug ("Did not run gdm-first-time-login-helper.");
18940N/A widget->priv->in_use_message = NULL;
18940N/A+ if (widget->priv->update_idle_id > 0) {
18940N/A+ g_source_remove (widget->priv->update_idle_id);
18940N/A+ widget->priv->update_idle_id = 0;
18940N/A G_OBJECT_CLASS (gdm_chooser_widget_parent_class)->dispose (object);
18940N/A+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
18940N/A+ * This program is free software; you can redistribute it
and/or modify
18940N/A+ * it under the terms of the GNU General Public License as published by
18940N/A+ * the Free Software Foundation; either version 2 of the License, or
18940N/A+ * (at your option) any later version.
18940N/A+ * This program is distributed in the hope that it will be useful,
18940N/A+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18940N/A+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18940N/A+ * GNU General Public License for more details.
18940N/A+ * You should have received a copy of the GNU General Public License
18940N/A+ * along with this program; if not, write to the Free Software
18940N/A+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18940N/A+ * Written by: Suresh Chandrasekharan <suresh.chandrasekharan@oracle.com>
18940N/A+typedef enum ptypes {MESSAGE=0, SESSION, LAYOUT, LANGUAGE} ptypes;
18940N/A+firsttime_login_message_popup (GtkWidget *dialog,
18940N/A+ dialog = (GtkWidget *) g_object_new (GTK_TYPE_MESSAGE_DIALOG,
18940N/A+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
18940N/A+ _("_Skip Setup"), GTK_RESPONSE_CANCEL,
18940N/A+ GTK_STOCK_OK, GTK_RESPONSE_OK,
18940N/A+ display_text = g_strconcat ("<b>", text, "</b>", NULL);
18940N/A+ gtk_message_dialog_set_markup ((GtkMessageDialog *)dialog, display_text);
18940N/A+ gtk_window_set_title (GTK_WINDOW (dialog), title);
18940N/A+ image = gtk_image_new_from_icon_name ("user-info", GTK_ICON_SIZE_DIALOG);
18940N/A+ gtk_message_dialog_set_image ((GtkMessageDialog *)dialog, image);
18940N/A+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
18940N/A+run_dialog(int height, int width, ptypes key, char *set_name, char **name) {
18940N/A+ dialog = firsttime_login_message_popup(dialog,
18940N/A+ _("First Time Login Assistant"),
18940N/A+ _("This is the first time you have logged in, please select your preferences:"));
18940N/A+ dialog = gdm_session_chooser_dialog_new();
18940N/A+ items = gdm_session_chooser_dialog_get_number_of_items (GDM_SESSION_CHOOSER_DIALOG (dialog));
18940N/A+ if (items && set_name && set_name[0] != '\0')
18940N/A+ gdm_session_chooser_dialog_set_current_session_name (GDM_SESSION_CHOOSER_DIALOG (dialog), set_name);
18940N/A+ dialog = gdm_layout_chooser_dialog_new();
18940N/A+ items = gdm_layout_chooser_dialog_get_number_of_items (GDM_LAYOUT_CHOOSER_DIALOG (dialog));
18940N/A+ if (items && set_name && set_name[0] != '\0')
18940N/A+ gdm_layout_chooser_dialog_set_current_layout_name (GDM_LAYOUT_CHOOSER_DIALOG (dialog), set_name);
18940N/A+ dialog = gdm_language_chooser_dialog_new();
18940N/A+ items = gdm_language_chooser_dialog_get_number_of_items (GDM_LANGUAGE_CHOOSER_DIALOG (dialog));
18940N/A+ if (items && set_name && set_name[0] != '\0')
18940N/A+ gdm_language_chooser_dialog_set_current_language_name (GDM_LANGUAGE_CHOOSER_DIALOG (dialog), set_name);
18940N/A+ gtk_widget_set_size_request (dialog, height, width);
18940N/A+ gtk_widget_show_all (GTK_WIDGET (dialog));
18940N/A+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
18940N/A+ *name = gdm_session_chooser_dialog_get_current_session_name (GDM_SESSION_CHOOSER_DIALOG (dialog));
18940N/A+ *name = gdm_layout_chooser_dialog_get_current_layout_name (GDM_LAYOUT_CHOOSER_DIALOG (dialog));
18940N/A+ *name = gdm_language_chooser_dialog_get_current_language_name (GDM_LANGUAGE_CHOOSER_DIALOG (dialog));
18940N/A+session_settings_save (char *session_name, char *language_name,
18940N/A+ g_return_val_if_fail (user_name != NULL, FALSE);
18940N/A+ if (pwent != NULL && pwent->pw_dir != NULL &&
18940N/A+ g_file_test (pwent->pw_dir, G_FILE_TEST_EXISTS))
18940N/A+ filename = g_build_filename (pwent->pw_dir, ".dmrc", NULL);
18940N/A+ g_key_file_load_from_file (key_file, filename,
18940N/A+ g_key_file_set_string (key_file, "Desktop", "Session",
18940N/A+ g_key_file_set_string (key_file, "Desktop", "Language",
18940N/A+ g_key_file_set_string (key_file, "Desktop", "Layout",
18940N/A+ contents = g_key_file_to_data (key_file, &length, &file_error);
18940N/A+ g_propagate_error (error, file_error);
18940N/A+ if (!g_file_set_contents (filename, contents, length, &file_error)) {
18940N/A+ g_propagate_error (error, file_error);
18940N/A+ chown (filename, pwent->pw_uid, pwent->pw_gid);
18940N/A+ g_message ("Usage: %s <user name> <session_name> <layout_name> <language_name>", argv[0]);
18940N/A+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
18940N/A+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
18940N/A+ run_dialog(480, 120, MESSAGE, NULL, &dialog_feedback);
18940N/A+ run_dialog(480, 480, SESSION, argv[2], &session_name);
18940N/A+ run_dialog(480, 480, LAYOUT, argv[3], &layout_name);
18940N/A+ run_dialog(480, 480, LANGUAGE, argv[4], &lang_name);
18940N/A+ if (!session_settings_save (session_name, lang_name, layout_name, argv[1], &error)) {
18940N/A+ g_warning (_("could not save session and language settings: %s"),
18940N/A@@ -71,6 +71,17 @@ gdm_language_chooser_dialog_set_current_
18940N/A gdm_language_chooser_widget_set_current_language_name (GDM_LANGUAGE_CHOOSER_WIDGET (dialog->priv->chooser_widget), language_name);
18940N/A+gdm_language_chooser_dialog_get_number_of_items (GdmLanguageChooserDialog *dialog)
18940N/A+ dialog->priv = GDM_LANGUAGE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
18940N/A+ if (dialog->priv->chooser_widget == NULL)
18940N/A+ dialog->priv->chooser_widget = gdm_language_chooser_widget_new ();
18940N/A+ return gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A gdm_language_chooser_dialog_size_request (GtkWidget *widget,
18940N/A@@ -164,7 +175,7 @@ gdm_language_chooser_dialog_init (GdmLan
18940N/A gtk_dialog_add_buttons (GTK_DIALOG (dialog),
18940N/A- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
18940N/A+ _("_Skip Setup"), GTK_RESPONSE_CANCEL,
18940N/A char * gdm_language_chooser_dialog_get_current_language_name (GdmLanguageChooserDialog *dialog);
18940N/A void gdm_language_chooser_dialog_set_current_language_name (GdmLanguageChooserDialog *dialog,
18940N/A+int gdm_language_chooser_dialog_get_number_of_items
18940N/A+(GdmLanguageChooserDialog *dialog);
18940N/A gdm_chooser_widget_set_separator_position (GDM_CHOOSER_WIDGET (widget),
18940N/A GDM_CHOOSER_WIDGET_POSITION_TOP);
18940N/A+ if (!widget->priv->languages_added) {
18940N/A+ add_available_languages (widget);
18940N/A+ widget->priv->languages_added = TRUE;
18940N/A@@ -71,6 +71,17 @@ gdm_layout_chooser_dialog_set_current_la
18940N/A gdm_layout_chooser_widget_set_current_layout_name (GDM_LAYOUT_CHOOSER_WIDGET (dialog->priv->chooser_widget), layout_name);
18940N/A+gdm_layout_chooser_dialog_get_number_of_items (GdmLayoutChooserDialog *dialog)
18940N/A+ dialog->priv = GDM_LAYOUT_CHOOSER_DIALOG_GET_PRIVATE (dialog);
18940N/A+ if (dialog->priv->chooser_widget == NULL)
18940N/A+ dialog->priv->chooser_widget = gdm_layout_chooser_widget_new ();
18940N/A+ return gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A gdm_layout_chooser_dialog_size_request (GtkWidget *widget,
18940N/A@@ -138,6 +149,7 @@ queue_response (GdmLayoutChooserDialog *
18940N/A gdm_layout_chooser_dialog_init (GdmLayoutChooserDialog *dialog)
18940N/A dialog->priv = GDM_LAYOUT_CHOOSER_DIALOG_GET_PRIVATE (dialog);
18940N/A@@ -145,8 +157,12 @@ gdm_layout_chooser_dialog_init (GdmLayou
18940N/A gdm_chooser_widget_set_hide_inactive_items (GDM_CHOOSER_WIDGET (dialog->priv->chooser_widget),
18940N/A- gdm_layout_chooser_widget_set_current_layout_name (GDM_LAYOUT_CHOOSER_WIDGET (dialog->priv->chooser_widget),
18940N/A- setlocale (LC_MESSAGES, NULL));
18940N/A+ layout_name = gdm_layout_chooser_widget_get_current_layout_name (GDM_LAYOUT_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A+ gdm_layout_chooser_widget_set_current_layout_name (GDM_LAYOUT_CHOOSER_WIDGET (dialog->priv->chooser_widget), layout_name);
18940N/A gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
18940N/A g_signal_connect_swapped (G_OBJECT (dialog->priv->chooser_widget),
18940N/A@@ -154,7 +170,7 @@ gdm_layout_chooser_dialog_init (GdmLayou
18940N/A gtk_dialog_add_buttons (GTK_DIALOG (dialog),
18940N/A- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
18940N/A+ _("_Skip Setup"), GTK_RESPONSE_CANCEL,
18940N/A char * gdm_layout_chooser_dialog_get_current_layout_name (GdmLayoutChooserDialog *dialog);
18940N/A void gdm_layout_chooser_dialog_set_current_layout_name (GdmLayoutChooserDialog *dialog,
18940N/A+int gdm_layout_chooser_dialog_get_number_of_items (GdmLayoutChooserDialog *dialog);
18940N/A gdm_chooser_widget_set_separator_position (GDM_CHOOSER_WIDGET (widget),
18940N/A GDM_CHOOSER_WIDGET_POSITION_TOP);
18940N/A+ if (!widget->priv->layouts_added) {
18940N/A+ add_available_layouts (widget);
18940N/A+ widget->priv->layouts_added = TRUE;
18940N/A+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
18940N/A+ * Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
18940N/A+ * This program is free software; you can redistribute it
and/or modify
18940N/A+ * it under the terms of the GNU General Public License as published by
18940N/A+ * the Free Software Foundation; either version 2 of the License, or
18940N/A+ * (at your option) any later version.
18940N/A+ * This program is distributed in the hope that it will be useful,
18940N/A+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18940N/A+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18940N/A+ * GNU General Public License for more details.
18940N/A+ * You should have received a copy of the GNU General Public License
18940N/A+ * along with this program; if not, write to the Free Software
18940N/A+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18940N/A+ * Written by suresh.chandrasekharan@oracle.com based on
18940N/A+#define GDM_SESSION_CHOOSER_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SESSION_CHOOSER_DIALOG, GdmSessionChooserDialogPrivate))
18940N/A+struct GdmSessionChooserDialogPrivate
18940N/A+static void gdm_session_chooser_dialog_class_init (GdmSessionChooserDialogClass *klass);
18940N/A+static void gdm_session_chooser_dialog_init (GdmSessionChooserDialog *session_chooser_dialog);
18940N/A+static void gdm_session_chooser_dialog_finalize (GObject *object);
18940N/A+G_DEFINE_TYPE (GdmSessionChooserDialog, gdm_session_chooser_dialog, GTK_TYPE_DIALOG)
18940N/A+gdm_session_chooser_dialog_get_current_session_name (GdmSessionChooserDialog *dialog)
18940N/A+ g_return_val_if_fail (GDM_IS_SESSION_CHOOSER_DIALOG (dialog), NULL);
18940N/A+ session_name = gdm_session_chooser_widget_get_current_session_name (GDM_SESSION_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A+gdm_session_chooser_dialog_set_current_session_name (GdmSessionChooserDialog *dialog,
18940N/A+ g_return_if_fail (GDM_IS_SESSION_CHOOSER_DIALOG (dialog));
18940N/A+ gdm_session_chooser_widget_set_current_session_name (GDM_SESSION_CHOOSER_WIDGET (dialog->priv->chooser_widget), session_name);
18940N/A+gdm_session_chooser_dialog_get_number_of_items (GdmSessionChooserDialog *dialog)
18940N/A+ dialog->priv = GDM_SESSION_CHOOSER_DIALOG_GET_PRIVATE (dialog);
18940N/A+ if (dialog->priv->chooser_widget == NULL)
18940N/A+ dialog->priv->chooser_widget = gdm_session_chooser_widget_new ();
18940N/A+ return gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A+gdm_session_chooser_dialog_size_request (GtkWidget *widget,
18940N/A+ GtkRequisition child_requisition;
18940N/A+ if (GTK_WIDGET_CLASS (gdm_session_chooser_dialog_parent_class)->size_request) {
18940N/A+ GTK_WIDGET_CLASS (gdm_session_chooser_dialog_parent_class)->size_request (widget, requisition);
18940N/A+ screen_w = gdk_screen_get_width (gtk_widget_get_screen (widget));
18940N/A+ screen_h = gdk_screen_get_height (gtk_widget_get_screen (widget));
18940N/A+ gtk_widget_get_child_requisition (GTK_BIN (widget)->child, &child_requisition);
18940N/A+ *requisition = child_requisition;
18940N/A+ requisition->width += 2 * GTK_CONTAINER (widget)->border_width;
18940N/A+ requisition->height += 2 * GTK_CONTAINER (widget)->border_width;
18940N/A+ requisition->width = MIN (requisition->width, .50 * screen_w);
18940N/A+ requisition->height = MIN (requisition->height, .80 * screen_h);
18940N/A+gdm_session_chooser_dialog_realize (GtkWidget *widget)
18940N/A+ GdmSessionChooserDialog *chooser_dialog;
18940N/A+ chooser_dialog = GDM_SESSION_CHOOSER_DIALOG (widget);
18940N/A+ gtk_widget_show (chooser_dialog->priv->chooser_widget);
18940N/A+ GTK_WIDGET_CLASS (gdm_session_chooser_dialog_parent_class)->realize (widget);
18940N/A+gdm_session_chooser_dialog_class_init (GdmSessionChooserDialogClass *klass)
18940N/A+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
18940N/A+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
18940N/A+ object_class->finalize = gdm_session_chooser_dialog_finalize;
18940N/A+ widget_class->size_request = gdm_session_chooser_dialog_size_request;
18940N/A+ widget_class->realize = gdm_session_chooser_dialog_realize;
18940N/A+ g_type_class_add_private (klass, sizeof (GdmSessionChooserDialogPrivate));
18940N/A+respond (GdmSessionChooserDialog *dialog)
18940N/A+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
18940N/A+queue_response (GdmSessionChooserDialog *dialog)
18940N/A+ g_idle_add ((GSourceFunc) respond, dialog);
18940N/A+gdm_session_chooser_dialog_init (GdmSessionChooserDialog *dialog)
18940N/A+ dialog->priv = GDM_SESSION_CHOOSER_DIALOG_GET_PRIVATE (dialog);
18940N/A+ dialog->priv->chooser_widget = gdm_session_chooser_widget_new ();
18940N/A+ gdm_chooser_widget_set_hide_inactive_items (GDM_CHOOSER_WIDGET (dialog->priv->chooser_widget),
18940N/A+ session_name = gdm_session_chooser_widget_get_current_session_name (GDM_SESSION_CHOOSER_WIDGET (dialog->priv->chooser_widget));
18940N/A+ gdm_session_chooser_widget_set_current_session_name (GDM_SESSION_CHOOSER_WIDGET (dialog->priv->chooser_widget), session_name);
18940N/A+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
18940N/A+ g_signal_connect_swapped (G_OBJECT (dialog->priv->chooser_widget),
18940N/A+ "activated", G_CALLBACK (queue_response),
18940N/A+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
18940N/A+ _("_Skip Setup"), GTK_RESPONSE_CANCEL,
18940N/A+ GTK_STOCK_OK, GTK_RESPONSE_OK,
18940N/A+ gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
18940N/A+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
18940N/A+ gtk_container_set_border_width (GTK_CONTAINER (dialog->priv->chooser_widget), 5);
18940N/A+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
18940N/A+ gtk_window_set_default_size (GTK_WINDOW (dialog), 512, 440);
18940N/A+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
18940N/A+gdm_session_chooser_dialog_finalize (GObject *object)
18940N/A+ GdmSessionChooserDialog *session_chooser_dialog;
18940N/A+ g_return_if_fail (object != NULL);
18940N/A+ g_return_if_fail (GDM_IS_SESSION_CHOOSER_DIALOG (object));
18940N/A+ session_chooser_dialog = GDM_SESSION_CHOOSER_DIALOG (object);
18940N/A+ g_return_if_fail (session_chooser_dialog->priv != NULL);
18940N/A+ G_OBJECT_CLASS (gdm_session_chooser_dialog_parent_class)->finalize (object);
18940N/A+gdm_session_chooser_dialog_new (void)
18940N/A+ object = g_object_new (GDM_TYPE_SESSION_CHOOSER_DIALOG,
18940N/A+ "icon-name", "session-properties",
18940N/A+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
18940N/A+ * Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
18940N/A+ * This program is free software; you can redistribute it
and/or modify
18940N/A+ * it under the terms of the GNU General Public License as published by
18940N/A+ * the Free Software Foundation; either version 2 of the License, or
18940N/A+ * (at your option) any later version.
18940N/A+ * This program is distributed in the hope that it will be useful,
18940N/A+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18940N/A+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18940N/A+ * GNU General Public License for more details.
18940N/A+ * You should have received a copy of the GNU General Public License
18940N/A+ * along with this program; if not, write to the Free Software
18940N/A+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18940N/A+ * Written by suresh.chandrasekharan@oracle.com based on
18940N/A+#ifndef __GDM_SESSION_CHOOSER_DIALOG_H
18940N/A+#define __GDM_SESSION_CHOOSER_DIALOG_H
18940N/A+#define GDM_TYPE_SESSION_CHOOSER_DIALOG (gdm_session_chooser_dialog_get_type ())
18940N/A+#define GDM_SESSION_CHOOSER_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_SESSION_CHOOSER_DIALOG, GdmSessionChooserDialog))
18940N/A+#define GDM_SESSION_CHOOSER_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_SESSION_CHOOSER_DIALOG, GdmSessionChooserDialogClass))
18940N/A+#define GDM_IS_SESSION_CHOOSER_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_SESSION_CHOOSER_DIALOG))
18940N/A+#define GDM_IS_SESSION_CHOOSER_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_SESSION_CHOOSER_DIALOG))
18940N/A+#define GDM_SESSION_CHOOSER_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_SESSION_CHOOSER_DIALOG, GdmSessionChooserDialogClass))
18940N/A+typedef struct GdmSessionChooserDialogPrivate GdmSessionChooserDialogPrivate;
18940N/A+ GdmSessionChooserDialogPrivate *priv;
18940N/A+} GdmSessionChooserDialogClass;
18940N/A+GType gdm_session_chooser_dialog_get_type (void);
18940N/A+GtkWidget * gdm_session_chooser_dialog_new (void);
18940N/A+char * gdm_session_chooser_dialog_get_current_session_name (GdmSessionChooserDialog *dialog);
18940N/A+void gdm_session_chooser_dialog_set_current_session_name (GdmSessionChooserDialog *dialog,
18940N/A+int gdm_session_chooser_dialog_get_number_of_items
18940N/A+(GdmSessionChooserDialog *dialog);
18940N/A+#endif /* __GDM_SESSION_CHOOSER_DIALOG_H */
18940N/A+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
18940N/A+ * Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
18940N/A+ * This program is free software; you can redistribute it
and/or modify
18940N/A+ * it under the terms of the GNU General Public License as published by
18940N/A+ * the Free Software Foundation; either version 2 of the License, or
18940N/A+ * (at your option) any later version.
18940N/A+ * This program is distributed in the hope that it will be useful,
18940N/A+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18940N/A+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18940N/A+ * GNU General Public License for more details.
18940N/A+ * You should have received a copy of the GNU General Public License
18940N/A+ * along with this program; if not, write to the Free Software
18940N/A+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18940N/A+ * Written by suresh.chandrasekharan@oracle.com based on
18940N/A+#define GDM_SESSION_CHOOSER_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SESSION_CHOOSER_WIDGET, GdmSessionChooserWidgetPrivate))
18940N/A+struct GdmSessionChooserWidgetPrivate
18940N/A+static void gdm_session_chooser_widget_class_init (GdmSessionChooserWidgetClass *klass);
18940N/A+static void gdm_session_chooser_widget_init (GdmSessionChooserWidget *session_chooser_widget);
18940N/A+static void gdm_session_chooser_widget_finalize (GObject *object);
18940N/A+G_DEFINE_TYPE (GdmSessionChooserWidget, gdm_session_chooser_widget, GDM_TYPE_CHOOSER_WIDGET)
18940N/A+ CHOOSER_LIST_TITLE_COLUMN = 0,
18940N/A+ CHOOSER_LIST_TRANSLATED_COLUMN,
18940N/A+gdm_session_chooser_widget_get_current_session_name (GdmSessionChooserWidget *widget)
18940N/A+ g_return_val_if_fail (GDM_IS_SESSION_CHOOSER_WIDGET (widget), NULL);
18940N/A+ id = gdm_chooser_widget_get_selected_item (GDM_CHOOSER_WIDGET (widget));
18940N/A+gdm_session_chooser_widget_set_current_session_name (GdmSessionChooserWidget *widget,
18940N/A+ g_return_if_fail (GDM_IS_SESSION_CHOOSER_WIDGET (widget));
18940N/A+ gdm_chooser_widget_set_selected_item (GDM_CHOOSER_WIDGET (widget),
18940N/A+ gdm_chooser_widget_set_selected_item (GDM_CHOOSER_WIDGET (widget), id);
18940N/A+gdm_session_chooser_widget_add_session (GdmSessionChooserWidget *widget,
18940N/A+ escaped = g_markup_escape_text (name, -1);
18940N/A+ gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
18940N/A+add_available_sessions (GdmSessionChooserWidget *widget)
18940N/A+ session_names = gdm_get_all_sessions ();
18940N/A+ for (i = 0; session_names[i] != NULL; i++) {
18940N/A+ gdm_session_chooser_widget_add_session (widget,
18940N/A+gdm_session_chooser_widget_dispose (GObject *object)
18940N/A+ G_OBJECT_CLASS (gdm_session_chooser_widget_parent_class)->dispose (object);
18940N/A+gdm_session_chooser_widget_realize (GtkWidget *widget)
18940N/A+ GdmSessionChooserWidget *chooser;
18940N/A+ chooser = GDM_SESSION_CHOOSER_WIDGET (widget);
18940N/A+ GTK_WIDGET_CLASS (gdm_session_chooser_widget_parent_class)->realize (widget);
18940N/A+ if (!chooser->priv->sessions_added) {
18940N/A+ add_available_sessions (chooser);
18940N/A+ chooser->priv->sessions_added = TRUE;
18940N/A+gdm_session_chooser_widget_class_init (GdmSessionChooserWidgetClass *klass)
18940N/A+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
18940N/A+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
18940N/A+ object_class->dispose = gdm_session_chooser_widget_dispose;
18940N/A+ object_class->finalize = gdm_session_chooser_widget_finalize;
18940N/A+ widget_class->realize = gdm_session_chooser_widget_realize;
18940N/A+ g_type_class_add_private (klass, sizeof (GdmSessionChooserWidgetPrivate));
18940N/A+gdm_session_chooser_widget_init (GdmSessionChooserWidget *widget)
18940N/A+ widget->priv = GDM_SESSION_CHOOSER_WIDGET_GET_PRIVATE (widget);
18940N/A+ gdm_chooser_widget_set_separator_position (GDM_CHOOSER_WIDGET (widget),
18940N/A+ GDM_CHOOSER_WIDGET_POSITION_TOP);
18940N/A+ if (!widget->priv->sessions_added) {
18940N/A+ add_available_sessions (widget);
18940N/A+ widget->priv->sessions_added = TRUE;
18940N/A+gdm_session_chooser_widget_finalize (GObject *object)
18940N/A+ GdmSessionChooserWidget *session_chooser_widget;
18940N/A+ g_return_if_fail (object != NULL);
18940N/A+ g_return_if_fail (GDM_IS_SESSION_CHOOSER_WIDGET (object));
18940N/A+ session_chooser_widget = GDM_SESSION_CHOOSER_WIDGET (object);
18940N/A+ g_return_if_fail (session_chooser_widget->priv != NULL);
18940N/A+ G_OBJECT_CLASS (gdm_session_chooser_widget_parent_class)->finalize (object);
18940N/A+gdm_session_chooser_widget_new (void)
18940N/A+ object = g_object_new (GDM_TYPE_SESSION_CHOOSER_WIDGET,
18940N/A+ "inactive-text", _("_Session:"),
18940N/A+ "active-text", _("_Session:"),
18940N/A+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
18940N/A+ * Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
18940N/A+ * This program is free software; you can redistribute it
and/or modify
18940N/A+ * it under the terms of the GNU General Public License as published by
18940N/A+ * the Free Software Foundation; either version 2 of the License, or
18940N/A+ * (at your option) any later version.
18940N/A+ * This program is distributed in the hope that it will be useful,
18940N/A+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18940N/A+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18940N/A+ * GNU General Public License for more details.
18940N/A+ * You should have received a copy of the GNU General Public License
18940N/A+ * along with this program; if not, write to the Free Software
18940N/A+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18940N/A+ * Written by suresh.chandrasekharan@oracle.com based on
18940N/A+#ifndef __GDM_SESSION_CHOOSER_WIDGET_H
18940N/A+#define __GDM_SESSION_CHOOSER_WIDGET_H
18940N/A+#define GDM_TYPE_SESSION_CHOOSER_WIDGET (gdm_session_chooser_widget_get_type ())
18940N/A+#define GDM_SESSION_CHOOSER_WIDGET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_SESSION_CHOOSER_WIDGET, GdmSessionChooserWidget))
18940N/A+#define GDM_SESSION_CHOOSER_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_SESSION_CHOOSER_WIDGET, GdmSessionChooserWidgetClass))
18940N/A+#define GDM_IS_SESSION_CHOOSER_WIDGET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_SESSION_CHOOSER_WIDGET))
18940N/A+#define GDM_IS_SESSION_CHOOSER_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_SESSION_CHOOSER_WIDGET))
18940N/A+#define GDM_SESSION_CHOOSER_WIDGET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_SESSION_CHOOSER_WIDGET, GdmSessionChooserWidgetClass))
18940N/A+typedef struct GdmSessionChooserWidgetPrivate GdmSessionChooserWidgetPrivate;
18940N/A+ GdmSessionChooserWidgetPrivate *priv;
18940N/A+ GdmChooserWidgetClass parent_class;
18940N/A+} GdmSessionChooserWidgetClass;
18940N/A+GType gdm_session_chooser_widget_get_type (void);
18940N/A+GtkWidget * gdm_session_chooser_widget_new (void);
18940N/A+char * gdm_session_chooser_widget_get_current_session_name (GdmSessionChooserWidget *widget);
18940N/A+void gdm_session_chooser_widget_set_current_session_name (GdmSessionChooserWidget *widget,
18940N/A+#endif /* __GDM_SESSION_CHOOSER_WIDGET_H */
18940N/A+gdm_first_time_login_helper_SOURCES = \
18940N/A+gdm_first_time_login_helper_LDADD = \