Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rustdesk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李朝发
rustdesk
Commits
30156c69
Commit
30156c69
authored
Sep 08, 2022
by
csf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file_transfer confirm close
parent
63cb816b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
12 deletions
+27
-12
connection_tab_page.dart
flutter/lib/desktop/pages/connection_tab_page.dart
+12
-10
file_manager_tab_page.dart
flutter/lib/desktop/pages/file_manager_tab_page.dart
+14
-0
tabbar_widget.dart
flutter/lib/desktop/widgets/tabbar_widget.dart
+1
-2
No files found.
flutter/lib/desktop/pages/connection_tab_page.dart
View file @
30156c69
...
...
@@ -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
);
}
}
}
flutter/lib/desktop/pages/file_manager_tab_page.dart
View file @
30156c69
...
...
@@ -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
);
}
}
}
flutter/lib/desktop/widgets/tabbar_widget.dart
View file @
30156c69
...
...
@@ -24,7 +24,7 @@ class TabInfo {
final
String
label
;
final
IconData
?
selectedIcon
;
final
IconData
?
unselectedIcon
;
final
bool
closable
;
//
final
bool
closable
;
final
VoidCallback
?
onTabCloseButton
;
final
Widget
page
;
...
...
@@ -147,7 +147,6 @@ class DesktopTabController {
void
closeBy
(
String
?
key
)
{
if
(!
isDesktop
)
return
;
debugPrint
(
"closeBy:
$key
"
);
assert
(
onRemove
!=
null
);
if
(
key
==
null
)
{
if
(
state
.
value
.
selected
<
state
.
value
.
tabs
.
length
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment