diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/prefs-dialog.c | 19 |
2 files changed, 17 insertions, 9 deletions
@@ -1,5 +1,12 @@ 2004-11-07 Christian Persch <chpe@cvs.gnome.org> + * src/prefs-dialog.c: (language_editor_update_buttons): + + Fix button sensitivity setting in language editor not to first + disable the buttons. Fixes moving an item more than once at a time. + +2004-11-07 Christian Persch <chpe@cvs.gnome.org> + * Makefile.am: * configure.ac: A idl/.cvsignore: diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 9fdf34a73..89b5e2b0a 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -694,27 +694,28 @@ language_editor_update_buttons (PrefsDialog *dialog) GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; + gboolean can_remove = FALSE, can_move_up = FALSE, can_move_down = FALSE; int selected; selection = gtk_tree_view_get_selection (dialog->priv->lang_treeview); - gtk_widget_set_sensitive (dialog->priv->lang_remove_button, FALSE); - gtk_widget_set_sensitive (dialog->priv->lang_up_button, FALSE); - gtk_widget_set_sensitive (dialog->priv->lang_down_button, FALSE); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { path = gtk_tree_model_get_path (model, &iter); selected = gtk_tree_path_get_indices (path)[0]; - - gtk_widget_set_sensitive (dialog->priv->lang_remove_button, TRUE); - gtk_widget_set_sensitive (dialog->priv->lang_up_button, selected > 0); - gtk_widget_set_sensitive (dialog->priv->lang_down_button, - selected < gtk_tree_model_iter_n_children (model, NULL) - 1); + + can_remove = TRUE; + can_move_up = selected > 0; + can_move_down = + selected < gtk_tree_model_iter_n_children (model, NULL) - 1; gtk_tree_path_free (path); } + + gtk_widget_set_sensitive (dialog->priv->lang_remove_button, can_remove); + gtk_widget_set_sensitive (dialog->priv->lang_up_button, can_move_up); + gtk_widget_set_sensitive (dialog->priv->lang_down_button, can_move_down); } static void |