Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9857) bugfix for single player gameload failure
Home

[Freeciv-Dev] (PR#9857) bugfix for single player gameload failure

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9857) bugfix for single player gameload failure
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 17 Sep 2004 11:44:48 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [kauf - Sun Aug 29 03:06:32 2004]:
> 
> In single-player mode if you attempt to load a game and it fails (you try
> and load a non-savegame), then you can still click on the storesaved list
> despite it being blank. It will start a game with no players and cause
> trouble. This patch disallows that.

This also does the trick, is shorter and enables keyboard activation.



Index: client/gui-gtk-2.0/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/connectdlg.c,v
retrieving revision 1.43
diff -u -r1.43 connectdlg.c
--- client/gui-gtk-2.0/connectdlg.c     16 Sep 2004 00:12:21 -0000      1.43
+++ client/gui-gtk-2.0/connectdlg.c     17 Sep 2004 18:43:11 -0000
@@ -360,17 +360,15 @@
 }
 
 /**************************************************************************
-  This function is called on a click in the single player saved list
+  This function is called on a double-click in the single player saved list
 ***************************************************************************/
-static gboolean saved_click_callback(GtkWidget *w, GdkEventButton *event, 
-                                     gpointer data)
+static void saved_click_callback(GtkTreeView *treeview,
+                                 GtkTreePath *arg1,
+                                 GtkTreeViewColumn *arg2,
+                                 gpointer data)
 {
-  if (event->type == GDK_2BUTTON_PRESS) {
-    really_close_connection_dialog();
-    send_start_saved_game();
-  }
-
-  return FALSE;
+  really_close_connection_dialog();
+  send_start_saved_game();
 }
 
 /**************************************************************************
@@ -1101,7 +1099,7 @@
    * it may not be on very slow machines) */
 
 
-  g_signal_connect(listsaved, "button_press_event",
+  g_signal_connect(listsaved, "row_activated",
                   G_CALLBACK(saved_click_callback), NULL);
   g_signal_connect(selectionsaved, "changed",
                    G_CALLBACK(saved_list_callback), NULL);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9857) bugfix for single player gameload failure, Vasco Alexandre da Silva Costa <=