From b54b5bf25a9f71d726c752dea2de5107b28a29c4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 10 Jun 2021 06:19:19 +0300 Subject: [PATCH 39/39] gtk3.x: Drop empty create_help_page() See osdn #42504 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/helpdlg.c | 36 +++++------------------------------ client/gui-gtk-3.22/helpdlg.c | 36 +++++------------------------------ 2 files changed, 10 insertions(+), 62 deletions(-) diff --git a/client/gui-gtk-3.0/helpdlg.c b/client/gui-gtk-3.0/helpdlg.c index e97c812792..cc4e1707bb 100644 --- a/client/gui-gtk-3.0/helpdlg.c +++ b/client/gui-gtk-3.0/helpdlg.c @@ -132,7 +132,6 @@ static const char *help_elabel_name[6] = static void create_help_dialog(void); static void help_update_dialog(const struct help_item *pitem); -static void create_help_page(enum help_page_type type); static void select_help_item_string(const char *item, enum help_page_type htype); @@ -726,15 +725,6 @@ static void create_help_dialog(void) gtk_container_add(GTK_CONTAINER(help_tree_buttons_hbox), help_tree_collapse); gtk_container_add(GTK_CONTAINER(help_box), help_tree_buttons_hbox); gtk_widget_show_all(help_tree_buttons_hbox); - - create_help_page(HELP_TEXT); -} - -/************************************************************************** - Create page for help type -**************************************************************************/ -static void create_help_page(enum help_page_type type) -{ } /************************************************************************** @@ -790,9 +780,7 @@ static void help_update_improvement(const struct help_item *pitem, char buf[8192]; struct impr_type *imp = improvement_by_translated_name(title); - create_help_page(HELP_IMPROVEMENT); - - if (imp && !is_great_wonder(imp)) { + if (imp && !is_great_wonder(imp)) { const char *req = skip_intl_qualifier_prefix(REQ_LABEL_NONE); char req_buf[512]; @@ -840,8 +828,6 @@ static void help_update_wonder(const struct help_item *pitem, char buf[8192]; struct impr_type *imp = improvement_by_translated_name(title); - create_help_page(HELP_WONDER); - if (imp && is_great_wonder(imp)) { int i; char req_buf[512]; @@ -901,8 +887,6 @@ static void help_update_unit_type(const struct help_item *pitem, char buf[8192]; struct unit_type *utype = unit_type_by_translated_name(title); - create_help_page(HELP_UNIT); - if (utype) { sprintf(buf, "%d", utype_build_shield_cost(utype)); gtk_label_set_text(GTK_LABEL(help_ulabel[0][1]), buf); @@ -990,8 +974,6 @@ static void help_update_tech(const struct help_item *pitem, char *title) char buf[8192]; struct advance *padvance = advance_by_translated_name(title); - create_help_page(HELP_TECH); - if (padvance && !is_future_tech(i = advance_number(padvance))) { GtkTextBuffer *txt; size_t len; @@ -1200,8 +1182,6 @@ static void help_update_terrain(const struct help_item *pitem, char buf[8192]; struct terrain *pterrain = terrain_by_translated_name(title); - create_help_page(HELP_TERRAIN); - if (pterrain) { struct universal for_terr = { .kind = VUT_TERRAIN, .value = { .terrain = pterrain }}; @@ -1317,8 +1297,6 @@ static void help_update_extra(const struct help_item *pitem, char *title) char buf[8192]; struct extra_type *pextra = extra_type_by_translated_name(title); - create_help_page(HELP_EXTRA); - buf[0] = '\0'; if (pextra == NULL) { strcat(buf, pitem->text); @@ -1397,15 +1375,13 @@ static void help_update_goods(const struct help_item *pitem, char buf[8192]; struct goods_type *pgood = goods_by_translated_name(title); - create_help_page(HELP_GOODS); - if (!pgood) { strcat(buf, pitem->text); } else { helptext_goods(buf, sizeof(buf), client.conn.playing, pitem->text, pgood); } - create_help_page(HELP_GOODS); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1425,7 +1401,7 @@ static void help_update_specialist(const struct help_item *pitem, helptext_specialist(buf, sizeof(buf), client.conn.playing, pitem->text, pspec); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1444,7 +1420,7 @@ static void help_update_government(const struct help_item *pitem, } else { helptext_government(buf, sizeof(buf), client.conn.playing, pitem->text, gov); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1462,7 +1438,7 @@ static void help_update_nation(const struct help_item *pitem, char *title, } else { helptext_nation(buf, sizeof(buf), pnation, pitem->text); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1517,8 +1493,6 @@ static void help_update_dialog(const struct help_item *pitem) case HELP_TEXT: default: /* it was a pure text item */ - create_help_page(HELP_TEXT); - gtk_text_buffer_set_text(help_text, pitem->text, -1); gtk_widget_show(help_text_sw); break; diff --git a/client/gui-gtk-3.22/helpdlg.c b/client/gui-gtk-3.22/helpdlg.c index bb6e293ee5..0c9460bd18 100644 --- a/client/gui-gtk-3.22/helpdlg.c +++ b/client/gui-gtk-3.22/helpdlg.c @@ -132,7 +132,6 @@ static const char *help_elabel_name[6] = static void create_help_dialog(void); static void help_update_dialog(const struct help_item *pitem); -static void create_help_page(enum help_page_type type); static void select_help_item_string(const char *item, enum help_page_type htype); @@ -725,15 +724,6 @@ static void create_help_dialog(void) gtk_container_add(GTK_CONTAINER(help_tree_buttons_hbox), help_tree_collapse); gtk_container_add(GTK_CONTAINER(help_box), help_tree_buttons_hbox); gtk_widget_show_all(help_tree_buttons_hbox); - - create_help_page(HELP_TEXT); -} - -/************************************************************************** - Create page for help type -**************************************************************************/ -static void create_help_page(enum help_page_type type) -{ } /************************************************************************** @@ -789,9 +779,7 @@ static void help_update_improvement(const struct help_item *pitem, char buf[8192]; struct impr_type *imp = improvement_by_translated_name(title); - create_help_page(HELP_IMPROVEMENT); - - if (imp && !is_great_wonder(imp)) { + if (imp && !is_great_wonder(imp)) { const char *req = skip_intl_qualifier_prefix(REQ_LABEL_NONE); char req_buf[512]; @@ -839,8 +827,6 @@ static void help_update_wonder(const struct help_item *pitem, char buf[8192]; struct impr_type *imp = improvement_by_translated_name(title); - create_help_page(HELP_WONDER); - if (imp && is_great_wonder(imp)) { int i; char req_buf[512]; @@ -900,8 +886,6 @@ static void help_update_unit_type(const struct help_item *pitem, char buf[8192]; struct unit_type *utype = unit_type_by_translated_name(title); - create_help_page(HELP_UNIT); - if (utype) { sprintf(buf, "%d", utype_build_shield_cost(utype)); gtk_label_set_text(GTK_LABEL(help_ulabel[0][1]), buf); @@ -989,8 +973,6 @@ static void help_update_tech(const struct help_item *pitem, char *title) char buf[8192]; struct advance *padvance = advance_by_translated_name(title); - create_help_page(HELP_TECH); - if (padvance && !is_future_tech(i = advance_number(padvance))) { GtkTextBuffer *txt; size_t len; @@ -1199,8 +1181,6 @@ static void help_update_terrain(const struct help_item *pitem, char buf[8192]; struct terrain *pterrain = terrain_by_translated_name(title); - create_help_page(HELP_TERRAIN); - if (pterrain) { struct universal for_terr = { .kind = VUT_TERRAIN, .value = { .terrain = pterrain }}; @@ -1316,8 +1296,6 @@ static void help_update_extra(const struct help_item *pitem, char *title) char buf[8192]; struct extra_type *pextra = extra_type_by_translated_name(title); - create_help_page(HELP_EXTRA); - buf[0] = '\0'; if (pextra == NULL) { strcat(buf, pitem->text); @@ -1396,15 +1374,13 @@ static void help_update_goods(const struct help_item *pitem, char buf[8192]; struct goods_type *pgood = goods_by_translated_name(title); - create_help_page(HELP_GOODS); - if (!pgood) { strcat(buf, pitem->text); } else { helptext_goods(buf, sizeof(buf), client.conn.playing, pitem->text, pgood); } - create_help_page(HELP_GOODS); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1424,7 +1400,7 @@ static void help_update_specialist(const struct help_item *pitem, helptext_specialist(buf, sizeof(buf), client.conn.playing, pitem->text, pspec); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1443,7 +1419,7 @@ static void help_update_government(const struct help_item *pitem, } else { helptext_government(buf, sizeof(buf), client.conn.playing, pitem->text, gov); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1461,7 +1437,7 @@ static void help_update_nation(const struct help_item *pitem, char *title, } else { helptext_nation(buf, sizeof(buf), pnation, pitem->text); } - create_help_page(HELP_TEXT); + gtk_text_buffer_set_text(help_text, buf, -1); gtk_widget_show(help_text_sw); } @@ -1516,8 +1492,6 @@ static void help_update_dialog(const struct help_item *pitem) case HELP_TEXT: default: /* it was a pure text item */ - create_help_page(HELP_TEXT); - gtk_text_buffer_set_text(help_text, pitem->text, -1); gtk_widget_show(help_text_sw); break; -- 2.30.2