$NetBSD: patch-al,v 1.1 2005/07/17 22:53:06 kristerw Exp $ --- gui/gdmsetup.c.orig Sun Jul 17 23:50:28 2005 +++ gui/gdmsetup.c Mon Jul 18 00:06:08 2005 @@ -334,13 +334,13 @@ for (li = list; li != NULL; li = li->next) { char *key = li->data; + GtkTreeIter iter; int vt = atoi(key); key = g_strconcat(GDM_KEY_SERVERS, "/", key, NULL); cpy = ve_config_get_string (cfg, key); server = ve_first_word (cpy); options = ve_rest (cpy); - GtkTreeIter iter; gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, XSERVER_COLUMN_VT, vt, @@ -2075,16 +2075,19 @@ const char *nosound_button; const char *soundtest_button; char *sound_key, *val, *config_val; + GtkWidget *acc_no_sound_file; + GtkWidget *acc_sound_test; + VeConfig *config; nosound_button = g_strconcat ("acc_nosound_", key, "_button", NULL); soundtest_button = g_strconcat ("acc_soundtest_", key, "_button", NULL); - GtkWidget *acc_no_sound_file = glade_helper_get (xml, nosound_button, + acc_no_sound_file = glade_helper_get (xml, nosound_button, GTK_TYPE_BUTTON); - GtkWidget *acc_sound_test = glade_helper_get (xml, soundtest_button, + acc_sound_test = glade_helper_get (xml, soundtest_button, GTK_TYPE_BUTTON); - VeConfig *config = ve_config_get (GDM_CONFIG_FILE); + config = ve_config_get (GDM_CONFIG_FILE); gtk_label_set_text (GTK_LABEL (acc_sound_file_label), _("None")); gtk_widget_set_sensitive (acc_no_sound_file, FALSE); gtk_widget_set_sensitive (acc_sound_test, FALSE); @@ -2120,17 +2123,20 @@ const char *nosound_button; const char *soundtest_button; + GtkWidget *acc_no_sound_file; + GtkWidget *acc_sound_test; nosound_button = g_strconcat("acc_nosound_",key,"_button",NULL); soundtest_button = g_strconcat("acc_soundtest_",key,"_button",NULL); - GtkWidget *acc_no_sound_file = glade_helper_get (xml, nosound_button, + acc_no_sound_file = glade_helper_get (xml, nosound_button, GTK_TYPE_BUTTON); - GtkWidget *acc_sound_test = glade_helper_get (xml, soundtest_button, + acc_sound_test = glade_helper_get (xml, soundtest_button, GTK_TYPE_BUTTON); if (response == GTK_RESPONSE_ACCEPT) { VeConfig *config = ve_config_get (GDM_CONFIG_FILE); char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog)); char *val; + char* sound_key; gtk_label_set_text (GTK_LABEL (acc_sound_file_label), filename); @@ -2138,7 +2144,6 @@ gtk_widget_set_sensitive (acc_sound_test, TRUE); - char* sound_key; if (strcmp (key, "ready") == 0 ) { have_sound_ready_file = TRUE; sound_key = g_strdup(GDM_KEY_SOUND_ON_LOGIN_READY_FILE); @@ -2270,6 +2275,9 @@ gchar *success_key = g_strdup("success"); gchar *failure_key = g_strdup("failure"); VeConfig *config = ve_config_get (GDM_CONFIG_FILE); + gboolean add_gtk_modules; + char *modules_list; + char *val; g_object_set_data (G_OBJECT (acc_sound_ready_file_label), "key", ready_key); @@ -2278,11 +2286,10 @@ g_object_set_data (G_OBJECT (acc_sound_failure_file_label), "key", failure_key); - gboolean add_gtk_modules = ve_config_get_bool (config, + add_gtk_modules = ve_config_get_bool (config, GDM_KEY_ADD_GTK_MODULES); - char *modules_list = ve_config_get_string (config, + modules_list = ve_config_get_string (config, GDM_KEY_GTK_MODULES_LIST); - char *val; if (add_gtk_modules && modules_list_contains (modules_list, "gail") && @@ -2749,6 +2756,7 @@ /* Loop through all checkboxes */ while (gtk_tree_model_get_iter (model, &iter, path)) { + gboolean selected; /* If this checkbox was just toggled */ if (gtk_tree_path_compare (path, sel_path) == 0) { @@ -2766,7 +2774,7 @@ } } - gboolean selected = FALSE; + selected = FALSE; gtk_tree_model_get (model, &iter, THEME_COLUMN_SELECTED_LIST, &selected, THEME_COLUMN_DIR, &theme_name, -1); @@ -3435,12 +3443,15 @@ static gboolean xserver_entry_timeout (GtkWidget *entry) { + const char *key; + VeConfig *cfg; + const char *text; /* Get xserver section to update */ GtkWidget *combobox = glade_helper_get (xml, "xserver_mod_combobox", GTK_TYPE_COMBO_BOX); gchar *section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox)); section = g_strconcat(GDM_KEY_SERVER_PREFIX, section, "/", NULL); - const char *key = g_object_get_data (G_OBJECT (entry), "key"); + key = g_object_get_data (G_OBJECT (entry), "key"); if (strcmp (key, GDM_KEY_SERVER_NAME) == 0) section = g_strconcat(section, GDM_KEY_SERVER_NAME, NULL); @@ -3448,10 +3459,10 @@ section = g_strconcat(section, GDM_KEY_SERVER_COMMAND, NULL); /* Locate this server's section */ - VeConfig *cfg = ve_config_get (GDM_CONFIG_FILE); + cfg = ve_config_get (GDM_CONFIG_FILE); /* Update this servers configuration */ - const char *text = gtk_entry_get_text (GTK_ENTRY (entry)); + text = gtk_entry_get_text (GTK_ENTRY (entry)); ve_config_set_string (cfg, section, ve_sure_string (text)); ve_config_save (cfg, FALSE /* force */); g_free(section); @@ -3462,12 +3473,15 @@ static gboolean xserver_toggle_timeout (GtkWidget *toggle) { + const char *key; + VeConfig *cfg; + gboolean val; /* Get xserver section to update */ GtkWidget *combobox = glade_helper_get (xml, "xserver_mod_combobox", GTK_TYPE_COMBO_BOX); gchar *section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox)); section = g_strconcat(GDM_KEY_SERVER_PREFIX, section, "/", NULL); - const char *key = g_object_get_data (G_OBJECT (toggle), "key"); + key = g_object_get_data (G_OBJECT (toggle), "key"); if (strcmp (key, GDM_KEY_SERVER_HANDLED) == 0) section = g_strconcat(section, GDM_KEY_SERVER_HANDLED, NULL); @@ -3477,8 +3491,8 @@ section = g_strconcat(section, GDM_KEY_SERVER_CHOOSER, NULL); /* Locate this server's section */ - VeConfig *cfg = ve_config_get (GDM_CONFIG_FILE); - gboolean val = ve_config_get_bool (cfg, section); + cfg = ve_config_get (GDM_CONFIG_FILE); + val = ve_config_get_bool (cfg, section); /* Update this servers configuration */ if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) { @@ -3513,6 +3527,7 @@ xserver_populate_combobox(GtkComboBox* combobox) { gint i,j; + GSList *xservers; /* Get number of items in combobox */ i = gtk_tree_model_iter_n_children( @@ -3524,7 +3539,7 @@ } /* Populate combobox with list of current servers */ - GSList *xservers = xservers_get_server_definitions(); + xservers = xservers_get_server_definitions(); g_slist_foreach(xservers, (GFunc) xserver_append_combobox, combobox); } @@ -3608,13 +3623,14 @@ if (gtk_tree_selection_get_selected (selection, &model, &iter)) { + char *key; /* Update config */ cfg = ve_config_get (GDM_CONFIG_FILE); gtk_tree_model_get (model, &iter, XSERVER_COLUMN_VT, &vt, -1); g_snprintf (vt_value, sizeof (vt_value), "%d", vt); - char *key = g_object_get_data (G_OBJECT (combo), "key"); + key = g_object_get_data (G_OBJECT (combo), "key"); key = g_strconcat (key, "/", vt_value, "=", NULL); ve_config_delete_key (cfg, key); ve_config_save (cfg, FALSE /* force */); @@ -3634,6 +3650,8 @@ GtkWidget *spinner, *combo, *entry, *button; gchar *string; char spinner_value[3]; + char *key; + VeConfig *cfg; /* Get Widgets from glade */ spinner = glade_helper_get (xml, "xserver_spin_button", @@ -3646,7 +3664,7 @@ GTK_TYPE_BUTTON); /* Section in config to modify */ - char *key = g_object_get_data (G_OBJECT (combo), "key"); + key = g_object_get_data (G_OBJECT (combo), "key"); /* String to add to config */ g_snprintf (spinner_value, sizeof (spinner_value), "%d", @@ -3658,7 +3676,7 @@ NULL); /* Add to config */ - VeConfig *cfg = ve_config_get (GDM_CONFIG_FILE); + cfg = ve_config_get (GDM_CONFIG_FILE); ve_config_set_string (cfg, key, ve_sure_string(string)); ve_config_save (cfg, FALSE /* force */); @@ -3684,6 +3702,8 @@ GtkWidget *handled_check, *flexible_check; GtkWidget *greeter_radio, *chooser_radio; GtkWidget *create_button, *delete_button; + VeConfig *cfg; + gboolean success; /* Get Widgets from glade */ frame = glade_helper_get (xml, "xserver_modify_frame", @@ -3712,12 +3732,13 @@ /* TODO: Create a new section for this server */ /* TODO: Write this value to the config and update xservers list */ - VeConfig *cfg = ve_config_get (GDM_CONFIG_FILE); - gboolean success = FALSE; + cfg = ve_config_get (GDM_CONFIG_FILE); + success = FALSE; /* success = ve_config_add_section (cfg, SECTION_NAME); */ if (success) { + gint i; /* Update settings for new server */ gtk_widget_set_sensitive (frame, TRUE); gtk_widget_set_sensitive (delete_button, TRUE); @@ -3735,7 +3756,7 @@ FALSE); /* Select the new server in the combobox */ - gint i = gtk_tree_model_iter_n_children ( + i = gtk_tree_model_iter_n_children ( gtk_combo_box_get_model (GTK_COMBO_BOX (modify_combobox)), NULL) - 1; gtk_combo_box_set_active (GTK_COMBO_BOX (modify_combobox), i); }