Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9781) gui-xaw: fix keyboard shortcuts (for the load co
Home

[Freeciv-Dev] (PR#9781) gui-xaw: fix keyboard shortcuts (for the load co

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9781) gui-xaw: fix keyboard shortcuts (for the load commands)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Aug 2004 16:20:44 -0700
Reply-to: rt@xxxxxxxxxxx

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

This patch fixes the keyboard shortcuts affected by the load commands.

   shift-L is load.
   shift-U is unload.

These have to go first in the rc file.  Apparently if you bind a key U 
before the key shift-U then U takes on shift-U as well.  Crazy.

   ctrl-w is worklist editor
   u is unload transporter

Unchanged:

   w is wait
   shift-W is activate all
   l is goto/airlift

Todo:

   ctrl-q should be quit.

jason

Index: client/gui-xaw/actions.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/actions.c,v
retrieving revision 1.21
diff -u -r1.21 actions.c
--- client/gui-xaw/actions.c    23 Aug 2004 20:59:57 -0000      1.21
+++ client/gui-xaw/actions.c    23 Aug 2004 23:19:44 -0000
@@ -590,10 +590,33 @@
 
 static void xaw_key_unit_unload_all(Widget w, XEvent *event, String *argv, 
Cardinal *argc)
 {
-  if(is_menu_item_active(MENU_ORDER, MENU_ORDER_UNLOAD))
+  if(is_menu_item_active(MENU_ORDER, MENU_ORDER_UNLOAD_TRANSPORTER))
     key_unit_unload_all();
 }
 
+/****************************************************************************
+  Invoked when the key binding for orders->load is pressed.
+****************************************************************************/
+static void xaw_key_unit_load(Widget w, XEvent *event,
+                             String *argv, Cardinal *argc)
+{
+  if (can_client_issue_orders()
+      && is_menu_item_active(MENU_ORDER, MENU_ORDER_LOAD)) {
+    request_unit_load(get_unit_in_focus(), NULL);
+  }
+}
+
+/****************************************************************************
+  Invoked when the key binding for orders->unload is pressed.
+****************************************************************************/
+static void xaw_key_unit_unload(Widget w, XEvent *event,
+                               String *argv, Cardinal *argc)
+{
+  if (can_client_issue_orders()
+      && is_menu_item_active(MENU_ORDER, MENU_ORDER_UNLOAD)) {
+    request_unit_unload(get_unit_in_focus());
+  }
+}
 static void xaw_key_unit_wait(Widget w, XEvent *event, String *argv, Cardinal 
*argc)
 {
   if(is_menu_item_active(MENU_ORDER, MENU_ORDER_WAIT))
@@ -739,6 +762,8 @@
   { "key-unit-sentry", xaw_key_unit_sentry },
   { "key-unit-transform", xaw_key_unit_transform },
   { "key-unit-unload-all", xaw_key_unit_unload_all },
+  { "key-unit-load", xaw_key_unit_load },
+  { "key-unit-unload", xaw_key_unit_unload },
   { "key-unit-wait", xaw_key_unit_wait },
   { "key-unit-wakeup-others", xaw_key_unit_wakeup_others },
   { "msg-close-city", xaw_msg_close_city },
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.64
diff -u -r1.64 menu.c
--- client/gui-xaw/menu.c       23 Aug 2004 20:59:57 -0000      1.64
+++ client/gui-xaw/menu.c       23 Aug 2004 23:19:44 -0000
@@ -121,7 +121,7 @@
     { { N_("Tax Rates"), 0            },     "T", MENU_GOVERNMENT_RATES, 0 },
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Find City"), 0            },     "F", MENU_GOVERNMENT_FIND_CITY, 0 
},
-    { { N_("Worklists"), 0            },     "L", MENU_GOVERNMENT_WORKLISTS, 0 
},
+    { { N_("Worklists"), 0            },     "Ctl-W", 
MENU_GOVERNMENT_WORKLISTS, 0 },
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Revolution"), 0           },     "R", MENU_GOVERNMENT_REVOLUTION, 
0 },
     { { 0,                            },       0, MENU_END_OF_LIST, 0 }
