Provide a clearer message for TLS 1.3 cases
This commit is contained in:
@@ -529,7 +529,15 @@ void KOReaderSyncActivity::render(RenderLock&&) {
|
||||
|
||||
if (state == SYNC_FAILED) {
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, 280, tr(STR_SYNC_FAILED_MSG), true, EpdFontFamily::BOLD);
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, 320, statusMessage.c_str());
|
||||
|
||||
// Word-wrap the detail message so long TLS/network diagnostics aren't clipped.
|
||||
const int lineHeight = renderer.getLineHeight(UI_10_FONT_ID);
|
||||
const auto lines = renderer.wrappedText(UI_10_FONT_ID, statusMessage.c_str(), contentRect.width - 20, 4);
|
||||
int y = 320;
|
||||
for (const auto& line : lines) {
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, y, line.c_str());
|
||||
y += lineHeight;
|
||||
}
|
||||
|
||||
const auto labels = mappedInput.mapLabels(tr(STR_BACK), "", "", "");
|
||||
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
|
||||
|
||||
@@ -53,6 +53,11 @@ void KOReaderAuthActivity::performAuthentication() {
|
||||
} else {
|
||||
state = FAILED;
|
||||
errorMessage = KOReaderSyncClient::errorString(result);
|
||||
const char* detail = KOReaderSyncClient::lastFailureDetail();
|
||||
if (detail && detail[0]) {
|
||||
errorMessage += " — ";
|
||||
errorMessage += detail;
|
||||
}
|
||||
}
|
||||
}
|
||||
requestUpdate();
|
||||
@@ -72,6 +77,11 @@ void KOReaderAuthActivity::performRegistration() {
|
||||
} else {
|
||||
state = FAILED;
|
||||
errorMessage = KOReaderSyncClient::errorString(result);
|
||||
const char* detail = KOReaderSyncClient::lastFailureDetail();
|
||||
if (detail && detail[0]) {
|
||||
errorMessage += " — ";
|
||||
errorMessage += detail;
|
||||
}
|
||||
}
|
||||
}
|
||||
requestUpdate();
|
||||
@@ -120,7 +130,12 @@ void KOReaderAuthActivity::render(RenderLock&&) {
|
||||
} else if (state == FAILED) {
|
||||
const char* failedMsg = (mode == Mode::REGISTER) ? tr(STR_REGISTER_FAILED) : tr(STR_AUTH_FAILED);
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, top, failedMsg, true, EpdFontFamily::BOLD);
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, top + height + 10, errorMessage.c_str());
|
||||
const auto lines = renderer.wrappedText(UI_10_FONT_ID, errorMessage.c_str(), contentRect.width - 20, 4);
|
||||
int y = top + height + 10;
|
||||
for (const auto& line : lines) {
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, y, line.c_str());
|
||||
y += height;
|
||||
}
|
||||
}
|
||||
|
||||
const auto labels = mappedInput.mapLabels(tr(STR_BACK), "", "", "");
|
||||
|
||||
Reference in New Issue
Block a user