Refactor image rendering and add Bluetooth setting
- Added logic to render images only in BW mode in Page.cpp. - Implemented getRenderMode() in GfxRenderer.h. - Increased SETTINGS_COUNT and added bluetoothEnabled field in CrossPointSettings. - Updated saveToFile and loadFromFile methods to handle the new Bluetooth setting. - Added Bluetooth toggle in SettingsActivity.
This commit is contained in:
@@ -8,9 +8,11 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "CrossPointSettings.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "NetworkModeSelectionActivity.h"
|
||||
#include "WifiSelectionActivity.h"
|
||||
#include "activities/util/FullScreenMessageActivity.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
namespace {
|
||||
@@ -128,6 +130,15 @@ void CrossPointWebServerActivity::onNetworkModeSelected(const NetworkMode mode)
|
||||
Serial.printf("[%lu] [WEBACT] Network mode selected: %s\n", millis(),
|
||||
mode == NetworkMode::JOIN_NETWORK ? "Join Network" : "Create Hotspot");
|
||||
|
||||
// Check for WiFi/BLE mutual exclusion
|
||||
if (SETTINGS.bluetoothEnabled) {
|
||||
Serial.printf("[%lu] [WEBACT] ERROR: Cannot start WiFi while Bluetooth is enabled\n", millis());
|
||||
exitActivity();
|
||||
enterNewActivity(new FullScreenMessageActivity(
|
||||
renderer, mappedInput, "Disable Bluetooth first\n\nGo to Settings > Bluetooth"));
|
||||
return;
|
||||
}
|
||||
|
||||
networkMode = mode;
|
||||
isApMode = (mode == NetworkMode::CREATE_HOTSPOT);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Define the static settings list
|
||||
namespace {
|
||||
constexpr int settingsCount = 11;
|
||||
constexpr int settingsCount = 12;
|
||||
const SettingInfo settingsList[settingsCount] = {
|
||||
// Should match with SLEEP_SCREEN_MODE
|
||||
{"Sleep Screen", SettingType::ENUM, &CrossPointSettings::sleepScreen, {"Dark", "Light", "Custom", "Cover"}},
|
||||
@@ -34,6 +34,7 @@ const SettingInfo settingsList[settingsCount] = {
|
||||
{"Bookerly", "Noto Sans", "Open Dyslexic"}},
|
||||
{"Reader Font Size", SettingType::ENUM, &CrossPointSettings::fontSize, {"Small", "Medium", "Large", "X Large"}},
|
||||
{"Reader Line Spacing", SettingType::ENUM, &CrossPointSettings::lineSpacing, {"Tight", "Normal", "Wide"}},
|
||||
{"Bluetooth", SettingType::TOGGLE, &CrossPointSettings::bluetoothEnabled, {}},
|
||||
{"Check for updates", SettingType::ACTION, nullptr, {}},
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user