From 4b847dae690703a7893dff6a8e4b6e8251d29eb7 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 9 Oct 2023 10:31:02 -0500 Subject: [PATCH] Add the UI for Package Select, allowing for fine-tuned customization of the installed system. --- common/modules/pkgselect/CMakeLists.txt | 24 +++ .../pkgselect/PackageSelectViewStep.cpp | 29 +++ .../modules/pkgselect/PackageSelectViewStep.h | 28 +++ common/modules/pkgselect/pkgselect.qml | 168 ++++++++++++++++++ common/modules/pkgselect/pkgselect.qrc | 5 + debian/changelog | 2 + debian/control | 16 +- debian/rules | 21 ++- lubuntu/settings.conf | 1 + 9 files changed, 288 insertions(+), 6 deletions(-) create mode 100644 common/modules/pkgselect/CMakeLists.txt create mode 100644 common/modules/pkgselect/PackageSelectViewStep.cpp create mode 100644 common/modules/pkgselect/PackageSelectViewStep.h create mode 100644 common/modules/pkgselect/pkgselect.qml create mode 100644 common/modules/pkgselect/pkgselect.qrc diff --git a/common/modules/pkgselect/CMakeLists.txt b/common/modules/pkgselect/CMakeLists.txt new file mode 100644 index 0000000..4ca8a25 --- /dev/null +++ b/common/modules/pkgselect/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) + +set( CMAKE_CXX_STANDARD 17 ) +set( CMAKE_CXX_STANDARD_REQUIRED ON ) + +set( CALAMARES_VERSION_REQUIRED 3.3.0 ) +find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY) +if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui) + find_package(Calamares ${CALAMARES_VERSION_REQUIRED} REQUIRED) +endif() + +message(STATUS "Found Calamares version ${Calamares_VERSION}") +message(STATUS " libraries ${Calamares_LIB_DIRS}") +message(STATUS "") + +calamares_add_plugin( pkgselect + TYPE viewmodule + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + PackageSelectViewStep.cpp + RESOURCES + pkgselect.qrc + SHARED_LIB +) diff --git a/common/modules/pkgselect/PackageSelectViewStep.cpp b/common/modules/pkgselect/PackageSelectViewStep.cpp new file mode 100644 index 0000000..8cab8b0 --- /dev/null +++ b/common/modules/pkgselect/PackageSelectViewStep.cpp @@ -0,0 +1,29 @@ +#include "PackageSelectViewStep.h" + +PackageSelectViewStep::PackageSelectViewStep( QObject* parent ) + : Calamares::QmlViewStep( parent ) +{ +} + +PackageSelectViewStep::~PackageSelectViewStep() {} + +QString +PackageSelectViewStep::prettyName() const +{ + return tr( "Package Selection" ); +} + +void +PackageSelectViewStep::setConfigurationMap( const QVariantMap& configurationMap ) +{ + Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last +} + +void +PackageSelectViewStep::onLeave() +{ + Calamares::GlobalStorage* globalStorage = Calamares::JobQueue::instance()->globalStorage(); + globalStorage->insert( "item3", 3 ); +} + +CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageSelectViewStepFactory, registerPlugin< PackageSelectViewStep >(); ) diff --git a/common/modules/pkgselect/PackageSelectViewStep.h b/common/modules/pkgselect/PackageSelectViewStep.h new file mode 100644 index 0000000..e6ca32c --- /dev/null +++ b/common/modules/pkgselect/PackageSelectViewStep.h @@ -0,0 +1,28 @@ +#ifndef PACKAGESELECTVIEWSTEP_H +#define PACKAGESELECTVIEWSTEP_H + +#include "DllMacro.h" +#include "utils/PluginFactory.h" +#include "viewpages/QmlViewStep.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" + +class PLUGINDLLEXPORT PackageSelectViewStep : public Calamares::QmlViewStep +{ + Q_OBJECT + +public: + PackageSelectViewStep( QObject* parent = nullptr ); + virtual ~PackageSelectViewStep() override; + + QString prettyName() const override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; + + void onLeave() override; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageSelectViewStepFactory ) + +#endif diff --git a/common/modules/pkgselect/pkgselect.qml b/common/modules/pkgselect/pkgselect.qml new file mode 100644 index 0000000..0e721ff --- /dev/null +++ b/common/modules/pkgselect/pkgselect.qml @@ -0,0 +1,168 @@ +import io.calamares.ui 1.0 + +import QtQuick 2.7 +import QtQuick.Controls 2.2 +import QtQuick.Window 2.2 +import QtQuick.Layouts 1.3 +import QtQuick.Controls.Material 2.1 + +Item { + ColumnLayout { + scale: 0.9 + + Text { + text: qsTr("What apps would you like to start with?") + font.bold: true + font.pointSize: 14 + } + RadioButton { + checked: true + text: qsTr("Normal Installation") + font.pointSize: 12 + indicator.width: 20 + indicator.height: 20 + } + Text { + text: qsTr("Web browser, utilities, office software, games, and media players.") + font.pointSize: 10 + font.italic: true + } + RadioButton { + text: qsTr("Minimal Installation") + font.pointSize: 12 + indicator.width: 20 + indicator.height: 20 + } + Text { + text: qsTr("Only the desktop environment.") + font.pointSize: 10 + font.italic: true + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: "grey" + } + + Text { + text: qsTr("Additional Options") + font.bold: true + font.pointSize: 14 + } + CheckBox { + text: qsTr("Download updates following installation") + font.pointSize: 12 + indicator.width: 20 + indicator.height: 20 + } + Text { + text: qsTr("This saves time after the installation, and keeps your system secure.") + font.pointSize: 10 + font.italic: true + } + CheckBox { + text: qsTr("Install third-party software for graphics, WiFi hardware, and additional media formats") + font.pointSize: 12 + indicator.width: 20 + indicator.height: 20 + } + Text { + text: qsTr("This software is subject to license terms included with its documentation, and some may be proprietary.") + font.pointSize: 10 + font.italic: true + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: "grey" + } + + Text { + text: qsTr("Install additional third-party packages:") + font.bold: true + font.pointSize: 14 + } + Flickable { + Layout.fillWidth: true + height: 225 + contentHeight: column.height + clip: true + + Column { + id: column + width: parent.width + + CheckBox { + text: qsTr("Element") + objectName: "element" + font.pointSize: 11 + indicator.width: 18 + indicator.height: 18 + } + Text { + text: qsTr("Matrix-based end-to-end encrypted messenger and secure collaboration app") + font.italic: true + font.pointSize: 10 + } + CheckBox { + text: qsTr("Thunderbird") + objectName: "thunderbird" + font.pointSize: 11 + indicator.width: 18 + indicator.height: 18 + } + Text { + text: qsTr("Email, newsfeed, chat, and calendaring client") + font.italic: true + font.pointSize: 10 + } + CheckBox { + text: qsTr("VSCodium") + objectName: "vscodium" + font.pointSize: 11 + indicator.width: 18 + indicator.height: 18 + } + Text { + text: qsTr("Code editor redefined and optimized for building and debugging modern web and cloud applications") + font.italic: true + font.pointSize: 10 + } + CheckBox { + text: qsTr("Virtual Machine Manager") + objectName: "virt-manager" + font.pointSize: 11 + indicator.width: 18 + indicator.height: 18 + } + Text { + text: qsTr("Desktop user interface for managing virtual machines through libvirt") + font.italic: true + font.pointSize: 10 + } + CheckBox { + text: qsTr("Krita") + objectName: "krita" + font.pointSize: 11 + indicator.width: 18 + indicator.height: 18 + } + Text { + text: qsTr("Graphics editor designed primarily for digital art and 2D animation") + font.italic: true + font.pointSize: 10 + } + } + ScrollBar.vertical: ScrollBar { + active: true + } + } + Text { + text: qsTr("Note: third-party packages are provided by outside vendors and are not officially supported in any way. Use at your own risk.") + font.bold: true + font.pointSize: 10 + } + } +} diff --git a/common/modules/pkgselect/pkgselect.qrc b/common/modules/pkgselect/pkgselect.qrc new file mode 100644 index 0000000..0fb3a0d --- /dev/null +++ b/common/modules/pkgselect/pkgselect.qrc @@ -0,0 +1,5 @@ + + + pkgselect.qml + + diff --git a/debian/changelog b/debian/changelog index 38befa7..794149d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ calamares-settings-ubuntu (1:24.04.1) UNRELEASED; urgency=medium * Fix Vcs-*. + * Add a Package Select module, allowing for fine-tuned customization of the + installed system. -- Simon Quigley Sun, 08 Oct 2023 22:02:44 -0500 diff --git a/debian/control b/debian/control index 19fb489..1497be5 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,18 @@ Section: devel Priority: optional Maintainer: Lubuntu Developers Uploaders: Simon Quigley -Build-Depends: debhelper-compat (= 13), intltool, qttools5-dev-tools +Build-Depends: calamares, + cmake, + debhelper-compat (= 13), + extra-cmake-modules, + intltool, + libkf5coreaddons-dev, + libqt5svg5-dev, + libyaml-cpp-dev, + qtbase5-dev, + qtdeclarative5-dev, + qttools5-dev, + qttools5-dev-tools Standards-Version: 4.6.2 Homepage: https://code.launchpad.net/~ubuntu-qt-code/+git/calamares-settings-ubuntu Vcs-Git: https://git.launchpad.net/~ubuntu-qt-code/+git/calamares-settings-ubuntu @@ -31,7 +42,8 @@ Depends: calamares (>= 3.2.14~), qml-module-qtquick-window2, qml-module-qtquick2, squashfs-tools, - ${misc:Depends} + ${misc:Depends}, + ${shlibs:Depends} Description: Common Calamares Settings This package contains the common Calamares settings for all flavors. There is also a automirror Python script to set sources based on diff --git a/debian/rules b/debian/rules index b5fd664..4fe3746 100755 --- a/debian/rules +++ b/debian/rules @@ -1,16 +1,29 @@ #!/usr/bin/make -f DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +PKGSELECT = "common/modules/pkgselect" +MODULES_DIR = "debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/calamares/modules" %: dh $@ +override_dh_auto_configure: + cd $(PKGSELECT) && mkdir build && cd build && cmake .. + +override_dh_auto_build: + make; + cd $(PKGSELECT)/build && $(MAKE) + +override_dh_auto_install: + cd $(PKGSELECT)/build && $(MAKE) DESTDIR=$(CURDIR)/debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/ install + override_dh_missing: dh_missing - mkdir -pv debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/calamares/modules - cp -vr common/modules/automirror debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/calamares/modules + cp -v common/modules/pkgselect/pkgselect.qml debian/calamares-settings-lubuntu/etc/calamares/branding/lubuntu/pkgselect.qml + mkdir -pv $(MODULES_DIR) + cp -vr common/modules/automirror $(MODULES_DIR) mkdir -pv debian/calamares-settings-ubuntu-common/etc/calamares/modules cp -vr common/modules/*.conf debian/calamares-settings-ubuntu-common/etc/calamares/modules chmod -R 755 debian/calamares-settings-ubuntu-common/usr/lib/ - chmod 644 debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/calamares/modules/automirror/automirror.conf - chmod 644 debian/calamares-settings-ubuntu-common/usr/lib/$(DEB_HOST_MULTIARCH)/calamares/modules/automirror/module.desc + chmod 644 $(MODULES_DIR)/automirror/automirror.conf + chmod 644 $(MODULES_DIR)/automirror/module.desc diff --git a/lubuntu/settings.conf b/lubuntu/settings.conf index f9f2115..dbfb9f2 100644 --- a/lubuntu/settings.conf +++ b/lubuntu/settings.conf @@ -26,6 +26,7 @@ sequence: - welcome - locale - keyboard + - pkgselect - partition - users - summary