From 7d8a6cad0daf9d996c47ba39c48a9905203c1c49 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 16 Jul 2022 01:57:47 +0300 Subject: [PATCH 43/43] gtk4: Use index instead of gov rule name in action names See osdn #45111 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/gui-gtk-4.0/menu.c b/client/gui-gtk-4.0/menu.c index 99be5c8712..3b1b02a83f 100644 --- a/client/gui-gtk-4.0/menu.c +++ b/client/gui-gtk-4.0/menu.c @@ -2094,15 +2094,16 @@ GMenu *setup_menus(GtkApplication *app) submenu = g_menu_new(); menu_entry_init(submenu, "START_REVOLUTION"); + + i = 0; governments_iterate(g) { if (g != game.government_during_revolution) { GMenuItem *item; char name[256]; char actname[256]; GSimpleAction *act; - const char *grname = government_rule_name(g); - fc_snprintf(actname, sizeof(actname), "government_%s", grname); + fc_snprintf(actname, sizeof(actname), "government_%d", i); act = g_simple_action_new(actname, NULL); g_simple_action_set_enabled(act, can_change_to_government(client_player(), g)); g_action_map_add_action(G_ACTION_MAP(fc_app), G_ACTION(act)); @@ -2111,8 +2112,7 @@ GMenu *setup_menus(GtkApplication *app) /* TRANS: %s is a government name */ fc_snprintf(name, sizeof(name), _("%s..."), government_name_translation(g)); - fc_snprintf(actname, sizeof(actname), "app.government_%s", - grname); + fc_snprintf(actname, sizeof(actname), "app.government_%d", i++); item = g_menu_item_new(name, actname); g_menu_append_item(submenu, item); } -- 2.35.1