diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-03 23:32:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-03 23:32:11 +0200 |
commit | 0ede90f736caffdf600583a7826fc5d0c76c91c9 (patch) | |
tree | c20c763a6a8a27ac968101410332f2546e299722 /proto-ft | |
parent | 4478909bbf018e814591077dfb98eb9b785eeadf (diff) |
proto/freetrack: fix broken interface selection
Diffstat (limited to 'proto-ft')
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.cpp | 13 | ||||
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.h | 2 | ||||
-rw-r--r-- | proto-ft/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | proto-ft/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | proto-ft/lang/stub.ts | 4 | ||||
-rw-r--r-- | proto-ft/lang/zh_CN.ts | 4 |
6 files changed, 27 insertions, 4 deletions
diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 69a3c23f..09e71911 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -159,10 +159,17 @@ module_status freetrack::set_protocols() QSettings settings_npclient("NaturalPoint", "NATURALPOINT\\NPClient Location"); QString location = *s.custom_location_pathname; - const auto selection = *s.used_interface; - bool use_freetrack = ~selection & settings::enable_freetrack, - use_npclient = ~selection & settings::enable_npclient; + bool use_freetrack, use_npclient; + switch (*s.used_interface) + { + case settings::enable_npclient: use_freetrack = false; break; + case settings::enable_freetrack: use_npclient = false; break; + case settings::enable_both: use_freetrack = true; use_npclient = true; break; + default: + return error(tr("proto/freetrack: wrong interface selection '%1'") + .arg(*s.used_interface)); + } if (!s.use_custom_location || s.custom_location_pathname->isEmpty() || !QDir{s.custom_location_pathname}.exists()) location = program_dir; diff --git a/proto-ft/ftnoir_protocol_ft.h b/proto-ft/ftnoir_protocol_ft.h index 4b7ab89e..a07747d9 100644 --- a/proto-ft/ftnoir_protocol_ft.h +++ b/proto-ft/ftnoir_protocol_ft.h @@ -27,7 +27,7 @@ using namespace options; struct settings : opts { - enum enable_status { enable_both, enable_freetrack, enable_npclient, }; + enum enable_status : int { enable_both, enable_freetrack, enable_npclient, }; value<int> used_interface{b, "used-interfaces", (int)enable_both}; value<bool> ephemeral_library_location{b, "ephemeral-library-location", false}; value<bool> use_custom_location{b, "use-custom-location", false}; diff --git a/proto-ft/lang/nl_NL.ts b/proto-ft/lang/nl_NL.ts index f8408198..c8603973 100644 --- a/proto-ft/lang/nl_NL.ts +++ b/proto-ft/lang/nl_NL.ts @@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source> <source>Can't copy library to selected custom location '%1'</source> <translation type="unfinished"></translation> </message> + <message> + <source>proto/freetrack: wrong interface selection '%1'</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>freetrackDll</name> diff --git a/proto-ft/lang/ru_RU.ts b/proto-ft/lang/ru_RU.ts index c934e0f7..a6433fd5 100644 --- a/proto-ft/lang/ru_RU.ts +++ b/proto-ft/lang/ru_RU.ts @@ -93,6 +93,10 @@ Starting tracking will again overwrite the DLL locations.</source> <source>Can't copy library to selected custom location '%1'</source> <translation type="unfinished"></translation> </message> + <message> + <source>proto/freetrack: wrong interface selection '%1'</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>freetrackDll</name> diff --git a/proto-ft/lang/stub.ts b/proto-ft/lang/stub.ts index e15244b9..ac88d895 100644 --- a/proto-ft/lang/stub.ts +++ b/proto-ft/lang/stub.ts @@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source> <source>Can't copy library to selected custom location '%1'</source> <translation type="unfinished"></translation> </message> + <message> + <source>proto/freetrack: wrong interface selection '%1'</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>freetrackDll</name> diff --git a/proto-ft/lang/zh_CN.ts b/proto-ft/lang/zh_CN.ts index 2425f48b..2fd6bcd7 100644 --- a/proto-ft/lang/zh_CN.ts +++ b/proto-ft/lang/zh_CN.ts @@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source> <source>Can't copy library to selected custom location '%1'</source> <translation type="unfinished"></translation> </message> + <message> + <source>proto/freetrack: wrong interface selection '%1'</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>freetrackDll</name> |