From 8246209a7eb11f357208f6183ea5661d02311cb2 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Mon, 28 Sep 2026 16:56:45 +0200 Subject: [PATCH] feat: The Steamify page's Summary line shows the chosen items' labels and where it starts, not raw ids (patch on packagechooserq, applied by build-calamares-modules.sh) --- build-calamares-modules.sh | 4 +- .../packagechooserq-steamify-summary.patch | 74 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 patches/packagechooserq-steamify-summary.patch diff --git a/build-calamares-modules.sh b/build-calamares-modules.sh index 6cc6eb2..95fdf66 100755 --- a/build-calamares-modules.sh +++ b/build-calamares-modules.sh @@ -14,7 +14,7 @@ dest=archiso/airootfs/usr/lib/calamares/modules/packagechooserq src_url=https://github.com/CachyOS/cachyos-calamares/archive/refs/heads/cachyos.tar.gz pacman -S --needed --noconfirm cachyos-calamares-next cmake extra-cmake-modules \ - qt6-declarative qt6-tools qt6-svg kcoreaddons yaml-cpp base-devel >/dev/null + qt6-declarative qt6-tools qt6-svg kcoreaddons yaml-cpp base-devel patch >/dev/null work="$(mktemp -d)" mkdir -p "$work/src" "$work/cmake" # The module and the packagechooser sources it shares (Config, PackageModel), @@ -24,6 +24,8 @@ tar -xzf "$work/calamares.tar.gz" --strip-components=3 -C "$work/src" \ cachyos-calamares-cachyos/src/modules/packagechooserq cachyos-calamares-cachyos/src/modules/packagechooser tar -xzf "$work/calamares.tar.gz" --strip-components=2 -C "$work/cmake" \ cachyos-calamares-cachyos/CMakeModules/AppStreamHelper.cmake +# The Steamify page's Summary line shows labels instead of ids. +patch -s -d "$work/src" -p1 < patches/packagechooserq-steamify-summary.patch # KF6CoreAddons before Calamares: Calamares' CMake config needs its target. cat > "$work/src/CMakeLists.txt" << EOF cmake_minimum_required(VERSION 3.16) diff --git a/patches/packagechooserq-steamify-summary.patch b/patches/packagechooserq-steamify-summary.patch new file mode 100644 index 0000000..5c677b7 --- /dev/null +++ b/patches/packagechooserq-steamify-summary.patch @@ -0,0 +1,74 @@ +diff -ruN a/packagechooserq/PackageChooserQmlViewStep.cpp b/packagechooserq/PackageChooserQmlViewStep.cpp +--- a/packagechooserq/PackageChooserQmlViewStep.cpp 2026-09-28 16:56:21 ++++ b/packagechooserq/PackageChooserQmlViewStep.cpp 2026-09-28 16:56:21 +@@ -17,6 +17,12 @@ + #include "utils/System.h" + #include "utils/Variant.h" + ++#include ++#include ++#include ++#include ++#include ++ + CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageChooserQmlViewStepFactory, registerPlugin< PackageChooserQmlViewStep >(); ) + + PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent ) +@@ -35,9 +41,54 @@ + QString + PackageChooserQmlViewStep::prettyStatus() const + { +- //QString option = m_pkgc; +- //return tr( "Install option: %1" ).arg( option ); +- return m_config->prettyStatus(); ++ // Steamify page (steammachine-cachyos-live-iso): its choice is Steamify's ++ // item ids ("boot" = start in the desktop, "none" = nothing on); show ++ // their labels, from the rows calamares-online.sh writes next to the ++ // page, instead of the raw ids. Any other use keeps the stock text. ++ const QString choice = m_config->packageChoice(); ++ QFile rows( QStringLiteral( "/usr/local/share/steamify/qml/items.json" ) ); ++ if ( moduleInstanceKey().id() != QStringLiteral( "steamifypage" ) || choice.isEmpty() ++ || !rows.open( QIODevice::ReadOnly ) ) ++ { ++ return m_config->prettyStatus(); ++ } ++ QHash< QString, QString > labels; ++ const auto items = QJsonDocument::fromJson( rows.readAll() ).array(); ++ for ( const auto& item : items ) ++ { ++ const auto row = item.toObject(); ++ labels.insert( row.value( QStringLiteral( "id" ) ).toString(), ++ row.value( QStringLiteral( "label" ) ).toString() ); ++ } ++ if ( labels.isEmpty() ) ++ { ++ return m_config->prettyStatus(); ++ } ++ QStringList on; ++ bool desktop = false, gaming = false; ++ for ( const auto& part : choice.split( QLatin1Char( ',' ) ) ) ++ { ++ const QString id = part.trimmed(); ++ if ( id.isEmpty() || id == QStringLiteral( "none" ) ) ++ { ++ continue; ++ } ++ if ( id == QStringLiteral( "boot" ) ) ++ { ++ desktop = true; ++ continue; ++ } ++ gaming = gaming || id == QStringLiteral( "gaming" ); ++ on << labels.value( id, id ).toHtmlEscaped(); ++ } ++ QString status = on.isEmpty() ? tr( "Steamify: nothing" ) ++ : tr( "Steamify: %1" ).arg( on.join( QStringLiteral( ", " ) ) ); ++ if ( gaming ) ++ { ++ status += QStringLiteral( "
" ) ++ + ( desktop ? tr( "Starts in: the desktop" ) : tr( "Starts in: gaming mode" ) ); ++ } ++ return status; + } + + bool