@@ -178,8 +178,8 @@
     { { N_("Make Homecity"), 0        },     "h", MENU_ORDER_HOMECITY, 0 },
     { { N_("Unload Transporter"), 0 }, "u",
       MENU_ORDER_UNLOAD_TRANSPORTER, 0 },
-    { { N_("Load"), 0 }, "", MENU_ORDER_LOAD, 0 },
-    { { N_("Unload"), 0 }, "", MENU_ORDER_UNLOAD, 0 },
+    { { N_("Load"), 0 }, "L", MENU_ORDER_LOAD, 0 },
+    { { N_("Unload"), 0 }, "U", MENU_ORDER_UNLOAD, 0 },
     { { N_("Wake up others"), 0       },     "W", MENU_ORDER_WAKEUP_OTHERS, 0 
},
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Auto Settler"), 0         },     "a", MENU_ORDER_AUTO_SETTLER, 0 },
Index: data/Freeciv
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/Freeciv,v
retrieving revision 1.214
diff -u -r1.214 Freeciv
--- data/Freeciv        23 Aug 2004 20:59:57 -0000      1.214
+++ data/Freeciv        23 Aug 2004 23:19:50 -0000
@@ -2837,8 +2837,10 @@
    Shift Ctrl<Key>l:  key-unit-connect-rail()          \n\
    Shift Ctrl<Key>i:  key-unit-connect-irrigate()      \n\
    Shift<Key>d:       key-unit-disband()               \n\
+   Shift<Key>l:       key-unit-load()                  \n\
+   Shift<Key>u:       key-unit-unload()                \n\
    Shift<Key>f:       key-open-find-city()             \n\
-   Shift<Key>l:       key-open-worklists()             \n\
+   Ctrl<Key>w:        key-open-worklists()             \n\
    Shift<Key>n:       key-unit-nuke()                  \n\
    Shift<Key>p:       key-unit-pillage()               \n\
    Shift<Key>r:       key-open-revolution()            \n\
@@ -2862,7 +2864,7 @@
    <Key>r:            key-unit-road-or-traderoute()    \n\
    <Key>s:            key-unit-sentry()                \n\
    <Key>t:            key-city-workers()               \n\
-   <Key>u:            key-unit-unload()                \n\
+   <Key>u:            key-unit-unload-all()            \n\
    <Key>w:            key-unit-wait()                  \n\
    <Key>x:            key-unit-auto-explore()          \n\
    <Key>F1:           key-open-city-report()           \n\
@@ -2916,8 +2918,10 @@
    Ctrl<Key>l:        key-unit-connect-rail()          \n\
    Ctrl<Key>i:        key-unit-connect-irrigate()      \n\
    Shift<Key>d:       key-unit-disband()               \n\
+   Shift<Key>l:       key-unit-load()                  \n\
+   Shift<Key>u:       key-unit-unload()                \n\
    Shift<Key>f:       key-open-find-city()             \n\
-   Shift<Key>l:       key-open-worklists()             \n\
+   Ctrl<Key>w:        key-open-worklists()             \n\
    Shift<Key>n:       key-unit-nuke()                  \n\
    Shift<Key>p:       key-unit-pillage()               \n\
    Shift<Key>r:       key-open-revolution()            \n\
@@ -2941,7 +2945,7 @@
    <Key>r:            key-unit-road-or-traderoute()    \n\
    <Key>s:            key-unit-sentry()                \n\
    <Key>t:            key-city-workers()               \n\
-   <Key>u:            key-unit-unload()                \n\
+   <Key>u:            key-unit-unload-all()            \n\
    <Key>w:            key-unit-wait()                  \n\
    <Key>x:            key-unit-auto-explore()          \n\
    <Key>F1:           key-open-city-report()           \n\

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9781) gui-xaw: fix keyboard shortcuts (for the load commands), Jason Short <=