19 Commits
artix ... tmp

Author SHA1 Message Date
c6371cc151 packagechooser: kill test for now 2025-01-09 19:38:44 +01:00
678aeeba58 rm pacckagechooserq 2024-12-05 22:50:26 +01:00
8009e357ed upd packagechooser 2024-12-05 22:48:22 +01:00
0f242c944a fix artix-next branding 2024-05-16 20:44:42 +02:00
e04b3b69e8 scripts: fix config switcher 2024-05-16 20:23:35 +02:00
277603cf60 hold back gtk3 for later 2024-03-04 22:02:08 +02:00
2cce754737 fix wayland/x11 $DISPLAY 2024-03-04 21:53:22 +02:00
23edb4e685 bump ver 2024-03-04 01:01:13 +01:00
63be1deec3 cmake: add AppstreamHelper 2024-03-04 00:52:23 +01:00
09edbfeffb Merge branch 'calamares' into artix 2024-03-04 00:45:53 +01:00
dd1a91fbbd upd .gitignore 2024-03-04 00:43:52 +01:00
559daeaa53 [packagechooser*] Modernize linking with dependencies 2024-03-04 00:42:08 +01:00
8d56cc49df fix slideshow early start 2024-02-08 18:14:21 +02:00
80ca6b23eb minor tweaks 2024-02-08 17:05:41 +02:00
f75efc73a0 resize ridiculously large map 2024-02-08 01:27:16 +02:00
9c0c5ea291 fix slide order and adjust initial window size 2024-02-08 01:12:23 +02:00
767a7bac29 Merge pull request 'artix' (#2) from nous/calamares-extensions:artix into artix
Reviewed-on: artix/calamares-extensions#2
2024-02-07 23:19:04 +01:00
Adriaan de Groot
47cda51f8f CHANGES: post-release housekeeping 2024-01-15 23:45:28 +01:00
Adriaan de Groot
18e68245c1 CMake: be more verbose when looking for Calamares 2024-01-15 21:39:01 +01:00
27 changed files with 88 additions and 986 deletions

2
.gitignore vendored
View File

@@ -7,4 +7,4 @@ build/
*.qmlc
b.sh
modules/netinstall/
modules/packages/
#modules/packages/

13
CHANGES
View File

@@ -6,6 +6,19 @@ This is the changelog for Calamares-Extensions. For each release, the major
changes and contributors are listed. Note that Calamares-Extensions does not
have a historical changelog -- this log starts with version 1.0.0.
# 3.3.1 (2024-01-15)
This is the first *calamares-extensions* release to go with a Calamares 3.3
release. The extensions now require Calamares 3.3. There is a branch for
3.2 legacy support but no releases are planned for it. The main reason
for this release is to have a 3.3-compatible release of *-extensions* at all.
This release contains contributions from (alphabetically by first name):
- Adriaan de Groot
- Anke Boersma
- undef
# 1.3.2 (2023-08-28)
We skipped a couple of releases in the release-notes, then tagged

View File

@@ -43,7 +43,7 @@
#
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set( CALAMARES_EXTENSIONS_VERSION 3.3.1 )
set( CALAMARES_EXTENSIONS_VERSION 3.3.5 )
include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake )
if ( CMAKE_SCRIPT_MODE_FILE )
@@ -86,9 +86,11 @@ set_package_properties(
# consumers by loading the developer's config from a build
# directory (which doesn't have the rest of the config
# installed inside it).
set( CALAMARES_VERSION_REQUIRED 3.3.1 )
set( CALAMARES_VERSION_REQUIRED 3.3.5 )
message(STATUS "Looking for Calamares system-wide")
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY)
if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui)
message(STATUS "Looking for Calamares in the package registry")
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} REQUIRED)
endif()
@@ -161,7 +163,6 @@ calamares_add_module_subdirectory( modules/basestrap LIST_SKIPPED_MODULES )
calamares_add_module_subdirectory( modules/services-artix LIST_SKIPPED_MODULES )
calamares_add_module_subdirectory( modules/postcfg LIST_SKIPPED_MODULES )
calamares_add_module_subdirectory( modules/packagechooser LIST_SKIPPED_MODULES )
calamares_add_module_subdirectory( modules/packagechooserq LIST_SKIPPED_MODULES )
message(STATUS "Calamares extensions ${CALAMARES_EXTENSIONS_VERSION} for Calamares version ${Calamares_VERSION}")

