mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 01:20:27 +00:00
feat(desktop): implement native desktop notifications for task completion and errors (#1293)
This commit is contained in:
1 parent
98bd3305b7
commit
bc5c818eae
26 files changed
+285
-4
No files matched your search
@@ -89,6 +89,7 @@ class ExtraConfig {
|
||||
bool defaultBtClient;
|
||||
bool notifyWhenNewVersion;
|
||||
bool autoStartTasks;
|
||||
bool desktopNotification;
|
||||
List<DownloadCategory> downloadCategories;
|
||||
|
||||
ExtraConfigBt bt = ExtraConfigBt();
|
||||
@@ -102,6 +103,7 @@ class ExtraConfig {
|
||||
this.defaultBtClient = true,
|
||||
this.notifyWhenNewVersion = true,
|
||||
this.autoStartTasks = false,
|
||||
this.desktopNotification = true,
|
||||
this.downloadCategories = const [],
|
||||
});
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ DownloaderConfig _$DownloaderConfigFromJson(Map<String, dynamic> json) =>
|
||||
..proxy = ProxyConfig.fromJson(json['proxy'] as Map<String, dynamic>)
|
||||
..webhook =
|
||||
WebhookConfig.fromJson(json['webhook'] as Map<String, dynamic>?)
|
||||
..script =
|
||||
ScriptConfig.fromJson(json['script'] as Map<String, dynamic>?)
|
||||
..script = ScriptConfig.fromJson(json['script'] as Map<String, dynamic>?)
|
||||
..autoTorrent = AutoTorrentConfig.fromJson(
|
||||
json['autoTorrent'] as Map<String, dynamic>?)
|
||||
..archive =
|
||||
@@ -91,6 +90,7 @@ ExtraConfig _$ExtraConfigFromJson(Map<String, dynamic> json) => ExtraConfig(
|
||||
defaultBtClient: json['defaultBtClient'] as bool? ?? true,
|
||||
notifyWhenNewVersion: json['notifyWhenNewVersion'] as bool? ?? true,
|
||||
autoStartTasks: json['autoStartTasks'] as bool? ?? false,
|
||||
desktopNotification: json['desktopNotification'] as bool? ?? true,
|
||||
downloadCategories: (json['downloadCategories'] as List<dynamic>?)
|
||||
?.map((e) => DownloadCategory.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
@@ -109,6 +109,7 @@ Map<String, dynamic> _$ExtraConfigToJson(ExtraConfig instance) =>
|
||||
'defaultBtClient': instance.defaultBtClient,
|
||||
'notifyWhenNewVersion': instance.notifyWhenNewVersion,
|
||||
'autoStartTasks': instance.autoStartTasks,
|
||||
'desktopNotification': instance.desktopNotification,
|
||||
'downloadCategories':
|
||||
instance.downloadCategories.map((e) => e.toJson()).toList(),
|
||||
'bt': instance.bt.toJson(),
|
||||
@@ -156,8 +157,7 @@ Map<String, dynamic> _$WebhookConfigToJson(WebhookConfig instance) =>
|
||||
'urls': instance.urls,
|
||||
};
|
||||
|
||||
ScriptConfig _$ScriptConfigFromJson(Map<String, dynamic> json) =>
|
||||
ScriptConfig(
|
||||
ScriptConfig _$ScriptConfigFromJson(Map<String, dynamic> json) => ScriptConfig(
|
||||
enable: json['enable'] as bool? ?? false,
|
||||
paths:
|
||||
(json['paths'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
||||
|
||||
Reference in new issue
Block a user