-
Notifications
You must be signed in to change notification settings - Fork 784
切换语言后提示用户重启软件 #4380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
切换语言后提示用户重启软件 #4380
Conversation
|
注释用英文写 |
已完成 |
|
|
||
| if (oldValue != null && newValue != null && !oldValue.equals(newValue)) { | ||
| JFXButton restartButton = new JFXButton(i18n("button.restart")); | ||
| restartButton.getStyleClass().add("dialog-success"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 dialog-success 是什么东西?你没注意到你的重启按钮没应用到样式吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
欸我操,记错了,应该是dialog-accept
啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
|
不建议修改更新链逻辑上的相关逻辑。这些代码一旦出错,我们将无法将用户从错误的版本提升至新版本 |
我已经还原了update相关的代码,希望以后可以考虑迁移使用Restarter |
| import static org.jackhuang.hmcl.setting.ConfigHolder.config; | ||
|
|
||
| /** | ||
| * Common restart tool class, used for: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** 的 Javadoc 中应当使用 HTML 标签。如果你想使用 Markdown 文档,请使用 /// 开头的 Markdown 文档。
| builder().restart(); | ||
| } | ||
|
|
||
| public static void restartWithLocale(Locales.SupportedLocale locale) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样一个方法非常奇怪。有什么理由不在 SettingsPage 中更新 config,而非要创建一个新的方法呢?
| } catch (IOException ex) { | ||
| LOG.log(Level.WARNING, "Failed to restart", ex); | ||
| ignoreLanguageChange = true; | ||
| cboLanguage.getSelectionModel().select(oldValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重启失败的时候为什么要跳回去?我觉得应该提示用户手动重启完成切换。
|
|
||
| Runnable cancelAction = () -> { | ||
| ignoreLanguageChange = true; | ||
| cboLanguage.getSelectionModel().select(newValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的意义是什么?这时候 cboLanguage 不是已经切换到新的语言上了吗?
|
你的实现没有注意 一个更明显的例子是启动器的退出的时候会保存一次 |
这确实是一个很大的问题。我目前无法解决此问题。因为这可能涉及到较大范围的代码修改,会导致该PR更难以通过审查 |
#4513 或许可以替代本PR |
Uh oh!
There was an error while loading. Please reload this page.