Index: ChangeLog =================================================================== RCS file: /cvs/cygwin-apps/setup/ChangeLog,v retrieving revision 2.780 diff -u -p -r2.780 ChangeLog --- ChangeLog 4 Sep 2012 13:55:16 -0000 2.780 +++ ChangeLog 13 Sep 2012 04:32:13 -0000 @@ -1,3 +1,13 @@ +2012-09-12 Warren Young + + Sorting "select packages" UI lists case-insensitively now, + instead of taking setup.ini order, which is ASCIIbetical. + This doesn't fix the category (tree) view, only the flat list + views. + * PickCategoryLine.{cc,h}: Added sort() method + * PickView.cc: Calling new PickCategoryLine::sort() each time + something changes in the package list, just before UI repaint. + 2012-09-04 Yaakov Selkowitz Fix build with mingw-w64 headers. Index: PickCategoryLine.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/PickCategoryLine.cc,v retrieving revision 2.12 diff -u -p -r2.12 PickCategoryLine.cc --- PickCategoryLine.cc 23 Jul 2010 10:21:54 -0000 2.12 +++ PickCategoryLine.cc 13 Sep 2012 04:32:13 -0000 @@ -17,6 +17,8 @@ #include "package_db.h" #include "PickView.h" +#include + void PickCategoryLine::empty (void) { @@ -147,3 +149,14 @@ PickCategoryLine::set_action (packagemet theView.GetParent ()->ClearBusy (); return accum_diff; } + +static bool is_lt_icase(const PickLine* a, const PickLine* b) +{ + return casecompare(a->key, b->key) < 0; +} + +void +PickCategoryLine::sort () +{ + std::sort (bucket.begin (), bucket.end (), is_lt_icase); +} Index: PickCategoryLine.h =================================================================== RCS file: /cvs/cygwin-apps/setup/PickCategoryLine.h,v retrieving revision 2.8 diff -u -p -r2.8 PickCategoryLine.h --- PickCategoryLine.h 21 May 2005 23:04:02 -0000 2.8 +++ PickCategoryLine.h 13 Sep 2012 04:32:13 -0000 @@ -73,6 +73,7 @@ public: } void empty (); virtual int set_action (packagemeta::_actions); + void sort (); private: packagemeta::_actions current_default; Index: PickView.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/PickView.cc,v retrieving revision 2.42 diff -u -p -r2.42 PickView.cc --- PickView.cc 19 Feb 2012 13:57:02 -0000 2.42 +++ PickView.cc 13 Sep 2012 04:32:13 -0000 @@ -207,6 +207,8 @@ PickView::setViewMode (views mode) } } + contents.sort(); + RECT r = GetClientRect (); SCROLLINFO si; memset (&si, 0, sizeof (si));