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

> [emj - Di 05. Dez 2006, 16:10:14]:
> 
> 1. click on city
> 2. bring up worklist
> 3. click on the options icon in left corner
> 
> 
> Perhaps these two should be merged?
> void popdown_worklist_editor(void)
> static int popdown_worklist_editor_callback(struct widget *pWidget)
> 

Yes, that's right. Patch attached.
Index: client/gui-sdl/dialogs.c
===================================================================
--- client/gui-sdl/dialogs.c	(Revision 12413)
+++ client/gui-sdl/dialogs.c	(Arbeitskopie)
@@ -158,6 +158,7 @@
   popdown_all_science_dialogs();
   popdown_meswin_dialog();
   popdown_worklist_editor();
+  popdown_all_city_dialogs();
   popdown_economy_report_dialog();
   popdown_activeunits_report_dialog();
   popdown_intel_dialogs();
Index: client/gui-sdl/wldlg.c
===================================================================
--- client/gui-sdl/wldlg.c	(Revision 12413)
+++ client/gui-sdl/wldlg.c	(Arbeitskopie)
@@ -102,26 +102,7 @@
 static int popdown_worklist_editor_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-    if(pEditor) {
-      popdown_window_group_dialog(pEditor->pBeginWidgetList,
-                                              pEditor->pEndWidgetList);
-      FC_FREE(pEditor->pTargets->pScroll);
-      FC_FREE(pEditor->pWork->pScroll);
-      if(pEditor->pGlobal) {
-        FC_FREE(pEditor->pGlobal->pScroll);
-        FC_FREE(pEditor->pGlobal);
-      }
-      FC_FREE(pEditor->pTargets);
-      FC_FREE(pEditor->pWork);
-      FC_FREE(pEditor->pCopy_WorkList);
-          
-      if(city_dialog_is_open(pEditor->pCity)) {
-        enable_city_dlg_widgets();
-      }
-    
-      FC_FREE(pEditor);
-      flush_dirty();
-    }
+    popdown_worklist_editor();
   }
   return -1;
 }
@@ -177,29 +158,10 @@
       update_worklist_report_dialog();
     }  
     
-    /* popdown dlg */
-    popdown_window_group_dialog(pEditor->pBeginWidgetList,
-                                              pEditor->pEndWidgetList);
-    FC_FREE(pEditor->pTargets->pScroll);
-    FC_FREE(pEditor->pWork->pScroll);
-    if(pEditor->pGlobal) {
-      FC_FREE(pEditor->pGlobal->pScroll);
-      FC_FREE(pEditor->pGlobal);
-    }
-    FC_FREE(pEditor->pTargets);
-    FC_FREE(pEditor->pWork);
-    FC_FREE(pEditor->pCopy_WorkList);
-    FC_FREE(pEditor);
-    
-    if(city_dialog_is_open(pCity)) {
-      enable_city_dlg_widgets();
-      if(same_prod) {
-        flush_dirty();
-      }
-    } else {
-      flush_dirty();
-    }
+    /* popdown dialog */
+    popdown_worklist_editor();
   }
+  
   return -1;
 }
 
@@ -1749,17 +1711,28 @@
   
 void popdown_worklist_editor(void)
 {
-    if(pEditor) {
+  if(pEditor) {
     popdown_window_group_dialog(pEditor->pBeginWidgetList,
-					    pEditor->pEndWidgetList);
+                                            pEditor->pEndWidgetList);
     FC_FREE(pEditor->pTargets->pScroll);
-    FC_FREE(pEditor->pWork->pScroll);
-    FC_FREE(pEditor->pGlobal->pScroll);
-    FC_FREE(pEditor->pGlobal);
     FC_FREE(pEditor->pTargets);
+    
+    FC_FREE(pEditor->pWork->pScroll);
     FC_FREE(pEditor->pWork);
+    
+    if(pEditor->pGlobal) {
+      FC_FREE(pEditor->pGlobal->pScroll);
+      FC_FREE(pEditor->pGlobal);
+    }
+
     FC_FREE(pEditor->pCopy_WorkList);
+        
+    if(city_dialog_is_open(pEditor->pCity)) {
+      enable_city_dlg_widgets();
+    }
+  
     FC_FREE(pEditor);
+    
+    flush_dirty();
   }
-
 }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to