Skip to content

Commit

Permalink
profile
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed Jan 1, 2024
1 parent fc506b8 commit d1439bb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
5 changes: 3 additions & 2 deletions lib/src/l18n/en_US.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class en_US {
/// eh setting page
'site': 'Site',
'redirect2Eh': 'Redirect to EH if available',
'imDonor': 'I\'m a Donor',
'imDonorHint': 'If you are a donor, you can turn this on to help you access EX site',
'redirectAllGallery': 'Redirect all gallery to EH',
'imDonorHint': 'If you are a donor, you can turn this on to help you access gallerys in EX site',
'profileSetting': 'Profile Setting',
'chooseProfileHint': 'Choose profile used in JHenTai',
'siteSetting': 'Site Setting',
Expand Down Expand Up @@ -256,6 +256,7 @@ class en_US {

/// Profile Setting page
'selectedProfile': 'Selected Profile',
'resetIfSwitchSite': 'Will be reset if switch site',

/// add host mapping dialog
'addHostMapping': 'Add Host Mapping',
Expand Down
5 changes: 3 additions & 2 deletions lib/src/l18n/ko_KR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class ko_KR {
/// eh setting page
'site': '사이트',
'redirect2Eh': '사용 가능하면 EH로 재요청',
'imDonor': 'I\'m a Donor',
'imDonorHint': 'If you are a donor, you can turn this on to help you access EX site',
'redirectAllGallery': 'Redirect all gallery to EH',
'imDonorHint': 'If you are a donor, you can turn this on to help you access gallerys in EX site',
'profileSetting': 'Profile Setting',
'chooseProfileHint': 'Choose profile used in JHenTai',
'siteSetting': '사이트 내부 설정',
Expand Down Expand Up @@ -256,6 +256,7 @@ class ko_KR {

/// Profile Setting page
'selectedProfile': 'Selected Profile',
'resetIfSwitchSite': 'Will be reset if switch site',

/// add host mapping dialog
'addHostMapping': 'Add Host Mapping',
Expand Down
5 changes: 3 additions & 2 deletions lib/src/l18n/pt_BR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ class pt_BR {
/// eh setting page
'site': 'Site',
'redirect2Eh': 'Redirecionar para EH, se disponível',
'imDonor': 'I\'m a Donor',
'imDonorHint': 'If you are a donor, you can turn this on to help you access EX site',
'redirectAllGallery': 'Redirect all gallery to EH',
'imDonorHint': 'If you are a donor, you can turn this on to help you access gallerys in EX site',
'profileSetting': 'Profile Setting',
'chooseProfileHint': 'Choose profile used in JHenTai',
'siteSetting': 'Configuração do site',
Expand Down Expand Up @@ -257,6 +257,7 @@ class pt_BR {

/// Profile Setting page
'selectedProfile': 'Selected Profile',
'resetIfSwitchSite': 'Will be reset if switch site',

/// add host mapping dialog
'addHostMapping': 'Add Host Mapping',
Expand Down
5 changes: 3 additions & 2 deletions lib/src/l18n/zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ class zh_CN {
/// eh setting page
'site': '站点',
'redirect2Eh': '优先重定向至表站',
'imDonor': '我是捐赠者',
'imDonorHint': '如果你是捐赠者,你可以打开此项来更容易地访问部分里站画廊',
'redirectAllGallery': '重定向所有画廊至表站',
'imDonorHint': '如果你是捐赠者,你可以打开此项来更容易地访问里站中的画廊',
'profileSetting': 'Profile设置',
'chooseProfileHint': '选择在JHenTai中使用的Profile',
'siteSetting': '站点设置',
Expand Down Expand Up @@ -255,6 +255,7 @@ class zh_CN {

/// Profile Setting page
'selectedProfile': '当前使用的Profile',
'resetIfSwitchSite': '切换站点后将会自动重置',

/// add host mapping dialog
'addHostMapping': '添加自定义Host',
Expand Down
5 changes: 3 additions & 2 deletions lib/src/l18n/zh_TW.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ class zh_TW {
/// eh setting page
'site': '站點',
'redirect2Eh': '優先重定向至表站',
'imDonor': 'I\'m a Donor',
'imDonorHint': '如果你是捐贈者,你可以打開此項來更容易地訪問部分裏站畫廊',
'redirectAllGallery': '重定向所有畫廊至表站',
'imDonorHint': '如果你是捐赠者,你可以打開此項來更容易地訪問裏站中的畫廊',
'profileSetting': 'Profile設定',
'chooseProfileHint': '选择在JHenTai中使用的Profile',
'siteSetting': '站點設定',
Expand Down Expand Up @@ -255,6 +255,7 @@ class zh_TW {

/// Profile Setting page
'selectedProfile': '當前使用的Profile',
'resetIfSwitchSite': '切換站點後將會自動重置',

/// add host mapping dialog
'addHostMapping': '添加自定義Host',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class _SettingEHProfilePageState extends State<SettingEHProfilePage> {
children: [
ListTile(
title: Text('selectedProfile'.tr),
subtitle: Text('resetIfSwitchSite'.tr),
trailing: DropdownButton<int>(
value: number,
elevation: 4,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/setting/eh/setting_eh_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _SettingEHPageState extends State<SettingEHPage> {

Widget _buildIsDonor() {
return ListTile(
title: Text('imDonor'.tr),
title: Text('redirectAllGallery'.tr),
subtitle: Text('imDonorHint'.tr),
trailing: Switch(value: EHSetting.isDonor.value, onChanged: EHSetting.saveIsDonor),
);
Expand Down
6 changes: 6 additions & 0 deletions lib/src/setting/eh_setting.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:dio/dio.dart';
import 'package:get/get.dart';
import 'package:jhentai/src/network/eh_request.dart';
Expand All @@ -8,6 +10,7 @@ import 'package:jhentai/src/widget/loading_state_indicator.dart';
import 'package:retry/retry.dart';

import '../exception/eh_exception.dart';
import '../network/eh_cookie_manager.dart';
import '../service/storage_service.dart';
import '../utils/eh_spider_parser.dart';

Expand Down Expand Up @@ -78,6 +81,9 @@ class EHSetting {
Log.debug('saveSite:$site');
EHSetting.site.value = site;
_save();

Get.find<EHCookieManager>().storeEhCookiesForAllUri([Cookie('sp','1')]);

SiteSetting.refresh();
}

Expand Down

0 comments on commit d1439bb

Please sign in to comment.