From 2bd2aaf2366d7767131cfc2695bac99f0f7eee34 Mon Sep 17 00:00:00 2001 From: jpue <94829332+jpue@users.noreply.github.com> Date: Fri, 10 Jan 2025 23:31:46 +0100 Subject: [PATCH] webaccess: show page names of multi-page (solo-) frames --- variables.pri | 2 +- webaccess/res/virtualconsole.js | 3 +- webaccess/src/webaccess.cpp | 107 ++++++++++++++++++++++---------- 3 files changed, 76 insertions(+), 36 deletions(-) diff --git a/variables.pri b/variables.pri index a7c4378904..503894d292 100644 --- a/variables.pri +++ b/variables.pri @@ -216,7 +216,7 @@ macx:USERRGBSCRIPTDIR = $$USERDATADIR/RGBScripts android:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts ios:USERRGBSCRIPTDIR = $$USERDATADIR/RGBScripts -# RGB Scripts +# Web Files win32:WEBFILESDIR = Web unix:!macx:WEBFILESDIR = $$DATADIR/web macx:WEBFILESDIR = $$DATADIR/Web diff --git a/webaccess/res/virtualconsole.js b/webaccess/res/virtualconsole.js index ea4b916f8f..0b5ad374bf 100644 --- a/webaccess/res/virtualconsole.js +++ b/webaccess/res/virtualconsole.js @@ -259,10 +259,11 @@ var framesTotalPages = new Array(); var framesCurrentPage = new Array(); var frameDisableState = new Array(); var frameCaption = new Array(); +var framesPageNames = new Array(); function updateFrameLabel(id) { var framePageObj = document.getElementById("fr" + id + "Page"); - var newLabel = "Page " + (framesCurrentPage[id] + 1); + var newLabel = framesPageNames[id][framesCurrentPage[id]]; framePageObj.innerHTML = newLabel; var frameCaptionObj = document.getElementById("fr" + id + "Caption"); diff --git a/webaccess/src/webaccess.cpp b/webaccess/src/webaccess.cpp index 03105b6095..8e8608f17b 100644 --- a/webaccess/src/webaccess.cpp +++ b/webaccess/src/webaccess.cpp @@ -45,6 +45,7 @@ #include "vcmatrix.h" #include "vclabel.h" #include "vcframe.h" +#include "vcframepageshortcut.h" #include "vcclock.h" #include "vcxypad.h" #include "qlcfile.h" @@ -1050,15 +1051,6 @@ QString WebAccess::getFrameHTML(VCFrame *frame) int cw = 36; // header width int hw = w - pw - ew - cw; - // header caption - QString caption = ""; - if (frame->multipageMode()) { - caption = QString(frame->caption()) != "" - ? QString("%1 - Page: %2").arg(frame->caption()).arg(frame->currentPage() + 1) - : QString("Page: %1").arg(frame->currentPage() + 1); - } else { - caption = QString(frame->caption()); - } QString str = "