commit 234b1336f9aa541c60cacd8bf7bf0ca11ae820f9
parent 4fcdceab7bb5107551b3d6e73bea3e8766e58027
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 6 Oct 2024 12:44:01 +0200
fix next-button sensitivity, fixes #8905
Diffstat:
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/src/anastasis/anastasis-gtk.c b/src/anastasis/anastasis-gtk.c
@@ -231,6 +231,7 @@ run (void *cls)
main_window = GTK_WIDGET (
GCG_get_main_window_object ("anastasis_gtk_main_window"));
gtk_window_maximize (GTK_WINDOW (main_window));
+ AG_insensitive ("anastasis_gtk_main_window_forward_button");
/* make GUI visible */
gtk_widget_show (main_window);
gtk_window_present (GTK_WINDOW (main_window));
diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c
@@ -102,6 +102,30 @@ lookup_provider_name (const char *provider_url)
/**
+ * Set country selection next-button sensitivity based on
+ * whether a country is currently selected.
+ */
+static void
+set_country_selection_next (void)
+{
+ GtkTreeView *tv;
+ GtkTreeSelection *sel;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ tv = GTK_TREE_VIEW (GCG_get_main_window_object (
+ "anastasis_gtk_country_treeview"));
+ sel = gtk_tree_view_get_selection (tv);
+ if (gtk_tree_selection_get_selected (sel,
+ &model,
+ &iter))
+ AG_enable_next ();
+ else
+ AG_insensitive ("anastasis_gtk_main_window_forward_button");
+}
+
+
+/**
* Prepare window for selection of the continent.
*/
static void
@@ -178,7 +202,7 @@ action_continent_selecting (void)
AG_hide ("anastasis_gtk_backup_progress_scrolled_window");
}
AG_show ("anastasis_gtk_main_window_prev_button");
- AG_enable_next ();
+ set_country_selection_next ();
AG_show ("anastasis_gtk_main_control_vbox");
AG_show ("anastasis_gtk_continent_frame");
}
@@ -275,7 +299,9 @@ action_country_selecting (void)
AG_hide ("anastasis_gtk_backup_progress_scrolled_window");
}
AG_show ("anastasis_gtk_main_window_prev_button");
- AG_enable_next ();
+
+ set_country_selection_next ();
+
AG_show ("anastasis_gtk_continent_frame");
}
@@ -653,7 +679,7 @@ action_user_attributes_collecting (void)
AG_show ("anastasis_gtk_main_window_save_as_button");
AG_show ("anastasis_gtk_main_control_vbox");
AG_show ("anastasis_gtk_main_window_prev_button");
- AG_enable_next ();
+ AG_identity_changed ();
AG_show ("anastasis_gtk_identity_frame");
AG_focus ("anastasis_gtk_ia_full_name_entry");
}
diff --git a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
@@ -485,5 +485,6 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
.action = NULL }
};
+ AG_insensitive ("anastasis_gtk_main_window_forward_button");
AG_dispatch (actions);
}