Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10756) Xaw: Find city dialog try to close whole client
Home

[Freeciv-Dev] (PR#10756) Xaw: Find city dialog try to close whole client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10756) Xaw: Find city dialog try to close whole client
From: "Egor Vyscrebentsov" <evyscr@xxxxxxxxx>
Date: Wed, 27 Oct 2004 09:58:01 -0700
Reply-to: rt@xxxxxxxxxxx

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

Freeciv CVS S2_0 (HEAD also) 2004-10-27, Xaw client

When you try to close find city dialog by standard (x) button,
it tries to close whole client.
With attached patch, this button works like 'Cancel' dialog button.

Thanks, evyscr.
PS There are several other dialogs, that try to close client
while closing.

Index: client/gui-xaw/actions.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/actions.c,v
retrieving revision 1.22
diff -u -r1.22 actions.c
--- client/gui-xaw/actions.c    23 Aug 2004 23:24:45 -0000      1.22
+++ client/gui-xaw/actions.c    27 Oct 2004 16:47:39 -0000
@@ -35,6 +35,7 @@
 #include "menu.h"
 #include "messagewin.h"
 #include "plrdlg.h"
+#include "finddlg.h"
 #include "ratesdlg.h"
 #include "repodlgs.h"
 #include "spaceshipdlg.h"
@@ -689,6 +690,11 @@
   plrdlg_msg_close(w);
 }
 
+static void xaw_msg_close_find_city(Widget w, XEvent *event, String *argv, 
Cardinal *argc)
+{
+  finddlg_msg_close(w);
+}
+
 static void xaw_msg_close_science_report(Widget w, XEvent *event, String 
*argv, Cardinal *argc)
 {
   sciencereport_msg_close(w);
@@ -802,6 +808,7 @@
   { "msg-close-help", xaw_msg_close_help },
   { "msg-close-messages", xaw_msg_close_messages },
   { "msg-close-players", xaw_msg_close_players },
+  { "msg-close-find-city", xaw_msg_close_find_city },
   { "msg-close-science-report", xaw_msg_close_science_report },
   { "msg-close-spaceship", xaw_msg_close_spaceship },
   { "msg-close-units-report", xaw_msg_close_units_report },
Index: client/gui-xaw/finddlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/finddlg.c,v
retrieving revision 1.11
diff -u -r1.11 finddlg.c
--- client/gui-xaw/finddlg.c    29 Sep 2004 02:24:22 -0000      1.11
+++ client/gui-xaw/finddlg.c    27 Oct 2004 16:47:39 -0000
@@ -125,6 +125,11 @@
 
   XtRealizeWidget(find_dialog_shell);
 
+  XSetWMProtocols(display, XtWindow(find_dialog_shell), 
+                 &wm_delete_window, 1);
+  XtOverrideTranslations(find_dialog_shell,
+    XtParseTranslationTable("<Message>WM_PROTOCOLS: msg-close-find-city()"));
+
   update_find_dialog(find_list);
 
   XtVaGetValues(toplevel, XtNwidth, &width, XtNheight, &height, NULL);
@@ -210,6 +215,14 @@
   popdown_find_dialog();
 }
 
+/****************************************************************
+...
+*****************************************************************/
+void finddlg_msg_close(Widget w)
+{
+  find_cancel_command_callback(w, NULL, NULL);
+}
+
 /**************************************************************************
 ...
 **************************************************************************/
Index: client/gui-xaw/finddlg.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/finddlg.h,v
retrieving revision 1.1
diff -u -r1.1 finddlg.h
--- client/gui-xaw/finddlg.h    23 Feb 2003 14:11:15 -0000      1.1
+++ client/gui-xaw/finddlg.h    27 Oct 2004 16:47:39 -0000
@@ -15,6 +15,6 @@
 
 #include "finddlg_g.h"
 
-/* nothing to add */
+void finddlg_msg_close(Widget w);
 
 #endif  /* FC__FINDDLG_H */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10756) Xaw: Find city dialog try to close whole client, Egor Vyscrebentsov <=