From 04ea541aacd4d87e7118d476a0029c11abacf029 Mon Sep 17 00:00:00 2001 From: No0ne558 Date: Fri, 23 Jan 2026 12:56:34 -0800 Subject: [PATCH] Remove automatic creation of system page -94 - Eliminated code that creates page -94 template for Index with Tabs - Simplified page 60 creation to use default template - Prevents 'Can't delete page -94' errors - Updated changelog.md with details --- docs/changelog.md | 13 +++++++- zone/zone.cc | 77 ++++++----------------------------------------- 2 files changed, 22 insertions(+), 68 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 12047428..014f07ba 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -31,7 +31,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - **Impact**: Split check interface now provides clean, simple, and functional experience with clear visual feedback, proper pricing display, and intuitive manual item selection ### Fixed -- **Split Check Interface: Enhanced Button Display and Usability (2026-01-20)** +- **Removed Automatic Creation of System Page -94 (2026-01-23)** + - Eliminated the automatic creation of page -94 (Index with Tabs template) that was causing "Can't delete page -94" errors + - **Changes Made**: + - Removed the code that creates page -94 for all screen resolutions during ZoneDB initialization + - Simplified page 60 creation to use a default template instead of copying from page -94 + - **Root Cause**: System was automatically creating page -94 as a template for Index with Tabs pages, but this page couldn't be deleted, causing user confusion and errors + - **Solution**: + - Removed the template creation loop in ZoneDB::Init() + - Modified page 60 creation to always use a basic default configuration + - **Files modified**: + - `zone/zone.cc` (removed page -94 creation code and simplified page 60 creation) + - **Impact**: Prevents "Can't delete page -94" errors and reduces system complexity by removing unnecessary template pages - Improved the split check zone interface for better readability and user experience - **Changes Made**: - Added dynamic font responsiveness - buttons now properly inherit font sizes from zone settings diff --git a/zone/zone.cc b/zone/zone.cc index f7a5d752..f6a03c1b 100644 --- a/zone/zone.cc +++ b/zone/zone.cc @@ -1260,33 +1260,7 @@ int ZoneDB::Init() p = p->next; } - // Ensure template page -94 exists for Index with Tabs (create first so it can be used as template) - int sizes[] = {SIZE_640x480, SIZE_800x600, SIZE_1024x600, SIZE_1024x768, - SIZE_1280x800, SIZE_1280x1024, SIZE_1366x768, SIZE_1440x900, - SIZE_1600x900, SIZE_1680x1050, SIZE_1920x1080, SIZE_1920x1200, -1}; - for (int i = 0; sizes[i] != -1; ++i) - { - Page *page94 = FindByID(-94, sizes[i]); - if (page94 == nullptr) - { - // Create template page -94 for Index with Tabs - Page *newPage = NewPosPage(); - if (newPage) - { - newPage->id = -94; - newPage->type = PAGE_INDEX_WITH_TABS; - newPage->size = static_cast(sizes[i]); - newPage->name.Set("Index with Tabs Template"); - newPage->index = INDEX_GENERAL; - newPage->Init(this); - Add(newPage); - } - } - } - // Ensure default Index page (page 60) exists for 1920x1080 only - // Use page -94 as template if available - // Check for exact size match, not just max_size Page *page60 = nullptr; Page *currPage = page_list.Head(); while (currPage != nullptr) @@ -1301,48 +1275,17 @@ int ZoneDB::Init() if (page60 == nullptr) { - // Try to use page -94 as template (check for exact size match) - Page *templatePage = nullptr; - currPage = page_list.Head(); - while (currPage != nullptr) + // Create default Index page on page 60 + Page *newPage = NewPosPage(); + if (newPage) { - if (currPage->id == -94 && currPage->size == SIZE_1920x1080) - { - templatePage = currPage; - break; - } - currPage = currPage->next; - } - - if (templatePage != nullptr) - { - // Copy from template page -94 - auto pageCopy = templatePage->Copy(); - if (pageCopy) - { - pageCopy->id = 60; - pageCopy->type = PAGE_INDEX; // Ensure it's PAGE_INDEX, not PAGE_INDEX_WITH_TABS - pageCopy->size = SIZE_1920x1080; // Ensure exact size - pageCopy->name.Set("Index"); - pageCopy->index = INDEX_GENERAL; - pageCopy->Init(this); - Add(pageCopy.release()); - } - } - else - { - // Create default Index page on page 60 if no template exists - Page *newPage = NewPosPage(); - if (newPage) - { - newPage->id = 60; - newPage->type = PAGE_INDEX; - newPage->size = SIZE_1920x1080; - newPage->name.Set("Index"); - newPage->index = INDEX_GENERAL; - newPage->Init(this); - Add(newPage); - } + newPage->id = 60; + newPage->type = PAGE_INDEX; + newPage->size = SIZE_1920x1080; + newPage->name.Set("Index"); + newPage->index = INDEX_GENERAL; + newPage->Init(this); + Add(newPage); } }