mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-15 07:21:29 +03:00
add file_transfer confirm close
This commit is contained in:
@@ -39,11 +39,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
label: peerId,
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () {
|
||||
debugPrint("onTabCloseButton");
|
||||
tabController.jumpBy(peerId);
|
||||
clientClose(ffi(peerId).dialogManager);
|
||||
},
|
||||
onTabCloseButton: () => handleTabCloseButton(peerId),
|
||||
page: RemotePage(
|
||||
key: ValueKey(peerId),
|
||||
id: peerId,
|
||||
@@ -75,11 +71,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
label: id,
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () {
|
||||
debugPrint("onTabCloseButton");
|
||||
tabController.jumpBy(id);
|
||||
clientClose(ffi(id).dialogManager);
|
||||
},
|
||||
onTabCloseButton: () => handleTabCloseButton(id),
|
||||
page: RemotePage(
|
||||
key: ValueKey(id),
|
||||
id: id,
|
||||
@@ -165,4 +157,14 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
int windowId() {
|
||||
return widget.params["windowId"];
|
||||
}
|
||||
|
||||
void handleTabCloseButton(String peerId) {
|
||||
final session = ffi(peerId);
|
||||
if (session.ffiModel.pi.hostname.isNotEmpty) {
|
||||
tabController.jumpBy(peerId);
|
||||
clientClose(session.dialogManager);
|
||||
} else {
|
||||
tabController.closeBy(peerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
|
||||
import 'package:flutter_hbb/utils/multi_window_manager.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../mobile/widgets/dialog.dart';
|
||||
|
||||
/// File Transfer for multi tabs
|
||||
class FileManagerTabPage extends StatefulWidget {
|
||||
final Map<String, dynamic> params;
|
||||
@@ -31,6 +33,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
label: params['id'],
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () => handleTabCloseButton(params['id']),
|
||||
page: FileManagerPage(key: ValueKey(params['id']), id: params['id'])));
|
||||
}
|
||||
|
||||
@@ -53,6 +56,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
label: id,
|
||||
selectedIcon: selectedIcon,
|
||||
unselectedIcon: unselectedIcon,
|
||||
onTabCloseButton: () => handleTabCloseButton(id),
|
||||
page: FileManagerPage(key: ValueKey(id), id: id)));
|
||||
} else if (call.method == "onDestroy") {
|
||||
tabController.clear();
|
||||
@@ -89,4 +93,14 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
|
||||
int windowId() {
|
||||
return widget.params["windowId"];
|
||||
}
|
||||
|
||||
void handleTabCloseButton(String peerId) {
|
||||
final session = ffi('ft_$peerId');
|
||||
if (session.ffiModel.pi.hostname.isNotEmpty) {
|
||||
tabController.jumpBy(peerId);
|
||||
clientClose(session.dialogManager);
|
||||
} else {
|
||||
tabController.closeBy(peerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user