<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40680 >

> [book - Mon Jan 26 02:56:39 2009]:
> 
> The order of city report columns was changed for no good reason
> as a bundled "feature" of r12989 (39385, not even part of the
> original ticket request?!). This patch changes the ordering
> back so that concise rapture/disorder, city name, and city size
> are again back as the first 3 columns.

Version 2 allows the city report columns to be reordered by
dragging the column headers, so users can setup any order
they like if they really want to. Later, I will think of a
way the ordering information can be saved and restored in
the civclientrc.


-----------------------------------------------------------------------
まあまあ、柔軟にしましょう。
diff --git a/client/cityrepdata.c b/client/cityrepdata.c
index 5d923c8..bbaaa8d 100644
--- a/client/cityrepdata.c
+++ b/client/cityrepdata.c
@@ -443,17 +443,22 @@ static const char *cr_entry_cma(const struct city *pcity,
 #define FUNC_TAG(var)  cr_entry_##var, #var 
 
 static const struct city_report_spec base_city_report_specs[] = {
+  { FALSE,  1, 1, NULL,  NULL,          N_("Concise + Rapture, - Disorder"),
+    NULL, FUNC_TAG(hstate_concise) },
+  { TRUE, -15, 0, NULL,  N_("?city:Name"), N_("City Name"),
+    NULL, FUNC_TAG(cityname) },
+  { TRUE,   2, 1, NULL,  N_("?size [short]:Sz"), N_("Size"),
+    NULL, FUNC_TAG(size) },
+
+  { TRUE,  -8, 1, NULL,  N_("State"),   N_("Rapture/Peace/Disorder"),
+    NULL, FUNC_TAG(hstate_verbose) },
+
   /* Specialists grouped with init_city_report_game_data specialists */ 
   { FALSE,  7, 1, N_("Special"),
     N_("?entertainers/scientists/taxmen:E/S/T"),
     N_("Entertainers, Scientists, Taxmen"),
     NULL, FUNC_TAG(specialists) },
 
-  { FALSE,  1, 1, NULL,  NULL,          N_("Concise + Rapture, - Disorder"),
-    NULL, FUNC_TAG(hstate_concise) },
-  { TRUE,  -8, 1, NULL,  N_("State"),   N_("Rapture/Peace/Disorder"),
-    NULL, FUNC_TAG(hstate_verbose) },
-
   { FALSE, 2, 1, NULL, N_("?Happy workers:H"), N_("Workers: Happy"),
     NULL, FUNC_TAG(happy) },
   { FALSE, 2, 1, NULL, N_("?Content workers:C"), N_("Workers: Content"),
@@ -485,12 +490,6 @@ static const struct city_report_spec base_city_report_specs[] = {
     N_("?Stock/Target:(Have/Need)"),
     N_("Turns until growth/famine"),
     NULL, FUNC_TAG(growturns) },
-  { TRUE,   2, 1, NULL,  N_("?size [short]:Sz"), N_("Size"),
-    NULL, FUNC_TAG(size) },
-
-  /* city name closer to center, try to keep within scroll window */
-  { TRUE, -15, 0, NULL,  N_("?city:Name"), N_("City Name"),
-    NULL, FUNC_TAG(cityname) },
 
   { TRUE,  10, 1, N_("Surplus"), N_("?food/production/trade:F/P/T"),
                                  N_("Surplus: Food, Production, Trade"),
diff --git a/client/gui-gtk-2.0/cityrep.c b/client/gui-gtk-2.0/cityrep.c
index fef2336..10ade1e 100644
--- a/client/gui-gtk-2.0/cityrep.c
+++ b/client/gui-gtk-2.0/cityrep.c
@@ -864,6 +864,7 @@ static void create_city_report_dialog(bool make_modal)
     col = gtk_tree_view_column_new_with_attributes(titles[i], renderer,NULL);
     gtk_tree_view_column_set_visible(col, spec->show);
     gtk_tree_view_column_set_sort_column_id(col, i);
+    gtk_tree_view_column_set_reorderable(col, TRUE);
     gtk_tree_view_append_column(GTK_TREE_VIEW(city_view), col);
     gtk_tree_view_column_set_cell_data_func(col, renderer,
       cityrep_cell_data_func, GINT_TO_POINTER(i), NULL);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to