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

> [dmarks - So 11. Mär 2007, 07:01:30]:
> 
> Some suggestions that would IMO improve usability in the SDL client:
> 
>  * Since right-clicking on the world map moves it, right-clicking on
> the minimap should have the same effect.
> 
>  * Remap the Options menu to Esc and have Tab activating the chatline.
> This is IMHO more intuitive.
> 
>  * Shift+Enter ends turn instead of just Enter. It makes it less easy
> to accidentally end your turn and is also how it works in the GTK2
> client.
> 
>  ~Daniel
> 

Patch attached. It also assigns the help dialog popup in the research
dialog to the middle mouse button instead of the right button. 

Index: client/gui-sdl/optiondlg.c
===================================================================
--- client/gui-sdl/optiondlg.c	(Revision 12773)
+++ client/gui-sdl/optiondlg.c	(Arbeitskopie)
@@ -2107,12 +2107,15 @@
 
 void init_options_button(void)
 {
+  char buf[256];
+  
   pOptions_Button = create_themeicon(pTheme->Options_Icon, Main.gui,
 				       (WF_WIDGET_HAS_INFO_LABEL |
 					WF_RESTORE_BACKGROUND));
   pOptions_Button->action = optiondlg_callback;
-  pOptions_Button->string16 = create_str16_from_char(_("Options"), adj_font(12));
-  pOptions_Button->key = SDLK_TAB;
+  my_snprintf(buf, sizeof(buf), "%s (%s)", ("Options"), "Esc");
+  pOptions_Button->string16 = create_str16_from_char(buf, adj_font(12));
+  pOptions_Button->key = SDLK_ESCAPE;
   set_wflag(pOptions_Button, WF_HIDDEN);
   widget_set_position(pOptions_Button, adj_size(5), adj_size(5));
   
Index: client/gui-sdl/mapview.c
===================================================================
--- client/gui-sdl/mapview.c	(Revision 12773)
+++ client/gui-sdl/mapview.c	(Arbeitskopie)
@@ -308,10 +308,11 @@
   set_new_icon2_theme(pBuf, adj_surf(GET_SURF(gov)), TRUE);    
   
   if (game.player_ptr) {
-    my_snprintf(cBuf, sizeof(cBuf), _("Revolution (Shift + R)\n%s"),
-                              get_gov_pplayer(game.player_ptr)->name);
+    my_snprintf(cBuf, sizeof(cBuf), "%s (%s)\n%s", _("Revolution"), "Shift+R",
+                                    get_gov_pplayer(game.player_ptr)->name);
   } else {
-    my_snprintf(cBuf, sizeof(cBuf), _("Revolution (Shift + R)\n%s"), "None");
+    my_snprintf(cBuf, sizeof(cBuf), "%s (%s)\n%s", _("Revolution"), "Shift+R",
+                                    "None");
   }        
   copy_chars_to_string16(pBuf->string16, cBuf);
       
@@ -327,16 +328,16 @@
   pBuf = get_research_widget();
   
   if (!game.player_ptr) {
-    my_snprintf(cBuf, sizeof(cBuf), _("Research (F6)\n%s (%d/%d)"),
-                "None", 0, 0);
+    my_snprintf(cBuf, sizeof(cBuf), "%s (%s)\n%s (%d/%d)", _("Research"), "F6",
+                                    "None", 0, 0);
   } else if (get_player_research(game.player_ptr)->researching != A_UNSET) {  
-    my_snprintf(cBuf, sizeof(cBuf), _("Research (F6)\n%s (%d/%d)"),
+    my_snprintf(cBuf, sizeof(cBuf), "%s (%s)\n%s (%d/%d)", _("Research"), "F6",
 	      	get_tech_name(game.player_ptr,
                 get_player_research(game.player_ptr)->researching),
 	      	get_player_research(game.player_ptr)->bulbs_researched,
   		total_bulbs_required(game.player_ptr));
   } else {
-    my_snprintf(cBuf, sizeof(cBuf), _("Research (F6)\n%s (%d/%d)"),
+    my_snprintf(cBuf, sizeof(cBuf), "%s (%s)\n%s (%d/%d)", _("Research"), "F6",
 	      	get_tech_name(game.player_ptr,
 			    get_player_research(game.player_ptr)->researching),
 	      	get_player_research(game.player_ptr)->bulbs_researched,
@@ -1072,7 +1073,11 @@
       }
 
       if (game.player_ptr) {
-        pStr = create_str16_from_char(_("End of Turn\n(Press Enter)"), adj_font(14));
+        char buf[256];
+        my_snprintf(buf, sizeof(buf), "%s\n%s\n%s",
+                    _("End of Turn"), _("Press"), _("Shift+Return"));
+        pStr = create_str16_from_char(buf, adj_font(14));
+        pStr->style = SF_CENTER;
         pStr->bgcol = (SDL_Color) {0, 0, 0, 0};
         pBuf_Surf = create_text_surf_from_str16(pStr);
         area.x = pInfo_Window->size.x + BLOCKU_W +
Index: client/gui-sdl/repodlgs.c
===================================================================
--- client/gui-sdl/repodlgs.c	(Revision 12792)
+++ client/gui-sdl/repodlgs.c	(Arbeitskopie)
@@ -2769,7 +2769,7 @@
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     dsend_packet_player_research(&aconnection, (MAX_ID - pWidget->ID));
     exit_change_tech_dlg_callback(NULL);
-  } else if (Main.event.button.button == SDL_BUTTON_RIGHT) {
+  } else if (Main.event.button.button == SDL_BUTTON_MIDDLE) {
     popup_tech_info((MAX_ID - pWidget->ID));
   }
   return -1;
@@ -2968,7 +2968,7 @@
    /* Following is to make the menu go back to the current goal;
    * there may be a better way to do this?  --dwp */
     science_dialog_update();
-  } else if (Main.event.button.button == SDL_BUTTON_RIGHT) {
+  } else if (Main.event.button.button == SDL_BUTTON_MIDDLE) {
     popup_tech_info((MAX_ID - pWidget->ID));
   } 
   return -1;
Index: client/gui-sdl/gui_main.c
===================================================================
--- client/gui-sdl/gui_main.c	(Revision 12773)
+++ client/gui-sdl/gui_main.c	(Arbeitskopie)
@@ -242,7 +242,7 @@
   if ((pWidget = MainWidgetListKeyScaner(Key)) != NULL) {
     return widget_pressed_action(pWidget);
   } else {
-    if (RSHIFT && (Key.sym == SDLK_RETURN)) {
+    if (Key.sym == SDLK_TAB) {
       /* input */
       popup_input_line();
     } else {
@@ -251,19 +251,19 @@
         switch (Key.sym) {
 	  case SDLK_RETURN:
 	  case SDLK_KP_ENTER:
-	  {
-	    struct unit *pUnit;
-	    struct city *pCity;
-	    if((pUnit = unit_list_get(get_units_in_focus(), 0)) != NULL && 
-	      (pCity = pUnit->tile->city) != NULL &&
-	      city_owner(pCity) == game.player_ptr) {
-	      popup_city_dialog(pCity);
-	    } else {
+            if (LSHIFT || RSHIFT) {
 	      disable_focus_animation();
 	      key_end_turn();
+            } else {              
+              struct unit *pUnit;
+              struct city *pCity;
+              if((pUnit = unit_list_get(get_units_in_focus(), 0)) != NULL && 
+                (pCity = pUnit->tile->city) != NULL &&
+                city_owner(pCity) == game.player_ptr) {
+                popup_city_dialog(pCity);
+              }
 	    }
-	  }
-	  return ID_ERROR;
+          return ID_ERROR;
 
 	  case SDLK_F1:
             popup_city_report_dialog(FALSE);
Index: client/gui-sdl/menu.c
===================================================================
--- client/gui-sdl/menu.c	(Revision 12773)
+++ client/gui-sdl/menu.c	(Arbeitskopie)
@@ -355,7 +355,8 @@
   size_t len;
   
   /* No orders */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("No orders"), " (Space)");
+  /* TRANS: keyboard */
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("No orders"), _("Space"));
   pBuf = create_themeicon(pTheme->ODone_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -369,7 +370,7 @@
   pEndOrderWidgetList = pBuf;
 
   /* Wait */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Wait"), " (W)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Wait"), "W");
   pBuf = create_themeicon(pTheme->OWait_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -381,7 +382,7 @@
   /* --------- */  
 
   /* Explode Nuclear */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Explode Nuclear"), " (Shift + N)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Explode Nuclear"), "Shift+N");
   pBuf = create_themeicon(pTheme->ONuke_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -394,7 +395,7 @@
   /* --------- */
 
   /* Diplomat|Spy Actions */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Diplomat|Spy Actions"), " (D)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Diplomat|Spy Actions"), "D");
   pBuf = create_themeicon(pTheme->OSpy_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -406,7 +407,7 @@
   /* --------- */
 
   /* Disband */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Disband"), " (Shift + D)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Disband"), "Shift+D");
   pBuf = create_themeicon(pTheme->ODisband_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -419,7 +420,7 @@
   /* --------- */  
 
   /* Upgrade */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Upgrade"), " (Shift + U)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Upgrade"), "Shift+U");
   pBuf = create_themeicon(pTheme->Order_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -432,7 +433,7 @@
   /* --------- */
 
   /* Return to nearest city */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Return to nearest city"), " (Shift + G)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Return to nearest city"), "Shift+G");
   pBuf = create_themeicon(pTheme->OReturn_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -445,7 +446,7 @@
   /* --------- */
   
   /* Goto City */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Goto City"), " (L)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Goto City"), "L");
   pBuf = create_themeicon(pTheme->OGotoCity_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -457,7 +458,7 @@
   /* --------- */
 
   /* Airlift */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Airlift"), " (L)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Airlift"), "L");
   pBuf = create_themeicon(pTheme->Order_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -469,7 +470,7 @@
   /* --------- */
   
   /* Goto location */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Goto location"), " (G)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Goto location"), "G");
   pBuf = create_themeicon(pTheme->OGoto_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -481,7 +482,7 @@
   /* --------- */
 
   /* Patrol */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Patrol"), " (Q)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Patrol"), "Q");
   pBuf = create_themeicon(pTheme->OPatrol_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -493,7 +494,7 @@
   /* --------- */
 
   /* Connect irrigation */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Connect irrigation"), " (Shift + I)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect irrigation"), "Shift+I");
   pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -506,7 +507,7 @@
   /* --------- */
 
   /* Connect road */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Connect road"), " (Shift + R)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect road"), "Shift+R");
   pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -519,7 +520,7 @@
   /* --------- */
 
   /* Connect railroad */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Connect railroad"), " (Shift + L)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect railroad"), "Shift+L");
   pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -532,7 +533,7 @@
   /* --------- */
 
   /* Auto-Explore */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Auto-Explore"), " (X)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Explore"), "X");
   pBuf = create_themeicon(pTheme->OAutoExp_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -545,9 +546,9 @@
   /* --------- */
 
   /* Auto-Attack / Auto-Settler */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Auto-Attack"), " (A)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Attack"), "A");
   len = strlen(cBuf);
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Auto-Settler"), " (A)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Settler"), "A");
   len = MAX(len, strlen(cBuf));
   
   pBuf = create_themeicon(pTheme->OAutoSett_Icon, Main.gui,
@@ -566,7 +567,7 @@
   /* --------- */    
   
   /* Wake Up Others */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Wake Up Others"), " (Shift + W)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Wake Up Others"), "Shift+W");
   pBuf = create_themeicon(pTheme->OWakeUp_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -579,7 +580,7 @@
   /* --------- */
 
   /* Unload */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Unload"), " (U)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unload"), "U");
   pBuf = create_themeicon(pTheme->OUnload_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -591,7 +592,7 @@
   /* --------- */
 
   /* Find Homecity */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Find Homecity"), " (H)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Find Homecity"), "H");
   pBuf = create_themeicon(pTheme->OHomeCity_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -603,7 +604,7 @@
   /* --------- */
 
   /* Pillage */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Pillage"), " (Shift + P)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Pillage"), "Shift+P");
   pBuf = create_themeicon(pTheme->OPillage_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -616,7 +617,7 @@
   /* --------- */
 
   /* Sentry */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Sentry"), " (S)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Sentry"), "S");
   pBuf = create_themeicon(pTheme->OSentry_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -628,7 +629,7 @@
   /* --------- */
 
   /* Clean Nuclear Fallout */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Clean Nuclear Fallout"), " (N)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Clean Nuclear Fallout"), "N");
   pBuf = create_themeicon(pTheme->OFallout_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -640,7 +641,7 @@
   /* --------- */
 
   /* Paradrop */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Paradrop"), " (P)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Paradrop"), "P");
   pBuf = create_themeicon(pTheme->OParaDrop_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -652,7 +653,7 @@
   /* --------- */
 
   /* Clean Pollution */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Clean Pollution"), " (P)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Clean Pollution"), "P");
   pBuf = create_themeicon(pTheme->OPollution_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -664,7 +665,7 @@
   /* --------- */
 
   /* Build Airbase */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Build Airbase"), " (E)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build Airbase"), "E");
   pBuf = create_themeicon(pTheme->OAirBase_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -676,7 +677,7 @@
   /* --------- */
 
   /* Fortify */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Fortify"), " (F)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Fortify"), "F");
   pBuf = create_themeicon(pTheme->OFortify_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -688,7 +689,7 @@
   /* --------- */
 
   /* Build Fortress */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Build Fortress"), " (F)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build Fortress"), "F");
   pBuf = create_themeicon(pTheme->OFortress_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -700,7 +701,7 @@
   /* --------- */
 
   /* Transform Tile */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Transform Tile"), " (O)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Transform Tile"), "O");
   pBuf = create_themeicon(pTheme->OTransform_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -713,7 +714,7 @@
   /* --------- */
 
   /* Build Mine */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Build Mine"), " (M)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build Mine"), "M");
   pBuf = create_themeicon(pTheme->OMine_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -727,7 +728,7 @@
   /* --------- */    
 
   /* Build Irrigation */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Build Irrigation"), " (I)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build Irrigation"), "I");
   pBuf = create_themeicon(pTheme->OIrrigation_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -741,7 +742,7 @@
   /* --------- */    
 
   /* Form Traderoute */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Form Traderoute"), " (R)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Form Traderoute"), "R");
   pBuf = create_themeicon(pTheme->OTrade_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -755,12 +756,12 @@
   /* --------- */    
 
   /* Build (Rail-)Road */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s %d %s",
-			_("Build Railroad"), " (R)", 999, 
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s) %d %s",
+			_("Build Railroad"), "R", 999, 
 			PL_("turn", "turns", 999));
   len = strlen(cBuf);
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s %d %s",
-			_("Build Road"), " (R)", 999, 
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s) %d %s",
+			_("Build Road"), "R", 999, 
 			PL_("turn", "turns", 999));
   len = MAX(len, strlen(cBuf));
   
@@ -780,7 +781,7 @@
   /* --------- */  
   
   /* Help Build Wonder */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Help Build Wonder"), " (B)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Help Build Wonder"), "B");
   pBuf = create_themeicon(pTheme->OWonder_Icon, Main.gui,
 			  (WF_HIDDEN | WF_RESTORE_BACKGROUND |
 			   WF_WIDGET_HAS_INFO_LABEL));
@@ -792,9 +793,9 @@
   /* --------- */  
 
   /* Add to City / Build New City */
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Add to City"), " (B)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Add to City"), "B");
   len = strlen(cBuf);
-  my_snprintf(cBuf, sizeof(cBuf),"%s%s", _("Build New City"), " (B)");
+  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build New City"), "B");
   len = MAX(len, strlen(cBuf));
       
   pBuf = create_themeicon(pTheme->OBuildCity_Icon, Main.gui,
Index: client/gui-sdl/mapctrl.c
===================================================================
--- client/gui-sdl/mapctrl.c	(Revision 12792)
+++ client/gui-sdl/mapctrl.c	(Arbeitskopie)
@@ -1071,13 +1071,7 @@
 static int minimap_window_callback(struct widget *pWidget)
 {
   switch(Main.event.button.button) {
-    case SDL_BUTTON_RIGHT:    
-    /* FIXME: scaling needs to be fixed */
-#ifdef SCALE_MINIMAP
-      popup_minimap_scale_dialog();
-#endif    
-    break;
-    default:
+    case SDL_BUTTON_RIGHT:
       if ((SDL_Client_Flags & CF_MINI_MAP_SHOW) &&  
          (Main.event.motion.x >= OVERVIEW_START_X) &&
          (Main.event.motion.x <
@@ -1098,7 +1092,15 @@
                               
       }
 
-    break;
+      break;
+    case SDL_BUTTON_MIDDLE:
+    /* FIXME: scaling needs to be fixed */
+#ifdef SCALE_MINIMAP
+      popup_minimap_scale_dialog();
+#endif    
+      break;
+    default:
+      break;
   }
   return -1;
 }
@@ -1354,6 +1356,7 @@
 void popup_unitinfo_window() {
   struct widget *pWidget, *pWindow;
   SDL_Surface *pIcon_theme = NULL;
+  char buf[256];
   
   if (pUnitInfo_Dlg) {
     return;
@@ -1395,7 +1398,8 @@
   pWidget = create_icon2(get_tax_surface(O_GOLD), pUnits_Info_Window->dst, WF_FREE_GFX
                       | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME);
 
-  pWidget->string16 = create_str16_from_char(_("Economy (F5)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Economy"), "F5");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = economy_callback;
   pWidget->key = SDLK_F5;
 
@@ -1406,7 +1410,8 @@
   /* research button */
   pWidget = create_icon2(adj_surf(GET_SURF(client_research_sprite())), pUnits_Info_Window->dst, WF_FREE_GFX
 		       | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME);
-  pWidget->string16 = create_str16_from_char(_("Research (F6)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Research"), "F6");                       
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = research_callback;
   pWidget->key = SDLK_F6;
 
@@ -1417,7 +1422,8 @@
   /* revolution button */
   pWidget = create_icon2(adj_surf(GET_SURF(client_government_sprite())), pUnits_Info_Window->dst, (WF_FREE_GFX
 			| WF_WIDGET_HAS_INFO_LABEL| WF_RESTORE_BACKGROUND | WF_FREE_THEME));
-  pWidget->string16 = create_str16_from_char(_("Revolution (Shift + R)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Revolution"), "Shift+R");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = revolution_callback;
   pWidget->key = SDLK_r;
   pWidget->mod = KMOD_SHIFT;
@@ -1524,6 +1530,7 @@
 void popup_minimap_window() {
   struct widget *pWidget, *pWindow;
   SDL_Surface *pIcon_theme = NULL;
+  char buf[256];
   int w, h;
 
   if (pMiniMap_Dlg) {
@@ -1558,7 +1565,8 @@
   /* new turn button */
   pWidget = create_themeicon(pTheme->NEW_TURN_Icon, pMiniMap_Window->dst,
 			  WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(_("End Turn (Enter)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Turn Done"), _("Shift+Return"));
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = end_turn_callback;
   pWidget->key = SDLK_RETURN;
   pWidget->mod = KMOD_LCTRL;
@@ -1570,7 +1578,8 @@
   /* players button */
   pWidget = create_themeicon(pTheme->PLAYERS_Icon, pMiniMap_Window->dst,
 			     WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(_("Players (F3)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Players"), "F3");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = players_action_callback;
   pWidget->key = SDLK_F3;
 
@@ -1579,8 +1588,9 @@
   /* find city button */
   pWidget = create_themeicon(pTheme->FindCity_Icon, pMiniMap_Window->dst,
    			     WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(
-  		_("Cities Report (F1)\nor\nFind City (Shift + F)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)\n%s\n%s (%s)", _("Cities Report"),
+                                "F1", _("or"), _("Find City"), "Shift+F");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->string16->style |= SF_CENTER;
   pWidget->action = cities_action_callback;
   pWidget->key = SDLK_f;
@@ -1593,7 +1603,8 @@
   /* units button */
   pWidget = create_themeicon(pTheme->UNITS2_Icon, pMiniMap_Window->dst,
 		             WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(_("Units (F2)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Units"), "F2");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = units_action_callback;
   pWidget->key = SDLK_F2;
 
@@ -1602,7 +1613,8 @@
   /* show/hide log window button */
   pWidget = create_themeicon(pTheme->LOG_Icon, pMiniMap_Window->dst,
  			     WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(_("Hide Messages (F10)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Hide Messages"), "F10");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = toggle_msg_window_callback;
   pWidget->key = SDLK_F10;
 
@@ -1611,8 +1623,8 @@
   /* toggle minimap mode button */
   pWidget = create_themeicon(pTheme->BORDERS_Icon, pMiniMap_Window->dst,
  			     WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pWidget->string16 = create_str16_from_char(
-                         _("Toggle Minimap Mode (Shift + \\)"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Toggle Minimap Mode"), "Shift+\\");
+  pWidget->string16 = create_str16_from_char(buf, adj_font(12));
   pWidget->action = toggle_minimap_mode_callback;
   pWidget->key = SDLK_BACKSLASH;
   pWidget->mod = KMOD_SHIFT;
@@ -1623,10 +1635,11 @@
   /* options button */
   pOptions_Button = create_themeicon(pTheme->Options_Icon, pMiniMap_Window->dst,
  			             WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
-  pOptions_Button->string16 = create_str16_from_char(_("Options"), adj_font(12));
+  my_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc");
+  pOptions_Button->string16 = create_str16_from_char(buf, adj_font(12));
   
   pOptions_Button->action = optiondlg_callback;  
-  pOptions_Button->key = SDLK_TAB;
+  pOptions_Button->key = SDLK_ESCAPE;
 
   add_to_gui_list(ID_CLIENT_OPTIONS, pOptions_Button);
   #endif
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to