Add Bluetooth connecting popup message
Add new translation string for displaying a popup message while Bluetooth connection is in progress.
This commit is contained in:
@@ -296,6 +296,7 @@ STR_BT_PAIRED_DEVICES: "Paired Devices"
|
|||||||
STR_BT_NO_PAIRED: "No paired devices"
|
STR_BT_NO_PAIRED: "No paired devices"
|
||||||
STR_BT_MAP_BUTTONS: "Map Remote Buttons"
|
STR_BT_MAP_BUTTONS: "Map Remote Buttons"
|
||||||
STR_BT_PRESS_REMOTE: "Press a button on your remote"
|
STR_BT_PRESS_REMOTE: "Press a button on your remote"
|
||||||
|
STR_BT_CONNECTING_POPUP: "BT Connecting"
|
||||||
STR_BT_PAGE_FORWARD: "Page Forward"
|
STR_BT_PAGE_FORWARD: "Page Forward"
|
||||||
STR_BT_PAGE_BACK: "Page Back"
|
STR_BT_PAGE_BACK: "Page Back"
|
||||||
STR_BT_FORGET_PROMPT: "Hold Confirm to forget"
|
STR_BT_FORGET_PROMPT: "Hold Confirm to forget"
|
||||||
|
|||||||
@@ -874,7 +874,20 @@ void EpubReaderActivity::render(RenderLock&& lock) {
|
|||||||
bleinput::stop();
|
bleinput::stop();
|
||||||
built = buildSection();
|
built = buildSection();
|
||||||
const bool bleOk = bleinput::ensureStarted();
|
const bool bleOk = bleinput::ensureStarted();
|
||||||
LOG_INF("ERS", "BLE restart after build: begin=%d (auto-reconnect follows)", bleOk);
|
LOG_INF("ERS", "BLE restart after build: begin=%d", bleOk);
|
||||||
|
if (bleOk) {
|
||||||
|
// Show a connecting popup and give the bonded remote a moment to re-link so the
|
||||||
|
// user isn't left with an unresponsive remote and a silent pause. Bounded: a
|
||||||
|
// remote that needs a button press to re-advertise won't stall reading — it
|
||||||
|
// reconnects in the background after we return. The popup is drawn once (e-ink
|
||||||
|
// holds it) and the page render overwrites it when we resume.
|
||||||
|
GUI.drawPopup(renderer, tr(STR_BT_CONNECTING_POPUP));
|
||||||
|
const unsigned long deadline = millis() + 4000;
|
||||||
|
while (!BleHid.isConnected() && millis() < deadline) {
|
||||||
|
BleHid.poll();
|
||||||
|
delay(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!built) {
|
if (!built) {
|
||||||
LOG_ERR("ERS", "Failed to persist page data to SD");
|
LOG_ERR("ERS", "Failed to persist page data to SD");
|
||||||
|
|||||||
Reference in New Issue
Block a user