mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-03 00:30:15 +00:00
1 parent
f812adedff
commit
5887334c2e
8 files changed
+1066
-460
No files matched your search
+32
-1
@@ -55,7 +55,6 @@ class MyTheme {
|
||||
|
||||
bool isDarkTheme() {
|
||||
final isDark = "Y" == Get.find<SharedPreferences>().getString("darkTheme");
|
||||
debugPrint("current is dark theme: $isDark");
|
||||
return isDark;
|
||||
}
|
||||
|
||||
@@ -482,3 +481,35 @@ String translate(String name) {
|
||||
}
|
||||
return platformFFI.translate(name, localeName);
|
||||
}
|
||||
|
||||
bool option2bool(String key, String value) {
|
||||
bool res;
|
||||
if (key.startsWith("enable-")) {
|
||||
res = value != "N";
|
||||
} else if (key.startsWith("allow-") ||
|
||||
key == "stop-service" ||
|
||||
key == "direct-server" ||
|
||||
key == "stop-rendezvous-service") {
|
||||
res = value == "Y";
|
||||
} else {
|
||||
assert(false);
|
||||
res = value != "N";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
String bool2option(String key, bool option) {
|
||||
String res;
|
||||
if (key.startsWith('enable-')) {
|
||||
res = option ? '' : 'N';
|
||||
} else if (key.startsWith('allow-') ||
|
||||
key == "stop-service" ||
|
||||
key == "direct-server" ||
|
||||
key == "stop-rendezvous-service") {
|
||||
res = option ? 'Y' : '';
|
||||
} else {
|
||||
assert(false);
|
||||
res = option ? 'Y' : 'N';
|
||||
}
|
||||
return res;
|
||||
}
|
||||
Reference in new issue
Block a user