Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#6378) Disable buy command when nothing more to buy (gt
Home

[Freeciv-Dev] (PR#6378) Disable buy command when nothing more to buy (gt

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: remi.bonnet@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#6378) Disable buy command when nothing more to buy (gtk2)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jan 2004 19:36:20 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6378 >

OK, I take it back.  Desensitizing this button is easy.

jason

Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.70
diff -u -r1.70 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        2004/01/26 19:09:08     1.70
+++ client/gui-gtk-2.0/citydlg.c        2004/01/28 03:36:00
@@ -379,6 +379,8 @@
     gtk_widget_set_sensitive(pdialog->show_units_command,
                             can_client_issue_orders() &&
                             have_present_units);
+    gtk_widget_set_sensitive(pdialog->overview.buy_command,
+                            city_buy_cost(pdialog->pcity) > 0);
   } else {
     /* Set the buttons we do not want live while a Diplomat investigates */
     gtk_widget_set_sensitive(pdialog->overview.buy_command, FALSE);
@@ -2336,7 +2338,9 @@
        get_impr_name_ex(pdialog->pcity,
                         pdialog->pcity->currently_building);
   }
+
   value = city_buy_cost(pdialog->pcity);
+  assert(value > 0);
 
   if (game.player_ptr->economic.gold >= value) {
     shell = gtk_message_dialog_new(GTK_WINDOW(pdialog->shell),

[Prev in Thread] Current Thread [Next in Thread]