(svn r13299) -Fix (r13286): Stations sort type isn't updated correctly
authorskidd13
Tue, 27 May 2008 20:33:44 +0000
changeset 10749 b8ac8a8e27c4
parent 10748 b3ed48464a81
child 10751 ebd94f2d6385
(svn r13299) -Fix (r13286): Stations sort type isn't updated correctly
src/station_gui.cpp
--- a/src/station_gui.cpp	Tue May 27 20:25:28 2008 +0000
+++ b/src/station_gui.cpp	Tue May 27 20:33:44 2008 +0000
@@ -202,11 +202,7 @@
 		/* Reset name sorter sort cache */
 		this->last_station = NULL;
 
-		/* Display the current sort variant */
-		this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
-
-		/* Set the modified widgets dirty */
-		this->InvalidateWidget(SLW_SORTDROPBTN);
+		/* Set the modified widget dirty */
 		this->InvalidateWidget(SLW_LIST);
 	}
 
@@ -274,6 +270,8 @@
 		this->stations.NeedResort();
 		this->SortStationsList();
 
+		this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
+
 		this->FindWindowPlacementAndResize(desc);
 	}
 
@@ -501,6 +499,10 @@
 	{
 		if (this->stations.SortType() != index) {
 			this->stations.SetSortType(index);
+
+			/* Display the current sort variant */
+			this->widget[SLW_SORTDROPBTN].data = this->sorter_names[this->stations.SortType()];
+
 			this->SetDirty();
 		}
 	}