From a13f03f64bd9ad60a3298e1e124b75c80740787f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 4 Mar 2023 12:54:48 +0200 Subject: [PATCH 22/22] Resolve key binding conflicts with "Connect..." actions - Worklist dialog : "l" -> "l" - Infrapoints dialog: "i" -> "f" (gtk4 has "i" reserved) - Revolution: "r" -> "g" (to free old binding for Rally Dialog) - Rally dialog: "r" -> "r" See osdn #47491 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/menu.c | 11 +++++++---- client/gui-gtk-4.0/menu.c | 8 ++++---- client/gui-sdl2/mapctrl.c | 12 ++++++------ client/gui-sdl2/mapview.c | 6 +++--- data/helpdata.txt | 6 ++++-- 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/client/gui-gtk-3.22/menu.c b/client/gui-gtk-3.22/menu.c index b0e24aa80f..f8eeb7b78d 100644 --- a/client/gui-gtk-3.22/menu.c +++ b/client/gui-gtk-3.22/menu.c @@ -305,11 +305,14 @@ static struct menu_entry_info menu_entries[] = G_CALLBACK(quit_callback), MGROUP_SAFE }, { "FIND_CITY", N_("_Find City"), GDK_KEY_f, GDK_CONTROL_MASK, G_CALLBACK(find_city_callback), MGROUP_SAFE }, - { "WORKLISTS", N_("Work_lists"), GDK_KEY_l, GDK_CONTROL_MASK, + { "WORKLISTS", N_("Work_lists"), + GDK_KEY_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK, G_CALLBACK(worklists_callback), MGROUP_SAFE }, - { "RALLY_DLG", N_("Rally point dialog"), GDK_KEY_r, GDK_CONTROL_MASK, + { "RALLY_DLG", N_("Rally point dialog"), + GDK_KEY_r, GDK_CONTROL_MASK | GDK_SHIFT_MASK, G_CALLBACK(rally_dialog_callback), MGROUP_SAFE }, - { "INFRA_DLG", N_("Infra dialog"), GDK_KEY_i, GDK_CONTROL_MASK, + { "INFRA_DLG", N_("Infra dialog"), + GDK_KEY_f, GDK_CONTROL_MASK | GDK_SHIFT_MASK, G_CALLBACK(infra_dialog_callback), MGROUP_SAFE }, { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"), 0, 0, G_CALLBACK(client_lua_script_callback), MGROUP_SAFE }, @@ -608,7 +611,7 @@ static struct menu_entry_info menu_entries[] = { "TAX_RATE", N_("_Tax Rates..."), GDK_KEY_t, GDK_CONTROL_MASK, G_CALLBACK(tax_rate_callback), MGROUP_PLAYING }, { "START_REVOLUTION", N_("_Revolution..."), - GDK_KEY_r, GDK_SHIFT_MASK | GDK_CONTROL_MASK, + GDK_KEY_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK, G_CALLBACK(government_callback), MGROUP_PLAYING }, { NULL } }; diff --git a/client/gui-gtk-4.0/menu.c b/client/gui-gtk-4.0/menu.c index 18c0befc78..32a94f75c7 100644 --- a/client/gui-gtk-4.0/menu.c +++ b/client/gui-gtk-4.0/menu.c @@ -578,13 +578,13 @@ static struct menu_entry_info menu_entries[] = "find_city", "f", MGROUP_SAFE, NULL, FALSE }, { "WORKLISTS", N_("Work_lists"), - "worklists", "l", MGROUP_SAFE, + "worklists", "l", MGROUP_SAFE, NULL, FALSE }, { "RALLY_DLG", N_("Rally point dialog"), - "rally_dlg", "r", MGROUP_SAFE, + "rally_dlg", "r", MGROUP_SAFE, NULL, FALSE }, { "INFRA_DLG", N_("Infra dialog"), - "infra_dlg", "i", MGROUP_SAFE, + "infra_dlg", "f", MGROUP_SAFE, NULL, FALSE }, { "SCENARIO_SAVE", N_("Save Scenario"), "scenario_save", NULL, MGROUP_EDIT, @@ -815,7 +815,7 @@ static struct menu_entry_info menu_entries[] = "policies", "p", MGROUP_PLAYER, NULL, FALSE }, { "START_REVOLUTION", N_("_Revolution..."), - "revolution", "r", MGROUP_PLAYING, + "revolution", "g", MGROUP_PLAYING, NULL, FALSE }, { "REPORT_WOW", N_("_Wonders of the World"), diff --git a/client/gui-sdl2/mapctrl.c b/client/gui-sdl2/mapctrl.c index 077b36115a..467ce0196f 100644 --- a/client/gui-sdl2/mapctrl.c +++ b/client/gui-sdl2/mapctrl.c @@ -1518,24 +1518,24 @@ void popup_unitinfo_window(void) research_button = pwidget; - /* revolution button */ + /* Revolution button */ pwidget = create_icon2(adj_surf(GET_SURF(client_government_sprite())), units_info_window->dst, WF_FREE_GFX | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME); - fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Revolution"), "Ctrl+Shift+R"); + fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Revolution"), "Ctrl+Shift+G"); pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); pwidget->action = revolution_callback; - pwidget->key = SDLK_r; + pwidget->key = SDLK_g; pwidget->mod = KMOD_CTRL | KMOD_SHIFT; add_to_gui_list(ID_REVOLUTION, pwidget); revolution_button = pwidget; - /* show/hide unit's window button */ + /* Show/hide unit's window button */ - /* make UNITS Icon */ + /* Make UNITS Icon */ icon_theme = create_surf(current_theme->map_icon->w, current_theme->map_icon->h, SDL_SWSURFACE); alphablit(current_theme->map_icon, NULL, icon_theme, NULL, 255); @@ -2529,7 +2529,7 @@ bool map_event_handler(SDL_Keysym key) } return FALSE; - /* show map grid - Ctrl+g */ + /* Show map grid - Ctrl+g */ case SDLK_g: if (LCTRL || RCTRL) { key_map_grid_toggle(); diff --git a/client/gui-sdl2/mapview.c b/client/gui-sdl2/mapview.c index 6f6727e060..f0ea26cd5f 100644 --- a/client/gui-sdl2/mapview.c +++ b/client/gui-sdl2/mapview.c @@ -296,7 +296,7 @@ void gui_flush(void) /**********************************************************************//** Set information for the indicator icons typically shown in the main - client window. The parameters tell which sprite to use for the + client window. The parameters tell which sprite to use for the indicator. **************************************************************************/ void set_indicator_icons(struct sprite *bulb, struct sprite *sol, @@ -322,11 +322,11 @@ void set_indicator_icons(struct sprite *bulb, struct sprite *sol, if (NULL != client.conn.playing) { fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)\n%s", - _("Revolution"), "Ctrl+Shift+R", + _("Revolution"), "Ctrl+Shift+G", government_name_for_player(client.conn.playing)); } else { fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)\n%s", - _("Revolution"), "Ctrl+Shift+R", + _("Revolution"), "Ctrl+Shift+G", Q_("?gov:None")); } copy_chars_to_utf8_str(buf->info_label, cbuf); diff --git a/data/helpdata.txt b/data/helpdata.txt index d62b806463..fb264b8d62 100644 --- a/data/helpdata.txt +++ b/data/helpdata.txt @@ -1793,9 +1793,11 @@ Dialogs and Reports:\n\ F12: open Spaceship\n\ \n\ Ctrl-F: open Find City dialog\n\ - Ctrl-L: open Worklists dialog\n\ + Shift-Ctrl-L: open Worklists dialog\n\ Ctrl-T: open Tax/Lux/Sci Rates dialog\n\ - Shift-Ctrl-R: open Revolution dialog\n\ + Shift-Ctrl-G: open Revolution dialog\n\ + Shift-Ctrl-I: open Infrapoints dialog\n\ + Shift-Ctrl-R: open Rally point dialog\n\ \n\ Shift-Return: Turn done\n\ "), _("\ -- 2.39.2