add: file transfer status list like sciter
This commit is contained in:
parent
d49068706e
commit
6b8fc6efe9
@ -73,8 +73,9 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
backgroundColor: MyTheme.grayBg,
|
backgroundColor: MyTheme.grayBg,
|
||||||
body: Row(
|
body: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(flex: 1, child: body(isLocal: true)),
|
Flexible(flex: 3, child: body(isLocal: true)),
|
||||||
Flexible(flex: 1, child: body(isLocal: false))
|
Flexible(flex: 3, child: body(isLocal: false)),
|
||||||
|
Flexible(flex: 2, child: statusList())
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
bottomSheet: bottomSheet(),
|
bottomSheet: bottomSheet(),
|
||||||
@ -198,7 +199,7 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
itemCount: entries.length + 1,
|
itemCount: entries.length + 1,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index >= entries.length) {
|
if (index >= entries.length) {
|
||||||
return listTail();
|
return listTail(isLocal: isLocal);
|
||||||
}
|
}
|
||||||
var selected = false;
|
var selected = false;
|
||||||
if (model.selectMode) {
|
if (model.selectMode) {
|
||||||
@ -297,6 +298,16 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// transfer status list
|
||||||
|
/// watch transfer status
|
||||||
|
Widget statusList() {
|
||||||
|
return PreferredSize(child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.white70)
|
||||||
|
),
|
||||||
|
), preferredSize: Size(200, double.infinity));
|
||||||
|
}
|
||||||
|
|
||||||
goBack({bool? isLocal}) {
|
goBack({bool? isLocal}) {
|
||||||
model.goToParentDirectory(isLocal: isLocal);
|
model.goToParentDirectory(isLocal: isLocal);
|
||||||
}
|
}
|
||||||
@ -362,7 +373,8 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|
||||||
Widget listTail() {
|
Widget listTail({bool isLocal = false}) {
|
||||||
|
final dir = isLocal ? model.currentLocalDir : model.currentRemoteDir;
|
||||||
return Container(
|
return Container(
|
||||||
height: 100,
|
height: 100,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -370,14 +382,14 @@ class _FileManagerPageState extends State<FileManagerPage>
|
|||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.fromLTRB(30, 5, 30, 0),
|
padding: EdgeInsets.fromLTRB(30, 5, 30, 0),
|
||||||
child: Text(
|
child: Text(
|
||||||
model.currentDir.path,
|
dir.path,
|
||||||
style: TextStyle(color: MyTheme.darkGray),
|
style: TextStyle(color: MyTheme.darkGray),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(2),
|
padding: EdgeInsets.all(2),
|
||||||
child: Text(
|
child: Text(
|
||||||
"${translate("Total")}: ${model.currentDir.entries.length} ${translate("items")}",
|
"${translate("Total")}: ${dir.entries.length} ${translate("items")}",
|
||||||
style: TextStyle(color: MyTheme.darkGray),
|
style: TextStyle(color: MyTheme.darkGray),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -276,23 +276,40 @@ class FileModel extends ChangeNotifier {
|
|||||||
openDirectory(parent, isLocal: isLocal);
|
openDirectory(parent, isLocal: isLocal);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendFiles(SelectedItems items) {
|
/// isRemote only for desktop now, [isRemote == true] means [remote -> local]
|
||||||
if (items.isLocal == null) {
|
sendFiles(SelectedItems items, {bool isRemote = false}) {
|
||||||
debugPrint("Failed to sendFiles ,wrong path state");
|
if (isDesktop) {
|
||||||
return;
|
// desktop sendFiles
|
||||||
|
_jobProgress.state = JobState.inProgress;
|
||||||
|
final toPath =
|
||||||
|
isRemote ? currentRemoteDir.path : currentLocalDir.path;
|
||||||
|
final isWindows =
|
||||||
|
isRemote ? _localOption.isWindows : _remoteOption.isWindows;
|
||||||
|
final showHidden =
|
||||||
|
isRemote ? _localOption.showHidden : _remoteOption.showHidden ;
|
||||||
|
items.items.forEach((from) async {
|
||||||
|
_jobId++;
|
||||||
|
await _ffi.target?.bind.sessionSendFiles(id: '${_ffi.target?.id}', actId: _jobId, path: from.path, to: PathUtil.join(toPath, from.name, isWindows)
|
||||||
|
,fileNum: 0, includeHidden: showHidden, isRemote: isRemote);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (items.isLocal == null) {
|
||||||
|
debugPrint("Failed to sendFiles ,wrong path state");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_jobProgress.state = JobState.inProgress;
|
||||||
|
final toPath =
|
||||||
|
items.isLocal! ? currentRemoteDir.path : currentLocalDir.path;
|
||||||
|
final isWindows =
|
||||||
|
items.isLocal! ? _localOption.isWindows : _remoteOption.isWindows;
|
||||||
|
final showHidden =
|
||||||
|
items.isLocal! ? _localOption.showHidden : _remoteOption.showHidden;
|
||||||
|
items.items.forEach((from) async {
|
||||||
|
_jobId++;
|
||||||
|
await _ffi.target?.bind.sessionSendFiles(id: '${_ffi.target?.getId()}', actId: _jobId, path: from.path, to: PathUtil.join(toPath, from.name, isWindows)
|
||||||
|
,fileNum: 0, includeHidden: showHidden, isRemote: !(items.isLocal!));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_jobProgress.state = JobState.inProgress;
|
|
||||||
final toPath =
|
|
||||||
items.isLocal! ? currentRemoteDir.path : currentLocalDir.path;
|
|
||||||
final isWindows =
|
|
||||||
items.isLocal! ? _localOption.isWindows : _remoteOption.isWindows;
|
|
||||||
final showHidden =
|
|
||||||
items.isLocal! ? _localOption.showHidden : _remoteOption.showHidden;
|
|
||||||
items.items.forEach((from) async {
|
|
||||||
_jobId++;
|
|
||||||
await _ffi.target?.bind.sessionSendFiles(id: '${_ffi.target?.getId()}', actId: _jobId, path: from.path, to: PathUtil.join(toPath, from.name, isWindows)
|
|
||||||
,fileNum: 0, includeHidden: showHidden, isRemote: !(items.isLocal!));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool removeCheckboxRemember = false;
|
bool removeCheckboxRemember = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user