From c3917082ee20a241a79da13ab8e603d90386c758 Mon Sep 17 00:00:00 2001 From: Zkitefly <2573874409@qq.com> Date: Sun, 13 Oct 2024 19:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=99=A8=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20(#3237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加打开启动器日志文件夹 * Update HMCL/src/main/resources/assets/lang/I18N.properties Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> * Update HMCL/src/main/resources/assets/lang/I18N_zh.properties Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> * Update HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> * Update HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> --------- Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> --- .../org/jackhuang/hmcl/ui/main/SettingsView.java | 16 +++++++++++++++- .../main/resources/assets/lang/I18N.properties | 1 + .../resources/assets/lang/I18N_zh.properties | 1 + .../resources/assets/lang/I18N_zh_CN.properties | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java index 39bd0ae17..8995e1949 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java @@ -30,6 +30,7 @@ import javafx.scene.layout.*; import javafx.scene.text.Text; import javafx.scene.text.TextAlignment; import javafx.scene.text.TextFlow; +import org.jackhuang.hmcl.Metadata; import org.jackhuang.hmcl.setting.EnumCommonDirectory; import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.ui.FXUtils; @@ -191,10 +192,19 @@ public abstract class SettingsView extends StackPane { BorderPane.setAlignment(left, Pos.CENTER_LEFT); debugPane.setLeft(left); + JFXButton openLogFolderButton = new JFXButton(i18n("settings.launcher.launcher_log.reveal")); + openLogFolderButton.setOnMouseClicked(e -> openLogFolder()); + openLogFolderButton.getStyleClass().add("jfx-button-border"); + JFXButton logButton = new JFXButton(i18n("settings.launcher.launcher_log.export")); logButton.setOnMouseClicked(e -> onExportLogs()); logButton.getStyleClass().add("jfx-button-border"); - debugPane.setRight(logButton); + + HBox buttonBox = new HBox(); + buttonBox.setSpacing(10); + buttonBox.getChildren().addAll(openLogFolderButton, logButton); + BorderPane.setAlignment(buttonBox, Pos.CENTER_RIGHT); + debugPane.setRight(buttonBox); settingsPane.getContent().add(debugPane); } @@ -205,6 +215,10 @@ public abstract class SettingsView extends StackPane { } } + public void openLogFolder() { + FXUtils.openFolder(Metadata.HMCL_DIRECTORY.resolve("logs").toFile()); + } + protected abstract void onUpdate(); protected abstract void onExportLogs(); diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 5f7e8bfe5..14eb8e13e 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1183,6 +1183,7 @@ settings.launcher.font=Font settings.launcher.general=General settings.launcher.language=Language (applies after restart) settings.launcher.launcher_log.export=Export launcher logs +settings.launcher.launcher_log.reveal=Reveal Logs in Explorer settings.launcher.launcher_log.export.failed=Unable to export logs settings.launcher.launcher_log.export.success=Logs have been exported to %s settings.launcher.log=Logging diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 8373e0da1..78971778f 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -1042,6 +1042,7 @@ settings.launcher.font=字體 settings.launcher.general=通用 settings.launcher.language=語言 (重啟後生效) settings.launcher.launcher_log.export=匯出啟動器日誌 +settings.launcher.launcher_log.reveal=打開日誌目錄 settings.launcher.launcher_log.export.failed=無法匯出日誌 settings.launcher.launcher_log.export.success=日誌已儲存到 %s settings.launcher.log=記錄 diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index 2f7bf8962..945552efa 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1041,6 +1041,7 @@ settings.launcher.font=字体 settings.launcher.general=通用 settings.launcher.language=语言 (重启后生效) settings.launcher.launcher_log.export=导出启动器日志 +settings.launcher.launcher_log.reveal=打开日志目录 settings.launcher.launcher_log.export.failed=无法导出日志 settings.launcher.launcher_log.export.success=日志已保存到 %s settings.launcher.log=日志