Kiosk: add a data-driven System Settings menu
Settings now shows Proclamations, Audio Options, System Settings, System Logs, and Back. The new SystemSettingsPage groups Email Address, License Key, WiFi Setup, Time Zone Setup, and Date Format, driven by the pure settings::systemSettingEntries() list so future entries need one row, not new menu plumbing. Adds unit tests for the entry list.
This commit is contained in:
+7
-28
@@ -2,14 +2,10 @@
|
||||
#include "app_state.h"
|
||||
#include "home.h"
|
||||
#include "license_blocked_page.h"
|
||||
#include "wifi_setup_page.h"
|
||||
#include "audio_settings_page.h"
|
||||
#include "timezone_page.h"
|
||||
#include "system_settings_page.h"
|
||||
#include "log_viewer_page.h"
|
||||
#include "proclamation_options_page.h"
|
||||
#include "email_address_page.h"
|
||||
#include "license_key_page.h"
|
||||
#include "date_format_page.h"
|
||||
#include "logical_size.h"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
@@ -18,18 +14,13 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
constexpr int MENU_ITEM_COUNT = 9;
|
||||
// 0 = Proclamations, 1 = Audio Options, 2 = Email Address, 3 = License Key,
|
||||
// 4 = WiFi Setup, 5 = Time Zone Setup, 6 = Date Format,
|
||||
// 7 = System Logs, 8 = Back
|
||||
constexpr int MENU_ITEM_COUNT = 5;
|
||||
// 0 = Proclamations, 1 = Audio Options, 2 = System Settings,
|
||||
// 3 = System Logs, 4 = Back
|
||||
constexpr const char *MENU_LABELS[MENU_ITEM_COUNT] = {
|
||||
"Proclamations",
|
||||
"Audio Options",
|
||||
"Email Address",
|
||||
"License Key",
|
||||
"WiFi Setup",
|
||||
"Time Zone Setup",
|
||||
"Date Format",
|
||||
"System Settings",
|
||||
"System Logs",
|
||||
"Back to Home",
|
||||
};
|
||||
@@ -92,24 +83,12 @@ void Settings::handleEvent(const SDL_Event &event)
|
||||
state_->pages.push(*state_, std::make_unique<AudioSettingsPage>());
|
||||
break;
|
||||
case 2:
|
||||
state_->pages.push(*state_, std::make_unique<EmailAddressPage>());
|
||||
state_->pages.push(*state_, std::make_unique<SystemSettingsPage>());
|
||||
break;
|
||||
case 3:
|
||||
state_->pages.push(*state_, std::make_unique<LicenseKeyPage>());
|
||||
break;
|
||||
case 4:
|
||||
state_->pages.push(*state_, std::make_unique<WiFiSetupPage>());
|
||||
break;
|
||||
case 5:
|
||||
state_->pages.push(*state_, std::make_unique<TimeZonePage>());
|
||||
break;
|
||||
case 6:
|
||||
state_->pages.push(*state_, std::make_unique<DateFormatPage>());
|
||||
break;
|
||||
case 7:
|
||||
state_->pages.push(*state_, std::make_unique<LogViewerPage>());
|
||||
break;
|
||||
case 8:
|
||||
case 4:
|
||||
state_->pages.replace(*state_, std::make_unique<Home>());
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user