From 1e0d03a4963179d04dc04ed2cd2c6aed532ae564 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 1 Oct 2022 13:08:49 +0300 Subject: [PATCH 31/31] guis: Use 'board' / 'deboard' namespaces Make it a bit clearer what of the transport actions each function is about. See osdn #45750 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/menu.c | 24 ++++++++++++------------ client/gui-gtk-3.22/menu.c | 24 ++++++++++++------------ client/gui-gtk-4.0/menu.c | 24 ++++++++++++------------ client/gui-qt/hudwidget.cpp | 8 ++++---- client/gui-qt/menu.cpp | 24 ++++++++++++------------ client/gui-qt/menu.h | 8 ++++---- client/gui-qt/shortcuts.cpp | 4 ++-- client/gui-qt/shortcuts.h | 4 ++-- client/gui-sdl2/gui_id.h | 4 ++-- client/gui-sdl2/menu.c | 20 ++++++++++---------- data/gtk3.22_menus.xml | 4 ++-- data/gtk3_menus.xml | 4 ++-- data/gtk4_menus.xml | 4 ++-- 13 files changed, 78 insertions(+), 78 deletions(-) diff --git a/client/gui-gtk-3.0/menu.c b/client/gui-gtk-3.0/menu.c index b70f20dba0..cb2fcf9b55 100644 --- a/client/gui-gtk-3.0/menu.c +++ b/client/gui-gtk-3.0/menu.c @@ -218,8 +218,8 @@ static void unit_explore_callback(GtkMenuItem *item, gpointer data); static void unit_patrol_callback(GtkMenuItem *item, gpointer data); static void unit_sentry_callback(GtkMenuItem *item, gpointer data); static void unit_unsentry_callback(GtkMenuItem *item, gpointer data); -static void unit_load_callback(GtkMenuItem *item, gpointer data); -static void unit_unload_callback(GtkMenuItem *item, gpointer data); +static void unit_board_callback(GtkMenuItem *item, gpointer data); +static void unit_deboard_callback(GtkMenuItem *item, gpointer data); static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data); static void unit_homecity_callback(GtkMenuItem *item, gpointer data); @@ -477,10 +477,10 @@ static struct menu_entry_info menu_entries[] = G_CALLBACK(unit_sentry_callback), MGROUP_UNIT }, { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK, G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT }, - { "UNIT_LOAD", N_("_Load"), GDK_KEY_l, 0, - G_CALLBACK(unit_load_callback), MGROUP_UNIT }, - { "UNIT_UNLOAD", N_("_Unload"), GDK_KEY_u, 0, - G_CALLBACK(unit_unload_callback), MGROUP_UNIT }, + { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0, + G_CALLBACK(unit_board_callback), MGROUP_UNIT }, + { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0, + G_CALLBACK(unit_deboard_callback), MGROUP_UNIT }, { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"), GDK_KEY_t, GDK_SHIFT_MASK, G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT }, @@ -1488,9 +1488,9 @@ static void unit_unsentry_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_LOAD" callback. + Item "UNIT_BOARD" callback. ****************************************************************************/ -static void unit_load_callback(GtkMenuItem *item, gpointer data) +static void unit_board_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_transport(punit, unit_tile(punit)); @@ -1498,9 +1498,9 @@ static void unit_load_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_UNLOAD" callback. + Item "UNIT_DEBOARD" callback. ****************************************************************************/ -static void unit_unload_callback(GtkMenuItem *item, gpointer data) +static void unit_deboard_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_unit_unload(punit); @@ -2336,9 +2336,9 @@ void real_menus_update(void) can_units_do(punits, can_unit_change_homecity)); menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER", units_are_occupied(punits)); - menu_entry_set_sensitive("UNIT_LOAD", + menu_entry_set_sensitive("UNIT_BOARD", units_can_load(punits)); - menu_entry_set_sensitive("UNIT_UNLOAD", + menu_entry_set_sensitive("UNIT_DEBOARD", units_can_unload(punits)); menu_entry_set_sensitive("UNIT_UNSENTRY", units_have_activity_on_tile(punits, diff --git a/client/gui-gtk-3.22/menu.c b/client/gui-gtk-3.22/menu.c index d435fa6ee9..7619fcbf63 100644 --- a/client/gui-gtk-3.22/menu.c +++ b/client/gui-gtk-3.22/menu.c @@ -221,8 +221,8 @@ static void unit_explore_callback(GtkMenuItem *item, gpointer data); static void unit_patrol_callback(GtkMenuItem *item, gpointer data); static void unit_sentry_callback(GtkMenuItem *item, gpointer data); static void unit_unsentry_callback(GtkMenuItem *item, gpointer data); -static void unit_load_callback(GtkMenuItem *item, gpointer data); -static void unit_unload_callback(GtkMenuItem *item, gpointer data); +static void unit_board_callback(GtkMenuItem *item, gpointer data); +static void unit_deboard_callback(GtkMenuItem *item, gpointer data); static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data); static void unit_homecity_callback(GtkMenuItem *item, gpointer data); @@ -484,10 +484,10 @@ static struct menu_entry_info menu_entries[] = G_CALLBACK(unit_sentry_callback), MGROUP_UNIT }, { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK, G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT }, - { "UNIT_LOAD", N_("_Load"), GDK_KEY_l, 0, - G_CALLBACK(unit_load_callback), MGROUP_UNIT }, - { "UNIT_UNLOAD", N_("_Unload"), GDK_KEY_u, 0, - G_CALLBACK(unit_unload_callback), MGROUP_UNIT }, + { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0, + G_CALLBACK(unit_board_callback), MGROUP_UNIT }, + { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0, + G_CALLBACK(unit_deboard_callback), MGROUP_UNIT }, { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"), GDK_KEY_t, GDK_SHIFT_MASK, G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT }, @@ -1511,9 +1511,9 @@ static void unit_unsentry_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_LOAD" callback. + Item "UNIT_BOARD" callback. ****************************************************************************/ -static void unit_load_callback(GtkMenuItem *item, gpointer data) +static void unit_board_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_transport(punit, unit_tile(punit)); @@ -1521,9 +1521,9 @@ static void unit_load_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_UNLOAD" callback. + Item "UNIT_DEBOARD" callback. ****************************************************************************/ -static void unit_unload_callback(GtkMenuItem *item, gpointer data) +static void unit_deboard_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_unit_unload(punit); @@ -2361,9 +2361,9 @@ void real_menus_update(void) can_units_do(punits, can_unit_change_homecity)); menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER", units_are_occupied(punits)); - menu_entry_set_sensitive("UNIT_LOAD", + menu_entry_set_sensitive("UNIT_BOARD", units_can_load(punits)); - menu_entry_set_sensitive("UNIT_UNLOAD", + menu_entry_set_sensitive("UNIT_DEBOARD", units_can_unload(punits)); menu_entry_set_sensitive("UNIT_UNSENTRY", units_have_activity_on_tile(punits, diff --git a/client/gui-gtk-4.0/menu.c b/client/gui-gtk-4.0/menu.c index 2b999415a3..83bf284bbc 100644 --- a/client/gui-gtk-4.0/menu.c +++ b/client/gui-gtk-4.0/menu.c @@ -314,8 +314,8 @@ static void unit_disband_callback(GSimpleAction *action, #ifdef MENUS_GTK3 static void unit_patrol_callback(GtkMenuItem *item, gpointer data); static void unit_unsentry_callback(GtkMenuItem *item, gpointer data); -static void unit_load_callback(GtkMenuItem *item, gpointer data); -static void unit_unload_callback(GtkMenuItem *item, gpointer data); +static void unit_board_callback(GtkMenuItem *item, gpointer data); +static void unit_deboard_callback(GtkMenuItem *item, gpointer data); static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data); #endif /* MENUS_GTK3 */ @@ -628,10 +628,10 @@ static struct menu_entry_info menu_entries[] = G_CALLBACK(unit_patrol_callback), MGROUP_UNIT }, { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK, G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT }, - { "UNIT_LOAD", N_("_Load"), GDK_KEY_l, 0, - G_CALLBACK(unit_load_callback), MGROUP_UNIT }, - { "UNIT_UNLOAD", N_("_Unload"), GDK_KEY_u, 0, - G_CALLBACK(unit_unload_callback), MGROUP_UNIT }, + { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0, + G_CALLBACK(unit_board_callback), MGROUP_UNIT }, + { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0, + G_CALLBACK(unit_deboard_callback), MGROUP_UNIT }, { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"), GDK_KEY_t, GDK_SHIFT_MASK, G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT }, @@ -1736,9 +1736,9 @@ static void unit_unsentry_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_LOAD" callback. + Item "UNIT_BORAD" callback. ****************************************************************************/ -static void unit_load_callback(GtkMenuItem *item, gpointer data) +static void unit_board_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_transport(punit, unit_tile(punit)); @@ -1746,9 +1746,9 @@ static void unit_load_callback(GtkMenuItem *item, gpointer data) } /************************************************************************//** - Item "UNIT_UNLOAD" callback. + Item "UNIT_DEBOARD" callback. ****************************************************************************/ -static void unit_unload_callback(GtkMenuItem *item, gpointer data) +static void unit_deboard_callback(GtkMenuItem *item, gpointer data) { unit_list_iterate(get_units_in_focus(), punit) { request_unit_unload(punit); @@ -2963,9 +2963,9 @@ void real_menus_update(void) /* "UNIT_CONVERT" dealt with below */ menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER", units_are_occupied(punits)); - menu_entry_set_sensitive("UNIT_LOAD", + menu_entry_set_sensitive("UNIT_BOARD", units_can_load(punits)); - menu_entry_set_sensitive("UNIT_UNLOAD", + menu_entry_set_sensitive("UNIT_DEBOARD", units_can_unload(punits)); menu_entry_set_sensitive("UNIT_UNSENTRY", units_have_activity_on_tile(punits, diff --git a/client/gui-qt/hudwidget.cpp b/client/gui-qt/hudwidget.cpp index c3eb493eac..1de6083676 100644 --- a/client/gui-qt/hudwidget.cpp +++ b/client/gui-qt/hudwidget.cpp @@ -1071,10 +1071,10 @@ int unit_actions::update_actions() actions.append(a); } - /* Load */ + // Board if (unit_can_load(current_unit)) { a = new hud_action(this); - a->action_shortcut = SC_LOAD; + a->action_shortcut = SC_BOARD; a->set_pixmap(fc_icons::instance()->get_pixmap("load")); actions.append(a); } @@ -1122,13 +1122,13 @@ int unit_actions::update_actions() actions.append(a); } - /* Unload */ + // Deboard if (unit_transported(current_unit) && can_unit_unload(current_unit, unit_transport_get(current_unit)) && can_unit_exist_at_tile(&(wld.map), current_unit, unit_tile(current_unit))) { a = new hud_action(this); - a->action_shortcut = SC_UNLOAD; + a->action_shortcut = SC_DEBOARD; a->set_pixmap(fc_icons::instance()->get_pixmap("unload")); actions.append(a); } diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index f3692b6c26..e2b7bc3f46 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -1246,14 +1246,14 @@ void mr_menu::setup_menus() menu->addSeparator(); act = menu->addAction(_("Load")); act->setShortcut(QKeySequence(shortcut_to_string( - fc_shortcuts::sc()->get_shortcut(SC_LOAD)))); - menu_list.insert(LOAD, act); - connect(act, &QAction::triggered, this, &mr_menu::slot_load); + fc_shortcuts::sc()->get_shortcut(SC_BOARD)))); + menu_list.insert(BOARD, act); + connect(act, &QAction::triggered, this, &mr_menu::slot_board); act = menu->addAction(_("Unload")); act->setShortcut(QKeySequence(shortcut_to_string( - fc_shortcuts::sc()->get_shortcut(SC_UNLOAD)))); - menu_list.insert(UNLOAD, act); - connect(act, &QAction::triggered, this, &mr_menu::slot_unload); + fc_shortcuts::sc()->get_shortcut(SC_DEBOARD)))); + menu_list.insert(DEBOARD, act); + connect(act, &QAction::triggered, this, &mr_menu::slot_deboard); act = menu->addAction(_("Unload All From Transporter")); act->setShortcut(QKeySequence(tr("shift+u"))); menu_list.insert(TRANSPORTER, act); @@ -2119,13 +2119,13 @@ void mr_menu::menus_sensitive() } break; - case LOAD: + case BOARD: if (units_can_load(punits)) { i.value()->setEnabled(true); } break; - case UNLOAD: + case DEBOARD: if (units_can_unload(punits)) { i.value()->setEnabled(true); } @@ -2999,9 +2999,9 @@ void mr_menu::slot_execute_orders() } /**********************************************************************//** - Action "LOAD INTO TRANSPORTER" + Action "BOARD INTO TRANSPORTER" **************************************************************************/ -void mr_menu::slot_load() +void mr_menu::slot_board() { unit_list_iterate(get_units_in_focus(), punit) { qtg_request_transport(punit, unit_tile(punit)); @@ -3043,9 +3043,9 @@ void mr_menu::slot_set_home() } /**********************************************************************//** - Action "UNLOAD FROM TRANSPORTED" + Action "DEBOARD FROM TRANSPORTED" **************************************************************************/ -void mr_menu::slot_unload() +void mr_menu::slot_deboard() { unit_list_iterate(get_units_in_focus(), punit) { request_unit_unload(punit); diff --git a/client/gui-qt/menu.h b/client/gui-qt/menu.h index 515e38206f..1448c82d95 100644 --- a/client/gui-qt/menu.h +++ b/client/gui-qt/menu.h @@ -39,8 +39,8 @@ struct fc_shortcut; enum munit { STANDARD, EXPLORE, - LOAD, - UNLOAD, + BOARD, + DEBOARD, TRANSPORTER, DISBAND, CONVERT, @@ -333,8 +333,8 @@ private slots: void slot_return_to_city(); void slot_patrol(); void slot_unsentry(); - void slot_load(); - void slot_unload(); + void slot_board(); + void slot_deboard(); void slot_unload_all(); void slot_set_home(); void slot_upgrade(); diff --git a/client/gui-qt/shortcuts.cpp b/client/gui-qt/shortcuts.cpp index 16bea15357..2825984e65 100644 --- a/client/gui-qt/shortcuts.cpp +++ b/client/gui-qt/shortcuts.cpp @@ -138,9 +138,9 @@ fc_shortcut default_shortcuts[] = { _("Transform") }, {SC_NUKE, Qt::Key_N, Qt::AllButtons, Qt::ShiftModifier, _("Explode Nuclear") }, - {SC_LOAD, Qt::Key_L, Qt::AllButtons, Qt::NoModifier, + {SC_BOARD, Qt::Key_L, Qt::AllButtons, Qt::NoModifier, _("Load") }, - {SC_UNLOAD, Qt::Key_U, Qt::AllButtons, Qt::NoModifier, + {SC_DEBOARD, Qt::Key_U, Qt::AllButtons, Qt::NoModifier, _("Unload") }, {SC_BUY_MAP, 0, Qt::BackButton, Qt::NoModifier, _("Quick buy current production from map") }, diff --git a/client/gui-qt/shortcuts.h b/client/gui-qt/shortcuts.h index b2a26b37c2..0c7c1d01f9 100644 --- a/client/gui-qt/shortcuts.h +++ b/client/gui-qt/shortcuts.h @@ -74,8 +74,8 @@ enum shortcut_id { SC_WAIT = 40, SC_TRANSFORM = 41, SC_NUKE = 42, - SC_LOAD = 43, - SC_UNLOAD = 44, + SC_BOARD = 43, + SC_DEBOARD = 44, SC_BUY_MAP = 45, SC_IFACE_LOCK = 46, SC_AUTOMATE = 47, diff --git a/client/gui-sdl2/gui_id.h b/client/gui-sdl2/gui_id.h index 20db57a532..4f9c0ccce8 100644 --- a/client/gui-sdl2/gui_id.h +++ b/client/gui-sdl2/gui_id.h @@ -102,8 +102,8 @@ enum GUI_ID { ID_UNIT_ORDER_PILLAGE, ID_UNIT_ORDER_HOMECITY, ID_UNIT_ORDER_UNLOAD_TRANSPORTER, - ID_UNIT_ORDER_LOAD, - ID_UNIT_ORDER_UNLOAD, + ID_UNIT_ORDER_BOARD, + ID_UNIT_ORDER_DEBOARD, ID_UNIT_ORDER_WAKEUP_OTHERS, ID_UNIT_ORDER_AUTO_SETTLER, ID_UNIT_ORDER_AUTO_EXPLORE, diff --git a/client/gui-sdl2/menu.c b/client/gui-sdl2/menu.c index 506ce17b81..1dbd0971a4 100644 --- a/client/gui-sdl2/menu.c +++ b/client/gui-sdl2/menu.c @@ -162,12 +162,12 @@ static int unit_order_callback(struct widget *order_widget) case ID_UNIT_ORDER_UNLOAD_TRANSPORTER: key_unit_unload_all(); break; - case ID_UNIT_ORDER_LOAD: + case ID_UNIT_ORDER_BOARD: unit_list_iterate(get_units_in_focus(), punit) { request_unit_load(punit, NULL, unit_tile(punit)); } unit_list_iterate_end; break; - case ID_UNIT_ORDER_UNLOAD: + case ID_UNIT_ORDER_DEBOARD: unit_list_iterate(get_units_in_focus(), punit) { request_unit_unload(punit); } unit_list_iterate_end; @@ -668,7 +668,7 @@ void create_units_order_widgets(void) add_to_gui_list(ID_UNIT_ORDER_UNLOAD_TRANSPORTER, buf); /* --------- */ - /* Load */ + /* Board */ fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Load Unit"), "L"); buf = create_themeicon(current_theme->o_load_icon, main_data.gui, WF_HIDDEN | WF_RESTORE_BACKGROUND @@ -677,10 +677,10 @@ void create_units_order_widgets(void) buf->action = unit_order_callback; buf->info_label = create_utf8_from_char(cbuf, adj_font(10)); buf->key = SDLK_l; - add_to_gui_list(ID_UNIT_ORDER_LOAD, buf); + add_to_gui_list(ID_UNIT_ORDER_BOARD, buf); /* --------- */ - /* Unload */ + /* Deboard */ fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Unload Unit"), "U"); buf = create_themeicon(current_theme->o_unload_icon, main_data.gui, WF_HIDDEN | WF_RESTORE_BACKGROUND @@ -689,7 +689,7 @@ void create_units_order_widgets(void) buf->action = unit_order_callback; buf->info_label = create_utf8_from_char(cbuf, adj_font(10)); buf->key = SDLK_u; - add_to_gui_list(ID_UNIT_ORDER_UNLOAD, buf); + add_to_gui_list(ID_UNIT_ORDER_DEBOARD, buf); /* --------- */ /* Find Homecity */ @@ -1351,15 +1351,15 @@ void real_menus_update(void) } if (units_can_load(punits)) { - local_show(ID_UNIT_ORDER_LOAD); + local_show(ID_UNIT_ORDER_BOARD); } else { - local_hide(ID_UNIT_ORDER_LOAD); + local_hide(ID_UNIT_ORDER_BOARD); } if (units_can_unload(punits)) { - local_show(ID_UNIT_ORDER_UNLOAD); + local_show(ID_UNIT_ORDER_DEBOARD); } else { - local_hide(ID_UNIT_ORDER_UNLOAD); + local_hide(ID_UNIT_ORDER_DEBOARD); } if (is_unit_activity_on_tile(ACTIVITY_SENTRY, unit_tile(punit))) { diff --git a/data/gtk3.22_menus.xml b/data/gtk3.22_menus.xml index 075125f691..ca3e2abf42 100644 --- a/data/gtk3.22_menus.xml +++ b/data/gtk3.22_menus.xml @@ -300,10 +300,10 @@ - + - + diff --git a/data/gtk3_menus.xml b/data/gtk3_menus.xml index 676b4846b4..9303f60a32 100644 --- a/data/gtk3_menus.xml +++ b/data/gtk3_menus.xml @@ -294,10 +294,10 @@ - + - + diff --git a/data/gtk4_menus.xml b/data/gtk4_menus.xml index 075125f691..ca3e2abf42 100644 --- a/data/gtk4_menus.xml +++ b/data/gtk4_menus.xml @@ -300,10 +300,10 @@ - + - + -- 2.35.1