View File

@@ -30,7 +30,7 @@ strings:
images:
productBanner: "artix-banner.png"
productLogo: "artix-logo.svg"
productIcon: "artix-icon.svg"
productIcon: "artix-icon.png"
productWelcome: "languages.png"
slideshow: "show.qml"

View File

@@ -48,7 +48,7 @@ windowExpanding: normal
# This setting is ignored if "fullscreen" is selected for
# *windowExpanding*, above. If not set, use constants defined
# in CalamaresUtilsGui, 800x520.
windowSize: 1000px,800px
windowSize: 1100px,700px
# Placement of Calamares window. Either "center" or "free".
# Whether "center" actually works does depend on the window
@@ -216,7 +216,7 @@ slideshow: "show.qml"
# the QML components).
#
# An image slideshow does not need to have the API defined.
slideshowAPI: 2
slideshowAPI: 1
# These options are to customize online uploading of logs to pastebins:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 KiB

After

Width:  |  Height:  |  Size: 662 KiB

View File

@@ -177,6 +177,22 @@ Presentation
}
}
Slide {
Image {
source: "background.png"
width: parent.width * 4; height: parent.height * 4
fillMode: Image.Stretch
anchors.centerIn: parent
}
Image {
source: "packages1.png"
width: parent.width * 1.12; height: parent.height * 1.5
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
anchors.verticalCenterOffset: - parent.height / 16
}
}
Slide {
Image {
source: "background.png"
@@ -225,22 +241,6 @@ Presentation
}
}
Slide {
Image {
source: "background.png"
width: parent.width * 4; height: parent.height * 4
fillMode: Image.Stretch
anchors.centerIn: parent
}
Image {
source: "packages2.png"
width: parent.width * 1.12; height: parent.height * 1.5
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
anchors.verticalCenterOffset: - parent.height / 16
}
}
Slide {
Image {
source: "background.png"

View File

@@ -10,9 +10,9 @@ set(_extra_src "")
### OPTIONAL AppData XML support in PackageModel
#
#
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON)
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF)
if(BUILD_APPDATA)
find_package(${qtname} COMPONENTS Xml)
find_package(${qtname} REQUIRED COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
@@ -23,23 +23,7 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
if(BUILD_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ItemAppStream.cpp)
endif()
endif()
include(AppStreamHelper)
calamares_add_plugin(packagechooser
TYPE viewmodule
@@ -59,7 +43,11 @@ calamares_add_plugin(packagechooser
SHARED_LIB
)
# include(CalamaresAddTest)
if(AppStreamQt_FOUND)
target_link_libraries(calamares_viewmodule_packagechooser PRIVATE calamares::appstreamqt)
target_sources(calamares_viewmodule_packagechooser PRIVATE ItemAppStream.cpp)
endif()
# calamares_add_test(
# packagechoosertest
# GUI

View File

@@ -16,7 +16,6 @@
#ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory>
#endif

View File

@@ -7,20 +7,16 @@
*
*/
/** @brief Loading items from AppData XML files.
/** @brief Loading items from AppStream database.
*
* Only used if QtXML is found, implements PackageItem::fromAppData().
* Only used if AppStreamQt is found, implements PackageItem::fromAppStream().
*/
#include "PackageModel.h"
#include "ItemAppStream.h"
#include "locale/TranslationsModel.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
#include <AppStreamQt/image.h>
#include <AppStreamQt/pool.h>
#include <AppStreamQt/screenshot.h>
/// @brief Return number of pixels in a size, for < ordering purposes
static inline quint64
sizeOrder( const QSize& size )

View File

@@ -12,10 +12,28 @@
#include "PackageModel.h"
namespace AppStream
{
class Pool;
} // namespace AppStream
/*
* This weird include mechanism is because an #include line is allowed
* to consist of preprocessor-tokens, which are expanded, and then
* the #include is *re*processed. But if it starts with < or ", then
* preprocessor tokens are not expanded. So we build up a #include <>
* style line with a suitable path -- if we are given a value for
* HAVE_APPSTREAM_HEADERS, that is the directory that the AppStreamQt
* headers live in.
*/
#define CALAMARES_LT <
#define CALAMARES_GT >
#ifndef HAVE_APPSTREAM_HEADERS
#define HAVE_APPSTREAM_HEADERS AppStreamQt
#endif
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/pool.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/image.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/screenshot.h CALAMARES_GT
#undef CALAMARES_LT
#undef CALAMARES_GT
/** @brief Loads an item from AppStream data.
*

View File

@@ -21,7 +21,7 @@
#include <QtTest/QtTest>
QTEST_MAIN( PackageChooserTests )
QTEST_GUILESS_MAIN( PackageChooserTests )
PackageChooserTests::PackageChooserTests() {}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2014 Teo Mrnjavac <teo@kde.org>
SPDX-License-Identifier: GPL-3.0-or-later

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2014 Uri Herrera <uri_herrera@nitrux.in> and others
SPDX-License-Identifier: LGPL-3.0-or-later

View File

@@ -1,69 +0,0 @@
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
# SPDX-License-Identifier: BSD-2-Clause
#
if( NOT Calamares_WITH_QML )
calamares_skip_module( "packagechooserq (QML is not supported in this build)" )
return()
endif()
find_package(${qtname} ${QT_VERSION} CONFIG REQUIRED Core)
# Add optional libraries here
set(USER_EXTRA_LIB)
# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
set(_packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser)
include_directories(${_packagechooser})
### OPTIONAL AppData XML support in PackageModel
#
#
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON)
if(BUILD_APPDATA)
find_package(${qtname} COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
list(APPEND _extra_src ${_packagechooser}/ItemAppData.cpp)
endif()
endif()
### OPTIONAL AppStream support in PackageModel
#
#
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
if(BUILD_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp)
endif()
endif()
calamares_add_plugin(packagechooserq
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
PackageChooserQmlViewStep.cpp
${_packagechooser}/Config.cpp
${_packagechooser}/PackageModel.cpp
${_extra_src}
RESOURCES
packagechooserq${QT_VERSION_SUFFIX}.qrc
LINK_PRIVATE_LIBRARIES
calamaresui
${_extra_libraries}
SHARED_LIB
)

View File

@@ -1,86 +0,0 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "PackageChooserQmlViewStep.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
#include "locale/TranslatableConfiguration.h"
#include "utils/Logger.h"
#include "utils/System.h"
#include "utils/Variant.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageChooserQmlViewStepFactory, registerPlugin< PackageChooserQmlViewStep >(); )
PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent )
: Calamares::QmlViewStep( parent )
, m_config( new Config( this ) )
{
emit nextStatusChanged( true );
}
QString
PackageChooserQmlViewStep::prettyName() const
{
return m_config->prettyName();
}
QString
PackageChooserQmlViewStep::prettyStatus() const
{
//QString option = m_pkgc;
//return tr( "Install option: %1" ).arg( option );
return m_config->prettyStatus();
}
bool
PackageChooserQmlViewStep::isNextEnabled() const
{
return true;
}
bool
PackageChooserQmlViewStep::isBackEnabled() const
{
return true;
}
bool
PackageChooserQmlViewStep::isAtBeginning() const
{
return true;
}
bool
PackageChooserQmlViewStep::isAtEnd() const
{
return true;
}
Calamares::JobList
PackageChooserQmlViewStep::jobs() const
{
Calamares::JobList l;
return l;
}
void
PackageChooserQmlViewStep::onLeave()
{
m_config->updateGlobalStorage();
}
void
PackageChooserQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
m_config->setDefaultId( moduleInstanceKey() );
m_config->setConfigurationMap( configurationMap );
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
}

View File

@@ -1,58 +0,0 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef PACKAGECHOOSERQMLVIEWSTEP_H
#define PACKAGECHOOSERQMLVIEWSTEP_H
// Config from packagechooser module
#include "Config.h"
#include "DllMacro.h"
#include "locale/TranslatableConfiguration.h"
#include "utils/PluginFactory.h"
#include "viewpages/QmlViewStep.h"
#include <QVariantMap>
class Config;
class PackageChooserPage;
class PLUGINDLLEXPORT PackageChooserQmlViewStep : public Calamares::QmlViewStep
{
Q_OBJECT
public:
explicit PackageChooserQmlViewStep( QObject* parent = nullptr );
QString prettyName() const override;
QString prettyStatus() const override;
bool isNextEnabled() const override;
bool isBackEnabled() const override;
bool isAtBeginning() const override;
bool isAtEnd() const override;
//void onActivate() override;
void onLeave() override;
Calamares::JobList jobs() const override;
void setConfigurationMap( const QVariantMap& configurationMap ) override;
QObject* getConfig() override { return m_config; }
private:
Config* m_config;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserQmlViewStepFactory )
#endif // PACKAGECHOOSERQMLVIEWSTEP_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2020 demmm <anke62@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later

View File

@@ -1,304 +0,0 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
import io.calamares.core 1.0
import io.calamares.ui 1.0
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item {
width: parent.width
height: parent.height
Rectangle {
anchors.fill: parent
color: "#f2f2f2"
ButtonGroup {
id: switchGroup
}
Column {
id: column
anchors.centerIn: parent
spacing: 5
Rectangle {
//id: rectangle
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("OpenRC base system.<br/>
Default option.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element1
x: 500
y: 110
width: 187
height: 14
text: qsTr("OpenRC")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element1.checked ? "#3498db" : "#B9B9B9"
border.color: element1.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element1.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element1.down ? "#cccccc" : "#ffffff"
border.color: element1.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "openrc"
}
}
}
Image {
id: image1
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Dinit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("Dinit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element2.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "dinit"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Runit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element3
x: 500
y: 110
width: 187
height: 14
text: qsTr("Runit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element3.checked ? "#3498db" : "#B9B9B9"
border.color: element3.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element3.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element3.down ? "#cccccc" : "#ffffff"
border.color: element3.checked ? (element3.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "runit"
}
}
}
Image {
id: image3
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("S6 base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element4
x: 500
y: 110
width: 187
height: 14
text: qsTr("S6")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element4.checked ? "#3498db" : "#B9B9B9"
border.color: element4.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element4.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element4.down ? "#cccccc" : "#ffffff"
border.color: element4.checked ? (element4.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "s6"
}
}
}
Image {
id: image4
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 25
color: "#f2f2f2"
border.width: 0
Text {
height: 25
anchors.centerIn: parent
text: qsTr("Please select an option for your install, or use the default: OpenRC.")
font.pointSize: 10
wrapMode: Text.WordWrap
}
}
}
}
}

View File

@@ -1,6 +0,0 @@
<RCC>
<qresource>
<file alias="packagechooserq.qml">packagechooserq-qt6.qml</file>
<file>images/if.png</file>
</qresource>
</RCC>

View File

@@ -1,66 +0,0 @@
# SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0
#
# Configuration for the low-density software chooser, QML implementation
#
# The example QML implementation uses single-selection, rather than
# a model for the available packages. That makes it simpler: the
# QML itself codes the available options, descriptions and images
# -- after all, this is **low density** selection, so a custom UI
# can make sense for the few choices that need to be made.
#
#
---
# Software installation method:
#
# - "legacy" or "custom" or "contextualprocess"
# When set to "legacy", writes a GlobalStorage value for the choice that
# has been made. The key is *packagechooser_<id>*. The module's
# instance name is used; see the *instances* section of `settings.conf`.
# If there is just one packagechooserq module, and no special instance is set,
# resulting GS key is probably *packagechooser_packagechooserq*.
# (Do note that the prefix of the GS key remains "packagechooser_")
#
# The GS value is a comma-separated list of the IDs of the selected
# packages, or an empty string if none is selected.
#
# With "legacy" installation, you should have a contextualprocess or similar
# module somewhere in the `exec` phase to process the GlobalStorage key
# and actually **do** something for the packages.
#
# - "packages"
# When set to "packages", writes GlobalStorage values suitable for
# consumption by the *packages* module (which should appear later
# in the `exec` section. These package settings will then be handed
# off to whatever package manager is configured there.
#
# There is no need to put this module in the `exec` section. There
# are no jobs that this module provides. You should put **other**
# modules, either *contextualprocess* or *packages* or some custom
# module, in the `exec` section to do the actual work.
#
method: legacy
# Human-visible strings in this module. These are all optional.
# The following translated keys are used:
# - *step*, used in the overall progress view (left-hand pane)
#
# Each key can have a [locale] added to it, which is used as
# the translated string for that locale. For the strings
# associated with the "no-selection" item, see *items*, below
# with the explicit item-*id* "".
#
labels:
step: "Packages"
step[nl]: "Pakketten"
# The *packageChoice* value is used for setting the default selection
# in the QML view; this should match one of the keys used in the QML
# module for package names.
#
# (e.g. the sample QML uses "no_office_suite", "minimal_install" and
# "libreoffice" as possible choices).
#
packageChoice: libreoffice

View File

@@ -1,304 +0,0 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
import io.calamares.core 1.0
import io.calamares.ui 1.0
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
Item {
width: parent.width
height: parent.height
Rectangle {
anchors.fill: parent
color: "#f2f2f2"
ButtonGroup {
id: switchGroup
}
Column {
id: column
anchors.centerIn: parent
spacing: 5
Rectangle {
//id: rectangle
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("OpenRC base system.<br/>
Default option.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element1
x: 500
y: 110
width: 187
height: 14
text: qsTr("OpenRC")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element1.checked ? "#3498db" : "#B9B9B9"
border.color: element1.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element1.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element1.down ? "#cccccc" : "#ffffff"
border.color: element1.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "openrc"
}
}
}
Image {
id: image1
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Dinit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("Dinit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element2.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "dinit"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Runit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element3
x: 500
y: 110
width: 187
height: 14
text: qsTr("Runit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element3.checked ? "#3498db" : "#B9B9B9"
border.color: element3.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element3.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element3.down ? "#cccccc" : "#ffffff"
border.color: element3.checked ? (element3.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "runit"
}
}
}
Image {
id: image3
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("S6 base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element4
x: 500
y: 110
width: 187
height: 14
text: qsTr("S6")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element4.checked ? "#3498db" : "#B9B9B9"
border.color: element4.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element4.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element4.down ? "#cccccc" : "#ffffff"
border.color: element4.checked ? (element4.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "s6"
}
}
}
Image {
id: image4
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/if.png"
}
}
Rectangle {
width: 700
height: 25
color: "#f2f2f2"
border.width: 0
Text {
height: 25
anchors.centerIn: parent
text: qsTr("Please select an option for your install, or use the default: OpenRC.")
font.pointSize: 10
wrapMode: Text.WordWrap
}
}
}
}
}

View File

@@ -1,6 +0,0 @@
<RCC>
<qresource>
<file>packagechooserq.qml</file>
<file>images/if.png</file>
</qresource>
</RCC>

View File

@@ -1,35 +1,19 @@
#!/bin/bash
export XAUTHCOOKIE=$XAUTHORITY
readonly conf=/etc/calamares-config-switcher.conf
online_text='<span font="Roboto Regular 12"><b>Online</b> method lets you choose your desktop and most of your system components. It requires a (fast) internet connection and you get the most up-to-date software.
It may lead to incorrectly configured and even unbootable system, if the user makes wrong choices or the internet connection fails.
<b>Still experimental.</b></span>:LBL'
offline_text='<span font="Roboto Regular 12"><b>Offline</b> method copies this awesome live image to your disk. It is faster and immune to user errors.
Choose this if even slightly unsure; you can update at any time after installation.
You know what they say about red buttons.
<b>Seriously, choose offline.</b></span>:LBL'
online_icon='/etc/calamares-online/network-online.svg'
offline_icon='/etc/calamares-offline/network-offline.svg'
online_button='<span foreground="red" font="Roboto Bold 14"> Online</span>!'$online_icon'!:5'
offline_button='<span foreground="lime" font="Roboto Bold 14"> Offline</span>!'$offline_icon'!:7'
yad --center --on-top --form --window-icon='/usr/share/icons/artix/logo.svg' --height=384 --width=768 \
--title='Choose installation method' --image='/usr/share/icons/breeze-dark/apps/48/calamares.svg' \
--text-align='center' --text='<span font="Roboto Bold 14">Choose installation method\n\n</span>' \
--columns=2 --borders=10 --homogeneous --scroll --buttons-layout='spread' \
--field="$online_text" --field="$offline_text" --button="$online_button" --button="$offline_button"
if [ $? -eq 5 ]; then
mode='online'
else
mode='offline'
if [[ -f "${conf}" ]]; then
# shellcheck source=/etc/calamares-config-switcher.conf
. "${conf}"
fi
pkexec ln -snf /etc/calamares-"$mode" /etc/calamares
pkexec env DISPLAY=:0 XAUTHORITY=$XAUTHCOOKIE QT_QPA_PLATFORMTHEME=gtk2 calamares "$@"
title=${title:-"Switcher"}
text=${text:-"Select:"}
if [[ -z "${configs[*]}" ]]; then
configs=(online offline)
fi
select=$(kdialog --title "${title}" --combobox "${text}" "${configs[@]}" --default "${configs[0]}")
pkexec ln -snf /etc/calamares-"$select" /etc/calamares
pkexec calamares "$@"