Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] Re: (PR#10999) unload order
Home

[Freeciv-Dev] Re: (PR#10999) unload order

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10999) unload order
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Nov 2004 11:02:12 -0800
Reply-to: rt@xxxxxxxxxxx

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

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10999 >
> 
>>[chrisk - Sat Nov 13 11:37:56 2004]:
>>
>>
>>CVS 13 NOV 2004 S2 GTK2
>>
>>The unload order (shift-u) for ships is displayed in the orders menu even
>>for transporter ships that are empty.
> 
> 
> Here is a patch (untested).
> 
> However this will cause another (probably worse) bug.  Because the menus
> aren't updated when a unit is loaded, loading a unit into the focus unit
> when the focus unit is empty will leave you with the unload-all menu
> entry disabled.  (However it's pretty hard to load a unit into the focus
> unit.)

Oops.  Here's a patch without the garbage.

jason

Index: client/messagewin_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/messagewin_common.c,v
retrieving revision 1.15
diff -u -r1.15 messagewin_common.c
--- client/messagewin_common.c  29 Sep 2004 02:24:19 -0000      1.15
+++ client/messagewin_common.c  15 Nov 2004 18:56:16 -0000
@@ -75,7 +75,7 @@
 
   if (!is_meswin_open() && messages_total > 0 &&
       (!game.player_ptr->ai.control || ai_popup_windows)) {
-    popup_meswin_dialog();
+    popup_meswin_dialog(FALSE);
     change = FALSE;
     return;
   }
Index: client/gui-ftwl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-ftwl/mapview.c,v
retrieving revision 1.11
diff -u -r1.11 mapview.c
--- client/gui-ftwl/mapview.c   9 Oct 2004 16:48:27 -0000       1.11
+++ client/gui-ftwl/mapview.c   15 Nov 2004 18:56:16 -0000
@@ -1446,7 +1446,7 @@
       ADD("unit_homecity");
     }
 
