Commit 68aac879 authored by twanvl's avatar twanvl

fixed sorting of locale combo box

made update_checker compile in vc
parent 93c853d3
...@@ -127,14 +127,19 @@ END_EVENT_TABLE () ...@@ -127,14 +127,19 @@ END_EVENT_TABLE ()
// ----------------------------------------------------------------------------- : Preferences page : global // ----------------------------------------------------------------------------- : Preferences page : global
bool compare_package_name(const PackagedP& a, const PackagedP& b) {
return a->name() < b->name();
}
GlobalPreferencesPage::GlobalPreferencesPage(Window* parent) GlobalPreferencesPage::GlobalPreferencesPage(Window* parent)
: PreferencesPage(parent) : PreferencesPage(parent)
{ {
// init controls // init controls
language = new wxComboBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY | wxCB_SORT); language = new wxComboBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
// set values // set values
vector<PackagedP> locales; vector<PackagedP> locales;
::packages.findMatching(_("*.mse-locale"), locales); ::packages.findMatching(_("*.mse-locale"), locales);
sort(locales.begin(), locales.end(), compare_package_name);
int n = 0; int n = 0;
FOR_EACH(package, locales) { FOR_EACH(package, locales) {
language->Append(package->name() + _(": ") + package->full_name, package.get()); language->Append(package->name() + _(": ") + package->full_name, package.get());
......
...@@ -30,6 +30,8 @@ DECLARE_POINTER_TYPE(VersionData); ...@@ -30,6 +30,8 @@ DECLARE_POINTER_TYPE(VersionData);
DECLARE_TYPEOF_COLLECTION(PackageVersionDataP); DECLARE_TYPEOF_COLLECTION(PackageVersionDataP);
DECLARE_TYPEOF_COLLECTION(PackageDependencyP); DECLARE_TYPEOF_COLLECTION(PackageDependencyP);
DECLARE_TYPEOF(list<PackageVersionDataP>);
DECLARE_TYPEOF(set<String>);
// ----------------------------------------------------------------------------- : Update data // ----------------------------------------------------------------------------- : Update data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment