diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-04-28 17:25:35 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-04-28 21:27:35 +0200 |
commit | c80dd2e156e20f028cf4631fd7874a89c3568bab (patch) | |
tree | b15b61ad444aeaab61ea04e549ee24e98ab6415a /variant/default/main-window.hpp | |
parent | 526304a41970c1ad890cf81d92bb4b123e8608e7 (diff) |
settings: store untranslated chosen module names
Now that we translate module names, they have to be
stored as language-neutral in the config.
- add tie_setting overload with from/to conversions
- add logic to opentrack/main-window
- add migration
- remove actually useless tie_setting_traits
Diffstat (limited to 'variant/default/main-window.hpp')
-rw-r--r-- | variant/default/main-window.hpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/variant/default/main-window.hpp b/variant/default/main-window.hpp index c28aadc4..6e85a13c 100644 --- a/variant/default/main-window.hpp +++ b/variant/default/main-window.hpp @@ -32,6 +32,7 @@ #include <QEvent> #include <QCloseEvent> +#include <algorithm> #include <vector> #include <tuple> #include <memory> @@ -72,18 +73,14 @@ class main_window : public QMainWindow, private State menu_action_options { &tray_menu }, menu_action_mappings { &tray_menu }; - std::shared_ptr<dylib> current_tracker() - { - return modules.trackers().value(ui.iconcomboTrackerSource->currentIndex(), nullptr); - } - std::shared_ptr<dylib> current_protocol() - { - return modules.protocols().value(ui.iconcomboProtocol->currentIndex(), nullptr); - } - std::shared_ptr<dylib> current_filter() - { - return modules.filters().value(ui.iconcomboFilter->currentIndex(), nullptr); - } + using dylib_ptr = Modules::dylib_ptr; + using dylib_list = Modules::dylib_list; + + static std::tuple<dylib_ptr, int> module_by_name(const QString& name, Modules::dylib_list& list); + + dylib_ptr current_tracker(); + dylib_ptr current_protocol(); + dylib_ptr current_filter(); void update_button_state(bool running, bool inertialp); void display_pose(const double* mapped, const double* raw); |