Author: mir3x
Date: Sat Dec 26 12:17:43 2015
New Revision: 31215

URL: http://svn.gna.org/viewcvs/freeciv?rev=31215&view=rev
Log:
Allowed possibility to enable governor by double click 
in city dialog.

See patch #6717


Modified:
    trunk/client/gui-qt/citydlg.cpp
    trunk/client/gui-qt/citydlg.h

Modified: trunk/client/gui-qt/citydlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/citydlg.cpp?rev=31215&r1=31214&r2=31215&view=diff
==============================================================================
--- trunk/client/gui-qt/citydlg.cpp     (original)
+++ trunk/client/gui-qt/citydlg.cpp     Sat Dec 26 12:17:43 2015
@@ -1024,6 +1024,8 @@
                                     const QItemSelection &)),
             SLOT(cma_selected(const QItemSelection &,
                               const QItemSelection &)));
+    connect(cma_table, SIGNAL(cellDoubleClicked(int, int)), this,
+            SLOT(cma_double_clicked(int, int)));
     gridl->addWidget(cma_table, 0, 0, 1, 2);
     gridl->addWidget(qpush1, 1, 0, 1, 2);
     qgbox->setLayout(gridl);
@@ -1283,6 +1285,21 @@
 }
 
 /****************************************************************************
+  Double click on some row ( column is unused )
+****************************************************************************/
+void city_dialog::cma_double_clicked(int row, int column)
+{
+  const struct cm_parameter *param;
+
+  param = cmafec_preset_get_parameter(row);
+
+  if (cma_is_city_under_agent(pcity, NULL)) {
+    cma_release_city(pcity);
+  }
+  cma_put_city_under_agent(pcity, param);
+}
+
+/****************************************************************************
   CMA has been selected from list
 ****************************************************************************/
 void city_dialog::cma_selected(const QItemSelection &sl,

Modified: trunk/client/gui-qt/citydlg.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/citydlg.h?rev=31215&r1=31214&r2=31215&view=diff
==============================================================================
--- trunk/client/gui-qt/citydlg.h       (original)
+++ trunk/client/gui-qt/citydlg.h       Sat Dec 26 12:17:43 2015
@@ -422,6 +422,7 @@
   void cma_enable();
   void cma_changed();
   void cma_selected(const QItemSelection &sl, const QItemSelection &ds);
+  void cma_double_clicked(int row, int column);
   void save_cma();
   void city_rename();
 };


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

Reply via email to