Add a button to open log directory

This commit is contained in:
huanghongxun 2018-10-16 00:20:56 +08:00
parent 6c74364fa5
commit 8905f2e855
9 changed files with 108 additions and 30 deletions

28
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,28 @@
# 公告
提交前请确保你的启动器版本是**最新的开发版**,可以在启动器设置中更换更新通道至开发版获取更新。
**如果你在阅读完本公告后仍然希望在此处发布 issue请将公告内容删去并按照下面的模板填入相关信息。**
我们发现对于不经常检查邮箱的人来说GitHub issues 的反馈效率太低,时隔几个小时甚至一天的情况很多。为了改善反馈效率,并将积极为 HMCL 提供问题反馈和建议的人聚集起来,我们希望在这里反馈的人可以在 HMCL 3 用户 QQ 群219177735 中反馈信息,**而不在 GitHub Issues 中反馈问题**。
如果你希望在 QQ 群中反馈问题,也请将下面的信息表填好直接发在群中,加快我们的沟通速度。
# 问题提交
*完整地填下面的问题提交表对我们很重要,这可以加快我们分析问题原因的速度。*
* 启动器版本:
* 操作系统:
* Java 版本:
* 错误截图(最好请将整个电脑屏幕的截图发上来):
* 游戏版本(如果是启动通过启动器自带的自动安装功能安装的游戏):
* 对游戏做的修改(是否自行通过安装器安装 Rift 等 API以及 mod
* 游戏崩溃报告(如果有):
* 启动器崩溃报告(如果有):
* 启动器日志文件(在启动器设置中打开日志文件夹并将文件夹内所有文件打包发在这里):
* 问题描述(如何触发问题):

View File

@ -28,6 +28,7 @@ import javafx.beans.property.*;
import javafx.scene.control.ToggleGroup;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import org.jackhuang.hmcl.Launcher;
import org.jackhuang.hmcl.Metadata;
import org.jackhuang.hmcl.setting.*;
import org.jackhuang.hmcl.ui.construct.Validator;
@ -200,6 +201,11 @@ public final class SettingsPage extends SettingsView implements DecoratorPage {
UpdateHandler.updateFrom(target);
}
@Override
protected void onOpenLogFolder() {
FXUtils.openFolder(Launcher.LOG_DIRECTORY);
}
@Override
protected void onHelp() {
FXUtils.openLink(Metadata.HELP_URL);

View File

@ -332,16 +332,27 @@ public abstract class SettingsView extends StackPane {
settingsPane.getContent().add(themePane);
}
{
ComponentSublist logPane = new ComponentSublist();
logPane.setTitle(i18n("settings.launcher.log"));
{
JFXButton logButton = new JFXButton(i18n("settings.launcher.log.dir"));
logButton.setOnMouseClicked(e -> onOpenLogFolder());
logButton.getStyleClass().setAll("jfx-button-border");
logPane.setHeaderRight(logButton);
}
{
VBox fontPane = new VBox();
fontPane.setSpacing(5);
settingsPane.getContent().add(fontPane);
{
BorderPane borderPane = new BorderPane();
fontPane.getChildren().add(borderPane);
{
Label left = new Label(i18n("settings.launcher.log_font"));
Label left = new Label(i18n("settings.launcher.log.font"));
BorderPane.setAlignment(left, Pos.CENTER_LEFT);
borderPane.setLeft(left);
}
@ -361,6 +372,10 @@ public abstract class SettingsView extends StackPane {
lblDisplay = new Label("[23:33:33] [Client Thread/INFO] [WaterPower]: Loaded mod WaterPower.");
fontPane.getChildren().add(lblDisplay);
logPane.getContent().add(fontPane);
}
settingsPane.getContent().add(logPane);
}
{
@ -477,4 +492,5 @@ public abstract class SettingsView extends StackPane {
protected abstract void onUpdate();
protected abstract void onHelp();
protected abstract void onOpenLogFolder();
}

View File

@ -88,11 +88,16 @@ class ComponentListCell extends StackPane {
VBox labelVBox = new VBox();
labelVBox.setAlignment(Pos.CENTER_LEFT);
boolean overrideHeaderLeft = false;
if (list instanceof ComponentSublist) {
Node leftNode = ((ComponentSublist) list).getHeaderLeft();
if (leftNode != null)
if (leftNode != null) {
labelVBox.getChildren().setAll(leftNode);
} else {
overrideHeaderLeft = true;
}
}
if (!overrideHeaderLeft) {
Label label = new Label();
label.textProperty().bind(list.titleProperty());
labelVBox.getChildren().add(label);
@ -108,6 +113,7 @@ class ComponentListCell extends StackPane {
groupNode.setLeft(labelVBox);
HBox right = new HBox();
right.setSpacing(16);
right.setAlignment(Pos.CENTER_RIGHT);
if (list instanceof ComponentSublist) {
Node rightNode = ((ComponentSublist) list).getHeaderRight();

View File

@ -558,6 +558,22 @@
-fx-font-size: 14px;
}
.jfx-button-border {
-fx-text-fill: -fx-base-color;
-fx-border-color: gray;
-fx-border-radius: 5px;
-fx-border-width: 0.2px;
-fx-padding: 8px;
}
.jfx-button-border .jfx-rippler {
-jfx-rippler-fill: -fx-base-check-color;
}
.jfx-button-border .label {
-fx-text-fill: -fx-base-color;
}
.jfx-button-raised-round {
-fx-background-color: -fx-base-color;
-fx-background-radius: 50px;

View File

@ -22,7 +22,7 @@
<BorderPane><left><Label text="%archive.version"/></left><right><Label fx:id="lblVersion" /></right></BorderPane>
<BorderPane><left><Label text="%archive.author"/></left><right><Label fx:id="lblAuthor" /></right></BorderPane>
<BorderPane>
<left><JFXButton fx:id="btnDescription" onMouseClicked="#onDescribe" text="%modpack.wizard.step.3" styleClass="jfx-button" /></left>
<left><JFXButton fx:id="btnDescription" onMouseClicked="#onDescribe" text="%modpack.wizard.step.3" styleClass="jfx-button-border" /></left>
<right><JFXButton buttonType="RAISED" fx:id="btnInstall" onMouseClicked="#onInstall" text="%button.install" styleClass="jfx-button-raised" /></right>
</BorderPane>
</ComponentList>

View File

@ -327,7 +327,9 @@ settings.launcher.common_path.tooltip=This app will save all game libraries and
settings.launcher.download_source=Download Source
settings.launcher.enable_game_list=Display game list in main page
settings.launcher.language=Language
settings.launcher.log_font=Log Font
settings.launcher.log=Log
settings.launcher.log.font=Log Font
settings.launcher.log.dir=Open Log Directory
settings.launcher.proxy=Proxy
settings.launcher.proxy.authentication=Proxy Authentication
settings.launcher.proxy.disable=Use system proxies

View File

@ -327,7 +327,9 @@ settings.launcher.common_path.tooltip=啟動器將所有遊戲資源及依賴庫
settings.launcher.download_source=下載來源
settings.launcher.enable_game_list=在首頁內顯示遊戲列表
settings.launcher.language=語言
settings.launcher.log_font=記錄字體
settings.launcher.log=記錄
settings.launcher.log.font=記錄字體
settings.launcher.log.dir=打開記錄資料夾
settings.launcher.proxy=代理
settings.launcher.proxy.authentication=身份驗證
settings.launcher.proxy.disable=使用系統代理

View File

@ -327,7 +327,9 @@ settings.launcher.common_path.tooltip=启动器将所有游戏资源及依赖库
settings.launcher.download_source=下载源
settings.launcher.enable_game_list=在主页内显示游戏列表
settings.launcher.language=语言
settings.launcher.log_font=日志字体
settings.launcher.log=日志
settings.launcher.log.font=日志字体
settings.launcher.log.dir=打开日志文件夹
settings.launcher.proxy=代理
settings.launcher.proxy.authentication=身份验证
settings.launcher.proxy.disable=使用系统代理