Author: mir3x
Date: Mon Dec 28 10:00:37 2015
New Revision: 31231

URL: http://svn.gna.org/viewcvs/freeciv?rev=31231&view=rev
Log:
After closing player or city report, current sorted column 
will be remembered and after reopening report - previous sorting will be 
applied.

See patch #6726


Modified:
    branches/S2_6/client/gui-qt/cityrep.cpp
    branches/S2_6/client/gui-qt/fc_client.cpp
    branches/S2_6/client/gui-qt/fc_client.h
    branches/S2_6/client/gui-qt/plrdlg.cpp

Modified: branches/S2_6/client/gui-qt/cityrep.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/cityrep.cpp?rev=31231&r1=31230&r2=31231&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/cityrep.cpp     (original)
+++ branches/S2_6/client/gui-qt/cityrep.cpp     Mon Dec 28 10:00:37 2015
@@ -1179,6 +1179,8 @@
   delete c_i_d;
   delete list_model;
   delete filter_model;
+  gui()->qt_settings.city_repo_sort_col = header()->sortIndicatorSection();
+  gui()->qt_settings.city_report_sort = header()->sortIndicatorOrder();
 }
 
 /***************************************************************************
@@ -1188,7 +1190,10 @@
 {
   layout = new QVBoxLayout;
   city_wdg = new city_widget(this);
-
+  if (gui()->qt_settings.city_repo_sort_col != -1) {
+    city_wdg->sortByColumn(gui()->qt_settings.city_repo_sort_col,
+                           gui()->qt_settings.city_report_sort);
+  }
   layout->addWidget(city_wdg);
   setLayout(layout);
 }

Modified: branches/S2_6/client/gui-qt/fc_client.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/fc_client.cpp?rev=31231&r1=31230&r2=31231&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/fc_client.cpp   (original)
+++ branches/S2_6/client/gui-qt/fc_client.cpp   Mon Dec 28 10:00:37 2015
@@ -577,6 +577,9 @@
   } else {
     qt_settings.infotab_height = 29;
   }
+  qt_settings.player_repo_sort_col = -1;
+  qt_settings.city_repo_sort_col = -1;
+
 }
 
 /****************************************************************************

Modified: branches/S2_6/client/gui-qt/fc_client.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/fc_client.h?rev=31231&r1=31230&r2=31231&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/fc_client.h     (original)
+++ branches/S2_6/client/gui-qt/fc_client.h     Mon Dec 28 10:00:37 2015
@@ -127,6 +127,10 @@
 {
   int infotab_width; /* in percent */
   int infotab_height; /* in percent */
+  int player_repo_sort_col;
+  Qt::SortOrder player_report_sort;
+  int city_repo_sort_col;
+  Qt::SortOrder city_report_sort;
 };
 
 class fc_client : public QMainWindow

Modified: branches/S2_6/client/gui-qt/plrdlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/plrdlg.cpp?rev=31231&r1=31230&r2=31231&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/plrdlg.cpp      (original)
+++ branches/S2_6/client/gui-qt/plrdlg.cpp      Mon Dec 28 10:00:37 2015
@@ -540,6 +540,8 @@
   delete pid;
   delete list_model;
   delete filter_model;
+  gui()->qt_settings.player_repo_sort_col = header()->sortIndicatorSection();
+  gui()->qt_settings.player_report_sort = header()->sortIndicatorOrder();
 }
 
 /**************************************************************************
@@ -591,6 +593,10 @@
   connect(cancel_but, SIGNAL(pressed()), SLOT(req_caancel_threaty()));
   connect(withdraw_but, SIGNAL(pressed()), SLOT(req_wiithdrw_vision()));
   setLayout(layout);
+  if (gui()->qt_settings.player_repo_sort_col != -1) {
+    plr_wdg->sortByColumn(gui()->qt_settings.player_repo_sort_col,
+                          gui()->qt_settings.player_report_sort);
+  }
 }
 
 /**************************************************************************


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

Reply via email to