mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 17:40:28 +00:00
feat: support start and pause all tasks (#121)
This commit is contained in:
1 parent
0e3ca912a7
commit
eb9d966855
13 files changed
+141
-1
No files matched your search
@@ -118,6 +118,11 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
}
|
||||
|
||||
Future<void> _initDeepLinks() async {
|
||||
// currently only support android
|
||||
if (!Util.isAndroid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_appLinks = AppLinks();
|
||||
|
||||
// Handle link when app is in warm state (front or background)
|
||||
@@ -159,6 +164,15 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
await Get.rootDelegate.offAndToNamed(Routes.CREATE),
|
||||
},
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
label: "startAll".tr,
|
||||
onClick: (menuItem) async => {continueAllTasks()},
|
||||
),
|
||||
MenuItem(
|
||||
label: "pauseAll".tr,
|
||||
onClick: (menuItem) async => {pauseAllTasks()},
|
||||
),
|
||||
MenuItem(
|
||||
label: 'setting'.tr,
|
||||
onClick: (menuItem) async => {
|
||||
|
||||
@@ -5,4 +5,5 @@ class CreateController extends GetxController {
|
||||
final RxList fileInfos = [].obs;
|
||||
final RxList selectedIndexes = [].obs;
|
||||
final RxList openedFolders = [].obs;
|
||||
final isResolving = false.obs;
|
||||
}
|
||||
@@ -115,9 +115,10 @@ class CreateView extends GetView<CreateController> {
|
||||
}
|
||||
|
||||
Future<void> _doResolve() async {
|
||||
if (_confirmController.currentState == ButtonState.loading) {
|
||||
if (controller.isResolving.value) {
|
||||
return;
|
||||
}
|
||||
controller.isResolving.value = true;
|
||||
try {
|
||||
_confirmController.start();
|
||||
if (_resolveFormKey.currentState!.validate()) {
|
||||
@@ -130,6 +131,7 @@ class CreateView extends GetView<CreateController> {
|
||||
showErrorMessage(e);
|
||||
} finally {
|
||||
_confirmController.reset();
|
||||
controller.isResolving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user