mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-11 03:11:27 +03:00
feat: replace forceAppUpdate with customed reloadWindow
This commit is contained in:
@@ -5,6 +5,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart' hide MenuItem;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/connection_page.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
|
||||
@@ -452,6 +453,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
'scaleFactor': screen.scaleFactor,
|
||||
});
|
||||
}
|
||||
} else if (call.method == kWindowActionRebuild) {
|
||||
reloadCurrentWindow();
|
||||
}
|
||||
});
|
||||
Future.delayed(Duration.zero, () {
|
||||
|
||||
@@ -406,7 +406,7 @@ class _GeneralState extends State<_General> {
|
||||
initialKey: currentKey,
|
||||
onChanged: (key) async {
|
||||
await bind.mainSetLocalOption(key: "lang", value: key);
|
||||
Get.forceAppUpdate();
|
||||
reloadAllWindows();
|
||||
bind.mainChangeLanguage(lang: key);
|
||||
},
|
||||
).marginOnly(left: _kContentHMargin);
|
||||
|
||||
@@ -47,7 +47,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
|
||||
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
|
||||
print(
|
||||
"call ${call.method} with args ${call.arguments} from window ${fromWindowId} to ${windowId()}");
|
||||
"[FileTransfer] call ${call.method} with args ${call.arguments} from window ${fromWindowId} to ${windowId()}");
|
||||
// for simplify, just replace connectionId
|
||||
if (call.method == "new_file_transfer") {
|
||||
final args = jsonDecode(call.arguments);
|
||||
@@ -62,6 +62,8 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
page: FileManagerPage(key: ValueKey(id), id: id)));
|
||||
} else if (call.method == "onDestroy") {
|
||||
tabController.clear();
|
||||
} else if (call.method == kWindowActionRebuild) {
|
||||
reloadCurrentWindow();
|
||||
}
|
||||
});
|
||||
Future.delayed(Duration.zero, () {
|
||||
|
||||
@@ -70,6 +70,8 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
|
||||
page: PortForwardPage(id: id, isRDP: isRDP)));
|
||||
} else if (call.method == "onDestroy") {
|
||||
tabController.clear();
|
||||
} else if (call.method == kWindowActionRebuild) {
|
||||
reloadCurrentWindow();
|
||||
}
|
||||
});
|
||||
Future.delayed(Duration.zero, () {
|
||||
|
||||
@@ -89,6 +89,8 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
))));
|
||||
} else if (call.method == "onDestroy") {
|
||||
tabController.clear();
|
||||
} else if (call.method == kWindowActionRebuild) {
|
||||
reloadCurrentWindow();
|
||||
}
|
||||
_update_remote_count();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user