Author: mir3x Date: Mon Dec 28 10:00:46 2015 New Revision: 31232 URL: http://svn.gna.org/viewcvs/freeciv?rev=31232&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: trunk/client/gui-qt/cityrep.cpp trunk/client/gui-qt/fc_client.cpp trunk/client/gui-qt/fc_client.h trunk/client/gui-qt/plrdlg.cpp Modified: trunk/client/gui-qt/cityrep.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/cityrep.cpp?rev=31232&r1=31231&r2=31232&view=diff ============================================================================== --- trunk/client/gui-qt/cityrep.cpp (original) +++ trunk/client/gui-qt/cityrep.cpp Mon Dec 28 10:00:46 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: trunk/client/gui-qt/fc_client.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.cpp?rev=31232&r1=31231&r2=31232&view=diff ============================================================================== --- trunk/client/gui-qt/fc_client.cpp (original) +++ trunk/client/gui-qt/fc_client.cpp Mon Dec 28 10:00:46 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: trunk/client/gui-qt/fc_client.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.h?rev=31232&r1=31231&r2=31232&view=diff ============================================================================== --- trunk/client/gui-qt/fc_client.h (original) +++ trunk/client/gui-qt/fc_client.h Mon Dec 28 10:00:46 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: trunk/client/gui-qt/plrdlg.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.cpp?rev=31232&r1=31231&r2=31232&view=diff ============================================================================== --- trunk/client/gui-qt/plrdlg.cpp (original) +++ trunk/client/gui-qt/plrdlg.cpp Mon Dec 28 10:00:46 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