summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/ui.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-06 05:13:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-06 05:13:23 +0200
commit58ceabb21192742a46c9edf321459e54de23f0aa (patch)
treefc2ca5528f9dee68aa9013fb1b7424cd54bf45b1 /facetracknoir/ui.cpp
parent873667c7b59aeb02ffc813630736c87b11664c9b (diff)
parent0f7a4ba62369a42cf6b513ce0fa59d117551f0ed (diff)
Merge branch 'unstable' into trackhat-ui
* unstable: ui: sort combobox items according to their name, not filename mouse: remove GPL, has since been rewritten mouse: decruft freetrack: new game definitions
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r--facetracknoir/ui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index eb6cf7e1..43358f1b 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -21,6 +21,13 @@
# include <windows.h>
#endif
+template<typename t>
+static QList<t> sorted(QList<t> xs)
+{
+ std::sort(xs.begin(), xs.end(), [&](const t& a, const t& b) { return a->name.toLower() < b->name.toLower(); });
+ return xs;
+}
+
MainWindow::MainWindow() :
pose_update_timer(this),
kbd_quit(QKeySequence("Ctrl+Q"), this),
@@ -39,7 +46,7 @@ MainWindow::MainWindow() :
connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(show_options_dialog()));
connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showProtocolSettings()));
- for (auto x : modules.protocols())
+ for (auto x : sorted(modules.protocols()))
ui.iconcomboProtocol->addItem(x->icon, x->name);
refresh_config_list();