-    if (get_transporter_capacity(punit) > 0) {
+    if (get_transporter_occupancy(punit) > 0) {
       ADD("unit_unload");
     }
     if (is_unit_activity_on_tile(ACTIVITY_SENTRY, punit->tile)) {
Index: client/gui-gtk/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/menu.c,v
retrieving revision 1.91
diff -u -r1.91 menu.c
--- client/gui-gtk/menu.c       19 Oct 2004 06:29:12 -0000      1.91
+++ client/gui-gtk/menu.c       15 Nov 2004 18:56:16 -0000
@@ -1160,7 +1160,7 @@
       menus_set_sensitive("<main>/_Orders/Make _Homecity",
                          can_unit_change_homecity(punit));
       menus_set_sensitive("<main>/_Orders/_Unload Transporter",
-                         get_transporter_capacity(punit)>0);
+                         get_transporter_occupancy(punit) > 0);
       menus_set_sensitive("<main>/_Orders/Load",
        can_unit_load(punit, find_transporter_for_unit(punit,
                                                       punit->tile)));
Index: client/gui-gtk-2.0/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cityrep.c,v
retrieving revision 1.65
diff -u -r1.65 cityrep.c
--- client/gui-gtk-2.0/cityrep.c        31 Oct 2004 20:45:54 -0000      1.65
+++ client/gui-gtk-2.0/cityrep.c        15 Nov 2004 18:56:17 -0000
@@ -157,29 +157,23 @@
 ****************************************************************/
 
 /****************************************************************
-...
+ Popup the city report dialog, and optionally raise it.
 ****************************************************************/
-void popup_city_report_dialog(bool make_modal)
+void popup_city_report_dialog(bool raise)
 {
   if(!city_dialog_shell) {
-    city_dialog_shell_is_modal = make_modal;
+    city_dialog_shell_is_modal = FALSE;
     
-    create_city_report_dialog(make_modal);
+    create_city_report_dialog(FALSE);
 
     select_menu_cached = FALSE;
   }
 
   gui_dialog_present(city_dialog_shell);
   hilite_cities_from_canvas();
-}
-
-/****************************************************************
- Raises the city report dialog.
-****************************************************************/
-void raise_city_report_dialog(void)
-{
-  popup_city_report_dialog(FALSE);
-  gui_dialog_raise(city_dialog_shell);
+  if (raise) {
+    gui_dialog_raise(city_dialog_shell);
+  }
 }
 
 /****************************************************************
Index: client/gui-gtk-2.0/cityrep.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cityrep.h,v
retrieving revision 1.3
diff -u -r1.3 cityrep.h
--- client/gui-gtk-2.0/cityrep.h        31 Oct 2004 20:45:54 -0000      1.3
+++ client/gui-gtk-2.0/cityrep.h        15 Nov 2004 18:56:17 -0000
@@ -15,7 +15,6 @@
 
 #include "cityrep_g.h"
 
-void raise_city_report_dialog(void);
 void popdown_city_report_dialog(void);
 
 #endif  /* FC__CITYREP_H */
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.91
diff -u -r1.91 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       14 Nov 2004 16:47:30 -0000      1.91
+++ client/gui-gtk-2.0/gui_main.c       15 Nov 2004 18:56:17 -0000
@@ -983,7 +983,7 @@
   gtk_widget_hide(more_arrow_pixmap);
 
   if (enable_tabs) {
-    popup_meswin_dialog();
+    popup_meswin_dialog(FALSE);
   }
 
   gtk_notebook_set_current_page(GTK_NOTEBOOK(top_notebook), 0);
Index: client/gui-gtk-2.0/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/menu.c,v
retrieving revision 1.53
diff -u -r1.53 menu.c
--- client/gui-gtk-2.0/menu.c   13 Nov 2004 23:35:49 -0000      1.53
+++ client/gui-gtk-2.0/menu.c   15 Nov 2004 18:56:17 -0000
@@ -495,19 +495,19 @@
 {
   switch(callback_action) {
    case MENU_REPORT_CITIES:
-    raise_city_report_dialog();
+    popup_city_report_dialog(TRUE);
     break;
    case MENU_REPORT_UNITS:
-    raise_activeunits_report_dialog();
+    popup_activeunits_report_dialog(TRUE);
     break;
   case MENU_REPORT_PLAYERS:
-    raise_players_dialog();
+    popup_players_dialog(TRUE);
     break;
    case MENU_REPORT_ECONOMY:
-    raise_economy_report_dialog();
+    popup_economy_report_dialog(TRUE);
     break;
    case MENU_REPORT_SCIENCE:
-    raise_science_dialog();
+    popup_science_dialog(TRUE);
     break;
    case MENU_REPORT_WOW:
     send_report_request(REPORT_WONDERS_OF_THE_WORLD);
@@ -516,7 +516,7 @@
     send_report_request(REPORT_TOP_5_CITIES);
     break;
   case MENU_REPORT_MESSAGES:
-    raise_meswin_dialog();
+    popup_meswin_dialog(TRUE);
     break;
    case MENU_REPORT_DEMOGRAPHIC:
     send_report_request(REPORT_DEMOGRAPHIC);
@@ -1314,7 +1314,7 @@
       menus_set_sensitive("<main>/_Orders/Make _Homecity",
                          can_unit_change_homecity(punit));
       menus_set_sensitive("<main>/_Orders/_Unload Transporter",
-                         get_transporter_capacity(punit)>0);
+                         get_transporter_occupancy(punit) > 0);
       menus_set_sensitive("<main>/_Orders/_Load",
        can_unit_load(punit, find_transporter_for_unit(punit,
                                                       punit->tile)));
Index: client/gui-gtk-2.0/messagewin.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/messagewin.c,v
retrieving revision 1.28
diff -u -r1.28 messagewin.c
--- client/gui-gtk-2.0/messagewin.c     14 Nov 2004 23:49:17 -0000      1.28
+++ client/gui-gtk-2.0/messagewin.c     15 Nov 2004 18:56:17 -0000
@@ -59,9 +59,10 @@
 #define N_MSG_VIEW 24         /* max before scrolling happens */
 
 /****************************************************************
-popup the dialog 10% inside the main-window 
+popup the dialog 10% inside the main-window, and optionally
+raise it.
 *****************************************************************/
-void popup_meswin_dialog(void)
+void popup_meswin_dialog(bool raise)
 {
   if (!meswin_shell) {
     create_meswin_dialog();
@@ -70,15 +71,9 @@
   update_meswin_dialog();
 
   gui_dialog_present(meswin_shell);
-}
-
-/****************************************************************
- Raises the message window dialog.
-****************************************************************/
-void raise_meswin_dialog(void)
-{
-  popup_meswin_dialog();
-  gui_dialog_raise(meswin_shell);
+  if (raise) {
+    gui_dialog_raise(meswin_shell);
+  }
 }
 
 /**************************************************************************
Index: client/gui-gtk-2.0/messagewin.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/messagewin.h,v
retrieving revision 1.4
diff -u -r1.4 messagewin.h
--- client/gui-gtk-2.0/messagewin.h     31 Oct 2004 20:45:55 -0000      1.4
+++ client/gui-gtk-2.0/messagewin.h     15 Nov 2004 18:56:17 -0000
@@ -17,7 +17,6 @@
 
 GtkWidget *create_meswin_area(void);
 
-void raise_meswin_dialog(void);
 void popdown_meswin_dialog(void);
 
 #endif  /* FC__MESSAGEWIN_H */
Index: client/gui-gtk-2.0/plrdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/plrdlg.c,v
retrieving revision 1.44
diff -u -r1.44 plrdlg.c
--- client/gui-gtk-2.0/plrdlg.c 14 Nov 2004 23:49:17 -0000      1.44
+++ client/gui-gtk-2.0/plrdlg.c 15 Nov 2004 18:56:18 -0000
@@ -73,23 +73,17 @@
 static void update_views(void);
 
 /**************************************************************************
-popup the dialog 10% inside the main-window 
+popup the dialog 10% inside the main-window, and optionally raise it.
 **************************************************************************/
-void popup_players_dialog(void)
+void popup_players_dialog(bool raise)
 {
   if (!players_dialog_shell){
     create_players_dialog();
   }
   gui_dialog_present(players_dialog_shell);
-}
-
-/****************************************************************
- Raises the players dialog.
-****************************************************************/
-void raise_players_dialog(void)
-{
-  popup_players_dialog();
-  gui_dialog_raise(players_dialog_shell);
+  if (raise) {
+    gui_dialog_raise(players_dialog_shell);
+  }
 }
 
 /****************************************************************
Index: client/gui-gtk-2.0/plrdlg.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/plrdlg.h,v
retrieving revision 1.3
diff -u -r1.3 plrdlg.h
--- client/gui-gtk-2.0/plrdlg.h 31 Oct 2004 20:45:55 -0000      1.3
+++ client/gui-gtk-2.0/plrdlg.h 15 Nov 2004 18:56:18 -0000
@@ -15,7 +15,6 @@
 
 #include "plrdlg_g.h"
 
-void raise_players_dialog(void);
 void popdown_players_dialog(void);
 
 #endif  /* FC__PLRDLG_H */
Index: client/gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.68
diff -u -r1.68 repodlgs.c
--- client/gui-gtk-2.0/repodlgs.c       14 Nov 2004 23:49:17 -0000      1.68
+++ client/gui-gtk-2.0/repodlgs.c       15 Nov 2004 18:56:18 -0000
@@ -139,25 +139,19 @@
 /****************************************************************
 ...
 *****************************************************************/
-void popup_science_dialog(bool make_modal)
+void popup_science_dialog(bool raise)
 {
   if(!science_dialog_shell) {
-    science_dialog_shell_is_modal = make_modal;
+    science_dialog_shell_is_modal = FALSE;
     
-    create_science_dialog(make_modal);
+    create_science_dialog(FALSE);
   }
 
   gui_dialog_present(science_dialog_shell);
-}
-
 
-/****************************************************************
- Raises the science dialog.
-****************************************************************/
-void raise_science_dialog(void)
-{
-  popup_science_dialog(FALSE);
-  gui_dialog_raise(science_dialog_shell);
+  if (raise) {
+    gui_dialog_raise(science_dialog_shell);
+  }
 }
 
 
@@ -592,28 +586,20 @@
 /****************************************************************
 ...
 ****************************************************************/
-void popup_economy_report_dialog(bool make_modal)
+void popup_economy_report_dialog(bool raise)
 {
   if(!economy_dialog_shell) {
-    economy_dialog_shell_is_modal = make_modal;
+    economy_dialog_shell_is_modal = FALSE;
 
-    create_economy_report_dialog(make_modal);
+    create_economy_report_dialog(FALSE);
   }
 
   gui_dialog_present(economy_dialog_shell);
+  if (raise) {
+    gui_dialog_raise(economy_dialog_shell);
+  }
 }
 
-
-/****************************************************************
- Raises the economy report dialog.
-****************************************************************/
-void raise_economy_report_dialog(void)
-{
-  popup_economy_report_dialog(FALSE);
-  gui_dialog_raise(economy_dialog_shell);
-}
-
-
 /****************************************************************
  Close the economy report dialog.
 ****************************************************************/
@@ -887,28 +873,20 @@
 /****************************************************************
 ...
 ****************************************************************/
-void popup_activeunits_report_dialog(bool make_modal)
+void popup_activeunits_report_dialog(bool raise)
 {
   if(!activeunits_dialog_shell) {
-    activeunits_dialog_shell_is_modal = make_modal;
+    activeunits_dialog_shell_is_modal = FALSE;
     
-    create_activeunits_report_dialog(make_modal);
+    create_activeunits_report_dialog(FALSE);
   }
 
   gui_dialog_present(activeunits_dialog_shell);
+  if (raise) {
+    gui_dialog_raise(activeunits_dialog_shell);
+  }
 }
 
-
-/****************************************************************
- Raises the units report dialog.
-****************************************************************/
-void raise_activeunits_report_dialog(void)
-{
-  popup_activeunits_report_dialog(FALSE);
-  gui_dialog_raise(activeunits_dialog_shell);
-}
-
-
 /****************************************************************
  Closes the units report dialog.
 ****************************************************************/
Index: client/gui-gtk-2.0/repodlgs.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.h,v
retrieving revision 1.4
diff -u -r1.4 repodlgs.h
--- client/gui-gtk-2.0/repodlgs.h       31 Oct 2004 20:45:55 -0000      1.4
+++ client/gui-gtk-2.0/repodlgs.h       15 Nov 2004 18:56:18 -0000
@@ -15,11 +15,8 @@
 
 #include "repodlgs_g.h"
 
-void raise_science_dialog(void);
 void popdown_science_dialog(void);
-void raise_economy_report_dialog(void);
 void popdown_economy_report_dialog(void);
-void raise_activeunits_report_dialog(void);
 void popdown_activeunits_report_dialog(void);
 
 #endif  /* FC__REPODLGS_H */
Index: client/gui-mui/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/gui_main.c,v
retrieving revision 1.87
diff -u -r1.87 gui_main.c
--- client/gui-mui/gui_main.c   13 Nov 2004 09:26:51 -0000      1.87
+++ client/gui-mui/gui_main.c   15 Nov 2004 18:56:18 -0000
@@ -1259,7 +1259,8 @@
       menu_entry_sensitive(MENU_ORDER_SENTRY, can_unit_do_activity(punit, 
ACTIVITY_SENTRY));
       menu_entry_sensitive(MENU_ORDER_PILLAGE, can_unit_do_activity(punit, 
ACTIVITY_PILLAGE));
       menu_entry_sensitive(MENU_ORDER_HOMECITY, 
can_unit_change_homecity(punit));
-      menu_entry_sensitive(MENU_ORDER_UNLOAD, get_transporter_capacity(punit) 
> 0);
+      menu_entry_sensitive(MENU_ORDER_UNLOAD,
+                          get_transporter_occupancy(punit) > 0);
       menu_entry_sensitive(MENU_ORDER_WAKEUP_OTHERS, 
is_unit_activity_on_tile(ACTIVITY_SENTRY, punit->tile));
       menu_entry_sensitive(MENU_ORDER_AUTO_SETTLER, (can_unit_do_auto(punit) 
&& unit_flag(punit, F_SETTLERS)));
       menu_entry_sensitive(MENU_ORDER_AUTO_ATTACK, (can_unit_do_auto(punit) && 
!unit_flag(punit, F_SETTLERS)));
Index: client/gui-mui/mapclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapclass.c,v
retrieving revision 1.99
diff -u -r1.99 mapclass.c
--- client/gui-mui/mapclass.c   29 Sep 2004 02:24:21 -0000      1.99
+++ client/gui-mui/mapclass.c   15 Nov 2004 18:56:19 -0000
@@ -1690,7 +1690,7 @@
                  Map_InsertCommand(&list, _("Paradrop"), PACK_USERDATA(punit, 
MENU_ORDER_POLLUTION));
                if (unit_flag(punit, F_NUCLEAR))
                  Map_InsertCommand(&list, _("Explode Nuclear"), 
PACK_USERDATA(punit, MENU_ORDER_NUKE));
-               if (get_transporter_capacity(punit) > 0)
+               if (get_transporter_occupancy(punit) > 0)
                  Map_InsertCommand(&list, _("Unload"), PACK_USERDATA(punit, 
MENU_ORDER_UNLOAD));
                if (is_unit_activity_on_tile(ACTIVITY_SENTRY, punit->tile))
                  Map_InsertCommand(&list, _("Wake up"), PACK_USERDATA(punit, 
MENU_ORDER_WAKEUP_OTHERS));
Index: client/gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.73
diff -u -r1.73 mapview.c
--- client/gui-sdl/mapview.c    1 Oct 2004 17:40:28 -0000       1.73
+++ client/gui-sdl/mapview.c    15 Nov 2004 18:56:19 -0000
@@ -2058,7 +2058,8 @@
   }
   
   /* draw current occupy status */
-  if (pUnit->owner == game.player_idx && get_transporter_capacity(pUnit) > 0) {
+  if (pUnit->owner == game.player_idx
+      && get_transporter_occupancy(pUnit) > 0) {
     
     des.y += NORMAL_TILE_HEIGHT / 2;
     copy = des;
Index: client/gui-sdl/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/menu.c,v
retrieving revision 1.26
diff -u -r1.26 menu.c
--- client/gui-sdl/menu.c       25 Aug 2004 18:24:19 -0000      1.26
+++ client/gui-sdl/menu.c       15 Nov 2004 18:56:20 -0000
@@ -1155,7 +1155,7 @@
        local_hide(ID_UNIT_ORDER_HOMECITY);
       }
 
-      if (pUnit->occupy && get_transporter_capacity(pUnit) > 0) {
+      if (pUnit->occupy && get_transporter_occupancy(pUnit) > 0) {
        local_show(ID_UNIT_ORDER_UNLOAD);
       } else {
        local_hide(ID_UNIT_ORDER_UNLOAD);
Index: client/gui-win32/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/cityrep.c,v
retrieving revision 1.32
diff -u -r1.32 cityrep.c
--- client/gui-win32/cityrep.c  29 Sep 2004 06:26:11 -0000      1.32
+++ client/gui-win32/cityrep.c  15 Nov 2004 18:56:20 -0000
@@ -1060,21 +1060,24 @@
 
 **************************************************************************/
 void
-popup_city_report_dialog(bool make_modal)
+popup_city_report_dialog(bool raise)
 {
-  if (hCityRep) return;
-  hCityRep=
-    fcwin_create_layouted_window(city_report_proc,_("City Report"),
-                                WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | 
-                                WS_MAXIMIZEBOX | WS_THICKFRAME,
-                                CW_USEDEFAULT,CW_USEDEFAULT,
-                                root_window,NULL,
-                                JUST_CLEANUP,
-                                NULL);
+  if (!hCityRep) {
+    hCityRep =
+      fcwin_create_layouted_window(city_report_proc,_("City Report"),
+                                  WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX
+                                   | WS_MAXIMIZEBOX | WS_THICKFRAME,
+                                  CW_USEDEFAULT, CW_USEDEFAULT,
+                                  root_window, NULL, JUST_CLEANUP, NULL);
   
-  hChangeAll=NULL;
-  city_report_dialog_update();
-  ShowWindow(hCityRep,SW_SHOWNORMAL);
+    hChangeAll = NULL;
+    city_report_dialog_update();
+  }
+
+  ShowWindow(hCityRep, SW_SHOWNORMAL);
+  if (raise) {
+    SetFocus(hCityRep);
+  }
 }
 
 /**************************************************************************
Index: client/gui-win32/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/menu.c,v
retrieving revision 1.29
diff -u -r1.29 menu.c
--- client/gui-win32/menu.c     3 Nov 2004 07:06:18 -0000       1.29
+++ client/gui-win32/menu.c     15 Nov 2004 18:56:20 -0000
@@ -753,7 +753,7 @@
        if (can_unit_unload(punit, find_unit_by_id(punit->transported_by))
         && can_unit_exist_at_tile(punit, punit->tile)) {
          request_unit_unload(punit);
-       } else if (get_transporter_capacity(punit) > 0) {
+       } else if (get_transporter_occupancy(punit) > 0) {
          key_unit_unload_all();
        }
       }
@@ -813,19 +813,19 @@
 
 
     case IDM_REPORTS_CITIES:
-      popup_city_report_dialog(0);
+      popup_city_report_dialog(TRUE);
       break;
     case IDM_REPORTS_UNITS:
-      popup_activeunits_report_dialog(0);
+      popup_activeunits_report_dialog(TRUE);
       break;
     case IDM_REPORTS_PLAYERS:
-      popup_players_dialog();
+      popup_players_dialog(TRUE);
       break;
     case IDM_REPORTS_ECONOMY:
-      popup_economy_report_dialog(0);
+      popup_economy_report_dialog(TRUE);
       break;  
     case IDM_REPORTS_SCIENCE:
-      popup_science_dialog(0);
+      popup_science_dialog(TRUE);
       break;
     case IDM_REPORTS_WONDERS:
       send_report_request(REPORT_WONDERS_OF_THE_WORLD);
@@ -834,7 +834,7 @@
       send_report_request(REPORT_TOP_5_CITIES);
       break;       
     case IDM_REPORTS_MESSAGES:
-      popup_meswin_dialog();
+      popup_meswin_dialog(TRUE);
       break;
     case IDM_REPORTS_DEMOGRAPHICS:
       send_report_request(REPORT_DEMOGRAPHIC);
@@ -1137,7 +1137,7 @@
       my_enable_menu(menu, IDM_ORDERS_UNLOAD,
        (can_unit_unload(punit, find_unit_by_id(punit->transported_by))
         && can_unit_exist_at_tile(punit, punit->tile)) 
-       || get_transporter_capacity(punit) > 0);
+       || get_transporter_occupancy(punit) > 0);
       my_enable_menu(menu, IDM_ORDERS_WAKEUP_OTHERS,
                     is_unit_activity_on_tile(ACTIVITY_SENTRY,
                                              punit->tile));
Index: client/gui-win32/messagewin.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/messagewin.c,v
retrieving revision 1.10
diff -u -r1.10 messagewin.c
--- client/gui-win32/messagewin.c       23 Jan 2003 21:39:32 -0000      1.10
+++ client/gui-win32/messagewin.c       15 Nov 2004 18:56:20 -0000
@@ -159,7 +159,7 @@
 /**************************************************************************
 
 **************************************************************************/
-void popup_meswin_dialog(void)
+void popup_meswin_dialog(bool raise)
 {
   int updated = 0;
  
@@ -167,7 +167,9 @@
     create_meswin_dialog();
     updated = 1;               /* create_ calls update_ */
   }
-  
+  if (raise) {
+    SetFocus(meswin_dlg);
+  }
 }
 
 /****************************************************************
Index: client/gui-win32/plrdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/plrdlg.c,v
retrieving revision 1.19
diff -u -r1.19 plrdlg.c
--- client/gui-win32/plrdlg.c   8 Mar 2004 02:17:20 -0000       1.19
+++ client/gui-win32/plrdlg.c   15 Nov 2004 18:56:20 -0000
@@ -381,11 +381,14 @@
 
 *******************************************************************/      
 void
-popup_players_dialog(void)
+popup_players_dialog(bool raise)
 {
   if (!players_dialog)
     create_players_dialog();
   ShowWindow(players_dialog,SW_SHOWNORMAL);
+  if (raise) {
+    SetFocus(players_dialog);
+  }
 }
 
 /**************************************************************************
Index: client/gui-win32/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/repodlgs.c,v
retrieving revision 1.40
diff -u -r1.40 repodlgs.c
--- client/gui-win32/repodlgs.c 22 Sep 2004 08:45:04 -0000      1.40
+++ client/gui-win32/repodlgs.c 15 Nov 2004 18:56:20 -0000
@@ -221,7 +221,7 @@
 
 **************************************************************************/
 void
-popup_science_dialog(bool make_modal)
+popup_science_dialog(bool raise)
 {
   if (!science_dlg)
     {
@@ -263,6 +263,9 @@
     }
   science_dialog_update();
   ShowWindow(science_dlg,SW_SHOWNORMAL);
+  if (raise) {
+    SetFocus(science_dlg);
+  }
 }
 /**************************************************************************
 
@@ -382,7 +385,7 @@
 
 **************************************************************************/
 void
-popup_economy_report_dialog(bool make_modal)
+popup_economy_report_dialog(bool raise)
 {
   int i;
   struct fcwin_box *hbox;
@@ -431,6 +434,9 @@
   economy_report_dialog_update();
   
   ShowWindow(economy_dlg,SW_SHOWNORMAL);
+  if (raise) {
+    SetFocus(economy_dlg);
+  }
 }
 /****************************************************************
 ...
@@ -630,7 +636,7 @@
 
 **************************************************************************/
 void
-popup_activeunits_report_dialog(bool make_modal)
+popup_activeunits_report_dialog(bool raise)
 {
   if (!activeunits_dlg)
     {
@@ -683,6 +689,9 @@
     }
   activeunits_report_dialog_update();
   ShowWindow(activeunits_dlg,SW_SHOWNORMAL);
+  if (raise) {
+    SetFocus(activeunits_dlg);
+  }
 }
 
 /****************************************************************
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    15 Nov 2004 18:56:20 -0000
@@ -244,14 +244,14 @@
 {
   if (can_client_change_view() &&
      is_menu_item_active(MENU_REPORT, MENU_REPORT_MESSAGES))
-    popup_meswin_dialog();
+    popup_meswin_dialog(FALSE);
 }
 
 static void xaw_key_open_players(Widget w, XEvent *event, String *argv, 
Cardinal *argc)
 {
   if (can_client_change_view() &&
      is_menu_item_active(MENU_REPORT, MENU_REPORT_PLAYERS))
-    popup_players_dialog();
+    popup_players_dialog(FALSE);
 }
 
 /****************************************************************************
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.70
diff -u -r1.70 menu.c
--- client/gui-xaw/menu.c       10 Nov 2004 17:01:59 -0000      1.70
+++ client/gui-xaw/menu.c       15 Nov 2004 18:56:20 -0000
@@ -397,7 +397,7 @@
       menu_entry_sensitive(MENU_ORDER, MENU_ORDER_HOMECITY, 
                           can_unit_change_homecity(punit));
       menu_entry_sensitive(MENU_ORDER, MENU_ORDER_UNLOAD_TRANSPORTER, 
-                          get_transporter_capacity(punit)>0);
+                          get_transporter_occupancy(punit) > 0);
       menu_entry_sensitive(MENU_ORDER, MENU_ORDER_LOAD,
        can_unit_load(punit, find_transporter_for_unit(punit,
                                                       punit->tile)));
@@ -781,7 +781,7 @@
     popup_activeunits_report_dialog(0);
     break;
   case MENU_REPORT_PLAYERS:
-    popup_players_dialog();
+    popup_players_dialog(FALSE);
     break;
    case MENU_REPORT_ECONOMY:
     popup_economy_report_dialog(0);
@@ -796,7 +796,7 @@
     send_report_request(REPORT_TOP_5_CITIES);
     break;
   case MENU_REPORT_MESSAGES:
-    popup_meswin_dialog();
+    popup_meswin_dialog(FALSE);
     break;
    case MENU_REPORT_DEMOGRAPHIC:
     send_report_request(REPORT_DEMOGRAPHIC);
Index: client/gui-xaw/messagewin.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/messagewin.c,v
retrieving revision 1.26
diff -u -r1.26 messagewin.c
--- client/gui-xaw/messagewin.c 10 Oct 2004 11:37:43 -0000      1.26
+++ client/gui-xaw/messagewin.c 15 Nov 2004 18:56:21 -0000
@@ -52,8 +52,9 @@
 static Widget meswin_close_command;
 static Widget meswin_goto_command;
 static Widget meswin_popcity_command;
+static bool meswin_dialog_shell_is_raised;
 
-static void create_meswin_dialog(void);
+static void create_meswin_dialog(bool raise);
 static void meswin_scroll_down(void);
 static void meswin_close_callback(Widget w, XtPointer client_data,
                                  XtPointer call_data);
@@ -72,15 +73,21 @@
 /****************************************************************
 popup the dialog 10% inside the main-window 
 *****************************************************************/
-void popup_meswin_dialog(void)
+void popup_meswin_dialog(bool raise)
 {
   int updated = 0;
   
+  meswin_dialog_shell_is_raised = raise;
+
   if(!meswin_dialog_shell) {
-    create_meswin_dialog();
+    create_meswin_dialog(raise);
     updated = 1;               /* create_ calls update_ */
   }
 
+  if (raise) {
+    XtSetSensitive(main_form, FALSE);
+  }
+
   xaw_set_relative_position(toplevel, meswin_dialog_shell, 25, 25);
   XtPopup(meswin_dialog_shell, XtGrabNone);
   if(!updated) 
@@ -102,6 +109,9 @@
 void popdown_meswin_dialog(void)
 {
   if (meswin_dialog_shell) {
+    if (meswin_dialog_shell_is_raised) {
+      XtSetSensitive(main_form, TRUE);
+    }
     XtDestroyWidget(meswin_dialog_shell);
     meswin_dialog_shell = 0;
   }
@@ -122,12 +132,14 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void create_meswin_dialog(void)
+static void create_meswin_dialog(bool raise)
 {
   creating = TRUE;
 
   meswin_dialog_shell =
-    I_IN(I_T(XtCreatePopupShell("meswinpopup", topLevelShellWidgetClass,
+    I_IN(I_T(XtCreatePopupShell("meswinpopup",
+                               raise ? transientShellWidgetClass
+                               : topLevelShellWidgetClass,
                                toplevel, NULL, 0)));
 
   meswin_form = XtVaCreateManagedWidget("meswinform", 
Index: client/gui-xaw/plrdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/plrdlg.c,v
retrieving revision 1.40
diff -u -r1.40 plrdlg.c
--- client/gui-xaw/plrdlg.c     23 Sep 2004 18:17:23 -0000      1.40
+++ client/gui-xaw/plrdlg.c     15 Nov 2004 18:56:21 -0000
@@ -55,11 +55,12 @@
 static Widget players_war_command;
 static Widget players_vision_command;
 static Widget players_sship_command;
+static bool players_dialog_shell_is_raised;
 
 static int list_index_to_player_index[MAX_NUM_PLAYERS];
 
 
-static void create_players_dialog(void);
+static void create_players_dialog(bool raise);
 static void players_close_callback(Widget w, XtPointer client_data, 
                                   XtPointer call_data);
 static void players_meet_callback(Widget w, XtPointer client_data, 
@@ -81,10 +82,16 @@
 /****************************************************************
 popup the dialog somewhat inside the main-window 
 *****************************************************************/
-void popup_players_dialog(void)
+void popup_players_dialog(bool raise)
 {
+  players_dialog_shell_is_raised = raise;
+
   if(!players_dialog_shell)
-    create_players_dialog();
+    create_players_dialog(raise);
+
+  if (raise) {
+    XtSetSensitive(main_form, FALSE);
+  }
 
   xaw_set_relative_position(toplevel, players_dialog_shell, 5, 25);
   XtPopup(players_dialog_shell, XtGrabNone);
@@ -96,6 +103,9 @@
 void popdown_players_dialog(void)
 {
   if (players_dialog_shell) {
+    if (players_dialog_shell_is_raised) {
+      XtSetSensitive(main_form, TRUE);
+    }
     XtDestroyWidget(players_dialog_shell);
     players_dialog_shell = 0;
   }
@@ -104,11 +114,12 @@
 /****************************************************************
 ...
 *****************************************************************/
-void create_players_dialog(void)
+void create_players_dialog(bool raise)
 {
   players_dialog_shell =
     I_IN(I_T(XtCreatePopupShell("playerspopup", 
-                               topLevelShellWidgetClass,
+                               raise ? transientShellWidgetClass
+                               : topLevelShellWidgetClass,
                                toplevel, NULL, 0)));
 
   players_form = XtVaCreateManagedWidget("playersform", 
Index: client/include/cityrep_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/cityrep_g.h,v
retrieving revision 1.6
diff -u -r1.6 cityrep_g.h
--- client/include/cityrep_g.h  3 Sep 2004 04:22:36 -0000       1.6
+++ client/include/cityrep_g.h  15 Nov 2004 18:56:21 -0000
@@ -17,7 +17,7 @@
 
 #include "fc_types.h"
 
-void popup_city_report_dialog(bool make_modal);
+void popup_city_report_dialog(bool raise);
 void city_report_dialog_update(void);
 void city_report_dialog_update_city(struct city *pcity);
 
Index: client/include/messagewin_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/messagewin_g.h,v
retrieving revision 1.3
diff -u -r1.3 messagewin_g.h
--- client/include/messagewin_g.h       18 Jul 2002 09:42:29 -0000      1.3
+++ client/include/messagewin_g.h       15 Nov 2004 18:56:21 -0000
@@ -17,7 +17,7 @@
 
 #include "messagewin_common.h"
 
-void popup_meswin_dialog(void);
+void popup_meswin_dialog(bool raise);
 bool is_meswin_open(void);
 void real_update_meswin_dialog(void);
      
Index: client/include/plrdlg_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/plrdlg_g.h,v
retrieving revision 1.3
diff -u -r1.3 plrdlg_g.h
--- client/include/plrdlg_g.h   27 Jun 2002 00:59:21 -0000      1.3
+++ client/include/plrdlg_g.h   15 Nov 2004 18:56:21 -0000
@@ -15,7 +15,7 @@
 
 #include "plrdlg_common.h"
 
-void popup_players_dialog(void);
+void popup_players_dialog(bool raise);
 void update_players_dialog(void);
 
 #endif  /* FC__PLRDLG_G_H */
Index: client/include/repodlgs_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/repodlgs_g.h,v
retrieving revision 1.8
diff -u -r1.8 repodlgs_g.h
--- client/include/repodlgs_g.h 23 Apr 2004 22:58:06 -0000      1.8
+++ client/include/repodlgs_g.h 15 Nov 2004 18:56:21 -0000
@@ -21,11 +21,11 @@
 void update_report_dialogs(void);
 
 void science_dialog_update(void);
-void popup_science_dialog(bool make_modal);
+void popup_science_dialog(bool raise);
 void economy_report_dialog_update(void);
-void popup_economy_report_dialog(bool make_modal);
+void popup_economy_report_dialog(bool raise);
 void activeunits_report_dialog_update(void);
-void popup_activeunits_report_dialog(bool make_modal);
+void popup_activeunits_report_dialog(bool raise);
 void popup_endgame_report_dialog(struct packet_endgame_report *packet);
 void popup_settable_options_dialog(void);
 

[Prev in Thread] Current Thread [Next in Thread]