Bug #607 ยป 607.patch
| client/gui-gtk-3.22/citydlg.c | ||
|---|---|---|
| { | ||
|   gchar *buf; | ||
|   const gchar *now; | ||
|   const char * city_name = city_name_get(pdialog->pcity); | ||
|   gchar *escaped_city_name = g_markup_escape_text(city_name, -1);; | ||
|   if (city_unhappy(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - DISORDER"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else if (city_celebrating(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - celebrating"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else if (city_happy(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - happy"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } | ||
|   now = gtk_label_get_text(GTK_LABEL(pdialog->name_label)); | ||
|   if (strcmp(now, buf) != 0) { | ||
|     gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name_get(pdialog->pcity)); | ||
|     gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name); | ||
|     gtk_label_set_markup(GTK_LABEL(pdialog->name_label), buf); | ||
|   } | ||
| client/gui-gtk-3.22/cityrep.c | ||
|---|---|---|
|   int i, item, targets_used; | ||
|   char *row[4]; | ||
|   char buf[4][64]; | ||
|   char *item_text; | ||
|   gchar *escaped_item_text; | ||
|   GtkSizeGroup *group[3]; | ||
|   const char *markup[3] = { | ||
| ... | ... | |
|     for (i = 0; i < 3; i++) { | ||
|       if (row[i][0] == '\0') { | ||
| 	continue; | ||
|         continue; | ||
|       } | ||
|       if (city_operation == CO_SELL && i != 0) { | ||
|         continue; | ||
|       } | ||
|       item_text = row[i]; | ||
|       escaped_item_text = g_markup_escape_text(item_text, -1); | ||
|       fc_snprintf(txt, ARRAY_SIZE(txt), "<span %s>%s</span>", | ||
|                   markup[i], row[i]); | ||
|                   markup[i], escaped_item_text); | ||
|       label = gtk_label_new(NULL); | ||
|       gtk_label_set_markup(GTK_LABEL(label), txt); | ||
| client/gui-gtk-3.22/diplodlg.c | ||
|---|---|---|
|   GtkListStore *store; | ||
|   GtkCellRenderer *rend; | ||
|   int i; | ||
|   gchar *escaped; | ||
|   struct Diplomacy_dialog *pdialog; | ||
|   char plr_buf[4 * MAX_LEN_NAME]; | ||
| ... | ... | |
|   label = gtk_label_new(NULL); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text(nation_plural_for_player(plr0), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>", | ||
|                         nation_plural_for_player(plr0)); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_container_add(GTK_CONTAINER(vbox), label); | ||
| ... | ... | |
|   gtk_widget_set_hexpand(label, TRUE); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text( | ||
|               ruler_title_for_player(plr0, plr_buf, sizeof(plr_buf)), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>", | ||
|                         ruler_title_for_player(plr0, plr_buf, sizeof(plr_buf))); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_container_add(GTK_CONTAINER(hbox), label); | ||
| ... | ... | |
|   label = gtk_label_new(NULL); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text(nation_plural_for_player(plr1), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>", | ||
|                         nation_plural_for_player(plr1)); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_container_add(GTK_CONTAINER(vbox), label); | ||
| ... | ... | |
|   gtk_widget_set_hexpand(label, TRUE); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text( | ||
|               title_for_player(plr1, plr_buf, sizeof(plr_buf)), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>", | ||
|                         title_for_player(plr1, plr_buf, sizeof(plr_buf))); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_container_add(GTK_CONTAINER(hbox), label); | ||
| client/gui-gtk-3.22/plrdlg.c | ||
|---|---|---|
|   GdkPixbuf *pixbuf; | ||
|   int style = PANGO_STYLE_NORMAL, weight = PANGO_WEIGHT_NORMAL; | ||
|   int k; | ||
|   const char * score_tt = score_tooltip(pplayer, pplayer->score.game); | ||
|   gchar *escaped_score_tt = g_markup_escape_text(score_tt, -1); | ||
|   for (k = 0; k < num_player_dlg_columns; k++) { | ||
|     pcol = &player_dlg_columns[k]; | ||
| ... | ... | |
|     } | ||
|   } | ||
|   gtk_list_store_set(store, it, PLR_DLG_COL_TOOLTIP, | ||
|                      score_tooltip(pplayer, pplayer->score.game), -1); | ||
|   gtk_list_store_set(store, it, PLR_DLG_COL_TOOLTIP, escaped_score_tt, -1); | ||
|    /* Now add some eye candy ... */ | ||
|   if (client_has_player()) { | ||
| client/gui-gtk-3.22/repodlgs.c | ||
|---|---|---|
|   const struct player *pplayer = player_by_number(packet->player_id); | ||
|   GtkTreeIter iter; | ||
|   int i; | ||
|   const char * player_nm = player_name(pplayer); | ||
|   gchar *escaped_player_nm = g_markup_escape_text(player_nm, -1); | ||
|   const char * score_tt = score_tooltip(pplayer, pplayer->score.game); | ||
|   gchar *escaped_score_tt = g_markup_escape_text(score_tt, -1); | ||
|   gtk_list_store_append(preport->store, &iter); | ||
|   gtk_list_store_set(preport->store, &iter, | ||
|                      FRD_COL_PLAYER, player_name(pplayer), | ||
|                      FRD_COL_PLAYER, escaped_player_nm, | ||
|                      FRD_COL_NATION, get_flag(nation_of_player(pplayer)), | ||
|                      FRD_COL_SCORE, packet->score, | ||
|                      FRD_COL_TOOLTIP, score_tooltip(pplayer, packet->score), | ||
|                      FRD_COL_TOOLTIP, escaped_score_tt, | ||
|                      -1); | ||
|   for (i = 0; i < packet->category_num; i++) { | ||
|     gtk_list_store_set(preport->store, &iter, | ||
| client/gui-gtk-4.0/citydlg.c | ||
|---|---|---|
| { | ||
|   gchar *buf; | ||
|   const gchar *now; | ||
|   const char * city_name = city_name_get(pdialog->pcity); | ||
|   gchar *escaped_city_name = g_markup_escape_text(city_name, -1);; | ||
|   if (city_unhappy(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - DISORDER"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else if (city_celebrating(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - celebrating"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else if (city_happy(pdialog->pcity)) { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens - happy"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } else { | ||
|     /* TRANS: city dialog title */ | ||
|     buf = g_strdup_printf(_("<b>%s</b> - %s citizens"), | ||
|                           city_name_get(pdialog->pcity), | ||
|                           escaped_city_name, | ||
|                           population_to_text(city_population(pdialog->pcity))); | ||
|   } | ||
|   now = gtk_label_get_text(GTK_LABEL(pdialog->name_label)); | ||
|   if (strcmp(now, buf) != 0) { | ||
|     gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name_get(pdialog->pcity)); | ||
|     gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name); | ||
|     gtk_label_set_markup(GTK_LABEL(pdialog->name_label), buf); | ||
|   } | ||
| client/gui-gtk-4.0/diplodlg.c | ||
|---|---|---|
|   int main_row = 0; | ||
|   GActionGroup *group; | ||
|   GMenu *menu; | ||
|   gchar *escaped; | ||
|   pdialog = fc_malloc(sizeof(*pdialog)); | ||
| ... | ... | |
|   label = gtk_label_new(NULL); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text(nation_plural_for_player(plr0), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>", | ||
|                         nation_plural_for_player(plr0)); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_box_append(GTK_BOX(vbox), label); | ||
| ... | ... | |
|   gtk_widget_set_hexpand(label, TRUE); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text( | ||
|               ruler_title_for_player(plr0, plr_buf, sizeof(plr_buf)), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>", | ||
|                         ruler_title_for_player(plr0, plr_buf, sizeof(plr_buf))); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1); | ||
| ... | ... | |
|   label = gtk_label_new(NULL); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text(nation_plural_for_player(plr1), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>", | ||
|                         nation_plural_for_player(plr1)); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_box_append(GTK_BOX(vbox), label); | ||
| ... | ... | |
|   gtk_widget_set_hexpand(label, TRUE); | ||
|   gtk_widget_set_halign(label, GTK_ALIGN_CENTER); | ||
|   gtk_widget_set_valign(label, GTK_ALIGN_CENTER); | ||
|   escaped = g_markup_escape_text( | ||
|               title_for_player(plr1, plr_buf, sizeof(plr_buf)), -1); | ||
|   buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>", | ||
|                         title_for_player(plr1, plr_buf, sizeof(plr_buf))); | ||
|                         escaped); | ||
|   gtk_label_set_markup(GTK_LABEL(label), buf); | ||
|   g_free(buf); | ||
|   gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1); | ||
| client/gui-gtk-4.0/plrdlg.c | ||
|---|---|---|
|   GdkPixbuf *pixbuf; | ||
|   int style = PANGO_STYLE_NORMAL, weight = PANGO_WEIGHT_NORMAL; | ||
|   int k; | ||
|   const char * score_tt = score_tooltip(pplayer, pplayer->score.game); | ||
|   gchar *escaped_score_tt = g_markup_escape_text(score_tt, -1); | ||
|   for (k = 0; k < num_player_dlg_columns; k++) { | ||
|     pcol = &player_dlg_columns[k]; | ||
| ... | ... | |
|     } | ||
|   } | ||
|   gtk_list_store_set(store, it, PLR_DLG_COL_TOOLTIP, | ||
|                      score_tooltip(pplayer, pplayer->score.game), -1); | ||
|   gtk_list_store_set(store, it, PLR_DLG_COL_TOOLTIP, escaped_score_tt, -1); | ||
|    /* Now add some eye candy ... */ | ||
|   if (client_has_player()) { | ||
| client/gui-gtk-4.0/repodlgs.c | ||
|---|---|---|
|   const struct player *pplayer = player_by_number(packet->player_id); | ||
|   GtkTreeIter iter; | ||
|   int i; | ||
|   const char * player_nm = player_name(pplayer); | ||
|   gchar *escaped_player_nm = g_markup_escape_text(player_nm, -1); | ||
|   const char * score_tt = score_tooltip(pplayer, pplayer->score.game); | ||
|   gchar *escaped_score_tt = g_markup_escape_text(score_tt, -1); | ||
|   gtk_list_store_append(preport->store, &iter); | ||
|   gtk_list_store_set(preport->store, &iter, | ||
|                      FRD_COL_PLAYER, player_name(pplayer), | ||
|                      FRD_COL_PLAYER, escaped_player_nm, | ||
|                      FRD_COL_NATION, get_flag(nation_of_player(pplayer)), | ||
|                      FRD_COL_SCORE, packet->score, | ||
|                      FRD_COL_TOOLTIP, score_tooltip(pplayer, packet->score), | ||
|                      FRD_COL_TOOLTIP, escaped_score_tt, | ||
|                      -1); | ||
|   for (i = 0; i < packet->category_num; i++) { | ||
|     gtk_list_store_set(preport->store, &iter, | ||