[Freeciv-Dev] Re: (PR#737) New city report columns
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jason Short via RT wrote:
> This does _not_ include the GUI changes to make the city report
> configure dialog prettier. This will be included separately.
And here is that patch.
This simply hard-codes the cityrep config dialog as having two columns.
This is less than ideal. A longer-term solution would do the same
thing gui-gtk-2.0 does: use a menu to control which fields are present.
Note this means gui-gtk-2.0 needs no changes to handle more cityrep columns.
jason
? client/gui-gtk/diff
Index: client/gui-gtk/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/cityrep.c,v
retrieving revision 1.66
diff -u -r1.66 cityrep.c
--- client/gui-gtk/cityrep.c 7 Nov 2002 16:04:53 -0000 1.66
+++ client/gui-gtk/cityrep.c 11 Nov 2002 11:09:02 -0000
@@ -1367,7 +1367,7 @@
*****************************************************************/
static void create_city_report_config_dialog(void)
{
- GtkWidget *config_label, *config_ok_command;
+ GtkWidget *config_label, *config_ok_command, *box, *vbox;
struct city_report_spec *spec;
int i;
@@ -1379,11 +1379,24 @@
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(config_shell)->vbox), config_label,
FALSE, FALSE, 0);
+ box = gtk_hbox_new(TRUE,0);
+ gtk_widget_show(box);
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(config_shell)->vbox), box,
+ FALSE, FALSE, 0);
+
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_widget_show(vbox);
+ gtk_box_pack_start(GTK_BOX(box), vbox, FALSE, FALSE, 0);
+
for(i=1, spec=city_report_specs+i; i<NUM_CREPORT_COLS; i++, spec++) {
+ if (i == NUM_CREPORT_COLS / 2 + 1) {
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_widget_show(vbox);
+ gtk_box_pack_start(GTK_BOX(box), vbox, FALSE, FALSE, 0);
+ }
config_toggle[i] = gtk_check_button_new_with_label(spec->explanation);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(config_shell)->vbox),
config_toggle[i],
- FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), config_toggle[i], FALSE, FALSE, 0);
}
config_ok_command = gtk_button_new_with_label(_("Close"));
|
|