From da7e314df98c5089479ae00b263e5db0081de58e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 7 May 2023 12:20:52 +0300 Subject: [PATCH 16/16] gtk3.22: Support setting persistent rally points See osdn #47954 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/rallypointdlg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/gui-gtk-3.22/rallypointdlg.c b/client/gui-gtk-3.22/rallypointdlg.c index 1ddf19e657..cf61ab5909 100644 --- a/client/gui-gtk-3.22/rallypointdlg.c +++ b/client/gui-gtk-3.22/rallypointdlg.c @@ -37,6 +37,7 @@ bool rally_dialog = FALSE; static GtkWidget *instruction_label = NULL; +static GtkWidget *persistent; static int rally_city_id = -1; @@ -91,6 +92,12 @@ void rally_dialog_popup(void) sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_container_add(GTK_CONTAINER(main_box), sep); + persistent = gtk_check_button_new_with_label(_("Persistent rallypoint")); + gtk_container_add(GTK_CONTAINER(main_box), persistent); + + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); + gtk_container_add(GTK_CONTAINER(main_box), sep); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dlg))), main_box); @@ -166,12 +173,13 @@ bool rally_set_tile(struct tile *ptile) gtk_label_set_text(GTK_LABEL(instruction_label), buffer); } else { char buffer[100]; + bool psist = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(persistent)); fc_assert(pcity != NULL); rally_city_id = -1; - if (send_rally_tile(pcity, ptile, FALSE)) { + if (send_rally_tile(pcity, ptile, psist)) { fc_snprintf(buffer, sizeof(buffer), _("%s rally point set. Select another city."), city_name_get(pcity)); -- 2.39.2