mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 11:53:41 +00:00
feat: queue extractions (#1227)
This commit is contained in:
1 parent
de0afb1481
commit
24db9bb58b
35 files changed
+1047
-159
No files matched your search
@@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:window_manager/window_manager.dart'; // Import the required packages
|
||||
import 'package:window_manager/window_manager.dart'; // Import the required packages
|
||||
|
||||
import '../../../../i18n/message.dart';
|
||||
import '../../../../theme/theme.dart';
|
||||
import '../../../../util/locale_manager.dart';
|
||||
import '../../../../util/util.dart'; // Import the required packages
|
||||
import '../../../../util/util.dart'; // Import the required packages
|
||||
import '../../../routes/app_pages.dart';
|
||||
import '../controllers/app_controller.dart';
|
||||
|
||||
@@ -38,7 +38,7 @@ class AppView extends GetView<AppController> {
|
||||
// Add listening to theme changes, set the title bar color according to the current system theme.
|
||||
builder: (context, child) {
|
||||
// if platform is desktop
|
||||
if (Util.isDesktop()){
|
||||
if (Util.isDesktop()) {
|
||||
// actual brightness of the UI
|
||||
Brightness brightness = Theme.of(context).brightness;
|
||||
// Set the title bar to use the actual brightness of the UI
|
||||
@@ -46,7 +46,6 @@ class AppView extends GetView<AppController> {
|
||||
}
|
||||
return child!;
|
||||
},
|
||||
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -626,10 +626,11 @@ class CreateView extends GetView<CreateController> {
|
||||
child: CompactCheckbox(
|
||||
label: 'autoExtract'.tr,
|
||||
value: _autoExtractController
|
||||
.value ?? false,
|
||||
.value ??
|
||||
false,
|
||||
onChanged: (bool? value) {
|
||||
_autoExtractController
|
||||
.value = value ?? false;
|
||||
_autoExtractController.value =
|
||||
value ?? false;
|
||||
},
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.grey,
|
||||
@@ -638,33 +639,49 @@ class CreateView extends GetView<CreateController> {
|
||||
),
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: _autoExtractController.value ?? false,
|
||||
visible: _autoExtractController
|
||||
.value ??
|
||||
false,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10),
|
||||
const EdgeInsets.only(
|
||||
top: 10),
|
||||
child: TextFormField(
|
||||
controller: _archivePasswordController,
|
||||
controller:
|
||||
_archivePasswordController,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'archivePassword'.tr,
|
||||
hintText: 'archivePasswordHint'.tr,
|
||||
decoration:
|
||||
InputDecoration(
|
||||
labelText:
|
||||
'archivePassword'
|
||||
.tr,
|
||||
hintText:
|
||||
'archivePasswordHint'
|
||||
.tr,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10),
|
||||
const EdgeInsets.only(
|
||||
top: 10),
|
||||
child: CompactCheckbox(
|
||||
label: 'deleteAfterExtract'.tr,
|
||||
value: _deleteAfterExtractController
|
||||
.value ?? false,
|
||||
label:
|
||||
'deleteAfterExtract'
|
||||
.tr,
|
||||
value:
|
||||
_deleteAfterExtractController
|
||||
.value ??
|
||||
false,
|
||||
onChanged: (bool? value) {
|
||||
_deleteAfterExtractController
|
||||
.value = value ?? false;
|
||||
.value =
|
||||
value ?? false;
|
||||
},
|
||||
textStyle: const TextStyle(
|
||||
textStyle:
|
||||
const TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
@@ -1031,7 +1048,8 @@ class CreateView extends GetView<CreateController> {
|
||||
padding: const EdgeInsets.only(right: 8),
|
||||
child: OutlinedButton(
|
||||
onPressed: () {
|
||||
_pathController.text = renderPathPlaceholders(category.path);
|
||||
_pathController.text =
|
||||
renderPathPlaceholders(category.path);
|
||||
},
|
||||
style: OutlinedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
||||
@@ -179,7 +179,8 @@ class SettingView extends GetView<SettingController> {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Switch(
|
||||
value: appController.downloaderConfig.value.archive.deleteAfterExtract,
|
||||
value:
|
||||
appController.downloaderConfig.value.archive.deleteAfterExtract,
|
||||
onChanged: (bool value) async {
|
||||
appController.downloaderConfig.update((val) {
|
||||
val!.archive.deleteAfterExtract = value;
|
||||
|
||||
@@ -195,6 +195,8 @@ class BuildTaskListView extends GetView {
|
||||
return 'extractDone'.tr;
|
||||
case ExtractStatus.error:
|
||||
return 'extractError'.tr;
|
||||
case ExtractStatus.waitingParts:
|
||||
return 'waitingParts'.tr;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -333,13 +335,19 @@ class BuildTaskListView extends GetView {
|
||||
// Extraction status row
|
||||
if (task.progress.extractStatus != ExtractStatus.none)
|
||||
Builder(builder: (context) {
|
||||
final isExtracting =
|
||||
task.progress.extractStatus == ExtractStatus.extracting;
|
||||
final isExtracting = task.progress.extractStatus ==
|
||||
ExtractStatus.extracting;
|
||||
final isExtractDone =
|
||||
task.progress.extractStatus == ExtractStatus.done;
|
||||
final isWaitingParts = task.progress.extractStatus ==
|
||||
ExtractStatus.waitingParts;
|
||||
final statusColor = isExtracting
|
||||
? Get.theme.colorScheme.primary
|
||||
: (isExtractDone ? Colors.green : Colors.red);
|
||||
: (isExtractDone
|
||||
? Colors.green
|
||||
: isWaitingParts
|
||||
? Colors.orange
|
||||
: Colors.red);
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
@@ -367,7 +375,7 @@ class BuildTaskListView extends GetView {
|
||||
).padding(left: 18),
|
||||
),
|
||||
],
|
||||
).padding(top: 4, bottom: isExtracting ? 0 : 8),
|
||||
).padding(top: 4, bottom: 8),
|
||||
// Extraction progress bar
|
||||
if (isExtracting)
|
||||
LinearProgressIndicator(
|
||||
|
||||
@@ -52,9 +52,9 @@ class _CompactCheckboxState extends State<CompactCheckbox> {
|
||||
widget.scale == null
|
||||
? checkbox
|
||||
: Transform.scale(
|
||||
scale: widget.scale,
|
||||
child: checkbox,
|
||||
),
|
||||
scale: widget.scale,
|
||||
child: checkbox,
|
||||
),
|
||||
Text(
|
||||
widget.label,
|
||||
style: widget.textStyle,
|
||||
|
||||
@@ -246,7 +246,8 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.arrow_forward, size: 14, color: Colors.blue[700]),
|
||||
Icon(Icons.arrow_forward,
|
||||
size: 14, color: Colors.blue[700]),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: Text(
|
||||
@@ -263,9 +264,10 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return TextFormField(
|
||||
readOnly: widget.allowEdit ? false : (Util.isWeb() ? false : true),
|
||||
readOnly:
|
||||
widget.allowEdit ? false : (Util.isWeb() ? false : true),
|
||||
controller: widget.controller,
|
||||
decoration: widget.showLabel
|
||||
? InputDecoration(
|
||||
|
||||
Reference in new issue
Block a user