Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11195) 2.0 beta 4 bugs
Home

[Freeciv-Dev] (PR#11195) 2.0 beta 4 bugs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ryan@xxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#11195) 2.0 beta 4 bugs
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 3 Dec 2004 10:51:22 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [jdorje - Sat Nov 27 20:00:53 2004]:
> 
> Vasco, can you look into the GUI problem?  Then reassign the bug so we
> can try to find the other problem.

This should fix the UI issue in the buy unit dialog.

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.95.2.5
diff -u -u -r1.95.2.5 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        13 Nov 2004 23:26:53 -0000      1.95.2.5
+++ client/gui-gtk-2.0/citydlg.c        3 Dec 2004 18:50:26 -0000
@@ -2322,6 +2322,19 @@
 /****************************************************************
 ...
 *****************************************************************/
+static void buy_callback_response(GtkWidget *w, gint response, gpointer data)
+{
+  struct city_dialog *pdialog = data;
+
+  if (response == GTK_RESPONSE_YES) {
+    city_buy_production(pdialog->pcity);
+  }
+  gtk_widget_destroy(w);
+}
+
+/****************************************************************
+...
+*****************************************************************/
 static void buy_callback(GtkWidget *w, gpointer data)
 {
   struct city_dialog *pdialog;
@@ -2342,18 +2355,16 @@
 
   if (game.player_ptr->economic.gold >= value) {
     shell = gtk_message_dialog_new(NULL,
-        GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+        GTK_DIALOG_DESTROY_WITH_PARENT,
         GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
         _("Buy %s for %d gold?\nTreasury contains %d gold."),
         name, value, game.player_ptr->economic.gold);
     setup_dialog(shell, pdialog->shell);
     gtk_window_set_title(GTK_WINDOW(shell), _("Buy It!"));
     gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_NO);
-
-    if (gtk_dialog_run(GTK_DIALOG(shell)) == GTK_RESPONSE_YES) {
-      city_buy_production(pdialog->pcity);
-    }
-    gtk_widget_destroy(shell);
+    g_signal_connect(shell, "response", G_CALLBACK(buy_callback_response),
+       pdialog);
+    gtk_window_present(GTK_WINDOW(shell));
   } else {
     shell = gtk_message_dialog_new(NULL,
         GTK_DIALOG_DESTROY_WITH_PARENT,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11195) 2.0 beta 4 bugs, Vasco Alexandre da Silva Costa <=