Author: cazfi
Date: Thu Apr 23 00:16:39 2015
New Revision: 28843

URL: http://svn.gna.org/viewcvs/freeciv?rev=28843&view=rev
Log:
Make sure orders icons do not appear on main screen after one has left the game 
in
sdl-clients.

See bug #23357

Modified:
    branches/S2_5/client/gui-sdl/dialogs.c
    branches/S2_5/client/gui-sdl/menu.c
    branches/S2_5/client/gui-sdl/optiondlg.c
    branches/S2_5/client/gui-sdl/optiondlg.h

Modified: branches/S2_5/client/gui-sdl/dialogs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/dialogs.c?rev=28843&r1=28842&r2=28843&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/dialogs.c      (original)
+++ branches/S2_5/client/gui-sdl/dialogs.c      Thu Apr 23 00:16:39 2015
@@ -63,6 +63,7 @@
 #include "inteldlg.h"
 #include "mapctrl.h"
 #include "mapview.h"
+#include "menu.h"
 #include "messagewin.h"
 #include "optiondlg.h"
 #include "plrdlg.h"
@@ -150,7 +151,8 @@
   popdown_advanced_terrain_dialog();
   popdown_terrain_info_dialog();
   popdown_newcity_dialog();
-  popdown_optiondlg();
+  popdown_optiondlg(TRUE);
+  undraw_order_widgets();
   popdown_diplomat_dialog();
   popdown_pillage_dialog();
   popdown_incite_dialog();

Modified: branches/S2_5/client/gui-sdl/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/menu.c?rev=28843&r1=28842&r2=28843&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/menu.c (original)
+++ branches/S2_5/client/gui-sdl/menu.c Thu Apr 23 00:16:39 2015
@@ -942,6 +942,10 @@
 void undraw_order_widgets(void)
 {
   struct widget *pTmpWidget = pBeginOrderWidgetList;
+
+  if (pTmpWidget == NULL) {
+    return;
+  }
 
   while (TRUE) {
 

Modified: branches/S2_5/client/gui-sdl/optiondlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/optiondlg.c?rev=28843&r1=28842&r2=28843&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/optiondlg.c    (original)
+++ branches/S2_5/client/gui-sdl/optiondlg.c    Thu Apr 23 00:16:39 2015
@@ -238,16 +238,16 @@
   }
 
   if (ODM_MAIN == option_dialog->mode) {
-    popdown_optiondlg();
-
     if (client.conn.established) {
       /* Back to game. */
+      popdown_optiondlg(FALSE);
       enable_options_button();
       widget_redraw(pOptions_Button);
       widget_mark_dirty(pOptions_Button);
       flush_dirty();
     } else {
       /* Back to main page. */
+      popdown_optiondlg(TRUE);
       set_client_page(PAGE_MAIN);
     }
     return -1;
@@ -366,7 +366,7 @@
 static int disconnect_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-    popdown_optiondlg();
+    popdown_optiondlg(TRUE);
     enable_options_button();
     disconnect_from_server();
   }
@@ -379,7 +379,7 @@
 static int exit_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-    popdown_optiondlg();
+    popdown_optiondlg(TRUE);
     force_exit_from_event_loop();
   }
   return 0;
@@ -1379,9 +1379,9 @@
 }
 
 /**************************************************************************
-  ...
+  Close option dialog.
 **************************************************************************/
-void popdown_optiondlg(void)
+void popdown_optiondlg(bool leave_game)
 {
   if (NULL == option_dialog) {
     return;
@@ -1389,7 +1389,10 @@
 
   option_dialog_destroy(option_dialog);
   option_dialog = NULL;
-  enable_main_widgets();
+
+  if (!leave_game) {
+    enable_main_widgets();
+  }
 
   if (restore_meswin_dialog) {
     meswin_dialog_popup(TRUE);

Modified: branches/S2_5/client/gui-sdl/optiondlg.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/optiondlg.h?rev=28843&r1=28842&r2=28843&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/optiondlg.h    (original)
+++ branches/S2_5/client/gui-sdl/optiondlg.h    Thu Apr 23 00:16:39 2015
@@ -27,7 +27,7 @@
 struct widget *pOptions_Button;
 
 void popup_optiondlg(void);
-void popdown_optiondlg(void);
+void popdown_optiondlg(bool leave_game);
 
 void init_options_button(void);
 void enable_options_button(void);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to