forked from artix/calamares-extensions
Compare commits
6 Commits
artix
...
loaderqueu
| Author | SHA1 | Date | |
|---|---|---|---|
| d3a3c6bb04 | |||
| 9729936e2f | |||
| 5225dbff9a | |||
| c831299490 | |||
| 8b1ed58cf2 | |||
| f700653eb9 |
@@ -7,12 +7,15 @@ find_package(${qtname} COMPONENTS Core Gui Widgets REQUIRED)
|
|||||||
set(_extra_libraries "")
|
set(_extra_libraries "")
|
||||||
set(_extra_src "")
|
set(_extra_src "")
|
||||||
|
|
||||||
|
set(_netinstall ${CMAKE_CURRENT_SOURCE_DIR}/../netinstall)
|
||||||
|
include_directories(${_netinstall})
|
||||||
|
|
||||||
### OPTIONAL AppData XML support in PackageModel
|
### 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)
|
if(BUILD_APPDATA)
|
||||||
find_package(${qtname} COMPONENTS Xml)
|
find_package(${qtname} REQUIRED COMPONENTS Xml)
|
||||||
if(TARGET ${qtname}::Xml)
|
if(TARGET ${qtname}::Xml)
|
||||||
add_definitions(-DHAVE_APPDATA)
|
add_definitions(-DHAVE_APPDATA)
|
||||||
list(APPEND _extra_libraries ${qtname}::Xml)
|
list(APPEND _extra_libraries ${qtname}::Xml)
|
||||||
@@ -23,23 +26,7 @@ endif()
|
|||||||
### OPTIONAL AppStream support in PackageModel
|
### OPTIONAL AppStream support in PackageModel
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
|
#include(AppStreamHelper)
|
||||||
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()
|
|
||||||
|
|
||||||
calamares_add_plugin(packagechooser
|
calamares_add_plugin(packagechooser
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
@@ -48,7 +35,10 @@ calamares_add_plugin(packagechooser
|
|||||||
Config.cpp
|
Config.cpp
|
||||||
PackageChooserPage.cpp
|
PackageChooserPage.cpp
|
||||||
PackageChooserViewStep.cpp
|
PackageChooserViewStep.cpp
|
||||||
PackageModel.cpp
|
PackageChooserModel.cpp
|
||||||
|
${_netinstall}/LoaderQueue.cpp
|
||||||
|
${_netinstall}/PackageModel.cpp
|
||||||
|
${_netinstall}/PackageTreeItem.cpp
|
||||||
${_extra_src}
|
${_extra_src}
|
||||||
RESOURCES
|
RESOURCES
|
||||||
packagechooser.qrc
|
packagechooser.qrc
|
||||||
@@ -59,7 +49,11 @@ calamares_add_plugin(packagechooser
|
|||||||
SHARED_LIB
|
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(
|
# calamares_add_test(
|
||||||
# packagechoosertest
|
# packagechoosertest
|
||||||
# GUI
|
# GUI
|
||||||
|
|||||||
@@ -10,13 +10,14 @@
|
|||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
#include "LoaderQueue.h"
|
||||||
|
|
||||||
#ifdef HAVE_APPDATA
|
#ifdef HAVE_APPDATA
|
||||||
#include "ItemAppData.h"
|
#include "ItemAppData.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_APPSTREAM_VERSION
|
#ifdef HAVE_APPSTREAM_VERSION
|
||||||
#include "ItemAppStream.h"
|
#include "ItemAppStream.h"
|
||||||
#include <AppStreamQt/pool.h>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -26,6 +27,9 @@
|
|||||||
#include "packages/Globals.h"
|
#include "packages/Globals.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
#include "network/Manager.h"
|
||||||
|
|
||||||
|
#include <QNetworkReply>
|
||||||
|
|
||||||
/** @brief This removes any values from @p groups that match @p source
|
/** @brief This removes any values from @p groups that match @p source
|
||||||
*
|
*
|
||||||
@@ -87,12 +91,68 @@ PackageChooserMethodNames()
|
|||||||
Config::Config( QObject* parent )
|
Config::Config( QObject* parent )
|
||||||
: Calamares::ModuleSystem::Config( parent )
|
: Calamares::ModuleSystem::Config( parent )
|
||||||
, m_model( new PackageListModel( this ) )
|
, m_model( new PackageListModel( this ) )
|
||||||
|
, m_netmodel( new PackageModel( this ) )
|
||||||
, m_mode( PackageChooserMode::Required )
|
, m_mode( PackageChooserMode::Required )
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::~Config() {}
|
Config::~Config() {}
|
||||||
|
|
||||||
|
QString
|
||||||
|
Config::status() const
|
||||||
|
{
|
||||||
|
switch ( m_status )
|
||||||
|
{
|
||||||
|
case Status::Ok:
|
||||||
|
return QString();
|
||||||
|
case Status::FailedBadConfiguration:
|
||||||
|
return tr( "Network Installation. (Disabled: Incorrect configuration)" );
|
||||||
|
case Status::FailedBadData:
|
||||||
|
return tr( "Network Installation. (Disabled: Received invalid groups data)" );
|
||||||
|
case Status::FailedInternalError:
|
||||||
|
return tr( "Network Installation. (Disabled: Internal error)" );
|
||||||
|
case Status::FailedNetworkError:
|
||||||
|
return tr( "Network Installation. (Disabled: Unable to fetch package lists, check your network connection)" );
|
||||||
|
case Status::FailedNoData:
|
||||||
|
return tr( "Network Installation. (Disabled: No package list)" );
|
||||||
|
}
|
||||||
|
__builtin_unreachable();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::setStatus( Status s )
|
||||||
|
{
|
||||||
|
m_status = s;
|
||||||
|
emit statusChanged( status() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::loadGroupList( const QVariantList& groupData )
|
||||||
|
{
|
||||||
|
m_netmodel->setupModelData( groupData );
|
||||||
|
if ( m_netmodel->rowCount() < 1 )
|
||||||
|
{
|
||||||
|
cWarning() << "NetInstall groups data was empty.";
|
||||||
|
setStatus( Status::FailedNoData );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setStatus( Status::Ok );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::loadingDone()
|
||||||
|
{
|
||||||
|
if ( m_queue )
|
||||||
|
{
|
||||||
|
m_queue->deleteLater();
|
||||||
|
m_queue = nullptr;
|
||||||
|
}
|
||||||
|
emit statusReady();
|
||||||
|
}
|
||||||
|
|
||||||
const PackageItem&
|
const PackageItem&
|
||||||
Config::introductionPackage() const
|
Config::introductionPackage() const
|
||||||
{
|
{
|
||||||
@@ -324,6 +384,29 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
{
|
{
|
||||||
fillModel( m_model, configurationMap.value( "items" ).toList() );
|
fillModel( m_model, configurationMap.value( "items" ).toList() );
|
||||||
|
|
||||||
|
// Lastly, load the groups data
|
||||||
|
// const QString key = QStringLiteral( "groupsUrl" );
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// const auto& groupsUrlVariant = configurationMap.value( key );
|
||||||
|
// m_queue = new LoaderQueue( this );
|
||||||
|
// if ( Calamares::typeOf( groupsUrlVariant ) == Calamares::StringVariantType )
|
||||||
|
// {
|
||||||
|
// m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) );
|
||||||
|
// }
|
||||||
|
// else if ( Calamares::typeOf( groupsUrlVariant ) == Calamares::ListVariantType )
|
||||||
|
// {
|
||||||
|
// for ( const auto& s : groupsUrlVariant.toStringList() )
|
||||||
|
// {
|
||||||
|
// m_queue->append( SourceItem::makeSourceItem( s, configurationMap ) );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// setStatus( required() ? Status::FailedNoData : Status::Ok );
|
||||||
|
// cDebug() << "Loading netinstall from" << m_queue->count() << "alternate sources.";
|
||||||
|
// connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone );
|
||||||
|
// m_queue->load();
|
||||||
|
|
||||||
QString default_item_id = Calamares::getString( configurationMap, "default" );
|
QString default_item_id = Calamares::getString( configurationMap, "default" );
|
||||||
if ( !default_item_id.isEmpty() )
|
if ( !default_item_id.isEmpty() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,14 +11,22 @@
|
|||||||
#ifndef PACKAGECHOOSER_CONFIG_H
|
#ifndef PACKAGECHOOSER_CONFIG_H
|
||||||
#define PACKAGECHOOSER_CONFIG_H
|
#define PACKAGECHOOSER_CONFIG_H
|
||||||
|
|
||||||
|
#include "PackageChooserModel.h"
|
||||||
#include "PackageModel.h"
|
#include "PackageModel.h"
|
||||||
|
|
||||||
#include "modulesystem/Config.h"
|
#include "modulesystem/Config.h"
|
||||||
#include "modulesystem/InstanceKey.h"
|
#include "modulesystem/InstanceKey.h"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class LoaderQueue;
|
||||||
|
|
||||||
enum class PackageChooserMode
|
enum class PackageChooserMode
|
||||||
{
|
{
|
||||||
Optional, // zero or one
|
Optional, // zero or one
|
||||||
@@ -55,6 +63,9 @@ class Config : public Calamares::ModuleSystem::Config
|
|||||||
Q_PROPERTY( QString packageChoice READ packageChoice WRITE setPackageChoice NOTIFY packageChoiceChanged )
|
Q_PROPERTY( QString packageChoice READ packageChoice WRITE setPackageChoice NOTIFY packageChoiceChanged )
|
||||||
Q_PROPERTY( QString prettyStatus READ prettyStatus NOTIFY prettyStatusChanged FINAL )
|
Q_PROPERTY( QString prettyStatus READ prettyStatus NOTIFY prettyStatusChanged FINAL )
|
||||||
|
|
||||||
|
Q_PROPERTY( PackageModel* PackageModel MEMBER m_netmodel FINAL )
|
||||||
|
Q_PROPERTY( QString status READ status NOTIFY statusChanged FINAL )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Config( QObject* parent = nullptr );
|
Config( QObject* parent = nullptr );
|
||||||
~Config() override;
|
~Config() override;
|
||||||
@@ -73,6 +84,10 @@ public:
|
|||||||
PackageListModel* model() const { return m_model; }
|
PackageListModel* model() const { return m_model; }
|
||||||
QModelIndex defaultSelectionIndex() const { return m_defaultModelIndex; }
|
QModelIndex defaultSelectionIndex() const { return m_defaultModelIndex; }
|
||||||
|
|
||||||
|
PackageModel* netmodel() const { return m_netmodel; }
|
||||||
|
void loadGroupList( const QVariantList& groupData );
|
||||||
|
|
||||||
|
|
||||||
/** @brief Returns an "introductory package" which describes packagechooser
|
/** @brief Returns an "introductory package" which describes packagechooser
|
||||||
*
|
*
|
||||||
* If the model contains a "none" package, returns that one on
|
* If the model contains a "none" package, returns that one on
|
||||||
@@ -101,14 +116,43 @@ public:
|
|||||||
QString prettyName() const;
|
QString prettyName() const;
|
||||||
QString prettyStatus() const;
|
QString prettyStatus() const;
|
||||||
|
|
||||||
|
enum class Status
|
||||||
|
{
|
||||||
|
Ok,
|
||||||
|
FailedBadConfiguration,
|
||||||
|
FailedInternalError,
|
||||||
|
FailedNetworkError,
|
||||||
|
FailedBadData,
|
||||||
|
FailedNoData
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Human-readable, translated representation of the status
|
||||||
|
QString status() const;
|
||||||
|
/// Internal code for the status
|
||||||
|
Status statusCode() const { return m_status; }
|
||||||
|
void setStatus( Status s );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void packageChoiceChanged( QString packageChoice );
|
void packageChoiceChanged( QString packageChoice );
|
||||||
void prettyStatusChanged();
|
void prettyStatusChanged();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void statusChanged( QString status ); ///< Something changed
|
||||||
|
void sidebarLabelChanged( QString label );
|
||||||
|
void titleLabelChanged( QString label );
|
||||||
|
void statusReady(); ///< Loading groups is complete
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void loadingDone();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PackageListModel* m_model = nullptr;
|
PackageListModel* m_model = nullptr;
|
||||||
QModelIndex m_defaultModelIndex;
|
QModelIndex m_defaultModelIndex;
|
||||||
|
|
||||||
|
PackageModel* m_netmodel = nullptr;
|
||||||
|
LoaderQueue* m_queue = nullptr;
|
||||||
|
Status m_status = Status::Ok;
|
||||||
|
|
||||||
/// Selection mode for this module
|
/// Selection mode for this module
|
||||||
PackageChooserMode m_mode = PackageChooserMode::Optional;
|
PackageChooserMode m_mode = PackageChooserMode::Optional;
|
||||||
/// How this module stores to GS
|
/// How this module stores to GS
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Only used if QtXML is found, implements PackageItem::fromAppData().
|
* Only used if QtXML is found, implements PackageItem::fromAppData().
|
||||||
*/
|
*/
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#ifndef ITEMAPPDATA_H
|
#ifndef ITEMAPPDATA_H
|
||||||
#define ITEMAPPDATA_H
|
#define ITEMAPPDATA_H
|
||||||
|
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
/** @brief Loads an AppData XML file and returns a PackageItem
|
/** @brief Loads an AppData XML file and returns a PackageItem
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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 "locale/TranslationsModel.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.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
|
/// @brief Return number of pixels in a size, for < ordering purposes
|
||||||
static inline quint64
|
static inline quint64
|
||||||
sizeOrder( const QSize& size )
|
sizeOrder( const QSize& size )
|
||||||
|
|||||||
@@ -10,12 +10,30 @@
|
|||||||
#ifndef ITEMAPPSTREAM_H
|
#ifndef ITEMAPPSTREAM_H
|
||||||
#define ITEMAPPSTREAM_H
|
#define ITEMAPPSTREAM_H
|
||||||
|
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
namespace AppStream
|
/*
|
||||||
{
|
* This weird include mechanism is because an #include line is allowed
|
||||||
class Pool;
|
* to consist of preprocessor-tokens, which are expanded, and then
|
||||||
} // namespace AppStream
|
* 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.
|
/** @brief Loads an item from AppStream data.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,12 +7,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
|
#include "compat/Variant.h"
|
||||||
|
#include "utils/Yaml.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
/** @brief A wrapper for Calamares::getSubMap that excludes the success param
|
/** @brief A wrapper for Calamares::getSubMap that excludes the success param
|
||||||
@@ -7,12 +7,19 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PACKAGEMODEL_H
|
#ifndef PACKAGECHOOSERMODEL_H
|
||||||
#define PACKAGEMODEL_H
|
#define PACKAGECHOOSERMODEL_H
|
||||||
|
|
||||||
#include "locale/TranslatableConfiguration.h"
|
#include "locale/TranslatableConfiguration.h"
|
||||||
#include "utils/NamedEnum.h"
|
#include "utils/NamedEnum.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <QAbstractItemModel>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
#include "PackageTreeItem.h"
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#define PACKAGECHOOSERPAGE_H
|
#define PACKAGECHOOSERPAGE_H
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PackageChooserPage.h"
|
#include "PackageChooserPage.h"
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#ifdef HAVE_APPSTREAM_VERSION
|
#ifdef HAVE_APPSTREAM_VERSION
|
||||||
#include "ItemAppStream.h"
|
#include "ItemAppStream.h"
|
||||||
#endif
|
#endif
|
||||||
#include "PackageModel.h"
|
#include "PackageChooserModel.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
)
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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 |
@@ -1,2 +0,0 @@
|
|||||||
SPDX-FileCopyrightText: 2020 demmm <anke62@gmail.com>
|
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource>
|
|
||||||
<file alias="packagechooserq.qml">packagechooserq-qt6.qml</file>
|
|
||||||
<file>images/if.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource>
|
|
||||||
<file>packagechooserq.qml</file>
|
|
||||||
<file>images/if.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
Reference in New Issue
Block a user