<URL: http://bugs.freeciv.org/Ticket/Display.html?id=37734 >

> [EMAIL PROTECTED] - Mi 07. Mär 2007, 22:37:49]:
> 
> 2) When choosing unit options from the city dialog the following options
> left the unit dialog permanently open:
> - Disband
> - Activate
> - Activate, close window
> I didn't test the rest of the options, but I was unable to close the 
> unit dialog
> and it remained open (but inresponsive) through the rest of the game.
> 

Patch attached.

Index: client/gui-sdl/citydlg.c
===================================================================
--- client/gui-sdl/citydlg.c	(Revision 12773)
+++ client/gui-sdl/citydlg.c	(Arbeitskopie)
@@ -135,14 +135,14 @@
 /**************************************************************************
   Destroy City Menu Dlg but not undraw.
 **************************************************************************/
-static void del_city_menu_dlg(bool enable)
+static void popdown_city_menu_dlg(bool enable_city_dialog_widgets)
 {
   if (pCityDlg->pEndCityMenuWidgetList) {
-    del_group_of_widgets_from_gui_list(pCityDlg->pBeginCityMenuWidgetList,
-				       pCityDlg->pEndCityMenuWidgetList);
+    popdown_window_group_dialog(pCityDlg->pBeginCityMenuWidgetList,
+				pCityDlg->pEndCityMenuWidgetList);
     pCityDlg->pEndCityMenuWidgetList = NULL;
   }
-  if (enable) {
+  if (enable_city_dialog_widgets) {
     /* enable city dlg */
     enable_city_dlg_widgets();
   }
@@ -178,7 +178,7 @@
     }
     
     free_city_units_lists();
-    del_city_menu_dlg(FALSE);
+    popdown_city_menu_dlg(FALSE);
     
     popdown_window_group_dialog(pCityDlg->pBeginCityWidgetList,
 				       pCityDlg->pEndCityWidgetList);
@@ -253,15 +253,13 @@
 
 /**************************************************************************
   activate unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int activate_units_orders_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     struct unit *pUnit = pButton->data.unit;
   
-    del_city_menu_dlg(TRUE);
+    popdown_city_menu_dlg(TRUE);
     if(pUnit) {
       set_unit_focus(pUnit);
     }
@@ -294,15 +292,13 @@
 
 /**************************************************************************
   sentry unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int sentry_units_orders_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     struct unit *pUnit = pButton->data.unit;
   
-    del_city_menu_dlg(TRUE);
+    popdown_city_menu_dlg(TRUE);
     if(pUnit) {
       request_unit_sentry(pUnit);
     }
@@ -312,15 +308,13 @@
 
 /**************************************************************************
   fortify unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int fortify_units_orders_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     struct unit *pUnit = pButton->data.unit;
   
-    del_city_menu_dlg(TRUE);
+    popdown_city_menu_dlg(TRUE);
     if(pUnit) {
       request_unit_fortify(pUnit);
     }
@@ -330,8 +324,6 @@
 
 /**************************************************************************
   disband unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int disband_units_orders_city_dlg_callback(struct widget *pButton)
 {
@@ -339,7 +331,7 @@
     struct unit *pUnit = pButton->data.unit;
   
     free_city_units_lists();
-    del_city_menu_dlg(TRUE);
+    popdown_city_menu_dlg(TRUE);
   
     /* ugly hack becouse this free unit widget list*/
     /* FIX ME: add remove from list support */
@@ -354,15 +346,13 @@
 
 /**************************************************************************
   homecity unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int homecity_units_orders_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     struct unit *pUnit = pButton->data.unit;
   
-    del_city_menu_dlg(TRUE);
+    popdown_city_menu_dlg(TRUE);
     if(pUnit) {
       request_unit_change_homecity(pUnit);
     }
@@ -372,17 +362,13 @@
 
 /**************************************************************************
   upgrade unit and del unit order dlg. widget group.
-  update screen is unused becouse common code call here 
-  redraw_city_dialog(pCityDlg->pCity);
 **************************************************************************/
 static int upgrade_units_orders_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     struct unit *pUnit = pButton->data.unit;
-      
-    popdown_window_group_dialog(pCityDlg->pBeginCityMenuWidgetList,
-                                pCityDlg->pEndCityMenuWidgetList);
-    pCityDlg->pEndCityMenuWidgetList = NULL;
+
+    popdown_city_menu_dlg(TRUE);    
     popup_unit_upgrade_dlg(pUnit, TRUE);
   }
   return -1;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to