Author: mir3x
Date: Fri Nov 11 10:26:41 2016
New Revision: 34480

URL: http://svn.gna.org/viewcvs/freeciv?rev=34480&view=rev
Log:
Qt client - added shortcut to quick buy current city production

See patch #7969


Modified:
    branches/S2_6/client/gui-qt/mapctrl.cpp
    branches/S2_6/client/gui-qt/shortcuts.cpp
    branches/S2_6/client/gui-qt/shortcuts.h

Modified: branches/S2_6/client/gui-qt/mapctrl.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapctrl.cpp?rev=34480&r1=34479&r2=34480&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapctrl.cpp     (original)
+++ branches/S2_6/client/gui-qt/mapctrl.cpp     Fri Nov 11 10:26:41 2016
@@ -43,6 +43,7 @@
 #include "qtg_cxxside.h"
 
 extern void side_disable_endturn(bool do_restore);
+extern "C" int city_buy_production(struct city *pcity);
 
 /**************************************************************************
   Popup a dialog to ask for the name of a new city.  The given string
@@ -318,8 +319,12 @@
       gui()->infotab->chtwdg->make_link(ptile);
       return;
     }
-
-
+    sc = fc_shortcuts::sc()->get_shortcut(SC_BUY_MAP);
+    if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
+        && pcity != nullptr) {
+      city_buy_production(pcity);
+      return;
+    }
     sc = fc_shortcuts::sc()->get_shortcut(SC_QUICK_BUY);
     if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
         && pcity != nullptr) {

Modified: branches/S2_6/client/gui-qt/shortcuts.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/shortcuts.cpp?rev=34480&r1=34479&r2=34480&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/shortcuts.cpp   (original)
+++ branches/S2_6/client/gui-qt/shortcuts.cpp   Fri Nov 11 10:26:41 2016
@@ -50,7 +50,7 @@
   RESPONSE_SAVE
 };
 
-static int num_shortcuts = 42;
+static int num_shortcuts = 43;
 fc_shortcut default_shortcuts[] = {
   {SC_SCROLL_MAP, 0, Qt::RightButton, Qt::NoModifier, "Scroll map" },
   {SC_CENTER_VIEW, Qt::Key_C, Qt::AllButtons, Qt::NoModifier,
@@ -101,7 +101,7 @@
     _("Go to/Airlift to City...") },
   {SC_AUTOEXPLORE, Qt::Key_X, Qt::AllButtons, Qt::NoModifier,
     _("Auto Explore") },
-  {SC_PATROL, Qt::Key_P, Qt::AllButtons, Qt::ControlModifier,
+  {SC_PATROL, Qt::Key_E, Qt::AllButtons, Qt::ShiftModifier,
     _("Patrol") },
   {SC_UNSENTRY_TILE, Qt::Key_D, Qt::AllButtons,
     Qt::ShiftModifier | Qt::ControlModifier, _("Unsentry All On Tile") },
@@ -134,6 +134,8 @@
     _("Load") },
   {SC_UNLOAD, Qt::Key_U, Qt::AllButtons, Qt::NoModifier,
     _("Unload") },
+  {SC_BUY_MAP, 0, Qt::BackButton, Qt::NoModifier,
+    _("Quick buy current production from map") },
 };
 
 

Modified: branches/S2_6/client/gui-qt/shortcuts.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/shortcuts.h?rev=34480&r1=34479&r2=34480&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/shortcuts.h     (original)
+++ branches/S2_6/client/gui-qt/shortcuts.h     Fri Nov 11 10:26:41 2016
@@ -72,7 +72,8 @@
   SC_TRANSFORM = 39,
   SC_NUKE = 40,
   SC_LOAD = 41,
-  SC_UNLOAD = 42
+  SC_UNLOAD = 42,
+  SC_BUY_MAP
 };
 
 


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

Reply via email to