Merge pull request #6333 from 21pages/cm

close all connections if cm exit unexpected, and allow retry
This commit is contained in:
RustDesk
2023-11-09 16:06:57 +08:00
committed by GitHub
6 changed files with 56 additions and 17 deletions

View File

@@ -1319,7 +1319,7 @@ class _DisplayState extends State<_Display> {
otherRow('Zoom cursor', 'zoom-cursor'),
otherRow('Show quality monitor', 'show_quality_monitor'),
otherRow('Mute', 'disable_audio'),
otherRow('Allow file copy and paste', 'enable_file_transfer'),
otherRow('Enable file copy and paste', 'enable_file_transfer'),
otherRow('Disable clipboard', 'disable_clipboard'),
otherRow('Lock after session end', 'lock_after_session_end'),
otherRow('Privacy mode', 'privacy_mode'),

View File

@@ -91,7 +91,7 @@ Future<void> main(List<String> args) async {
debugPrint("--cm started");
desktopType = DesktopType.cm;
await windowManager.ensureInitialized();
runConnectionManagerScreen(args.contains('--hide'));
runConnectionManagerScreen();
} else if (args.contains('--install')) {
runInstallPage();
} else {
@@ -225,13 +225,14 @@ void runMultiWindow(
WindowController.fromWindowId(kWindowId!).show();
}
void runConnectionManagerScreen(bool hide) async {
void runConnectionManagerScreen() async {
await initEnv(kAppTypeConnectionManager);
_runApp(
'',
const DesktopServerPage(),
MyTheme.currentThemeMode(),
);
final hide = await bind.cmGetConfig(name: "hide_cm") == 'true';
gFFI.serverModel.hideCm = hide;
if (hide) {
await hideCmWindow(isStartup: true);

View File

@@ -79,10 +79,12 @@ class ServerModel with ChangeNotifier {
setVerificationMethod(String method) async {
await bind.mainSetOption(key: "verification-method", value: method);
/*
if (method != kUsePermanentPassword) {
await bind.mainSetOption(
key: 'allow-hide-cm', value: bool2option('allow-hide-cm', false));
}
*/
}
String get temporaryPasswordLength {
@@ -99,10 +101,12 @@ class ServerModel with ChangeNotifier {
setApproveMode(String mode) async {
await bind.mainSetOption(key: 'approve-mode', value: mode);
/*
if (mode != 'password') {
await bind.mainSetOption(
key: 'allow-hide-cm', value: bool2option('allow-hide-cm', false));
}
*/
}
TextEditingController get serverId => _serverId;