diff --git a/assets/tr.json b/assets/tr.json index 0ef648f..70ce16c 100644 --- a/assets/tr.json +++ b/assets/tr.json @@ -147,7 +147,8 @@ "Submit": "提交", "Local": "本地", "Both": "同时", - "This artwork is blocked": "此作品已被屏蔽" + "This artwork is blocked": "此作品已被屏蔽", + "Delete Invalid Items": "删除无效项目" }, "zh_TW": { "Search": "搜索", @@ -297,6 +298,7 @@ "Submit": "提交", "Local": "本地", "Both": "同時", - "This artwork is blocked": "此作品已被屏蔽" + "This artwork is blocked": "此作品已被屏蔽", + "Delete Invalid Items": "刪除無效項目" } } \ No newline at end of file diff --git a/lib/pages/downloaded_page.dart b/lib/pages/downloaded_page.dart index fef3fa4..1cbfb8c 100644 --- a/lib/pages/downloaded_page.dart +++ b/lib/pages/downloaded_page.dart @@ -56,7 +56,7 @@ class _DownloadedPageState extends State { }); }, ), - ), + ), Expanded( child: buildBody(), ), @@ -77,8 +77,9 @@ class _DownloadedPageState extends State { child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - context.to(() => _DownloadedIllustViewPage( - DownloadManager().getImagePaths(illusts[index].illustId))); + App.rootNavigatorKey.currentContext?.to(() => + _DownloadedIllustViewPage(DownloadManager() + .getImagePaths(illusts[index].illustId))); }, child: Row( children: [ diff --git a/lib/pages/illust_page.dart b/lib/pages/illust_page.dart index 51d2715..64f5eaa 100644 --- a/lib/pages/illust_page.dart +++ b/lib/pages/illust_page.dart @@ -1192,7 +1192,7 @@ class __BlockingPageState extends State<_BlockingPage> { strokeWidth: 1.6, ).fixWidth(18).fixHeight(18).toAlign(Alignment.center) : Text("Submit".tl), - ).fixWidth(96).fixHeight(28), + ).fixWidth(96).fixHeight(32), ).toAlign(Alignment.center).paddingTop(16); } } diff --git a/lib/pages/novel_reading_page.dart b/lib/pages/novel_reading_page.dart index 302a86f..4c889e8 100644 --- a/lib/pages/novel_reading_page.dart +++ b/lib/pages/novel_reading_page.dart @@ -33,11 +33,12 @@ class _NovelReadingPageState extends LoadingState { if (!isShowingSettings) { _NovelReadingSettings.show(context, () { setState(() {}); + }).then((value) { + isShowingSettings = false; }); isShowingSettings = true; } else { Navigator.of(context).pop(); - isShowingSettings = false; } }); Future.delayed(const Duration(milliseconds: 200), () { @@ -136,8 +137,8 @@ class _NovelReadingSettings extends StatefulWidget { final void Function() callback; - static void show(BuildContext context, void Function() callback) { - Navigator.of(context).push(SideBarRoute(_NovelReadingSettings(callback))); + static Future show(BuildContext context, void Function() callback) { + return Navigator.of(context).push(SideBarRoute(_NovelReadingSettings(callback))); } @override diff --git a/windows/build.iss b/windows/build.iss new file mode 100644 index 0000000..8be1cfc --- /dev/null +++ b/windows/build.iss @@ -0,0 +1,63 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "pixes" +#define MyAppVersion "1.0.5" +#define MyAppPublisher "Nyne" +#define MyAppURL "https://github.com/wgh136/pixes" +#define MyAppExeName "pixes.exe" +#define RootPath "C:\Users\wgh19\IdeaProjects\pixes" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{88521115-48B7-4AF3-BF49-2BC6AF90B8D3} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir=C:\Users\wgh19\IdeaProjects\pixes\build\windows +OutputBaseFilename=pixes-windows-installer +SetupIconFile={#RootPath}\windows\runner\resources\app_icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern +ArchitecturesInstallIn64BitMode=x64 arm64 +ArchitecturesAllowed=x64 arm64 + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "{#RootPath}\build\windows\x64\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\app_links_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\dynamic_color_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\file_selector_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\screen_retriever_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\share_plus_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\sqlite3_flutter_libs_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\url_launcher_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\window_manager_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall \ No newline at end of file diff --git a/build_windows.py b/windows/build_windows.py similarity index 52% rename from build_windows.py rename to windows/build_windows.py index bb756fb..4125de1 100644 --- a/build_windows.py +++ b/windows/build_windows.py @@ -1,6 +1,8 @@ import subprocess import os +os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + fontUse = ''' fonts: - family: font @@ -26,4 +28,19 @@ if os.path.exists("build/app-windows.zip"): subprocess.run(["tar", "-a", "-c", "-f", "build/windows/x64/app-windows.zip", "-C", "build/windows/x64/runner/Release", "."] , shell=True) -subprocess.run(["iscc", "build/windows/build.iss"], shell=True) \ No newline at end of file +version = str.split(str.split(content, 'version: ')[1], '+')[0] +issContent = "" +file = open('windows/build.iss', 'r') +issContent = file.read() +newContent = issContent +newContent = newContent.replace("{{version}}", version) +newContent = newContent.replace("{{root_path}}", os.getcwd()) +file.close() +file = open('windows/build.iss', 'w') +file.write(newContent) +file.close() + +subprocess.run(["iscc", "windows/build.iss"], shell=True) + +with open('windows/build.iss', 'w') as file: + file.write(issContent) \ No newline at end of file