mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
parent
7937f8ddf5
commit
c7f248a092
@ -166,6 +166,16 @@ public final class MessageDialogPane extends HBox {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addAction(String text, @Nullable Runnable action) {
|
||||
JFXButton btnAction = new JFXButton(text);
|
||||
btnAction.getStyleClass().add("dialog-accept");
|
||||
if (action != null) {
|
||||
btnAction.setOnAction(e -> action.run());
|
||||
}
|
||||
dialog.addButton(btnAction);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder ok(@Nullable Runnable ok) {
|
||||
JFXButton btnOk = new JFXButton(i18n("button.ok"));
|
||||
btnOk.getStyleClass().add("dialog-accept");
|
||||
|
@ -237,10 +237,13 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
||||
doAnimation(show);
|
||||
|
||||
if (show && getLatestVersion() != null && !Objects.equals(config().getPromptedVersion(), getLatestVersion().getVersion())) {
|
||||
Controllers.confirm("", i18n("update.bubble.title", getLatestVersion().getVersion()), MessageDialogPane.MessageType.INFO, () -> {
|
||||
config().setPromptedVersion(getLatestVersion().getVersion());
|
||||
onUpgrade();
|
||||
}, null);
|
||||
Controllers.dialog(new MessageDialogPane.Builder("", i18n("update.bubble.title", getLatestVersion().getVersion()), MessageDialogPane.MessageType.INFO)
|
||||
.addAction(i18n("button.view"), () -> {
|
||||
config().setPromptedVersion(getLatestVersion().getVersion());
|
||||
onUpgrade();
|
||||
})
|
||||
.addCancel(null)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,6 +183,7 @@ button.retry=Retry
|
||||
button.save=Save
|
||||
button.save_as=Save As
|
||||
button.select_all=Select All
|
||||
button.view=View
|
||||
button.yes=Yes
|
||||
|
||||
chat=Join Group Chat
|
||||
|
@ -192,6 +192,7 @@ button.retry=重試
|
||||
button.save=儲存
|
||||
button.save_as=另存為
|
||||
button.select_all=全選
|
||||
button.view=查看
|
||||
button.yes=是
|
||||
|
||||
chat=官方群組
|
||||
|
@ -193,6 +193,7 @@ button.retry=重试
|
||||
button.save=保存
|
||||
button.save_as=另存为
|
||||
button.select_all=全选
|
||||
button.view=查看
|
||||
button.yes=是
|
||||
|
||||
chat=官方群组
|
||||
|
Loading…
Reference in New Issue
Block a user