mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
feat: support proxy (#284)
This commit is contained in:
45 files changed
+1017
-1124
No files matched your search
@@ -16,7 +16,7 @@ import 'package:window_manager/window_manager.dart';
|
||||
import '../../../../api/api.dart';
|
||||
import '../../../../api/model/downloader_config.dart';
|
||||
import '../../../../core/common/start_config.dart';
|
||||
import '../../../../generated/locales.g.dart';
|
||||
import '../../../../i18n/message.dart';
|
||||
import '../../../../util/locale_manager.dart';
|
||||
import '../../../../util/log_util.dart';
|
||||
import '../../../../util/package_info.dart';
|
||||
@@ -185,9 +185,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
MenuItem(
|
||||
label: 'donate'.tr,
|
||||
onClick: (menuItem) => {
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
"https://github.com/GopeedLab/gopeed/blob/main/.donate/index.md#donate"),
|
||||
launchUrl(Uri.parse("https://docs.gopeed.com/donate.html"),
|
||||
mode: LaunchMode.externalApplication)
|
||||
},
|
||||
),
|
||||
@@ -376,7 +374,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
}
|
||||
if (extra.locale.isEmpty) {
|
||||
final systemLocale = getLocaleKey(PlatformDispatcher.instance.locale);
|
||||
extra.locale = AppTranslation.translations.containsKey(systemLocale)
|
||||
extra.locale = messages.keys.containsKey(systemLocale)
|
||||
? systemLocale
|
||||
: getLocaleKey(fallbackLocale);
|
||||
}
|
||||
@@ -384,6 +382,10 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
// default select all tracker subscribe urls
|
||||
extra.bt.trackerSubscribeUrls.addAll(allTrackerSubscribeUrls);
|
||||
}
|
||||
final proxy = config.proxy;
|
||||
if (proxy.scheme.isEmpty) {
|
||||
proxy.scheme = 'http';
|
||||
}
|
||||
|
||||
if (config.downloadDir.isEmpty) {
|
||||
if (Util.isDesktop()) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../generated/locales.g.dart';
|
||||
import '../../../../i18n/message.dart';
|
||||
import '../../../../theme/theme.dart';
|
||||
import '../../../../util/locale_manager.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
@@ -20,8 +20,7 @@ class AppView extends GetView<AppController> {
|
||||
theme: GopeedTheme.light,
|
||||
darkTheme: GopeedTheme.dark,
|
||||
themeMode: ThemeMode.values.byName(config.extra.themeMode),
|
||||
// translations: messages,
|
||||
translationsKeys: AppTranslation.translations,
|
||||
translations: messages,
|
||||
locale: toLocale(config.extra.locale),
|
||||
fallbackLocale: fallbackLocale,
|
||||
localizationsDelegates: const [
|
||||
@@ -29,8 +28,7 @@ class AppView extends GetView<AppController> {
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales:
|
||||
AppTranslation.translations.keys.map((e) => toLocale(e)).toList(),
|
||||
supportedLocales: messages.keys.keys.map((e) => toLocale(e)).toList(),
|
||||
getPages: AppPages.routes,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user