feat(microsoft): copy device code instead of verification uri.

This commit is contained in:
huanghongxun 2021-10-23 23:28:19 +08:00
parent f893eeea1f
commit ec37b32eaa
5 changed files with 9 additions and 7 deletions

View File

@ -270,14 +270,15 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware {
HintPane hintPane = new HintPane(MessageDialogPane.MessageType.INFO);
FXUtils.onChangeAndOperate(deviceCode, deviceCode -> {
if (deviceCode != null) {
hintPane.setSegment(i18n("account.methods.microsoft.manual", deviceCode.getUserCode()));
FXUtils.copyText(deviceCode.getUserCode());
hintPane.setSegment(i18n("account.methods.microsoft.manual", deviceCode.getUserCode(), deviceCode.getVerificationUri()));
} else {
hintPane.setSegment(i18n("account.methods.microsoft.hint"));
}
});
hintPane.setOnMouseClicked(e -> {
if (deviceCode.get() != null) {
FXUtils.copyText(deviceCode.get().getVerificationUri());
FXUtils.copyText(deviceCode.get().getUserCode());
}
});

View File

@ -47,14 +47,15 @@ public class OAuthAccountLoginDialog extends DialogPane {
HintPane hintPane = new HintPane(MessageDialogPane.MessageType.INFO);
FXUtils.onChangeAndOperate(deviceCode, deviceCode -> {
if (deviceCode != null) {
hintPane.setSegment(i18n("account.methods.microsoft.manual", deviceCode.getUserCode()));
FXUtils.copyText(deviceCode.getUserCode());
hintPane.setSegment(i18n("account.methods.microsoft.manual", deviceCode.getUserCode(), deviceCode.getVerificationUri()));
} else {
hintPane.setSegment(i18n("account.methods.microsoft.hint"));
}
});
hintPane.setOnMouseClicked(e -> {
if (deviceCode.get() != null) {
FXUtils.copyText(deviceCode.get().getVerificationUri());
FXUtils.copyText(deviceCode.get().getUserCode());
}
});

View File

@ -97,7 +97,7 @@ account.methods.microsoft.error.no_character=Account is missing a Minecraft Java
account.methods.microsoft.error.unknown=Failed to log in. Microsoft respond with error code %d.
account.methods.microsoft.logging_in=Logging in...
account.methods.microsoft.hint=You should click "login" button, paste the device code shown here later and continue login process in newly opened browser window.
account.methods.microsoft.manual=Your device code is <b>%s</b>. After clicking "login" button, you should finish authorization in the newly opened browser window. If the browser window failed to show, you can click here to copy the URL, and manually open it in your browser.
account.methods.microsoft.manual=Your device code is <b>%1$s</b>, click here to copy. After clicking "login" button, you should finish authorization in the newly opened browser window. If the browser window failed to show, you can open %2$s manually.
account.methods.microsoft.profile=Account Profile...
account.methods.microsoft.snapshot=HMCL Snapshot version does not support Microsoft login.
account.methods.microsoft.waiting_browser=Waiting for authorization in opened browser window...

View File

@ -97,7 +97,7 @@ account.methods.microsoft.error.no_character=該帳號沒有包含 Minecraft Jav
account.methods.microsoft.error.unknown=登入失敗,錯誤碼:%d
account.methods.microsoft.logging_in=登入中...
account.methods.microsoft.hint=您需要點擊登錄按鈕,並在新打開的瀏覽器窗口中完成登錄,並輸入待會在此處顯示的設備代碼。
account.methods.microsoft.manual=設備代碼為:<b>%s</b>。若登錄頁面未能打開,您可以點擊此處複製連結,並手動在瀏覽器中打開網頁
account.methods.microsoft.manual=設備代碼為:<b>%1$s</b>,已經幫你拷貝到剪切板中,如果未能黏貼,你可以點擊此處再複製一次。你需要在新打開的瀏覽器窗口中完成登錄,若登錄頁面未能打開,您手動在瀏覽器中打開網頁:%2$s
account.methods.microsoft.profile=帳戶設置頁
account.methods.microsoft.snapshot=HMCL 快照版不支持微软登录
account.methods.microsoft.waiting_browser=等待在新打開的瀏覽器窗口中完成登入...

View File

@ -97,7 +97,7 @@ account.methods.microsoft.error.no_character=该帐户没有包含 Minecraft Jav
account.methods.microsoft.error.unknown=登录失败,错误码:%d
account.methods.microsoft.logging_in=登录中...
account.methods.microsoft.hint=您需要点击登录按钮,并在新打开的浏览器窗口中完成登录,并输入待会在此处显示的设备代码。
account.methods.microsoft.manual=设备代码为:<b>%s</b>。若登录页面未能打开,您可以点击此处复制链接,并手动在浏览器中打开网页
account.methods.microsoft.manual=设备代码为:<b>%1$s</b>,已经帮你拷贝到剪切板中,如果未能粘贴,你可以点击此处再复制一次。你需要在新打开的浏览器窗口中完成登录,若登录页面未能打开,您手动在浏览器中打开网页:%2$s
account.methods.microsoft.profile=帐户设置页
account.methods.microsoft.snapshot=HMCL 快照版不支持微软登录
account.methods.microsoft.waiting_browser=等待在新打开的浏览器窗口中完成登录...