From dd8b893ee87a8c76e9579872920b4f54084bedec Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 8 Feb 2021 15:36:27 +0100 Subject: [PATCH 01/38] Changes: mention what this branch is for --- CHANGES | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index aa5dba206..1750c1e6e 100644 --- a/CHANGES +++ b/CHANGES @@ -16,7 +16,11 @@ This release contains contributions from (alphabetically by first name): - No core changes yet ## Modules ## - - No module changes yet + - *netinstall* now supports fallbacks for the groups data. + Instead of a single URL, multiple URLs may be specified in + a list and Calamares goes through them until one is successfully + retrieved. Older configurations with a single string are + treated like a one-item list. #1579 # 3.2.36 (2021-02-03) # From cf7391696e6f11c2a5ccba993c6b6917697cdad7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 8 Feb 2021 22:57:38 +0100 Subject: [PATCH 02/38] [netinstall] Continue moving settings to the Config object --- src/modules/netinstall/Config.cpp | 49 +++++++++++++++++++ src/modules/netinstall/Config.h | 19 ++++++- src/modules/netinstall/NetInstallViewStep.cpp | 27 +--------- src/modules/netinstall/NetInstallViewStep.h | 2 - 4 files changed, 69 insertions(+), 28 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index e69b3c2a4..99fe28eb0 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -12,9 +12,12 @@ #include "Config.h" +#include "GlobalStorage.h" +#include "JobQueue.h" #include "network/Manager.h" #include "utils/Logger.h" #include "utils/RAII.h" +#include "utils/Variant.h" #include "utils/Yaml.h" #include @@ -54,6 +57,19 @@ Config::setStatus( Status s ) emit statusChanged( status() ); } +QString +Config::sidebarLabel() const +{ + return m_sidebarLabel ? m_sidebarLabel->get() : tr( "Package selection" ); +} + +QString +Config::titleLabel() const +{ + return m_titleLabel ? m_titleLabel->get() : QString(); +} + + void Config::loadGroupList( const QVariantList& groupData ) { @@ -143,3 +159,36 @@ Config::receivedGroupData() setStatus( Status::FailedBadData ); } } + +void +Config::setConfigurationMap( const QVariantMap& configurationMap ) +{ + setRequired( CalamaresUtils::getBool( configurationMap, "required", false ) ); + + // Get the translations, if any + bool bogus = false; + auto label = CalamaresUtils::getSubMap( configurationMap, "label", bogus ); + + if ( label.contains( "sidebar" ) ) + { + m_sidebarLabel = new CalamaresUtils::Locale::TranslatedString( label, "sidebar", metaObject()->className() ); + } + + // Lastly, load the groups data + QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" ); + if ( !groupsUrl.isEmpty() ) + { + // Keep putting groupsUrl into the global storage, + // even though it's no longer used for in-module data-passing. + Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl ); + if ( groupsUrl == QStringLiteral( "local" ) ) + { + QVariantList l = configurationMap.value( "groups" ).toList(); + loadGroupList( l ); + } + else + { + loadGroupList( groupsUrl ); + } + } +} diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index 13eb098c6..24c5e6b68 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -14,8 +14,11 @@ #include "PackageModel.h" +#include "locale/TranslatableConfiguration.h" + #include #include +#include class QNetworkReply; @@ -26,10 +29,16 @@ class Config : public QObject Q_PROPERTY( PackageModel* packageModel MEMBER m_model FINAL ) Q_PROPERTY( QString status READ status NOTIFY statusChanged FINAL ) + // Translations, of the module name (for sidebar) and above the list + Q_PROPERTY( QString sidebarLabel READ sidebarLabel NOTIFY sidebarLabelChanged FINAL ) + Q_PROPERTY( QString titleLabel READ titleLabel NOTIFY titleLabelChanged FINAL ) + public: Config( QObject* parent = nullptr ); ~Config() override; + void setConfigurationMap( const QVariantMap& configurationMap ); + enum class Status { Ok, @@ -45,6 +54,11 @@ public: bool required() const { return m_required; } void setRequired( bool r ) { m_required = r; } + PackageModel* model() const { return m_model; } + + QString sidebarLabel() const; + QString titleLabel() const; + /** @brief Retrieves the groups, with name, description and packages * * Loads data from the given URL. Once done, the data is parsed @@ -59,16 +73,19 @@ public: */ void loadGroupList( const QVariantList& groupData ); - PackageModel* model() const { return m_model; } signals: void statusChanged( QString status ); ///< Something changed + void sidebarLabelChanged( QString label ); + void titleLabelChanged( QString label ); void statusReady(); ///< Loading groups is complete private slots: void receivedGroupData(); ///< From async-loading group data private: + CalamaresUtils::Locale::TranslatedString* m_sidebarLabel = nullptr; // As it appears in the sidebar + CalamaresUtils::Locale::TranslatedString* m_titleLabel = nullptr; PackageModel* m_model = nullptr; QNetworkReply* m_reply = nullptr; // For fetching data Status m_status = Status::Ok; diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index d92058e51..2e035a8aa 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -24,7 +24,6 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( NetInstallViewStepFactory, registerPlugin< NetInstallViewStep::NetInstallViewStep( QObject* parent ) : Calamares::ViewStep( parent ) , m_widget( new NetInstallPage( &m_config ) ) - , m_sidebarLabel( nullptr ) , m_nextEnabled( false ) { connect( &m_config, &Config::statusReady, this, &NetInstallViewStep::nextIsReady ); @@ -37,14 +36,13 @@ NetInstallViewStep::~NetInstallViewStep() { m_widget->deleteLater(); } - delete m_sidebarLabel; } QString NetInstallViewStep::prettyName() const { - return m_sidebarLabel ? m_sidebarLabel->get() : tr( "Package selection" ); + return m_config.sidebarLabel(); #if defined( TABLE_OF_TRANSLATIONS ) __builtin_unreachable(); @@ -201,32 +199,11 @@ NetInstallViewStep::nextIsReady() void NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { - m_config.setRequired( CalamaresUtils::getBool( configurationMap, "required", false ) ); - - QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" ); - if ( !groupsUrl.isEmpty() ) - { - // Keep putting groupsUrl into the global storage, - // even though it's no longer used for in-module data-passing. - Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl ); - if ( groupsUrl == QStringLiteral( "local" ) ) - { - QVariantList l = configurationMap.value( "groups" ).toList(); - m_config.loadGroupList( l ); - } - else - { - m_config.loadGroupList( groupsUrl ); - } - } + m_config.setConfigurationMap( configurationMap ); bool bogus = false; auto label = CalamaresUtils::getSubMap( configurationMap, "label", bogus ); - if ( label.contains( "sidebar" ) ) - { - m_sidebarLabel = new CalamaresUtils::Locale::TranslatedString( label, "sidebar", metaObject()->className() ); - } if ( label.contains( "title" ) ) { m_widget->setPageTitle( diff --git a/src/modules/netinstall/NetInstallViewStep.h b/src/modules/netinstall/NetInstallViewStep.h index c500cbcd9..8949632c1 100644 --- a/src/modules/netinstall/NetInstallViewStep.h +++ b/src/modules/netinstall/NetInstallViewStep.h @@ -14,7 +14,6 @@ #include "Config.h" #include "DllMacro.h" -#include "locale/TranslatableConfiguration.h" #include "utils/PluginFactory.h" #include "viewpages/ViewStep.h" @@ -56,7 +55,6 @@ private: Config m_config; NetInstallPage* m_widget; - CalamaresUtils::Locale::TranslatedString* m_sidebarLabel; // As it appears in the sidebar bool m_nextEnabled = false; }; From 335ccbc14913be47a33a626eef098ab90f1fa80b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Feb 2021 10:58:11 +0100 Subject: [PATCH 03/38] [netinstall] Move other translation parts to Config --- src/modules/netinstall/Config.cpp | 10 ++++- src/modules/netinstall/NetInstallPage.cpp | 43 +++++++------------ src/modules/netinstall/NetInstallPage.h | 15 +------ src/modules/netinstall/NetInstallViewStep.cpp | 12 ++---- 4 files changed, 28 insertions(+), 52 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 99fe28eb0..022e6fcd7 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -168,10 +168,18 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) // Get the translations, if any bool bogus = false; auto label = CalamaresUtils::getSubMap( configurationMap, "label", bogus ); + // Use a different class name for translation lookup because the + // .. table of strings lives in NetInstallViewStep.cpp and moving them + // .. around is annoying for translators. + static const char className[] = "NetInstallViewStep"; if ( label.contains( "sidebar" ) ) { - m_sidebarLabel = new CalamaresUtils::Locale::TranslatedString( label, "sidebar", metaObject()->className() ); + m_sidebarLabel = new CalamaresUtils::Locale::TranslatedString( label, "sidebar", className ); + } + if ( label.contains( "title" ) ) + { + m_titleLabel = new CalamaresUtils::Locale::TranslatedString( label, "title", className ); } // Lastly, load the groups data diff --git a/src/modules/netinstall/NetInstallPage.cpp b/src/modules/netinstall/NetInstallPage.cpp index 75175a941..0dfb810b5 100644 --- a/src/modules/netinstall/NetInstallPage.cpp +++ b/src/modules/netinstall/NetInstallPage.cpp @@ -34,39 +34,12 @@ NetInstallPage::NetInstallPage( Config* c, QWidget* parent ) ui->groupswidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); ui->groupswidget->setModel( c->model() ); connect( c, &Config::statusChanged, this, &NetInstallPage::setStatus ); + connect( c, &Config::titleLabelChanged, this, &NetInstallPage::setTitle ); connect( c, &Config::statusReady, this, &NetInstallPage::expandGroups ); - - setPageTitle( nullptr ); - CALAMARES_RETRANSLATE_SLOT( &NetInstallPage::retranslate ) } NetInstallPage::~NetInstallPage() {} -void -NetInstallPage::setPageTitle( CalamaresUtils::Locale::TranslatedString* t ) -{ - m_title.reset( t ); - if ( !m_title ) - { - ui->label->hide(); - } - else - { - ui->label->show(); - } - retranslate(); -} - -void -NetInstallPage::retranslate() -{ - if ( m_title ) - { - ui->label->setText( m_title->get() ); // That's get() on the TranslatedString - } - ui->netinst_status->setText( m_config->status() ); -} - void NetInstallPage::expandGroups() { @@ -88,6 +61,20 @@ NetInstallPage::setStatus( QString s ) ui->netinst_status->setText( s ); } +void +NetInstallPage::setTitle( QString title ) +{ + if ( title.isEmpty() ) + { + ui->label->hide(); + } + else + { + ui->label->setText( title ); // That's get() on the TranslatedString + ui->label->show(); + } +} + void NetInstallPage::onActivate() { diff --git a/src/modules/netinstall/NetInstallPage.h b/src/modules/netinstall/NetInstallPage.h index 1c97423da..e58a7dd8c 100644 --- a/src/modules/netinstall/NetInstallPage.h +++ b/src/modules/netinstall/NetInstallPage.h @@ -37,22 +37,11 @@ public: NetInstallPage( Config* config, QWidget* parent = nullptr ); ~NetInstallPage() override; - /** @brief Sets the page title - * - * In situations where there is more than one netinstall page, - * or you want some explanatory title above the treeview, - * set the page title. This page takes ownership of the - * TranslatedString object. - * - * Set to nullptr to remove the title. - */ - void setPageTitle( CalamaresUtils::Locale::TranslatedString* ); - void onActivate(); public slots: - void retranslate(); void setStatus( QString s ); + void setTitle( QString title ); /** @brief Expand entries that should be pre-expanded. * @@ -64,8 +53,6 @@ public slots: private: Config* m_config; Ui::Page_NetInst* ui; - - std::unique_ptr< CalamaresUtils::Locale::TranslatedString > m_title; // Above the treeview }; #endif // NETINSTALLPAGE_H diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index 2e035a8aa..a8ce1e311 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -49,6 +49,9 @@ NetInstallViewStep::prettyName() const // This is a table of "standard" labels for this module. If you use them // in the label: sidebar: section of the config file, the existing // translations can be used. + // + // These translations still live here, even though the lookup + // code is in the Config class. tr( "Package selection" ); tr( "Office software" ); tr( "Office package" ); @@ -200,13 +203,4 @@ void NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { m_config.setConfigurationMap( configurationMap ); - - bool bogus = false; - auto label = CalamaresUtils::getSubMap( configurationMap, "label", bogus ); - - if ( label.contains( "title" ) ) - { - m_widget->setPageTitle( - new CalamaresUtils::Locale::TranslatedString( label, "title", metaObject()->className() ) ); - } } From ca1ae6fd1d5276a9dd44f90108053368ecaeb9a2 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Feb 2021 11:06:59 +0100 Subject: [PATCH 04/38] [netinstall] Support retranslation in the Config object --- src/modules/netinstall/Config.cpp | 14 ++++++++++++-- src/modules/netinstall/Config.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 022e6fcd7..2327a732c 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -17,6 +17,7 @@ #include "network/Manager.h" #include "utils/Logger.h" #include "utils/RAII.h" +#include "utils/Retranslator.h" #include "utils/Variant.h" #include "utils/Yaml.h" @@ -24,11 +25,20 @@ Config::Config( QObject* parent ) : QObject( parent ) - , m_model( new PackageModel( this ) ) + , m_model( new PackageModel( this ) ) { CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ) } + + Config::~Config() { } -Config::~Config() {} +void +Config::retranslate() +{ + emit statusChanged( status() ); + emit sidebarLabelChanged( sidebarLabel() ); + emit titleLabelChanged( titleLabel() ); +} + QString Config::status() const diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index 24c5e6b68..f5f76f35f 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -82,6 +82,7 @@ signals: private slots: void receivedGroupData(); ///< From async-loading group data + void retranslate(); private: CalamaresUtils::Locale::TranslatedString* m_sidebarLabel = nullptr; // As it appears in the sidebar From 04f4441182e8acad8f5cd2515f8d60c6d4804563 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Feb 2021 15:06:53 +0100 Subject: [PATCH 05/38] [netinstall] Build up a list of urls, rather than just one - the list is unused, and doesn't drive the loading of groups either; the existing one-string entry is used. --- src/modules/netinstall/Config.cpp | 27 +++++++++++++++++++++++++++ src/modules/netinstall/Config.h | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 2327a732c..6b1daaa07 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -170,6 +170,19 @@ Config::receivedGroupData() } } +Config::SourceItem Config::SourceItem::makeSourceItem(const QVariantMap& configurationMap, const QString& groupsUrl) +{ + if ( groupsUrl == QStringLiteral( "local" ) ) + { + return SourceItem{ QUrl(), configurationMap.value( "groups" ).toList() }; + } + else + { + return SourceItem{ QUrl{ groupsUrl }, QVariantList() }; + } +} + + void Config::setConfigurationMap( const QVariantMap& configurationMap ) { @@ -193,6 +206,20 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } // Lastly, load the groups data + const QString key = QStringLiteral( "groupsUrl" ); + const auto& groupsUrlVariant = configurationMap.value( key ); + if ( groupsUrlVariant.type() == QVariant::String ) + { + m_urls.append( SourceItem::makeSourceItem( configurationMap, groupsUrlVariant.toString() ) ); + } + else if ( groupsUrlVariant.type() == QVariant::StringList ) + { + for ( const auto& s : groupsUrlVariant.toStringList() ) + { + m_urls.append( SourceItem::makeSourceItem( configurationMap, s ) ); + } + } + QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" ); if ( !groupsUrl.isEmpty() ) { diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index f5f76f35f..554b4ce7d 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -18,6 +18,7 @@ #include #include +#include #include class QNetworkReply; @@ -85,6 +86,23 @@ private slots: void retranslate(); private: + /** @brief Data about an entry in *groupsUrl* + * + * This can be a specific URL, or "local" which uses data stored + * in the configuration file itself. + */ + struct SourceItem + { + QUrl url; + QVariantList data; + + bool isUrl() const { return url.isValid(); } + bool isLocal() const { return !data.isEmpty(); } + bool isValid() const { return isUrl() || isLocal(); } + static SourceItem makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl); + }; + + QQueue< SourceItem > m_urls; CalamaresUtils::Locale::TranslatedString* m_sidebarLabel = nullptr; // As it appears in the sidebar CalamaresUtils::Locale::TranslatedString* m_titleLabel = nullptr; PackageModel* m_model = nullptr; From f8afb15c4ceaef8745b573c4dbcd44ad1716a516 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 20:47:27 +0100 Subject: [PATCH 06/38] [libcalamaresui] Improve logging for QML modules - mention which instance produces warnings - tag additional debugging from the same method with Logger::SubEntry --- src/libcalamaresui/viewpages/QmlViewStep.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libcalamaresui/viewpages/QmlViewStep.cpp b/src/libcalamaresui/viewpages/QmlViewStep.cpp index 17a1ea79c..b0392e404 100644 --- a/src/libcalamaresui/viewpages/QmlViewStep.cpp +++ b/src/libcalamaresui/viewpages/QmlViewStep.cpp @@ -168,7 +168,7 @@ QmlViewStep::loadComplete() } if ( m_qmlComponent->isReady() && !m_qmlObject ) { - cDebug() << "QML component complete" << m_qmlFileName; + cDebug() << Logger::SubEntry << "QML component complete" << m_qmlFileName << "creating object"; // Don't do this again disconnect( m_qmlComponent, &QQmlComponent::statusChanged, this, &QmlViewStep::loadComplete ); @@ -196,7 +196,7 @@ QmlViewStep::showQml() { if ( !m_qmlWidget || !m_qmlObject ) { - cDebug() << "showQml() called but no QML object"; + cWarning() << "showQml() called but no QML object"; return; } if ( m_spinner ) @@ -208,7 +208,7 @@ QmlViewStep::showQml() } else { - cDebug() << "showQml() called twice"; + cWarning() << "showQml() called twice"; } if ( ViewManager::instance()->currentStep() == this ) @@ -228,7 +228,7 @@ QmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) = CalamaresUtils::qmlSearchNames().find( CalamaresUtils::getString( configurationMap, "qmlSearch" ), ok ); if ( !ok ) { - cDebug() << "Bad QML search mode."; + cWarning() << "Bad QML search mode set for" << moduleInstanceKey(); } QString qmlFile = CalamaresUtils::getString( configurationMap, "qmlFilename" ); @@ -253,7 +253,7 @@ QmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cWarning() << "QML configuration set after component has loaded."; + cWarning() << "QML configuration set after component" << moduleInstanceKey() << "has loaded."; } } From 33fec86ef6bc25f2957a62f80a4b1fb5cf1df2cc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 20:53:59 +0100 Subject: [PATCH 07/38] [welcome] Improve logging of requirements-checking - less chatty when 0-results come in - compress the welcome debug to one output chunk --- .../modulesystem/RequirementsChecker.cpp | 2 +- .../welcome/checker/GeneralRequirements.cpp | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/libcalamares/modulesystem/RequirementsChecker.cpp b/src/libcalamares/modulesystem/RequirementsChecker.cpp index a12a4f681..32c7254de 100644 --- a/src/libcalamares/modulesystem/RequirementsChecker.cpp +++ b/src/libcalamares/modulesystem/RequirementsChecker.cpp @@ -85,9 +85,9 @@ void RequirementsChecker::addCheckedRequirements( Module* m ) { RequirementsList l = m->checkRequirements(); - cDebug() << "Got" << l.count() << "requirement results from" << m->name(); if ( l.count() > 0 ) { + cDebug() << "Got" << l.count() << "requirement results from" << m->name(); m_model->addRequirementsList( l ); } diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp index a10585af9..07c352946 100644 --- a/src/modules/welcome/checker/GeneralRequirements.cpp +++ b/src/modules/welcome/checker/GeneralRequirements.cpp @@ -107,14 +107,12 @@ GeneralRequirements::checkRequirements() && ( availableSize.height() >= CalamaresUtils::windowMinimumHeight ); qint64 requiredStorageB = CalamaresUtils::GiBtoBytes( m_requiredStorageGiB ); - cDebug() << "Need at least storage bytes:" << requiredStorageB; if ( m_entriesToCheck.contains( "storage" ) ) { enoughStorage = checkEnoughStorage( requiredStorageB ); } qint64 requiredRamB = CalamaresUtils::GiBtoBytes( m_requiredRamGiB ); - cDebug() << "Need at least ram bytes:" << requiredRamB; if ( m_entriesToCheck.contains( "ram" ) ) { enoughRam = checkEnoughRam( requiredRamB ); @@ -135,10 +133,18 @@ GeneralRequirements::checkRequirements() isRoot = checkIsRoot(); } + using TNum = Logger::DebugRow< const char*, qint64 >; using TR = Logger::DebugRow< const char*, MaybeChecked >; - cDebug() << "GeneralRequirements output:" << TR( "enoughStorage", enoughStorage ) << TR( "enoughRam", enoughRam ) - << TR( "hasPower", hasPower ) << TR( "hasInternet", hasInternet ) << TR( "isRoot", isRoot ); - + // clang-format off + cDebug() << "GeneralRequirements output:" + << TNum( "storage", requiredStorageB ) + << TR( "enoughStorage", enoughStorage ) + << TNum( "RAM", requiredRamB ) + << TR( "enoughRam", enoughRam ) + << TR( "hasPower", hasPower ) + << TR( "hasInternet", hasInternet ) + << TR( "isRoot", isRoot ); + // clang-format on Calamares::RequirementsList checkEntries; foreach ( const QString& entry, m_entriesToCheck ) { From a4c1f07521b9bc3ad4cfa19ae901a3ba1f4b3a72 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 21:11:01 +0100 Subject: [PATCH 08/38] [libcalamares] Reduce indentation-depth in apply() through early-return --- src/libcalamares/modulesystem/Config.cpp | 42 ++++++++++++++---------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/libcalamares/modulesystem/Config.cpp b/src/libcalamares/modulesystem/Config.cpp index 71210a9cb..eece2f185 100644 --- a/src/libcalamares/modulesystem/Config.cpp +++ b/src/libcalamares/modulesystem/Config.cpp @@ -94,26 +94,34 @@ Config::ApplyPresets::apply( const char* fieldName ) if ( !prop.isValid() ) { cWarning() << "Applying invalid property" << fieldName; + return *this; } - else - { - const QString key( fieldName ); - if ( !key.isEmpty() && m_c.d->m_presets->find( key ).isValid() ) - { - cWarning() << "Applying duplicate property" << fieldName; - } - else if ( !key.isEmpty() && m_map.contains( key ) ) - { - QVariantMap m = CalamaresUtils::getSubMap( m_map, key, m_bogus ); - QVariant value = m[ "value" ]; - bool editable = CalamaresUtils::getBool( m, "editable", true ); - if ( value.isValid() ) - { - m_c.setProperty( fieldName, value ); - } - m_c.d->m_presets->append( PresetField { key, value, editable } ); + const QString key( fieldName ); + if ( key.isEmpty() ) + { + cWarning() << "Applying empty field"; + return *this; + } + + if ( m_c.d->m_presets->find( key ).isValid() ) + { + cWarning() << "Applying duplicate property" << fieldName; + return *this; + } + + if ( m_map.contains( key ) ) + { + // Key has an explicit setting + QVariantMap m = CalamaresUtils::getSubMap( m_map, key, m_bogus ); + QVariant value = m[ "value" ]; + bool editable = CalamaresUtils::getBool( m, "editable", true ); + + if ( value.isValid() ) + { + m_c.setProperty( fieldName, value ); } + m_c.d->m_presets->append( PresetField { key, value, editable } ); } return *this; } From a3a1350dc78a6c87e05c967ca6a1c8107255d919 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 21:18:10 +0100 Subject: [PATCH 09/38] [libcalamares] Don't complain if there isn't a preset - If the module knows about a preset, then it should be registered even if there is not a value set for it specifically; this avoids complaints from isEditable() for fields that are known, but do not have a preset. (Reported by Anke) --- src/libcalamares/modulesystem/Config.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcalamares/modulesystem/Config.cpp b/src/libcalamares/modulesystem/Config.cpp index eece2f185..68d7b6514 100644 --- a/src/libcalamares/modulesystem/Config.cpp +++ b/src/libcalamares/modulesystem/Config.cpp @@ -123,6 +123,13 @@ Config::ApplyPresets::apply( const char* fieldName ) } m_c.d->m_presets->append( PresetField { key, value, editable } ); } + else + { + // There is no setting, but since we apply() this field, + // we do know about it; put in a preset so that looking + // it up won't complani. + m_c.d->m_presets->append( PresetField { key, QVariant(), true } ); + } return *this; } From 8fe2e1f68a59ceaf6e6740ba92a4ade4da12455f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 21:22:20 +0100 Subject: [PATCH 10/38] [finished] Make the debug-log less cryptic --- src/modules/finished/Config.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/finished/Config.cpp b/src/modules/finished/Config.cpp index 5d824a8f3..d6d602db0 100644 --- a/src/modules/finished/Config.cpp +++ b/src/modules/finished/Config.cpp @@ -111,8 +111,8 @@ Config::onInstallationFailed( const QString& message, const QString& details ) void Config::doRestart( bool restartAnyway ) { - cDebug() << "mode=" << restartModes().find( restartNowMode() ) << " user?" << restartNowWanted() << "arg?" - << restartAnyway; + cDebug() << "mode=" << restartModes().find( restartNowMode() ) << " user wants restart?" << restartNowWanted() + << "force restart?" << restartAnyway; if ( restartNowMode() != RestartMode::Never && restartAnyway ) { cDebug() << Logger::SubEntry << "Running restart command" << m_restartNowCommand; @@ -124,9 +124,11 @@ Config::doRestart( bool restartAnyway ) void Config::doNotify( bool hasFailed, bool sendAnyway ) { + const char* const failName = hasFailed ? "failed" : "succeeded"; + if ( !sendAnyway ) { - cDebug() << "Notification failed?" << hasFailed << "not sent."; + cDebug() << "Notification not sent; completion:" << failName; return; } @@ -134,7 +136,7 @@ Config::doNotify( bool hasFailed, bool sendAnyway ) "org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" ); if ( notify.isValid() ) { - cDebug() << "Sending notification of completion. Failed?" << hasFailed; + cDebug() << "Sending notification of completion:" << failName; QString title; QString message; From 72f67286a487f57932821424a93edcad6944bae0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 21:41:27 +0100 Subject: [PATCH 11/38] [libcalamares] Preserve type CDebug() if possible. --- src/libcalamares/utils/Logger.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index f318c78a6..79b2e8e38 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -57,7 +57,7 @@ public: explicit CDebug( unsigned int debugLevel = LOGDEBUG, const char* func = nullptr ); virtual ~CDebug(); - friend QDebug& operator<<( CDebug&&, const FuncSuppressor& ); + friend CDebug& operator<<( CDebug&&, const FuncSuppressor& ); private: QString m_msg; @@ -65,11 +65,12 @@ private: const char* m_funcinfo = nullptr; }; -inline QDebug& +inline CDebug& operator<<( CDebug&& s, const FuncSuppressor& f ) { s.m_funcinfo = nullptr; - return s << f.m_s; + s << f.m_s; + return s; } inline QDebug& From a90f510b85ef0493d473ba6a0ce256607f126a35 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 15 Mar 2021 22:45:29 +0100 Subject: [PATCH 12/38] [libcalamares] Convenience for logging subentries For methods that log a bunch of things, and which want to consistently use SubEntry, but don't know when the **first** log entry is within the method, Logger::Once can be used to log one regular message (with function info) and the rest are subentries. --- src/libcalamares/utils/Logger.h | 30 +++++++++++++++++++ .../modulesystem/ModuleManager.cpp | 10 +++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 79b2e8e38..7b17754e8 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -22,6 +22,8 @@ namespace Logger { +class Once; + struct FuncSuppressor { explicit constexpr FuncSuppressor( const char[] ); @@ -58,6 +60,7 @@ public: virtual ~CDebug(); friend CDebug& operator<<( CDebug&&, const FuncSuppressor& ); + friend CDebug& operator<<( CDebug&&, Once& ); private: QString m_msg; @@ -286,6 +289,33 @@ operator<<( QDebug& s, const Pointer& p ) s << '@' << p.ptr << Quote; return s; } + +class Once +{ +public: + Once() + : m( true ) + { + } + friend CDebug& operator<<( CDebug&&, Once& ); + +private: + bool m = false; +}; + +inline CDebug& +operator<<( CDebug&& s, Once& o ) +{ + if ( o.m ) + { + o.m = false; + return s; + } + s.m_funcinfo = nullptr; + s << SubEntry; + return s; +} + } // namespace Logger #define cDebug() Logger::CDebug( Logger::LOGDEBUG, Q_FUNC_INFO ) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 5a971d661..054f4d5d5 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -61,7 +61,6 @@ ModuleManager::init() QTimer::singleShot( 0, this, &ModuleManager::doInit ); } - void ModuleManager::doInit() { @@ -72,6 +71,7 @@ ModuleManager::doInit() // the module name, and must contain a settings file named module.desc. // If at any time the module loading procedure finds something unexpected, it // silently skips to the next module or search path. --Teo 6/2014 + Logger::Once deb; for ( const QString& path : m_paths ) { QDir currentDir( path ); @@ -88,12 +88,12 @@ ModuleManager::doInit() QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1String( "module.desc" ) ) ); if ( !descriptorFileInfo.exists() ) { - cDebug() << bad_descriptor << descriptorFileInfo.absoluteFilePath() << "(missing)"; + cDebug() << deb << bad_descriptor << descriptorFileInfo.absoluteFilePath() << "(missing)"; continue; } if ( !descriptorFileInfo.isReadable() ) { - cDebug() << bad_descriptor << descriptorFileInfo.absoluteFilePath() << "(unreadable)"; + cDebug() << deb << bad_descriptor << descriptorFileInfo.absoluteFilePath() << "(unreadable)"; continue; } @@ -118,12 +118,12 @@ ModuleManager::doInit() } else { - cDebug() << "ModuleManager module search path does not exist:" << path; + cDebug() << deb << "ModuleManager module search path does not exist:" << path; } } // At this point m_availableDescriptorsByModuleName is filled with // the modules that were found in the search paths. - cDebug() << "Found" << m_availableDescriptorsByModuleName.count() << "modules"; + cDebug() << deb << "Found" << m_availableDescriptorsByModuleName.count() << "modules"; QTimer::singleShot( 10, this, &ModuleManager::initDone ); } From 8e8525a941ecf660f038c582138c0bdf509f35d0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 13:10:09 +0100 Subject: [PATCH 13/38] [netinstall] Simplify slots in the UI page --- src/modules/netinstall/NetInstallPage.cpp | 28 +++++------------------ src/modules/netinstall/NetInstallPage.h | 4 ---- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/modules/netinstall/NetInstallPage.cpp b/src/modules/netinstall/NetInstallPage.cpp index 0dfb810b5..31c9d15ac 100644 --- a/src/modules/netinstall/NetInstallPage.cpp +++ b/src/modules/netinstall/NetInstallPage.cpp @@ -33,8 +33,12 @@ NetInstallPage::NetInstallPage( Config* c, QWidget* parent ) ui->setupUi( this ); ui->groupswidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); ui->groupswidget->setModel( c->model() ); - connect( c, &Config::statusChanged, this, &NetInstallPage::setStatus ); - connect( c, &Config::titleLabelChanged, this, &NetInstallPage::setTitle ); + connect( c, &Config::statusChanged, ui->netinst_status, &QLabel::setText ); + connect( c, &Config::titleLabelChanged, [ui = this->ui]( const QString title ) { + ui->label->setVisible( !title.isEmpty() ); + ui->label->setText( title ); + } ); + connect( c, &Config::statusReady, this, &NetInstallPage::expandGroups ); } @@ -55,26 +59,6 @@ NetInstallPage::expandGroups() } } -void -NetInstallPage::setStatus( QString s ) -{ - ui->netinst_status->setText( s ); -} - -void -NetInstallPage::setTitle( QString title ) -{ - if ( title.isEmpty() ) - { - ui->label->hide(); - } - else - { - ui->label->setText( title ); // That's get() on the TranslatedString - ui->label->show(); - } -} - void NetInstallPage::onActivate() { diff --git a/src/modules/netinstall/NetInstallPage.h b/src/modules/netinstall/NetInstallPage.h index e58a7dd8c..72375d0f0 100644 --- a/src/modules/netinstall/NetInstallPage.h +++ b/src/modules/netinstall/NetInstallPage.h @@ -39,10 +39,6 @@ public: void onActivate(); -public slots: - void setStatus( QString s ); - void setTitle( QString title ); - /** @brief Expand entries that should be pre-expanded. * * Follows the *expanded* key / the startExpanded field in the From 79b4f918fcc67bc1f2d154ee290a4c8548c31ddd Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 13:10:35 +0100 Subject: [PATCH 14/38] [netinstall] Apply coding style --- src/modules/netinstall/Config.cpp | 7 ++++--- src/modules/netinstall/Config.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 6b1daaa07..233bc65dd 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -170,15 +170,16 @@ Config::receivedGroupData() } } -Config::SourceItem Config::SourceItem::makeSourceItem(const QVariantMap& configurationMap, const QString& groupsUrl) +Config::SourceItem +Config::SourceItem::makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl ) { if ( groupsUrl == QStringLiteral( "local" ) ) { - return SourceItem{ QUrl(), configurationMap.value( "groups" ).toList() }; + return SourceItem { QUrl(), configurationMap.value( "groups" ).toList() }; } else { - return SourceItem{ QUrl{ groupsUrl }, QVariantList() }; + return SourceItem { QUrl { groupsUrl }, QVariantList() }; } } diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index 554b4ce7d..84ab027cd 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -17,8 +17,8 @@ #include "locale/TranslatableConfiguration.h" #include -#include #include +#include #include class QNetworkReply; @@ -99,7 +99,7 @@ private: bool isUrl() const { return url.isValid(); } bool isLocal() const { return !data.isEmpty(); } bool isValid() const { return isUrl() || isLocal(); } - static SourceItem makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl); + static SourceItem makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl ); }; QQueue< SourceItem > m_urls; From 6662cb5f2d8b2d96b034f651972fc4aad1407836 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 13:17:33 +0100 Subject: [PATCH 15/38] [netinstall] Swap parameters to makeSourceItem and document it --- src/modules/netinstall/Config.cpp | 6 +++--- src/modules/netinstall/Config.h | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 233bc65dd..017164c86 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -171,7 +171,7 @@ Config::receivedGroupData() } Config::SourceItem -Config::SourceItem::makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl ) +Config::SourceItem::makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ) { if ( groupsUrl == QStringLiteral( "local" ) ) { @@ -211,13 +211,13 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) const auto& groupsUrlVariant = configurationMap.value( key ); if ( groupsUrlVariant.type() == QVariant::String ) { - m_urls.append( SourceItem::makeSourceItem( configurationMap, groupsUrlVariant.toString() ) ); + m_urls.append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) ); } else if ( groupsUrlVariant.type() == QVariant::StringList ) { for ( const auto& s : groupsUrlVariant.toStringList() ) { - m_urls.append( SourceItem::makeSourceItem( configurationMap, s ) ); + m_urls.append( SourceItem::makeSourceItem( s, configurationMap ) ); } } diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index 84ab027cd..de96ccee4 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -99,7 +99,13 @@ private: bool isUrl() const { return url.isValid(); } bool isLocal() const { return !data.isEmpty(); } bool isValid() const { return isUrl() || isLocal(); } - static SourceItem makeSourceItem( const QVariantMap& configurationMap, const QString& groupsUrl ); + /** @brief Create a SourceItem + * + * If the @p groupsUrl is @c "local" then the *groups* key in + * the @p configurationMap is used as the source; otherwise the + * string is used as an actual URL. + */ + static SourceItem makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ); }; QQueue< SourceItem > m_urls; From b8688943714d1fcf583cade3557f4fa47e9d74db Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 13:50:15 +0100 Subject: [PATCH 16/38] [libcalamares] Start a packages service for netinstall and others --- src/libcalamares/CMakeLists.txt | 9 ++++ src/libcalamares/packages/Globals.cpp | 69 +++++++++++++++++++++++++++ src/libcalamares/packages/Globals.h | 32 +++++++++++++ src/libcalamares/packages/Tests.cpp | 44 +++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 src/libcalamares/packages/Globals.cpp create mode 100644 src/libcalamares/packages/Globals.h create mode 100644 src/libcalamares/packages/Tests.cpp diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index 826f0bc41..95dad0530 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -59,6 +59,9 @@ set( libSources # Network service network/Manager.cpp + # Packages service + packages/Globals.cpp + # Partition service partition/Mount.cpp partition/PartitionSize.cpp @@ -228,6 +231,12 @@ calamares_add_test( network/Tests.cpp ) +calamares_add_test( + libcalamarespackagestest + SOURCES + packages/Tests.cpp +) + calamares_add_test( libcalamarespartitiontest SOURCES diff --git a/src/libcalamares/packages/Globals.cpp b/src/libcalamares/packages/Globals.cpp new file mode 100644 index 000000000..a488e704b --- /dev/null +++ b/src/libcalamares/packages/Globals.cpp @@ -0,0 +1,69 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "Globals.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "utils/Logger.h" + +bool +CalamaresUtils::Packages::setGSPackageAdditions( const Calamares::ModuleSystem::InstanceKey& module, + const QVariantList& installPackages, + const QVariantList& tryInstallPackages ) +{ + static const char PACKAGEOP[] = "packageOperations"; + + // Check if there's already a PACAKGEOP entry in GS, and if so we'll + // extend that one (overwriting the value in GS at the end of this method) + Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); + QVariantList packageOperations = gs->contains( PACKAGEOP ) ? gs->value( PACKAGEOP ).toList() : QVariantList(); + cDebug() << "Existing package operations length" << packageOperations.length(); + + const QString key = module.toString() + QStringLiteral( ";add" ); + + // Clear out existing operations for this module, going backwards: + // Sometimes we remove an item, and we don't want the index to + // fall off the end of the list. + bool somethingRemoved = false; + for ( int index = packageOperations.length() - 1; 0 <= index; index-- ) + { + const QVariantMap op = packageOperations.at( index ).toMap(); + if ( op.contains( "source" ) && op.value( "source" ).toString() == key ) + { + cDebug() << Logger::SubEntry << "Removing existing operations for" << key; + packageOperations.removeAt( index ); + somethingRemoved = true; + } + } + + if ( !installPackages.empty() ) + { + QVariantMap op; + op.insert( "install", QVariant( installPackages ) ); + op.insert( "source", key ); + packageOperations.append( op ); + cDebug() << Logger::SubEntry << installPackages.length() << "critical packages."; + } + if ( !tryInstallPackages.empty() ) + { + QVariantMap op; + op.insert( "try_install", QVariant( tryInstallPackages ) ); + op.insert( "source", key ); + packageOperations.append( op ); + cDebug() << Logger::SubEntry << tryInstallPackages.length() << "non-critical packages."; + } + + if ( somethingRemoved || !packageOperations.isEmpty() ) + { + gs->insert( PACKAGEOP, packageOperations ); + return true; + } + return false; +} diff --git a/src/libcalamares/packages/Globals.h b/src/libcalamares/packages/Globals.h new file mode 100644 index 000000000..ef9fa3801 --- /dev/null +++ b/src/libcalamares/packages/Globals.h @@ -0,0 +1,32 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef LIBCALAMARES_PACKAGES_GLOBALS_H +#define LIBCALAMARES_PACKAGES_GLOBALS_H + +#include "modulesystem/InstanceKey.h" + +namespace CalamaresUtils +{ +namespace Packages +{ +/** @brief Sets the install-packages GS keys for the given module + * + * This replaces previously-set install-packages lists for the + * given module by the two new lists. + */ +bool setGSPackageAdditions( const Calamares::ModuleSystem::InstanceKey& module, + const QVariantList& installPackages, + const QVariantList& tryInstallPackages ); +// void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages ); +} // namespace Packages +} // namespace CalamaresUtils + + +#endif diff --git a/src/libcalamares/packages/Tests.cpp b/src/libcalamares/packages/Tests.cpp new file mode 100644 index 000000000..307fb3c41 --- /dev/null +++ b/src/libcalamares/packages/Tests.cpp @@ -0,0 +1,44 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "utils/Logger.h" + +#include "GlobalStorage.h" + +#include + +class PackagesTests : public QObject +{ + Q_OBJECT +public: + PackagesTests() {} + ~PackagesTests() override {} +private Q_SLOTS: + void initTestCase(); + + void testEmpty(); +}; + +void +PackagesTests::initTestCase() +{ + Logger::setupLogLevel( Logger::LOGDEBUG ); +} + +void +PackagesTests::testEmpty() +{ +} + + +QTEST_GUILESS_MAIN( PackagesTests ) + +#include "utils/moc-warnings.h" + +#include "Tests.moc" From 5b609565e2d7b3adefeede2688f2e44cb8495d2d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 14:14:02 +0100 Subject: [PATCH 17/38] [libcalamares] Make Packages API more flexible - pass in the GS object; this makes mostly **testing** much easier --- src/libcalamares/packages/Globals.cpp | 5 ++--- src/libcalamares/packages/Globals.h | 6 +++++- src/libcalamares/packages/Tests.cpp | 13 ++++++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/libcalamares/packages/Globals.cpp b/src/libcalamares/packages/Globals.cpp index a488e704b..6cd07bc4a 100644 --- a/src/libcalamares/packages/Globals.cpp +++ b/src/libcalamares/packages/Globals.cpp @@ -10,11 +10,11 @@ #include "Globals.h" #include "GlobalStorage.h" -#include "JobQueue.h" #include "utils/Logger.h" bool -CalamaresUtils::Packages::setGSPackageAdditions( const Calamares::ModuleSystem::InstanceKey& module, +CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs, + const Calamares::ModuleSystem::InstanceKey& module, const QVariantList& installPackages, const QVariantList& tryInstallPackages ) { @@ -22,7 +22,6 @@ CalamaresUtils::Packages::setGSPackageAdditions( const Calamares::ModuleSystem:: // Check if there's already a PACAKGEOP entry in GS, and if so we'll // extend that one (overwriting the value in GS at the end of this method) - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); QVariantList packageOperations = gs->contains( PACKAGEOP ) ? gs->value( PACKAGEOP ).toList() : QVariantList(); cDebug() << "Existing package operations length" << packageOperations.length(); diff --git a/src/libcalamares/packages/Globals.h b/src/libcalamares/packages/Globals.h index ef9fa3801..a47cf5ae1 100644 --- a/src/libcalamares/packages/Globals.h +++ b/src/libcalamares/packages/Globals.h @@ -10,6 +10,7 @@ #ifndef LIBCALAMARES_PACKAGES_GLOBALS_H #define LIBCALAMARES_PACKAGES_GLOBALS_H +#include "GlobalStorage.h" #include "modulesystem/InstanceKey.h" namespace CalamaresUtils @@ -20,8 +21,11 @@ namespace Packages * * This replaces previously-set install-packages lists for the * given module by the two new lists. + * + * Returns @c true if anything was changed, @c false otherwise. */ -bool setGSPackageAdditions( const Calamares::ModuleSystem::InstanceKey& module, +bool setGSPackageAdditions( Calamares::GlobalStorage* gs, + const Calamares::ModuleSystem::InstanceKey& module, const QVariantList& installPackages, const QVariantList& tryInstallPackages ); // void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages ); diff --git a/src/libcalamares/packages/Tests.cpp b/src/libcalamares/packages/Tests.cpp index 307fb3c41..aaff227a9 100644 --- a/src/libcalamares/packages/Tests.cpp +++ b/src/libcalamares/packages/Tests.cpp @@ -7,9 +7,10 @@ * */ -#include "utils/Logger.h" +#include "Globals.h" #include "GlobalStorage.h" +#include "utils/Logger.h" #include @@ -34,6 +35,16 @@ PackagesTests::initTestCase() void PackagesTests::testEmpty() { + Calamares::GlobalStorage gs; + const QString topKey( "packageOperations" ); + Calamares::ModuleSystem::InstanceKey k( "this", "that" ); + + QVERIFY( !gs.contains( topKey ) ); + QCOMPARE( k.toString(), "this@that" ); + + // Adding nothing at all does nothing + QVERIFY( !CalamaresUtils::Packages::setGSPackageAdditions( &gs, k, QVariantList(), QVariantList() ) ); + QVERIFY( !gs.contains( topKey ) ); } From f1446736f817a482ff26562aa968cb370a1e85b9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 14:37:13 +0100 Subject: [PATCH 18/38] [libcalamares] Expand tests a little - do some additions and check they work - drop the ";add" annotation on the source, this is not needed in the current situation with only adds available. --- src/libcalamares/packages/Globals.cpp | 2 +- src/libcalamares/packages/Tests.cpp | 33 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/libcalamares/packages/Globals.cpp b/src/libcalamares/packages/Globals.cpp index 6cd07bc4a..c5e882436 100644 --- a/src/libcalamares/packages/Globals.cpp +++ b/src/libcalamares/packages/Globals.cpp @@ -25,7 +25,7 @@ CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs, QVariantList packageOperations = gs->contains( PACKAGEOP ) ? gs->value( PACKAGEOP ).toList() : QVariantList(); cDebug() << "Existing package operations length" << packageOperations.length(); - const QString key = module.toString() + QStringLiteral( ";add" ); + const QString key = module.toString(); // Clear out existing operations for this module, going backwards: // Sometimes we remove an item, and we don't want the index to diff --git a/src/libcalamares/packages/Tests.cpp b/src/libcalamares/packages/Tests.cpp index aaff227a9..0a9be3a20 100644 --- a/src/libcalamares/packages/Tests.cpp +++ b/src/libcalamares/packages/Tests.cpp @@ -24,6 +24,7 @@ private Q_SLOTS: void initTestCase(); void testEmpty(); + void testAdd(); }; void @@ -47,6 +48,38 @@ PackagesTests::testEmpty() QVERIFY( !gs.contains( topKey ) ); } +void +PackagesTests::testAdd() +{ + Calamares::GlobalStorage gs; + const QString topKey( "packageOperations" ); + Calamares::ModuleSystem::InstanceKey k( "this", "that" ); + + QVERIFY( !gs.contains( topKey ) ); + QVERIFY( + CalamaresUtils::Packages::setGSPackageAdditions( &gs, k, QVariantList { QString( "vim" ) }, QVariantList() ) ); + QVERIFY( gs.contains( topKey ) ); + auto actionList = gs.value( topKey ).toList(); + QCOMPARE( actionList.length(), 1 ); + auto action = actionList[ 0 ].toMap(); + QVERIFY( action.contains( "install" ) ); + auto op = action[ "install" ].toList(); + QCOMPARE( op.length(), 1 ); + cDebug() << op; + + QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions( + &gs, k, QVariantList { QString( "vim" ), QString( "emacs" ) }, QVariantList() ) ); + QVERIFY( gs.contains( topKey ) ); + actionList = gs.value( topKey ).toList(); + QCOMPARE( actionList.length(), 1 ); + action = actionList[ 0 ].toMap(); + QVERIFY( action.contains( "install" ) ); + op = action[ "install" ].toList(); + QCOMPARE( op.length(), 2 ); + QCOMPARE( action[ "source" ].toString(), k.toString() ); + cDebug() << op; +} + QTEST_GUILESS_MAIN( PackagesTests ) From 9acd2fe458407f2259daa68ab64ac690cc78fcf5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 14:38:52 +0100 Subject: [PATCH 19/38] [netinstall] Use the packages service --- src/modules/netinstall/NetInstallViewStep.cpp | 50 ++----------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index a8ce1e311..ae8d2f95f 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -11,9 +11,8 @@ #include "NetInstallViewStep.h" -#include "GlobalStorage.h" #include "JobQueue.h" - +#include "packages/Globals.h" #include "utils/Logger.h" #include "utils/Variant.h" @@ -127,30 +126,6 @@ void NetInstallViewStep::onLeave() { auto packages = m_config.model()->getPackages(); - cDebug() << "Netinstall: Processing" << packages.length() << "packages."; - - static const char PACKAGEOP[] = "packageOperations"; - - // Check if there's already a PACAKGEOP entry in GS, and if so we'll - // extend that one (overwriting the value in GS at the end of this method) - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - QVariantList packageOperations = gs->contains( PACKAGEOP ) ? gs->value( PACKAGEOP ).toList() : QVariantList(); - cDebug() << Logger::SubEntry << "Existing package operations length" << packageOperations.length(); - - // Clear out existing operations for this module, going backwards: - // Sometimes we remove an item, and we don't want the index to - // fall off the end of the list. - bool somethingRemoved = false; - for ( int index = packageOperations.length() - 1; 0 <= index; index-- ) - { - const QVariantMap op = packageOperations.at( index ).toMap(); - if ( op.contains( "source" ) && op.value( "source" ).toString() == moduleInstanceKey().toString() ) - { - cDebug() << Logger::SubEntry << "Removing existing operations for" << moduleInstanceKey(); - packageOperations.removeAt( index ); - somethingRemoved = true; - } - } // This netinstall module may add two sub-steps to the packageOperations, // one for installing and one for try-installing. @@ -169,27 +144,8 @@ NetInstallViewStep::onLeave() } } - if ( !installPackages.empty() ) - { - QVariantMap op; - op.insert( "install", QVariant( installPackages ) ); - op.insert( "source", moduleInstanceKey().toString() ); - packageOperations.append( op ); - cDebug() << Logger::SubEntry << installPackages.length() << "critical packages."; - } - if ( !tryInstallPackages.empty() ) - { - QVariantMap op; - op.insert( "try_install", QVariant( tryInstallPackages ) ); - op.insert( "source", moduleInstanceKey().toString() ); - packageOperations.append( op ); - cDebug() << Logger::SubEntry << tryInstallPackages.length() << "non-critical packages."; - } - - if ( somethingRemoved || !packageOperations.isEmpty() ) - { - gs->insert( PACKAGEOP, packageOperations ); - } + CalamaresUtils::Packages::setGSPackageAdditions( + Calamares::JobQueue::instance()->globalStorage(), moduleInstanceKey(), installPackages, tryInstallPackages ); } void From 603a7106b3db9c78f7b0e7da79a606b4ecc4160b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 14:47:12 +0100 Subject: [PATCH 20/38] [netinstall] Move package-listing wrangling to the Config object Now all the business logic is in Config, the door is open to building a QML-ified netinstall module. I'm not sure that would be worth it: packagechooser offers more space for a nice UI and should be QML'ed first. --- src/modules/netinstall/Config.cpp | 34 +++++++++++++++++-- src/modules/netinstall/Config.h | 7 ++++ src/modules/netinstall/NetInstallViewStep.cpp | 27 +-------------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 017164c86..927eb8330 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -15,6 +15,7 @@ #include "GlobalStorage.h" #include "JobQueue.h" #include "network/Manager.h" +#include "packages/Globals.h" #include "utils/Logger.h" #include "utils/RAII.h" #include "utils/Retranslator.h" @@ -25,12 +26,13 @@ Config::Config( QObject* parent ) : QObject( parent ) - , m_model( new PackageModel( this ) ) { CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ) } - - Config::~Config() + , m_model( new PackageModel( this ) ) { + CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ); } +Config::~Config() {} + void Config::retranslate() { @@ -238,3 +240,29 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } } } + +void +Config::finalizeGlobalStorage( const Calamares::ModuleSystem::InstanceKey& key ) +{ + auto packages = model()->getPackages(); + + // This netinstall module may add two sub-steps to the packageOperations, + // one for installing and one for try-installing. + QVariantList installPackages; + QVariantList tryInstallPackages; + + for ( const auto& package : packages ) + { + if ( package->isCritical() ) + { + installPackages.append( package->toOperation() ); + } + else + { + tryInstallPackages.append( package->toOperation() ); + } + } + + CalamaresUtils::Packages::setGSPackageAdditions( + Calamares::JobQueue::instance()->globalStorage(), key, installPackages, tryInstallPackages ); +} diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index de96ccee4..e748449a3 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -15,6 +15,7 @@ #include "PackageModel.h" #include "locale/TranslatableConfiguration.h" +#include "modulesystem/InstanceKey.h" #include #include @@ -74,6 +75,12 @@ public: */ void loadGroupList( const QVariantList& groupData ); + /** @brief Write the selected package lists to global storage + * + * Since the config doesn't know what module it is for, + * pass in an instance key. + */ + void finalizeGlobalStorage( const Calamares::ModuleSystem::InstanceKey& key ); signals: void statusChanged( QString status ); ///< Something changed diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index ae8d2f95f..2ac0e73c9 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -11,11 +11,6 @@ #include "NetInstallViewStep.h" -#include "JobQueue.h" -#include "packages/Globals.h" -#include "utils/Logger.h" -#include "utils/Variant.h" - #include "NetInstallPage.h" CALAMARES_PLUGIN_FACTORY_DEFINITION( NetInstallViewStepFactory, registerPlugin< NetInstallViewStep >(); ) @@ -125,27 +120,7 @@ NetInstallViewStep::onActivate() void NetInstallViewStep::onLeave() { - auto packages = m_config.model()->getPackages(); - - // This netinstall module may add two sub-steps to the packageOperations, - // one for installing and one for try-installing. - QVariantList installPackages; - QVariantList tryInstallPackages; - - for ( const auto& package : packages ) - { - if ( package->isCritical() ) - { - installPackages.append( package->toOperation() ); - } - else - { - tryInstallPackages.append( package->toOperation() ); - } - } - - CalamaresUtils::Packages::setGSPackageAdditions( - Calamares::JobQueue::instance()->globalStorage(), moduleInstanceKey(), installPackages, tryInstallPackages ); + m_config.finalizeGlobalStorage( moduleInstanceKey() ); } void From 9341a848201dd11559bc126699ab292bff227acf Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 14:55:26 +0100 Subject: [PATCH 21/38] [libcalamares] Make the RETRANSLATE macros more statement-line Require a ; after RETRANSLATE macros. They are statement-like; this makes it easier for some of them to be recognized by clang-format and resolves some existing weird formatting. --- src/calamares/CalamaresWindow.cpp | 9 +++--- src/calamares/DebugWindow.cpp | 2 +- src/libcalamares/utils/Retranslator.h | 7 +++-- src/libcalamaresui/ViewManager.cpp | 2 +- src/libcalamaresui/viewpages/Slideshow.cpp | 6 ++-- .../InteractiveTerminalPage.cpp | 3 +- src/modules/keyboard/KeyboardPage.cpp | 28 +++++++++---------- src/modules/license/LicensePage.cpp | 2 +- src/modules/locale/LocalePage.cpp | 2 +- src/modules/netinstall/NetInstallPage.cpp | 2 +- src/modules/oemid/OEMViewStep.cpp | 2 +- .../packagechooser/PackageChooserPage.cpp | 2 +- src/modules/plasmalnf/PlasmaLnfPage.cpp | 2 +- src/modules/summary/SummaryPage.cpp | 2 +- src/modules/tracking/TrackingPage.cpp | 2 +- src/modules/users/UsersPage.cpp | 2 +- src/modules/welcome/Config.cpp | 2 +- src/modules/welcome/WelcomePage.cpp | 2 +- .../welcome/checker/CheckerContainer.cpp | 3 +- .../welcome/checker/ResultsListWidget.cpp | 4 +-- 20 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index c37ad97d7..d85d0de74 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -134,9 +134,10 @@ getWidgetSidebar( Calamares::DebugWindowManager* debug, { QPushButton* debugWindowBtn = new QPushButton; debugWindowBtn->setObjectName( "debugButton" ); - CALAMARES_RETRANSLATE_WIDGET( debugWindowBtn, - debugWindowBtn->setText( QCoreApplication::translate( - CalamaresWindow::staticMetaObject.className(), "Show debug information" ) ); ) + CALAMARES_RETRANSLATE_WIDGET( + debugWindowBtn, + debugWindowBtn->setText( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(), + "Show debug information" ) ); ); sideLayout->addWidget( debugWindowBtn ); debugWindowBtn->setFlat( true ); debugWindowBtn->setCheckable( true ); @@ -365,7 +366,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) CALAMARES_RETRANSLATE( const auto* branding = Calamares::Branding::instance(); setWindowTitle( Calamares::Settings::instance()->isSetupMode() ? tr( "%1 Setup Program" ).arg( branding->productName() ) - : tr( "%1 Installer" ).arg( branding->productName() ) ); ) + : tr( "%1 Installer" ).arg( branding->productName() ) ); ); const Calamares::Branding* const branding = Calamares::Branding::instance(); using ImageEntry = Calamares::Branding::ImageEntry; diff --git a/src/calamares/DebugWindow.cpp b/src/calamares/DebugWindow.cpp index ba5171437..45e28878c 100644 --- a/src/calamares/DebugWindow.cpp +++ b/src/calamares/DebugWindow.cpp @@ -213,7 +213,7 @@ DebugWindow::DebugWindow() } } ); - CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); ) + CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); ); } diff --git a/src/libcalamares/utils/Retranslator.h b/src/libcalamares/utils/Retranslator.h index df38fa4d8..f6169e9aa 100644 --- a/src/libcalamares/utils/Retranslator.h +++ b/src/libcalamares/utils/Retranslator.h @@ -91,15 +91,16 @@ private: } // namespace CalamaresUtils -#define CALAMARES_RETRANSLATE( body ) CalamaresUtils::Retranslator::attachRetranslator( this, [=] { body } ); +#define CALAMARES_RETRANSLATE( body ) CalamaresUtils::Retranslator::attachRetranslator( this, [=] { body } ) #define CALAMARES_RETRANSLATE_WIDGET( widget, body ) \ - CalamaresUtils::Retranslator::attachRetranslator( widget, [=] { body } ); + CalamaresUtils::Retranslator::attachRetranslator( widget, [=] { body } ) #define CALAMARES_RETRANSLATE_SLOT( slotfunc ) \ + do \ { \ this->connect( CalamaresUtils::Retranslator::retranslatorFor( this ), \ &CalamaresUtils::Retranslator::languageChange, \ this, \ slotfunc ); \ - } + } while ( 0 ) #endif diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index b22d34c88..566a77f93 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -81,7 +81,7 @@ ViewManager::ViewManager( QObject* parent ) connect( JobQueue::instance(), &JobQueue::failed, this, &ViewManager::onInstallationFailed ); connect( JobQueue::instance(), &JobQueue::finished, this, &ViewManager::next ); - CALAMARES_RETRANSLATE_SLOT( &ViewManager::updateButtonLabels ) + CALAMARES_RETRANSLATE_SLOT( &ViewManager::updateButtonLabels ); } diff --git a/src/libcalamaresui/viewpages/Slideshow.cpp b/src/libcalamaresui/viewpages/Slideshow.cpp index f6df1cae4..6ae5618db 100644 --- a/src/libcalamaresui/viewpages/Slideshow.cpp +++ b/src/libcalamaresui/viewpages/Slideshow.cpp @@ -43,7 +43,7 @@ SlideshowQML::SlideshowQML( QWidget* parent ) , m_qmlComponent( nullptr ) , m_qmlObject( nullptr ) { - m_qmlShow->setObjectName("qml"); + m_qmlShow->setObjectName( "qml" ); CalamaresUtils::registerQmlModels(); @@ -53,7 +53,7 @@ SlideshowQML::SlideshowQML( QWidget* parent ) cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() ); #if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 ) - CALAMARES_RETRANSLATE( if ( m_qmlShow ) { m_qmlShow->engine()->retranslate(); } ) + CALAMARES_RETRANSLATE( if ( m_qmlShow ) { m_qmlShow->engine()->retranslate(); } ); #endif if ( Branding::instance()->slideshowAPI() == 2 ) @@ -205,7 +205,7 @@ SlideshowPictures::SlideshowPictures( QWidget* parent ) , m_imageIndex( 0 ) , m_images( Branding::instance()->slideshowImages() ) { - m_label->setObjectName("image"); + m_label->setObjectName( "image" ); m_label->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_label->setAlignment( Qt::AlignCenter ); diff --git a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp index ea4e3b42e..65818aa03 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp @@ -99,5 +99,6 @@ void InteractiveTerminalPage::setCommand( const QString& command ) { m_command = command; - CALAMARES_RETRANSLATE( m_headerLabel->setText( tr( "Executing script:  %1" ).arg( m_command ) ); ) + CALAMARES_RETRANSLATE( + m_headerLabel->setText( tr( "Executing script:  %1" ).arg( m_command ) ); ); } diff --git a/src/modules/keyboard/KeyboardPage.cpp b/src/modules/keyboard/KeyboardPage.cpp index 5044d9bb6..902f65f9e 100644 --- a/src/modules/keyboard/KeyboardPage.cpp +++ b/src/modules/keyboard/KeyboardPage.cpp @@ -70,9 +70,8 @@ KeyboardPage::KeyboardPage( Config* config, QWidget* parent ) cDebug() << "Variants now" << model->rowCount() << model->currentIndex(); } - connect( ui->buttonRestore, &QPushButton::clicked, [ config = config ] { - config->keyboardModels()->setCurrentIndex(); - } ); + connect( + ui->buttonRestore, &QPushButton::clicked, [config = config] { config->keyboardModels()->setCurrentIndex(); } ); connect( ui->physicalModelSelector, QOverload< int >::of( &QComboBox::currentIndexChanged ), @@ -83,25 +82,24 @@ KeyboardPage::KeyboardPage( Config* config, QWidget* parent ) ui->physicalModelSelector, &QComboBox::setCurrentIndex ); - connect( - ui->layoutSelector->selectionModel(), - &QItemSelectionModel::currentChanged, - [ this ]( const QModelIndex& current ) { m_config->keyboardLayouts()->setCurrentIndex( current.row() ); } ); - connect( config->keyboardLayouts(), &KeyboardLayoutModel::currentIndexChanged, [ this ]( int index ) { + connect( ui->layoutSelector->selectionModel(), + &QItemSelectionModel::currentChanged, + [this]( const QModelIndex& current ) { m_config->keyboardLayouts()->setCurrentIndex( current.row() ); } ); + connect( config->keyboardLayouts(), &KeyboardLayoutModel::currentIndexChanged, [this]( int index ) { ui->layoutSelector->setCurrentIndex( m_config->keyboardLayouts()->index( index ) ); m_keyboardPreview->setLayout( m_config->keyboardLayouts()->key( index ) ); - m_keyboardPreview->setVariant( m_config->keyboardVariants()->key( m_config->keyboardVariants()->currentIndex() ) ); + m_keyboardPreview->setVariant( + m_config->keyboardVariants()->key( m_config->keyboardVariants()->currentIndex() ) ); } ); - connect( - ui->variantSelector->selectionModel(), - &QItemSelectionModel::currentChanged, - [ this ]( const QModelIndex& current ) { m_config->keyboardVariants()->setCurrentIndex( current.row() ); } ); - connect( config->keyboardVariants(), &KeyboardVariantsModel::currentIndexChanged, [ this ]( int index ) { + connect( ui->variantSelector->selectionModel(), + &QItemSelectionModel::currentChanged, + [this]( const QModelIndex& current ) { m_config->keyboardVariants()->setCurrentIndex( current.row() ); } ); + connect( config->keyboardVariants(), &KeyboardVariantsModel::currentIndexChanged, [this]( int index ) { ui->variantSelector->setCurrentIndex( m_config->keyboardVariants()->index( index ) ); m_keyboardPreview->setVariant( m_config->keyboardVariants()->key( index ) ); } ); - CALAMARES_RETRANSLATE_SLOT( &KeyboardPage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &KeyboardPage::retranslate ); } KeyboardPage::~KeyboardPage() diff --git a/src/modules/license/LicensePage.cpp b/src/modules/license/LicensePage.cpp index 1a92e9ac1..cb5481a1e 100644 --- a/src/modules/license/LicensePage.cpp +++ b/src/modules/license/LicensePage.cpp @@ -105,7 +105,7 @@ LicensePage::LicensePage( QWidget* parent ) connect( ui->acceptCheckBox, &QCheckBox::toggled, this, &LicensePage::checkAcceptance ); - CALAMARES_RETRANSLATE_SLOT( &LicensePage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &LicensePage::retranslate ); } void diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index e296b790b..f63aed10d 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -117,7 +117,7 @@ LocalePage::LocalePage( Config* config, QWidget* parent ) connect( m_localeChangeButton, &QPushButton::clicked, this, &LocalePage::changeLocale ); connect( m_formatsChangeButton, &QPushButton::clicked, this, &LocalePage::changeFormats ); - CALAMARES_RETRANSLATE_SLOT( &LocalePage::updateLocaleLabels ) + CALAMARES_RETRANSLATE_SLOT( &LocalePage::updateLocaleLabels ); } diff --git a/src/modules/netinstall/NetInstallPage.cpp b/src/modules/netinstall/NetInstallPage.cpp index 75175a941..3addf86b3 100644 --- a/src/modules/netinstall/NetInstallPage.cpp +++ b/src/modules/netinstall/NetInstallPage.cpp @@ -37,7 +37,7 @@ NetInstallPage::NetInstallPage( Config* c, QWidget* parent ) connect( c, &Config::statusReady, this, &NetInstallPage::expandGroups ); setPageTitle( nullptr ); - CALAMARES_RETRANSLATE_SLOT( &NetInstallPage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &NetInstallPage::retranslate ); } NetInstallPage::~NetInstallPage() {} diff --git a/src/modules/oemid/OEMViewStep.cpp b/src/modules/oemid/OEMViewStep.cpp index f996d4ff3..0c1bdd1d8 100644 --- a/src/modules/oemid/OEMViewStep.cpp +++ b/src/modules/oemid/OEMViewStep.cpp @@ -29,7 +29,7 @@ public: { m_ui->setupUi( this ); - CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); ) + CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); ); } ~OEMPage() override; diff --git a/src/modules/packagechooser/PackageChooserPage.cpp b/src/modules/packagechooser/PackageChooserPage.cpp index e46809fdd..020365a7f 100644 --- a/src/modules/packagechooser/PackageChooserPage.cpp +++ b/src/modules/packagechooser/PackageChooserPage.cpp @@ -28,7 +28,7 @@ PackageChooserPage::PackageChooserPage( PackageChooserMode mode, QWidget* parent m_introduction.screenshot = QPixmap( QStringLiteral( ":/images/no-selection.png" ) ); ui->setupUi( this ); - CALAMARES_RETRANSLATE( updateLabels(); ) + CALAMARES_RETRANSLATE( updateLabels(); ); switch ( mode ) { diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp index 0e7f05e43..a4de6cc47 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.cpp +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -85,7 +85,7 @@ PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent ) "You can also skip this step and configure the look-and-feel " "once the system is installed. Clicking on a look-and-feel " "selection will give you a live preview of that look-and-feel." ) ); - } ) + } ); auto* view = new QListView( this ); view->setModel( m_config->themeModel() ); diff --git a/src/modules/summary/SummaryPage.cpp b/src/modules/summary/SummaryPage.cpp index 96781c25e..3dd797be0 100644 --- a/src/modules/summary/SummaryPage.cpp +++ b/src/modules/summary/SummaryPage.cpp @@ -48,7 +48,7 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent ) headerLabel->setText( tr( "This is an overview of what will happen once you start " "the setup procedure." ) ); else headerLabel->setText( tr( "This is an overview of what will happen once you start " - "the install procedure." ) ); ) + "the install procedure." ) ); ); layout->addWidget( headerLabel ); layout->addWidget( m_scrollArea ); m_scrollArea->setWidgetResizable( true ); diff --git a/src/modules/tracking/TrackingPage.cpp b/src/modules/tracking/TrackingPage.cpp index ffdb8be66..727efebbd 100644 --- a/src/modules/tracking/TrackingPage.cpp +++ b/src/modules/tracking/TrackingPage.cpp @@ -28,7 +28,7 @@ TrackingPage::TrackingPage( Config* config, QWidget* parent ) , ui( new Ui::TrackingPage ) { ui->setupUi( this ); - CALAMARES_RETRANSLATE_SLOT( &TrackingPage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &TrackingPage::retranslate ); ui->noneCheckBox->setChecked( true ); ui->noneCheckBox->setEnabled( false ); diff --git a/src/modules/users/UsersPage.cpp b/src/modules/users/UsersPage.cpp index 0e86931c1..04554454c 100644 --- a/src/modules/users/UsersPage.cpp +++ b/src/modules/users/UsersPage.cpp @@ -140,7 +140,7 @@ UsersPage::UsersPage( Config* config, QWidget* parent ) config, &Config::requireStrongPasswordsChanged, ui->checkBoxRequireStrongPassword, &QCheckBox::setChecked ); } - CALAMARES_RETRANSLATE_SLOT( &UsersPage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &UsersPage::retranslate ); onReuseUserPasswordChanged( m_config->reuseUserPasswordForRoot() ); onFullNameTextEdited( m_config->fullName() ); diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 72e1cfc3b..097126ea6 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -30,7 +30,7 @@ Config::Config( QObject* parent ) { initLanguages(); - CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ); } void diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index aa9e9d7bb..616c91bff 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -75,7 +75,7 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent ) initLanguages(); - CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate ); connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox ); connect( Calamares::ModuleManager::instance(), diff --git a/src/modules/welcome/checker/CheckerContainer.cpp b/src/modules/welcome/checker/CheckerContainer.cpp index 0dcd820a3..eb3416ce5 100644 --- a/src/modules/welcome/checker/CheckerContainer.cpp +++ b/src/modules/welcome/checker/CheckerContainer.cpp @@ -34,7 +34,8 @@ CheckerContainer::CheckerContainer( const Calamares::RequirementsModel& model, Q CalamaresUtils::unmarginLayout( mainLayout ); mainLayout->addWidget( m_waitingWidget ); - CALAMARES_RETRANSLATE( if ( m_waitingWidget ) m_waitingWidget->setText( tr( "Gathering system information..." ) ); ) + CALAMARES_RETRANSLATE( if ( m_waitingWidget ) + m_waitingWidget->setText( tr( "Gathering system information..." ) ); ); } CheckerContainer::~CheckerContainer() diff --git a/src/modules/welcome/checker/ResultsListWidget.cpp b/src/modules/welcome/checker/ResultsListWidget.cpp index b0e8a175e..c04d2a48b 100644 --- a/src/modules/welcome/checker/ResultsListWidget.cpp +++ b/src/modules/welcome/checker/ResultsListWidget.cpp @@ -121,7 +121,7 @@ ResultsListDialog::ResultsListDialog( const Calamares::RequirementsModel& model, connect( buttonBox, &QDialogButtonBox::clicked, this, &QDialog::close ); - CALAMARES_RETRANSLATE_SLOT( &ResultsListDialog::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &ResultsListDialog::retranslate ); retranslate(); // Do it now to fill in the texts } @@ -216,7 +216,7 @@ ResultsListWidget::ResultsListWidget( const Calamares::RequirementsModel& model, m_explanation->setAlignment( Qt::AlignCenter ); } - CALAMARES_RETRANSLATE_SLOT( &ResultsListWidget::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &ResultsListWidget::retranslate ); retranslate(); } From bb426ebac4e7fc546136cb8c884a038aad2a163f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 16:01:25 +0100 Subject: [PATCH 22/38] [partition] Add missing ; (and apply coding style) --- src/modules/partition/gui/BootInfoWidget.cpp | 2 +- src/modules/partition/gui/ChoicePage.cpp | 111 +++++++++---------- 2 files changed, 54 insertions(+), 59 deletions(-) diff --git a/src/modules/partition/gui/BootInfoWidget.cpp b/src/modules/partition/gui/BootInfoWidget.cpp index 0b9d08c47..4bfa6f8f4 100644 --- a/src/modules/partition/gui/BootInfoWidget.cpp +++ b/src/modules/partition/gui/BootInfoWidget.cpp @@ -53,7 +53,7 @@ BootInfoWidget::BootInfoWidget( QWidget* parent ) m_bootIcon->setPalette( palette ); m_bootLabel->setPalette( palette ); - CALAMARES_RETRANSLATE( retranslateUi(); ) + CALAMARES_RETRANSLATE( retranslateUi(); ); } void diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 09a32b1a2..00b6b7d63 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -119,7 +119,7 @@ ChoicePage::ChoicePage( Config* config, QWidget* parent ) // Drive selector + preview CALAMARES_RETRANSLATE( retranslateUi( this ); m_drivesLabel->setText( tr( "Select storage de&vice:" ) ); m_previewBeforeLabel->setText( tr( "Current:" ) ); - m_previewAfterLabel->setText( tr( "After:" ) ); ) + m_previewAfterLabel->setText( tr( "After:" ) ); ); m_previewBeforeFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); m_previewAfterFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); @@ -298,7 +298,7 @@ ChoicePage::setupChoices() CALAMARES_RETRANSLATE( m_somethingElseButton->setText( tr( "Manual partitioning
" "You can create or resize partitions yourself." ) ); - updateSwapChoicesTr( m_eraseSwapChoiceComboBox ); ) + updateSwapChoicesTr( m_eraseSwapChoiceComboBox ); ); } @@ -360,13 +360,12 @@ ChoicePage::applyDeviceChoice() if ( m_core->isDirty() ) { - ScanningDialog::run( - QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertAllDevices(); - } ), - [this] { continueApplyDeviceChoice(); }, - this ); + ScanningDialog::run( QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertAllDevices(); + } ), + [this] { continueApplyDeviceChoice(); }, + this ); } else { @@ -453,16 +452,15 @@ ChoicePage::applyActionChoice( InstallChoice choice ) if ( m_core->isDirty() ) { - ScanningDialog::run( - QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [=] { - PartitionActions::doAutopartition( m_core, selectedDevice(), options ); - emit deviceChosen(); - }, - this ); + ScanningDialog::run( QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [=] { + PartitionActions::doAutopartition( m_core, selectedDevice(), options ); + emit deviceChosen(); + }, + this ); } else { @@ -474,13 +472,12 @@ ChoicePage::applyActionChoice( InstallChoice choice ) case InstallChoice::Replace: if ( m_core->isDirty() ) { - ScanningDialog::run( - QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [] {}, - this ); + ScanningDialog::run( QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [] {}, + this ); } updateNextEnabled(); @@ -494,18 +491,17 @@ ChoicePage::applyActionChoice( InstallChoice choice ) case InstallChoice::Alongside: if ( m_core->isDirty() ) { - ScanningDialog::run( - QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [this] { - // We need to reupdate after reverting because the splitter widget is - // not a true view. - updateActionChoicePreview( m_config->installChoice() ); - updateNextEnabled(); - }, - this ); + ScanningDialog::run( QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [this] { + // We need to reupdate after reverting because the splitter widget is + // not a true view. + updateActionChoicePreview( m_config->installChoice() ); + updateNextEnabled(); + }, + this ); } updateNextEnabled(); @@ -1037,23 +1033,22 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) Calamares::restoreSelectedBootLoader( *m_bootloaderComboBox, m_core->bootLoaderInstallPath() ); } } ); - connect( - m_core, - &PartitionCoreModule::deviceReverted, - this, - [this]( Device* dev ) { - Q_UNUSED( dev ) - if ( !m_bootloaderComboBox.isNull() ) - { - if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() ) - { - m_bootloaderComboBox->setModel( m_core->bootLoaderModel() ); - } + connect( m_core, + &PartitionCoreModule::deviceReverted, + this, + [this]( Device* dev ) { + Q_UNUSED( dev ) + if ( !m_bootloaderComboBox.isNull() ) + { + if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() ) + { + m_bootloaderComboBox->setModel( m_core->bootLoaderModel() ); + } - m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex ); - } - }, - Qt::QueuedConnection ); + m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex ); + } + }, + Qt::QueuedConnection ); // ^ Must be Queued so it's sure to run when the widget is already visible. eraseLayout->addWidget( m_bootloaderComboBox ); @@ -1303,7 +1298,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ); m_replaceButton->hide(); m_alongsideButton->hide(); @@ -1337,7 +1332,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ); } else { @@ -1358,7 +1353,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ); } } else @@ -1383,7 +1378,7 @@ ChoicePage::setupActions() m_replaceButton->setText( tr( "Replace a partition
" "Replaces a partition with %1." ) - .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) + .arg( Calamares::Branding::instance()->shortVersionedName() ) ); ); } #ifdef DEBUG_PARTITION_UNSAFE From 3b9c0bdf91638db41bf48423b2f04231913ed066 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 16:06:46 +0100 Subject: [PATCH 23/38] CI: don't allow clang-format 7 any more --- ci/calamaresstyle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/calamaresstyle b/ci/calamaresstyle index 42adc33cc..81ec71c39 100755 --- a/ci/calamaresstyle +++ b/ci/calamaresstyle @@ -36,7 +36,12 @@ test -x "$AS" || { echo "! $AS is not executable."; exit 1 ; } test -x "$CF" || { echo "! $CF is not executable."; exit 1 ; } unmangle_clang_format="" -if expr `"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1` '<' 10 > /dev/null ; then +format_version=`"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1` +if expr "$format_version" '<' 8 > /dev/null ; then + echo "! Clang-format version 8+ required" + exit 1 +fi +if expr "$format_version" '<' 10 > /dev/null ; then : else unmangle_clang_format=$( dirname $0 )/../.clang-format From 2b4bc7adf47f7b5458f698496c2ad80c9cc4d3fe Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 16:08:13 +0100 Subject: [PATCH 24/38] [partition] Apply newer formatting tool --- src/modules/partition/gui/ChoicePage.cpp | 99 +++++++++++++----------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 00b6b7d63..ba7552c76 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -360,12 +360,13 @@ ChoicePage::applyDeviceChoice() if ( m_core->isDirty() ) { - ScanningDialog::run( QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertAllDevices(); - } ), - [this] { continueApplyDeviceChoice(); }, - this ); + ScanningDialog::run( + QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertAllDevices(); + } ), + [this] { continueApplyDeviceChoice(); }, + this ); } else { @@ -452,15 +453,16 @@ ChoicePage::applyActionChoice( InstallChoice choice ) if ( m_core->isDirty() ) { - ScanningDialog::run( QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [=] { - PartitionActions::doAutopartition( m_core, selectedDevice(), options ); - emit deviceChosen(); - }, - this ); + ScanningDialog::run( + QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [=] { + PartitionActions::doAutopartition( m_core, selectedDevice(), options ); + emit deviceChosen(); + }, + this ); } else { @@ -472,12 +474,13 @@ ChoicePage::applyActionChoice( InstallChoice choice ) case InstallChoice::Replace: if ( m_core->isDirty() ) { - ScanningDialog::run( QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [] {}, - this ); + ScanningDialog::run( + QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [] {}, + this ); } updateNextEnabled(); @@ -491,17 +494,18 @@ ChoicePage::applyActionChoice( InstallChoice choice ) case InstallChoice::Alongside: if ( m_core->isDirty() ) { - ScanningDialog::run( QtConcurrent::run( [=] { - QMutexLocker locker( &m_coreMutex ); - m_core->revertDevice( selectedDevice() ); - } ), - [this] { - // We need to reupdate after reverting because the splitter widget is - // not a true view. - updateActionChoicePreview( m_config->installChoice() ); - updateNextEnabled(); - }, - this ); + ScanningDialog::run( + QtConcurrent::run( [=] { + QMutexLocker locker( &m_coreMutex ); + m_core->revertDevice( selectedDevice() ); + } ), + [this] { + // We need to reupdate after reverting because the splitter widget is + // not a true view. + updateActionChoicePreview( m_config->installChoice() ); + updateNextEnabled(); + }, + this ); } updateNextEnabled(); @@ -1033,22 +1037,23 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) Calamares::restoreSelectedBootLoader( *m_bootloaderComboBox, m_core->bootLoaderInstallPath() ); } } ); - connect( m_core, - &PartitionCoreModule::deviceReverted, - this, - [this]( Device* dev ) { - Q_UNUSED( dev ) - if ( !m_bootloaderComboBox.isNull() ) - { - if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() ) - { - m_bootloaderComboBox->setModel( m_core->bootLoaderModel() ); - } + connect( + m_core, + &PartitionCoreModule::deviceReverted, + this, + [this]( Device* dev ) { + Q_UNUSED( dev ) + if ( !m_bootloaderComboBox.isNull() ) + { + if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() ) + { + m_bootloaderComboBox->setModel( m_core->bootLoaderModel() ); + } - m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex ); - } - }, - Qt::QueuedConnection ); + m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex ); + } + }, + Qt::QueuedConnection ); // ^ Must be Queued so it's sure to run when the widget is already visible. eraseLayout->addWidget( m_bootloaderComboBox ); From 186d32ebeebf1a11f0553b47d3386e85187478a9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Mar 2021 16:11:02 +0100 Subject: [PATCH 25/38] [partition] More missing ; --- src/modules/partition/gui/DeviceInfoWidget.cpp | 2 +- src/modules/partition/gui/EncryptWidget.cpp | 2 +- src/modules/partition/gui/PartitionPage.cpp | 2 +- src/modules/partition/gui/PartitionViewStep.cpp | 2 +- src/modules/partition/gui/ReplaceWidget.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/partition/gui/DeviceInfoWidget.cpp b/src/modules/partition/gui/DeviceInfoWidget.cpp index 708982101..bbc8ce74c 100644 --- a/src/modules/partition/gui/DeviceInfoWidget.cpp +++ b/src/modules/partition/gui/DeviceInfoWidget.cpp @@ -54,7 +54,7 @@ DeviceInfoWidget::DeviceInfoWidget( QWidget* parent ) m_ptIcon->setPalette( palette ); m_ptLabel->setPalette( palette ); - CALAMARES_RETRANSLATE_SLOT( &DeviceInfoWidget::retranslateUi ) + CALAMARES_RETRANSLATE_SLOT( &DeviceInfoWidget::retranslateUi ); } diff --git a/src/modules/partition/gui/EncryptWidget.cpp b/src/modules/partition/gui/EncryptWidget.cpp index 3ac56575b..7f648491a 100644 --- a/src/modules/partition/gui/EncryptWidget.cpp +++ b/src/modules/partition/gui/EncryptWidget.cpp @@ -35,7 +35,7 @@ EncryptWidget::EncryptWidget( QWidget* parent ) setFixedHeight( m_ui->m_passphraseLineEdit->height() ); // Avoid jumping up and down updateState(); - CALAMARES_RETRANSLATE_SLOT( &EncryptWidget::retranslate ) + CALAMARES_RETRANSLATE_SLOT( &EncryptWidget::retranslate ); } diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index b9930504f..f5a3b0f43 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -117,7 +117,7 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent ) m_ui->label_3->hide(); } - CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); ) + CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); ); } PartitionPage::~PartitionPage() {} diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 561fdaba7..6755b64c6 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -67,7 +67,7 @@ PartitionViewStep::PartitionViewStep( QObject* parent ) m_waitingWidget = new WaitingWidget( QString() ); m_widget->addWidget( m_waitingWidget ); - CALAMARES_RETRANSLATE( m_waitingWidget->setText( tr( "Gathering system information..." ) ); ) + CALAMARES_RETRANSLATE( m_waitingWidget->setText( tr( "Gathering system information..." ) ); ); m_core = new PartitionCoreModule( this ); // Unusable before init is complete! // We're not done loading, but we need the configuration map first. diff --git a/src/modules/partition/gui/ReplaceWidget.cpp b/src/modules/partition/gui/ReplaceWidget.cpp index a8ab40570..078eb4de7 100644 --- a/src/modules/partition/gui/ReplaceWidget.cpp +++ b/src/modules/partition/gui/ReplaceWidget.cpp @@ -50,7 +50,7 @@ ReplaceWidget::ReplaceWidget( PartitionCoreModule* core, QComboBox* devicesCombo updateFromCurrentDevice( devicesComboBox ); } ); - CALAMARES_RETRANSLATE( onPartitionSelected(); ) + CALAMARES_RETRANSLATE( onPartitionSelected(); ); } From 404a9ef98ace44ace1e3cc3bf6ee04143a4a5559 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 17 Mar 2021 00:09:15 +0100 Subject: [PATCH 26/38] [netinstall] Split off requesting netinstall data into a queue-manager This is the actual "meat" of the branch, which makes the netinstall module request one URL at a time until one succeeds. --- src/modules/netinstall/CMakeLists.txt | 1 + src/modules/netinstall/Config.cpp | 132 +++---------------- src/modules/netinstall/Config.h | 43 +----- src/modules/netinstall/LoaderQueue.cpp | 174 +++++++++++++++++++++++++ src/modules/netinstall/LoaderQueue.h | 67 ++++++++++ 5 files changed, 264 insertions(+), 153 deletions(-) create mode 100644 src/modules/netinstall/LoaderQueue.cpp create mode 100644 src/modules/netinstall/LoaderQueue.h diff --git a/src/modules/netinstall/CMakeLists.txt b/src/modules/netinstall/CMakeLists.txt index 4500a314f..ec926c9d3 100644 --- a/src/modules/netinstall/CMakeLists.txt +++ b/src/modules/netinstall/CMakeLists.txt @@ -8,6 +8,7 @@ calamares_add_plugin( netinstall EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES Config.cpp + LoaderQueue.cpp NetInstallViewStep.cpp NetInstallPage.cpp PackageTreeItem.cpp diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 927eb8330..491443654 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -12,15 +12,15 @@ #include "Config.h" +#include "LoaderQueue.h" + #include "GlobalStorage.h" #include "JobQueue.h" #include "network/Manager.h" #include "packages/Globals.h" #include "utils/Logger.h" -#include "utils/RAII.h" #include "utils/Retranslator.h" #include "utils/Variant.h" -#include "utils/Yaml.h" #include @@ -86,106 +86,13 @@ void Config::loadGroupList( const QVariantList& groupData ) { m_model->setupModelData( groupData ); + if ( m_model->rowCount() < 1 ) + { + cWarning() << "NetInstall groups data was empty."; + } emit statusReady(); } -void -Config::loadGroupList( const QUrl& url ) -{ - if ( !url.isValid() ) - { - setStatus( Status::FailedBadConfiguration ); - } - - using namespace CalamaresUtils::Network; - - cDebug() << "NetInstall loading groups from" << url; - QNetworkReply* reply = Manager::instance().asynchronousGet( - url, - RequestOptions( RequestOptions::FakeUserAgent | RequestOptions::FollowRedirect, std::chrono::seconds( 30 ) ) ); - - if ( !reply ) - { - cDebug() << Logger::Continuation << "request failed immediately."; - setStatus( Status::FailedBadConfiguration ); - } - else - { - m_reply = reply; - connect( reply, &QNetworkReply::finished, this, &Config::receivedGroupData ); - } -} - -void -Config::receivedGroupData() -{ - if ( !m_reply || !m_reply->isFinished() ) - { - cWarning() << "NetInstall data called too early."; - setStatus( Status::FailedInternalError ); - return; - } - - cDebug() << "NetInstall group data received" << m_reply->size() << "bytes from" << m_reply->url(); - - cqDeleter< QNetworkReply > d { m_reply }; - - // If m_required is *false* then we still say we're ready - // even if the reply is corrupt or missing. - if ( m_reply->error() != QNetworkReply::NoError ) - { - cWarning() << "unable to fetch netinstall package lists."; - cDebug() << Logger::SubEntry << "Netinstall reply error: " << m_reply->error(); - cDebug() << Logger::SubEntry << "Request for url: " << m_reply->url().toString() - << " failed with: " << m_reply->errorString(); - setStatus( Status::FailedNetworkError ); - return; - } - - QByteArray yamlData = m_reply->readAll(); - try - { - YAML::Node groups = YAML::Load( yamlData.constData() ); - - if ( groups.IsSequence() ) - { - loadGroupList( CalamaresUtils::yamlSequenceToVariant( groups ) ); - } - else if ( groups.IsMap() ) - { - auto map = CalamaresUtils::yamlMapToVariant( groups ); - loadGroupList( map.value( "groups" ).toList() ); - } - else - { - cWarning() << "NetInstall groups data does not form a sequence."; - } - if ( m_model->rowCount() < 1 ) - { - cWarning() << "NetInstall groups data was empty."; - } - } - catch ( YAML::Exception& e ) - { - CalamaresUtils::explainYamlException( e, yamlData, "netinstall groups data" ); - setStatus( Status::FailedBadData ); - } -} - -Config::SourceItem -Config::SourceItem::makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ) -{ - if ( groupsUrl == QStringLiteral( "local" ) ) - { - return SourceItem { QUrl(), configurationMap.value( "groups" ).toList() }; - } - else - { - return SourceItem { QUrl { groupsUrl }, QVariantList() }; - } -} - - void Config::setConfigurationMap( const QVariantMap& configurationMap ) { @@ -213,31 +120,24 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) const auto& groupsUrlVariant = configurationMap.value( key ); if ( groupsUrlVariant.type() == QVariant::String ) { - m_urls.append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) ); + m_queue = new LoaderQueue( this ); + m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) ); } else if ( groupsUrlVariant.type() == QVariant::StringList ) { + m_queue = new LoaderQueue( this ); for ( const auto& s : groupsUrlVariant.toStringList() ) { - m_urls.append( SourceItem::makeSourceItem( s, configurationMap ) ); + m_queue->append( SourceItem::makeSourceItem( s, configurationMap ) ); } } - - QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" ); - if ( !groupsUrl.isEmpty() ) + if ( m_queue ) { - // Keep putting groupsUrl into the global storage, - // even though it's no longer used for in-module data-passing. - Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl ); - if ( groupsUrl == QStringLiteral( "local" ) ) - { - QVariantList l = configurationMap.value( "groups" ).toList(); - loadGroupList( l ); - } - else - { - loadGroupList( groupsUrl ); - } + connect( m_queue, &LoaderQueue::done, [this]() { + m_queue->deleteLater(); + m_queue = nullptr; + } ); + m_queue->fetchNext(); } } diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index e748449a3..b8e258eff 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -18,11 +18,11 @@ #include "modulesystem/InstanceKey.h" #include -#include -#include #include -class QNetworkReply; +#include + +class LoaderQueue; class Config : public QObject { @@ -61,13 +61,6 @@ public: QString sidebarLabel() const; QString titleLabel() const; - /** @brief Retrieves the groups, with name, description and packages - * - * Loads data from the given URL. Once done, the data is parsed - * and passed on to the other loadGroupList() method. - */ - void loadGroupList( const QUrl& url ); - /** @brief Fill model from parsed data. * * Fills the model with a list of groups -- which can contain @@ -82,44 +75,20 @@ public: */ void finalizeGlobalStorage( const Calamares::ModuleSystem::InstanceKey& key ); -signals: +Q_SIGNALS: void statusChanged( QString status ); ///< Something changed void sidebarLabelChanged( QString label ); void titleLabelChanged( QString label ); void statusReady(); ///< Loading groups is complete -private slots: - void receivedGroupData(); ///< From async-loading group data +private Q_SLOTS: void retranslate(); private: - /** @brief Data about an entry in *groupsUrl* - * - * This can be a specific URL, or "local" which uses data stored - * in the configuration file itself. - */ - struct SourceItem - { - QUrl url; - QVariantList data; - - bool isUrl() const { return url.isValid(); } - bool isLocal() const { return !data.isEmpty(); } - bool isValid() const { return isUrl() || isLocal(); } - /** @brief Create a SourceItem - * - * If the @p groupsUrl is @c "local" then the *groups* key in - * the @p configurationMap is used as the source; otherwise the - * string is used as an actual URL. - */ - static SourceItem makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ); - }; - - QQueue< SourceItem > m_urls; CalamaresUtils::Locale::TranslatedString* m_sidebarLabel = nullptr; // As it appears in the sidebar CalamaresUtils::Locale::TranslatedString* m_titleLabel = nullptr; PackageModel* m_model = nullptr; - QNetworkReply* m_reply = nullptr; // For fetching data + LoaderQueue* m_queue; Status m_status = Status::Ok; bool m_required = false; }; diff --git a/src/modules/netinstall/LoaderQueue.cpp b/src/modules/netinstall/LoaderQueue.cpp new file mode 100644 index 000000000..7236b4096 --- /dev/null +++ b/src/modules/netinstall/LoaderQueue.cpp @@ -0,0 +1,174 @@ +/* + * SPDX-FileCopyrightText: 2016 Luca Giambonini + * SPDX-FileCopyrightText: 2016 Lisa Vitolo + * SPDX-FileCopyrightText: 2017 Kyle Robbertze + * SPDX-FileCopyrightText: 2017-2018 2020, Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "LoaderQueue.h" + +#include "Config.h" +#include "network/Manager.h" +#include "utils/Logger.h" +#include "utils/RAII.h" +#include "utils/Yaml.h" + +#include +#include + +SourceItem +SourceItem::makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ) +{ + if ( groupsUrl == QStringLiteral( "local" ) ) + { + return SourceItem { QUrl(), configurationMap.value( "groups" ).toList() }; + } + else + { + return SourceItem { QUrl { groupsUrl }, QVariantList() }; + } +} + +LoaderQueue::LoaderQueue( Config* parent ) + : QObject( parent ) + , m_config( parent ) +{ +} + +void +LoaderQueue::append( SourceItem&& i ) +{ + m_queue.append( std::move( i ) ); +} + +void +LoaderQueue::fetchNext() +{ + if ( m_queue.isEmpty() ) + { + m_config->setStatus( Config::Status::FailedBadData ); + emit done(); + return; + } + + auto source = m_queue.takeFirst(); + if ( source.isLocal() ) + { + m_config->loadGroupList( source.data ); + emit done(); + } + else + { + fetch( source.url ); + } +} + + +void +LoaderQueue::fetch( const QUrl& url ) +{ + if ( !url.isValid() ) + { + m_config->setStatus( Config::Status::FailedBadConfiguration ); + } + + using namespace CalamaresUtils::Network; + + cDebug() << "NetInstall loading groups from" << url; + QNetworkReply* reply = Manager::instance().asynchronousGet( + url, + RequestOptions( RequestOptions::FakeUserAgent | RequestOptions::FollowRedirect, std::chrono::seconds( 30 ) ) ); + + if ( !reply ) + { + cDebug() << Logger::Continuation << "request failed immediately."; + m_config->setStatus( Config::Status::FailedBadConfiguration ); + } + else + { + m_reply = reply; + connect( reply, &QNetworkReply::finished, this, &LoaderQueue::dataArrived ); + } +} + +class FetchNextUnless +{ +public: + FetchNextUnless( LoaderQueue* q ) + : m_q( q ) + { + } + ~FetchNextUnless() + { + if ( m_q ) + { + QMetaObject::invokeMethod( m_q, "fetchNext", Qt::QueuedConnection ); + } + } + void release() { m_q = nullptr; } + +private: + LoaderQueue* m_q = nullptr; +}; + +void +LoaderQueue::dataArrived() +{ + FetchNextUnless finished( this ); + + if ( !m_reply || !m_reply->isFinished() ) + { + cWarning() << "NetInstall data called too early."; + m_config->setStatus( Config::Status::FailedInternalError ); + return; + } + + cDebug() << "NetInstall group data received" << m_reply->size() << "bytes from" << m_reply->url(); + + cqDeleter< QNetworkReply > d { m_reply }; + + // If m_required is *false* then we still say we're ready + // even if the reply is corrupt or missing. + if ( m_reply->error() != QNetworkReply::NoError ) + { + cWarning() << "unable to fetch netinstall package lists."; + cDebug() << Logger::SubEntry << "Netinstall reply error: " << m_reply->error(); + cDebug() << Logger::SubEntry << "Request for url: " << m_reply->url().toString() + << " failed with: " << m_reply->errorString(); + m_config->setStatus( Config::Status::FailedNetworkError ); + return; + } + + QByteArray yamlData = m_reply->readAll(); + try + { + YAML::Node groups = YAML::Load( yamlData.constData() ); + + if ( groups.IsSequence() ) + { + finished.release(); + m_config->loadGroupList( CalamaresUtils::yamlSequenceToVariant( groups ) ); + emit done(); + } + else if ( groups.IsMap() ) + { + finished.release(); + auto map = CalamaresUtils::yamlMapToVariant( groups ); + m_config->loadGroupList( map.value( "groups" ).toList() ); + emit done(); + } + else + { + cWarning() << "NetInstall groups data does not form a sequence."; + } + } + catch ( YAML::Exception& e ) + { + CalamaresUtils::explainYamlException( e, yamlData, "netinstall groups data" ); + m_config->setStatus( Config::Status::FailedBadData ); + } +} diff --git a/src/modules/netinstall/LoaderQueue.h b/src/modules/netinstall/LoaderQueue.h new file mode 100644 index 000000000..de6c7276f --- /dev/null +++ b/src/modules/netinstall/LoaderQueue.h @@ -0,0 +1,67 @@ +/* + * SPDX-FileCopyrightText: 2016 Luca Giambonini + * SPDX-FileCopyrightText: 2016 Lisa Vitolo + * SPDX-FileCopyrightText: 2017 Kyle Robbertze + * SPDX-FileCopyrightText: 2017-2018 2020, Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef NETINSTALL_LOADERQUEUE_H +#define NETINSTALL_LOADERQUEUE_H + +#include +#include +#include + +class Config; +class QNetworkReply; + +/** @brief Data about an entry in *groupsUrl* + * + * This can be a specific URL, or "local" which uses data stored + * in the configuration file itself. + */ +struct SourceItem +{ + QUrl url; + QVariantList data; + + bool isUrl() const { return url.isValid(); } + bool isLocal() const { return !data.isEmpty(); } + bool isValid() const { return isUrl() || isLocal(); } + /** @brief Create a SourceItem + * + * If the @p groupsUrl is @c "local" then the *groups* key in + * the @p configurationMap is used as the source; otherwise the + * string is used as an actual URL. + */ + static SourceItem makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ); +}; + + +class LoaderQueue : public QObject +{ + Q_OBJECT +public: + LoaderQueue( Config* parent ); + + void append( SourceItem&& i ); + void fetchNext(); + +public Q_SLOTS: + void fetch( const QUrl& url ); + void dataArrived(); + +Q_SIGNALS: + void done(); + +private: + QQueue< SourceItem > m_queue; + Config* m_config = nullptr; + QNetworkReply* m_reply = nullptr; +}; + +#endif From 03d086a2333ea8a2858662debcc4cee9d89b3d24 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 11:41:47 +0100 Subject: [PATCH 27/38] [netinstall] Missing initialisations, split out slot - m_queue was not initialized to nullptr, crashes - split queue-is-done to a separate slot rather than a lambda - prefer queueing calls to fetchNext(), for responsiveness --- src/modules/netinstall/Config.cpp | 18 +++++++++++++----- src/modules/netinstall/Config.h | 3 ++- src/modules/netinstall/LoaderQueue.cpp | 6 ++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 491443654..5f703f8d4 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -93,6 +93,17 @@ Config::loadGroupList( const QVariantList& groupData ) emit statusReady(); } +void +Config::loadingDone() +{ + if ( m_queue ) + { + m_queue->deleteLater(); + m_queue = nullptr; + } +} + + void Config::setConfigurationMap( const QVariantMap& configurationMap ) { @@ -133,11 +144,8 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } if ( m_queue ) { - connect( m_queue, &LoaderQueue::done, [this]() { - m_queue->deleteLater(); - m_queue = nullptr; - } ); - m_queue->fetchNext(); + connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone ); + QMetaObject::invokeMethod( m_queue, "fetchNext", Qt::QueuedConnection ); } } diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index b8e258eff..d4c3c6f19 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -83,12 +83,13 @@ Q_SIGNALS: private Q_SLOTS: void retranslate(); + void loadingDone(); private: CalamaresUtils::Locale::TranslatedString* m_sidebarLabel = nullptr; // As it appears in the sidebar CalamaresUtils::Locale::TranslatedString* m_titleLabel = nullptr; PackageModel* m_model = nullptr; - LoaderQueue* m_queue; + LoaderQueue* m_queue = nullptr; Status m_status = Status::Ok; bool m_required = false; }; diff --git a/src/modules/netinstall/LoaderQueue.cpp b/src/modules/netinstall/LoaderQueue.cpp index 7236b4096..98245dead 100644 --- a/src/modules/netinstall/LoaderQueue.cpp +++ b/src/modules/netinstall/LoaderQueue.cpp @@ -95,6 +95,12 @@ LoaderQueue::fetch( const QUrl& url ) } } +/** @brief Call fetchNext() on the queue if it can + * + * On destruction, a new call to fetchNext() is queued, so that + * the queue continues loading. Calling release() before the + * destructor skips the fetchNext(), ending the queue-loading. + */ class FetchNextUnless { public: From fdfe52efe29df1b0f26841feaf920beaa3f24765 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 12:30:09 +0100 Subject: [PATCH 28/38] [netinstall] Improve loader queue API a bit - use load() to start loading - the FetchNextUnless class is useful in more spots in the loading process - set status explicitly on success (otherwise, a failure in a previous URL would leave a failure message lying around even when the module shows something useful) --- src/modules/netinstall/Config.cpp | 16 ++++-- src/modules/netinstall/Config.h | 4 +- src/modules/netinstall/LoaderQueue.cpp | 70 +++++++++++++++----------- src/modules/netinstall/LoaderQueue.h | 14 +++++- 4 files changed, 69 insertions(+), 35 deletions(-) diff --git a/src/modules/netinstall/Config.cpp b/src/modules/netinstall/Config.cpp index 5f703f8d4..2d663829c 100644 --- a/src/modules/netinstall/Config.cpp +++ b/src/modules/netinstall/Config.cpp @@ -54,9 +54,11 @@ Config::status() const case Status::FailedBadData: return tr( "Network Installation. (Disabled: Received invalid groups data)" ); case Status::FailedInternalError: - return tr( "Network Installation. (Disabled: internal error)" ); + 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(); } @@ -89,6 +91,11 @@ Config::loadGroupList( const QVariantList& groupData ) if ( m_model->rowCount() < 1 ) { cWarning() << "NetInstall groups data was empty."; + setStatus( Status::FailedNoData ); + } + else + { + setStatus( Status::Ok ); } emit statusReady(); } @@ -134,7 +141,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) m_queue = new LoaderQueue( this ); m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) ); } - else if ( groupsUrlVariant.type() == QVariant::StringList ) + else if ( groupsUrlVariant.type() == QVariant::List ) { m_queue = new LoaderQueue( this ); for ( const auto& s : groupsUrlVariant.toStringList() ) @@ -142,10 +149,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) m_queue->append( SourceItem::makeSourceItem( s, configurationMap ) ); } } - if ( m_queue ) + if ( m_queue && m_queue->count() > 0 ) { + cDebug() << "Loading netinstall from" << m_queue->count() << "alternate sources."; connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone ); - QMetaObject::invokeMethod( m_queue, "fetchNext", Qt::QueuedConnection ); + m_queue->load(); } } diff --git a/src/modules/netinstall/Config.h b/src/modules/netinstall/Config.h index d4c3c6f19..b676a7d39 100644 --- a/src/modules/netinstall/Config.h +++ b/src/modules/netinstall/Config.h @@ -47,7 +47,9 @@ public: FailedBadConfiguration, FailedInternalError, FailedNetworkError, - FailedBadData + FailedBadData, + FailedNoData + }; QString status() const; diff --git a/src/modules/netinstall/LoaderQueue.cpp b/src/modules/netinstall/LoaderQueue.cpp index 98245dead..f8ba17cff 100644 --- a/src/modules/netinstall/LoaderQueue.cpp +++ b/src/modules/netinstall/LoaderQueue.cpp @@ -20,6 +20,32 @@ #include #include +/** @brief Call fetchNext() on the queue if it can + * + * On destruction, a new call to fetchNext() is queued, so that + * the queue continues loading. Calling release() before the + * destructor skips the fetchNext(), ending the queue-loading. + */ +class FetchNextUnless +{ +public: + FetchNextUnless( LoaderQueue* q ) + : m_q( q ) + { + } + ~FetchNextUnless() + { + if ( m_q ) + { + QMetaObject::invokeMethod( m_q, "fetchNext", Qt::QueuedConnection ); + } + } + void release() { m_q = nullptr; } + +private: + LoaderQueue* m_q = nullptr; +}; + SourceItem SourceItem::makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ) { @@ -45,6 +71,13 @@ LoaderQueue::append( SourceItem&& i ) m_queue.append( std::move( i ) ); } +void +LoaderQueue::load() +{ + QMetaObject::invokeMethod( this, "fetchNext", Qt::QueuedConnection ); +} + + void LoaderQueue::fetchNext() { @@ -67,13 +100,16 @@ LoaderQueue::fetchNext() } } - void LoaderQueue::fetch( const QUrl& url ) { + FetchNextUnless next( this ); + if ( !url.isValid() ) { m_config->setStatus( Config::Status::FailedBadConfiguration ); + cDebug() << "Invalid URL" << url; + return; } using namespace CalamaresUtils::Network; @@ -85,42 +121,20 @@ LoaderQueue::fetch( const QUrl& url ) if ( !reply ) { - cDebug() << Logger::Continuation << "request failed immediately."; + cDebug() << Logger::SubEntry << "Request failed immediately."; + // If nobody sets a different status, this will remain m_config->setStatus( Config::Status::FailedBadConfiguration ); } else { + // When the network request is done, **then** we might + // do the next item from the queue, so don't call fetchNext() now. + next.release(); m_reply = reply; connect( reply, &QNetworkReply::finished, this, &LoaderQueue::dataArrived ); } } -/** @brief Call fetchNext() on the queue if it can - * - * On destruction, a new call to fetchNext() is queued, so that - * the queue continues loading. Calling release() before the - * destructor skips the fetchNext(), ending the queue-loading. - */ -class FetchNextUnless -{ -public: - FetchNextUnless( LoaderQueue* q ) - : m_q( q ) - { - } - ~FetchNextUnless() - { - if ( m_q ) - { - QMetaObject::invokeMethod( m_q, "fetchNext", Qt::QueuedConnection ); - } - } - void release() { m_q = nullptr; } - -private: - LoaderQueue* m_q = nullptr; -}; - void LoaderQueue::dataArrived() { diff --git a/src/modules/netinstall/LoaderQueue.h b/src/modules/netinstall/LoaderQueue.h index de6c7276f..d7baf58d4 100644 --- a/src/modules/netinstall/LoaderQueue.h +++ b/src/modules/netinstall/LoaderQueue.h @@ -41,7 +41,14 @@ struct SourceItem static SourceItem makeSourceItem( const QString& groupsUrl, const QVariantMap& configurationMap ); }; - +/** @brief Queue of source items to load + * + * Queue things up by calling append() and then kick things off + * by calling load(). This will try to load the items, in order; + * the first one that succeeds will end the loading process. + * + * Signal done() is emitted when done (also when all of the items fail). + */ class LoaderQueue : public QObject { Q_OBJECT @@ -49,9 +56,12 @@ public: LoaderQueue( Config* parent ); void append( SourceItem&& i ); - void fetchNext(); + int count() const { return m_queue.count(); } public Q_SLOTS: + void load(); + + void fetchNext(); void fetch( const QUrl& url ); void dataArrived(); From 3588f06767c664ec740b4c6c71e1245e8d1158e1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 12:49:37 +0100 Subject: [PATCH 29/38] [netinstall] Document groupsUrl with multiple entries --- src/modules/netinstall/netinstall.conf | 48 +++++++++++++++++--------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/modules/netinstall/netinstall.conf b/src/modules/netinstall/netinstall.conf index c377b526e..d38c0b040 100644 --- a/src/modules/netinstall/netinstall.conf +++ b/src/modules/netinstall/netinstall.conf @@ -32,20 +32,21 @@ # This module supports multiple instances through the *label* key, # which allows you to distinguish them in the UI. --- -# This is the URL that is retrieved to get the netinstall groups-and-packages -# data (which should be in the format described in netinstall.yaml), e.g.: -# ``` -# groupsUrl: http://example.org/netinstall.php -# ``` -# or it can be a locally installed file: -# ``` -# groupsUrl: file:///usr/share/calamares/netinstall.yaml -# ``` -# or it can be the special-case literal string "local": -# ``` -# groupsUrl: local -# ``` +# The *groupsUrl* determines where the data for the netinstall groups-and- +# packages comes from. The value of the key may be: # +# - a single string (this is treated as a list with just that string in it) +# - a list of strings +# +# Each string is treated as a URL (see below for special cases. The +# list is examined **in order** and each URL is tried in turn. The +# first URL to load successfully -- even if it yields 0 packages -- +# ends the process. This allows using a network URL and a (fallback) +# local URL for package lists, or for using multiple mirrors of +# netinstall data. +# +# The URL must point to a YAML file that follows the format described +# below at the key *groups* -- except for the special case URL "local". # Note that the contents of the groups file is the **important** # part of the configuration of this module. It specifies what # groups and packages the user may select (and so what commands are to @@ -59,12 +60,27 @@ # must have a list-of-groups as value; if the file does not have # a top-level key *groups*, then the file must contain only a list of groups. # -# As a special case, setting *groupsUrl* to the literal string -# `local` means that the data is obtained from **this** config -# file, under the key *groups*. +# Each item in the list *groupsUrl* may be: +# - A remote URL like `http://example.org/netinstall.php` +# - A local file URL like `file:///usr/share/calamares/netinstall.yaml` +# - The special-case literal string `local` +# +# Non-special case URLs are loaded as YAML; if the load succeeds, then +# they are interpreted like the *groups* key below. The special case +# `local` loads the data directly from **this** file. # groupsUrl: local +# Alternate form: +# groupsUrl: [ local ] + +# Net-based package list, with fallback to local file +# groupsUrl: +# - http://example.com/calamares/netinstall.yaml +# - file:///etc/calamares/modules/netinstall.yaml + + + # If the installation can proceed without netinstall (e.g. the Live CD # can create a working installed system, but netinstall is preferred # to bring it up-to-date or extend functionality) leave this set to From 63e61e99245a621611669617850eabeee2abb1a6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 13:25:45 +0100 Subject: [PATCH 30/38] Changes: pre-release housekeeping --- CHANGES | 5 +++-- CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 10647218d..cd243ec43 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. -# 3.2.39 (unreleased) # +# 3.2.39 (2021-03-19) # This release contains contributions from (alphabetically by first name): - Matti Hyttinen @@ -20,7 +20,8 @@ This release contains contributions from (alphabetically by first name): If your distro has a default-to-btrfs setup, it can skip the hard- coded setup (which Calamares has had for a long time with @home and similar) and introduce a custom btrfs configuration through the - `mount.conf` file. + `mount.conf` file. See issues #1659 and #1661 for warnings about + using this in production. - *netinstall* now supports fallbacks for the groups data. Instead of a single URL, multiple URLs may be specified in a list and Calamares goes through them until one is successfully diff --git a/CMakeLists.txt b/CMakeLists.txt index e7377c265..0d1a00615 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ project( CALAMARES LANGUAGES C CXX ) -set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development +set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development ### OPTIONS # From 668921543af3d8b58467f8f98bfb5f2d78d072c1 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 13:36:40 +0100 Subject: [PATCH 31/38] [libcalamaresui] Convenience method to check if paste would do anything --- src/libcalamaresui/utils/Paste.cpp | 7 +++++++ src/libcalamaresui/utils/Paste.h | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index 2f0cfa143..a61b80b4e 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -126,3 +126,10 @@ CalamaresUtils::Paste::doLogUpload( QObject* parent ) } return QString(); } + +bool +CalamaresUtils::Paste::isEnabled() +{ + auto [ type, serverUrl ] = Calamares::Branding::instance()->uploadServer(); + return type != Calamares::Branding::UploadServerType::None; +} diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index 6258e57a0..c6b0adba8 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -18,12 +18,17 @@ namespace CalamaresUtils { namespace Paste { - /** @brief Send the current log file to a pastebin * * Returns the (string) URL that the pastebin gives us. */ QString doLogUpload( QObject* parent ); + +/** @brief Is paste enabled? + * + * Checks the branding instance if paste can be done. + */ +bool isEnabled(); } // namespace Paste } // namespace CalamaresUtils From c54e417ff358da5ef81f0d8ec9dbe9ca654de0f4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 13:38:06 +0100 Subject: [PATCH 32/38] [calamares] Add a 'send log' button to the debug window FIXES #1660 --- src/calamares/DebugWindow.cpp | 5 +++++ src/calamares/DebugWindow.ui | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/calamares/DebugWindow.cpp b/src/calamares/DebugWindow.cpp index 45e28878c..fa8a31647 100644 --- a/src/calamares/DebugWindow.cpp +++ b/src/calamares/DebugWindow.cpp @@ -20,6 +20,7 @@ #include "modulesystem/Module.h" #include "modulesystem/ModuleManager.h" #include "utils/Logger.h" +#include "utils/Paste.h" #include "utils/Retranslator.h" #ifdef WITH_PYTHONQT @@ -213,6 +214,10 @@ DebugWindow::DebugWindow() } } ); + // Send Log button only if it would be useful + m_ui->sendLogButton->setVisible( CalamaresUtils::Paste::isEnabled() ); + connect( m_ui->sendLogButton, &QPushButton::clicked, [this]() { CalamaresUtils::Paste::doLogUpload( this ); } ); + CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); ); } diff --git a/src/calamares/DebugWindow.ui b/src/calamares/DebugWindow.ui index 014d4837e..ad9234c0f 100644 --- a/src/calamares/DebugWindow.ui +++ b/src/calamares/DebugWindow.ui @@ -21,7 +21,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - 2 + 3 @@ -118,6 +118,13 @@ SPDX-License-Identifier: GPL-3.0-or-later + + + + Send Session Log + + + From 981e96ea7f12d1074b773c081b9e80a9beb9d90f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 13:51:30 +0100 Subject: [PATCH 33/38] [calamares] Redo debug window tools - make the tools tab buttons along the bottom row - show the global storage tab by default This costs little screen real-estate, makes the tools much more visible and useful. --- src/calamares/DebugWindow.ui | 106 +++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 49 deletions(-) diff --git a/src/calamares/DebugWindow.ui b/src/calamares/DebugWindow.ui index ad9234c0f..1b163d49d 100644 --- a/src/calamares/DebugWindow.ui +++ b/src/calamares/DebugWindow.ui @@ -21,7 +21,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - 3 + 0 @@ -92,56 +92,64 @@ SPDX-License-Identifier: GPL-3.0-or-later - - - Tools - - - - - - Crash now - - - - - - - Reload Stylesheet - - - - - - - Widget Tree - - - - - - - Send Session Log - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + + + + Crashes Calamares, so that Dr. Konqui can look at it. + + + Crash now + + + + + + + + + + Reloads the stylesheet from the branding directory. + + + Reload Stylesheet + + + + + + + + + + Displays the tree of widget names in the log (for stylesheet debugging). + + + Widget Tree + + + + + + + + + + Uploads the session log to the configured pastebin. + + + Send Session Log + + + + + + + + From 779e5ecf8f8b5727837d1a5679c0dd46bc019f5b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 14:17:34 +0100 Subject: [PATCH 34/38] [libcalamaresui] Factor out the pastebin UI - offer a convenience method for showing a popup and URL information and copying the URL to the clipboard - use that from ViewManager (on failure) and DebugWindow (on demand) --- src/calamares/DebugWindow.cpp | 2 +- src/libcalamaresui/ViewManager.cpp | 21 +----------------- src/libcalamaresui/utils/Paste.cpp | 35 ++++++++++++++++++++++++++++++ src/libcalamaresui/utils/Paste.h | 8 +++++++ 4 files changed, 45 insertions(+), 21 deletions(-) diff --git a/src/calamares/DebugWindow.cpp b/src/calamares/DebugWindow.cpp index fa8a31647..b5fd899d4 100644 --- a/src/calamares/DebugWindow.cpp +++ b/src/calamares/DebugWindow.cpp @@ -216,7 +216,7 @@ DebugWindow::DebugWindow() // Send Log button only if it would be useful m_ui->sendLogButton->setVisible( CalamaresUtils::Paste::isEnabled() ); - connect( m_ui->sendLogButton, &QPushButton::clicked, [this]() { CalamaresUtils::Paste::doLogUpload( this ); } ); + connect( m_ui->sendLogButton, &QPushButton::clicked, [this]() { CalamaresUtils::Paste::doLogUploadUI( this ); } ); CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); ); } diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 566a77f93..704655c8b 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -190,26 +190,7 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) { if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) { - QString pasteUrl = CalamaresUtils::Paste::doLogUpload( msgBox ); - QString pasteUrlMessage; - if ( pasteUrl.isEmpty() ) - { - pasteUrlMessage = tr( "The upload was unsuccessful. No web-paste was done." ); - } - else - { - QClipboard* clipboard = QApplication::clipboard(); - clipboard->setText( pasteUrl, QClipboard::Clipboard ); - - if ( clipboard->supportsSelection() ) - { - clipboard->setText( pasteUrl, QClipboard::Selection ); - } - QString pasteUrlFmt = tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" ); - pasteUrlMessage = pasteUrlFmt.arg( pasteUrl ); - } - - QMessageBox::critical( nullptr, tr( "Install Log Paste URL" ), pasteUrlMessage ); + CalamaresUtils::Paste::doLogUploadUI( msgBox ); } QApplication::quit(); } ); diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index a61b80b4e..40e314108 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -14,10 +14,14 @@ #include "utils/Logger.h" #include "utils/Units.h" +#include +#include #include #include +#include #include #include +#include using namespace CalamaresUtils::Units; @@ -127,6 +131,37 @@ CalamaresUtils::Paste::doLogUpload( QObject* parent ) return QString(); } +QString +CalamaresUtils::Paste::doLogUploadUI( QWidget* parent ) +{ + // These strings originated in the ViewManager class + QString pasteUrl = CalamaresUtils::Paste::doLogUpload( parent ); + QString pasteUrlMessage; + if ( pasteUrl.isEmpty() ) + { + pasteUrlMessage = QCoreApplication::translate( "Calamares::ViewManager", + "The upload was unsuccessful. No web-paste was done." ); + } + else + { + QClipboard* clipboard = QApplication::clipboard(); + clipboard->setText( pasteUrl, QClipboard::Clipboard ); + + if ( clipboard->supportsSelection() ) + { + clipboard->setText( pasteUrl, QClipboard::Selection ); + } + QString pasteUrlFmt = QCoreApplication::translate( "Calamares::ViewManager", + "Install log posted to\n\n%1\n\nLink copied to clipboard" ); + pasteUrlMessage = pasteUrlFmt.arg( pasteUrl ); + } + + QMessageBox::critical( + nullptr, QCoreApplication::translate( "Calamares::ViewManager", "Install Log Paste URL" ), pasteUrlMessage ); + return pasteUrl; +} + + bool CalamaresUtils::Paste::isEnabled() { diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index c6b0adba8..c77625415 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -13,6 +13,7 @@ #include class QObject; +class QWidget; namespace CalamaresUtils { @@ -24,6 +25,13 @@ namespace Paste */ QString doLogUpload( QObject* parent ); +/** @brief Send the current log file to a pastebin + * + * As doLogUpload(), but also sets the clipboard and displays + * a message saying it's been done. + */ +QString doLogUploadUI( QWidget* parent ); + /** @brief Is paste enabled? * * Checks the branding instance if paste can be done. From 64f9a2df26b1b3c5534184df78ba1c8e39e74939 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Fri, 19 Mar 2021 14:23:07 +0100 Subject: [PATCH 35/38] i18n: [calamares] Automatic merge of Transifex translations --- lang/calamares_ca.ts | 44 +++++++++++++++++++++++------------------ lang/calamares_eo.ts | 10 +++++++--- lang/calamares_fi_FI.ts | 44 +++++++++++++++++++++++------------------ lang/calamares_lt.ts | 44 +++++++++++++++++++++++------------------ lang/calamares_pt_PT.ts | 44 +++++++++++++++++++++++------------------ lang/calamares_si.ts | 4 ++-- lang/calamares_sv.ts | 44 +++++++++++++++++++++++------------------ 7 files changed, 134 insertions(+), 100 deletions(-) diff --git a/lang/calamares_ca.ts b/lang/calamares_ca.ts index b1375ea2f..b2594aff1 100644 --- a/lang/calamares_ca.ts +++ b/lang/calamares_ca.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Gestió dels paràmetres dels muntatges automàtics @@ -318,7 +318,11 @@ %1 Link copied to clipboard - + El registre d'instal·lació s'ha penjat a + +%1 + +L'enllaç s'ha copiat al porta-retalls. @@ -854,12 +858,12 @@ L'instal·lador es tancarà i tots els canvis es perdran. The setup of %1 did not complete successfully. - + La configuració de %1 no s'ha completat correctament. The installation of %1 did not complete successfully. - + La instal·lació de %1 no s'ha completat correctament. @@ -973,12 +977,12 @@ L'instal·lador es tancarà i tots els canvis es perdran. Create new %1MiB partition on %3 (%2) with entries %4. - + Crea una partició nova de %1 MiB a %3 (%2) amb entrades %4. Create new %1MiB partition on %3 (%2). - + Crea una partició nova de %1 MiB a %3 (%2). @@ -988,12 +992,12 @@ L'instal·lador es tancarà i tots els canvis es perdran. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. - + Crea una partició nova de <strong>%1 MiB</strong> a <strong>%3</strong> (%2) amb entrades <em>%4</em>. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Crea una partició nova de <strong>%1 MiB</strong> a <strong>%3</strong> (%2). @@ -1341,7 +1345,7 @@ L'instal·lador es tancarà i tots els canvis es perdran. Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> - + Instal·la %1 a la partició de sistema <strong>nova</strong> %2 amb funcions <em>%3</em>. @@ -1351,27 +1355,27 @@ L'instal·lador es tancarà i tots els canvis es perdran. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. - + Estableix la partició <strong>nova</strong> %2 amb el punt de muntatge <strong>%1</strong> i funcions <em>%3</em>. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Estableix la partició <strong>nova</strong> %2 amb el punt de muntatge <strong>%1</strong> %3. Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + Instal·la %2 a la partició de sistema %3 <strong>%1</strong> amb funcions <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. - + Estableix la partició %3 <strong>%1</strong> amb el punt de muntatge <strong>%2</strong> i funcions <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Estableix la partició %3 <strong>%1</strong> amb el punt de muntatge <strong>%2</strong> %4. @@ -3961,29 +3965,31 @@ La configuració pot continuar, però algunes característiques podrien estar in Installation Completed - + Instal·lació acabada %1 has been installed on your computer.<br/> You may now restart into your new system, or continue using the Live environment. - + %1 s'ha instal·lat a l'ordinador. <br/> + Ara podeu reiniciar-lo per tal d'accedir al sistema operatiu nou o bé continuar usant l'entorn autònom. Close Installer - + Tanca l'instal·lador Restart System - + Reinicia el sistema <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> This log is copied to /var/log/installation.log of the target system.</p> - + <p>Hi ha disponible un registre complet de la instal·lació com a installation.log al directori de l’usuari autònom.<br/> + Aquest registre es copia a /var/log/installation.log del sistema de destinació.</p> diff --git a/lang/calamares_eo.ts b/lang/calamares_eo.ts index a4483e7fb..ab4efbc43 100644 --- a/lang/calamares_eo.ts +++ b/lang/calamares_eo.ts @@ -304,12 +304,12 @@ Install Log Paste URL - + Retadreso de la alglua servilo The upload was unsuccessful. No web-paste was done. - + Alŝuto malsukcesinta. Neniu transpoŝigis al la reto. @@ -318,7 +318,11 @@ %1 Link copied to clipboard - + La protokolo de instalado estis enpoŝtita al: + +%1 + +La retadreso estis copiita al vian tondujon. diff --git a/lang/calamares_fi_FI.ts b/lang/calamares_fi_FI.ts index 5b0eb435b..16ec5d3ec 100644 --- a/lang/calamares_fi_FI.ts +++ b/lang/calamares_fi_FI.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Hallitse 'auto-mount' asetuksia @@ -318,7 +318,11 @@ %1 Link copied to clipboard - + Asennuksen loki on lähetetty + +%1 + +Linkki kopioitu leikepöydälle @@ -855,12 +859,12 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. The setup of %1 did not complete successfully. - + Määrityksen %1 asennus ei onnistunut. The installation of %1 did not complete successfully. - + Asennus %1 ei onnistunut. @@ -974,12 +978,12 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. Create new %1MiB partition on %3 (%2) with entries %4. - + Luo uusi %1MiB osio kohteeseen %3 (%2), jossa on %4. Create new %1MiB partition on %3 (%2). - + Luo uusi %1MiB osio kohteeseen %3 (%2). @@ -989,12 +993,12 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. - + Luo uusi <strong>%1MiB</strong> osio kohteeseen <strong>%3</strong> (%2) jossa on <em>%4</em>. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Luo uusi <strong>%1MiB</strong> osio kohteeseen <strong>%3</strong> (%2). @@ -1342,7 +1346,7 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> - + Asenna %1 <strong>uusi</strong> %2 järjestelmäosio ominaisuuksilla <em>%3</em> @@ -1352,27 +1356,27 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. - + Määritä <strong>uusi</strong> %2 osio liitospisteellä <strong>%1</strong> ja ominaisuuksilla <em>%3</em>. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Määritä <strong>uusi</strong> %2 osio liitospisteellä <strong>%1</strong>%3. Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + Asenna %2 - %3 järjestelmäosio <strong>%1</strong> ominaisuuksilla <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. - + Määritä %3 osio <strong>%1</strong> liitospisteellä <strong>%2</strong> ja ominaisuuksilla <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Määritä %3 osio <strong>%1</strong> liitospisteellä <strong>%2</strong>%4. @@ -3963,29 +3967,31 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä. Installation Completed - + Asennus suoritettu %1 has been installed on your computer.<br/> You may now restart into your new system, or continue using the Live environment. - + %1 on asennettu tietokoneellesi.<br/> + Voit käynnistää nyt uuden järjestelmän tai jatkaa Live-ympäristön käyttöä. Close Installer - + Sulje asennusohjelma Restart System - + Käynnistä järjestelmä <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> This log is copied to /var/log/installation.log of the target system.</p> - + <p>Täydellinen loki asennuksesta on saatavana nimellä install.log Live-käyttäjän kotihakemistossa.<br/> + Tämä loki on kopioitu /var/log/installation.log tiedostoon.</p> diff --git a/lang/calamares_lt.ts b/lang/calamares_lt.ts index 0bf3751c7..7e4fec521 100644 --- a/lang/calamares_lt.ts +++ b/lang/calamares_lt.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Tvarkyti automatinio prijungimo nustatymus @@ -322,7 +322,11 @@ %1 Link copied to clipboard - + Diegimo žurnalas paskelbtas į + +%1 + +Nuoroda nukopijuota į iškarpinę @@ -858,12 +862,12 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. The setup of %1 did not complete successfully. - + %1 sąranka nebuvo užbaigta sėkmingai. The installation of %1 did not complete successfully. - + %1 nebuvo užbaigtas sėkmingai. @@ -977,12 +981,12 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Create new %1MiB partition on %3 (%2) with entries %4. - + Sukurti naują %1MiB skaidinį ties %3 (%2) su įrašais %4. Create new %1MiB partition on %3 (%2). - + Sukurti naują %1MiB skaidinį ties %3 (%2). @@ -992,12 +996,12 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. - + Sukurti naują <strong>%1MiB</strong> skaidinį ties <strong>%3</strong> (%2) su įrašais <em>%4</em>. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Sukurti naują <strong>%1MiB</strong> skaidinį ties <strong>%3</strong> (%2). @@ -1345,7 +1349,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> - + Įdiegti %1 <strong>naujame</strong> %2 sistemos skaidinyje su ypatybėmis <em>%3</em> @@ -1355,27 +1359,27 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. - + Nustatyti <strong>naują</strong> %2 skaidinį su prijungimo tašku <strong>%1</strong> ir ypatybėmis <em>%3</em>. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Nustatyti <strong>naują</strong> %2 skaidinį su prijungimo tašku <strong>%1</strong>%3. Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + Įdiegti %2 sistemą %3 sistemos skaidinyje <strong>%1</strong> su ypatybėmis <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. - + Nustatyti %3 skaidinį <strong>%1</strong> su prijungimo tašku <strong>%2</strong> ir ypatybėmis <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Nustatyti %3 skaidinį <strong>%1</strong> su prijungimo tašku <strong>%2</strong>%4. @@ -3983,29 +3987,31 @@ Išvestis: Installation Completed - + Diegimas užbaigtas %1 has been installed on your computer.<br/> You may now restart into your new system, or continue using the Live environment. - + %1 įdiegta jūsų kompiuteryje.<br/> + Galite iš naujo paleisti kompiuterį dabar ir naudotis savo naująja sistema; arba galite ir toliau naudotis demonstracine aplinka. Close Installer - + Užverti diegimo programą Restart System - + Paleisti sistemą iš naujo <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> This log is copied to /var/log/installation.log of the target system.</p> - + <p>Pilnas diegimo žurnalas yra prieinamas kaip installation.log failas, esantis demonstracinio naudotojo namų kataloge.<br/> + Šis žurnalas yra nukopijuotas paskirties sistemoje į failą /var/log/installation.log.</p> diff --git a/lang/calamares_pt_PT.ts b/lang/calamares_pt_PT.ts index ecd1f3c64..c3ec77d14 100644 --- a/lang/calamares_pt_PT.ts +++ b/lang/calamares_pt_PT.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Gerir definições de montagem automática @@ -318,7 +318,11 @@ %1 Link copied to clipboard - + Registo de instalação publicado em + +%1 + +Ligação copiada para a área de transferência @@ -854,12 +858,12 @@ O instalador será encerrado e todas as alterações serão perdidas. The setup of %1 did not complete successfully. - + A configuração de %1 não foi concluída com sucesso. The installation of %1 did not complete successfully. - + A instalação de %1 não foi concluída com sucesso. @@ -973,12 +977,12 @@ O instalador será encerrado e todas as alterações serão perdidas. Create new %1MiB partition on %3 (%2) with entries %4. - + Criar nova partição de %1MiB em %3 (%2) com entradas %4. Create new %1MiB partition on %3 (%2). - + Criar nova partição de %1MiB em %3 (%2). @@ -988,12 +992,12 @@ O instalador será encerrado e todas as alterações serão perdidas. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. - + Criar nova partição de <strong>%1MiB</strong> em <strong>%3</strong> (%2) com entradas <em>%4</em>. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Criar nova partição de <strong>%1MiB</strong> em <strong>%3</strong> (%2). @@ -1341,7 +1345,7 @@ O instalador será encerrado e todas as alterações serão perdidas. Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> - + Instalar %1 na <strong>nova</strong> partição do sistema %2 com funcionalidades <em>%3</em> @@ -1351,27 +1355,27 @@ O instalador será encerrado e todas as alterações serão perdidas. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. - + Configurar <strong>nova</strong> partição %2 com ponto de montagem <strong>%1</strong> e funcionalidades <em>%3</em>. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Configurar <strong>nova</strong> partição %2 com ponto de montagem <strong>%1</strong>%3. Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + Instalar %2 em %3 partição do sistema <strong>%1</strong> com funcionalidades <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. - + Configurar %3 partição <strong>%1</strong> com ponto de montagem <strong>%2</strong> e funcionalidades <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Configurar %3 partição <strong>%1</strong> com ponto de montagem <strong>%2</strong>%4. @@ -3961,29 +3965,31 @@ Saída de Dados: Installation Completed - + Instalação Concluída %1 has been installed on your computer.<br/> You may now restart into your new system, or continue using the Live environment. - + %1 foi instalado no seu computador.<br/> + Pode agora reiniciar no seu novo sistema, ou continuar a utilizar o ambiente Live. Close Installer - + Fechar Instalador Restart System - + Reiniciar Sistema <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> This log is copied to /var/log/installation.log of the target system.</p> - + <p>Um registo completo da instalação está disponível como installation.log no diretório home do utilizador Live.<br/> + Este registo é copiado para /var/log/installation.log do sistema de destino.</p> diff --git a/lang/calamares_si.ts b/lang/calamares_si.ts index 085f79c07..ca2abdc58 100644 --- a/lang/calamares_si.ts +++ b/lang/calamares_si.ts @@ -52,7 +52,7 @@ %1 (%2) - + %1 (%2) @@ -2888,7 +2888,7 @@ Output: %1 (%2) - + %1 (%2) diff --git a/lang/calamares_sv.ts b/lang/calamares_sv.ts index 907373b3f..e30f2463c 100644 --- a/lang/calamares_sv.ts +++ b/lang/calamares_sv.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Hantera inställningar för automatisk montering @@ -318,7 +318,11 @@ %1 Link copied to clipboard - + Installationslogg postad till + +%1 + +Länken kopierades till urklipp @@ -853,12 +857,12 @@ Alla ändringar kommer att gå förlorade. The setup of %1 did not complete successfully. - + Installationen av %1 slutfördes inte korrekt. The installation of %1 did not complete successfully. - + Installationen av %1 slutfördes inte korrekt. @@ -972,12 +976,12 @@ Alla ändringar kommer att gå förlorade. Create new %1MiB partition on %3 (%2) with entries %4. - + Skapa ny %1MiB partition på %3 (%2) med poster %4. Create new %1MiB partition on %3 (%2). - + Skapa ny %1MiB partition på %3 (%2). @@ -987,12 +991,12 @@ Alla ändringar kommer att gå förlorade. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. - + Skapa ny <strong>%1MiB</strong> partition på <strong>%3</strong> (%2) med poster <em>%4</em>. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Skapa ny <strong>%1MiB</strong> partition på <strong>%3</strong> (%2). @@ -1340,7 +1344,7 @@ Alla ändringar kommer att gå förlorade. Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> - + Installera %1 på <strong>ny</strong> %2 system partition med funktioner <em>%3</em> @@ -1350,27 +1354,27 @@ Alla ändringar kommer att gå förlorade. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. - + Skapa <strong>ny</strong>%2 partition med monteringspunkt <strong>%1</strong> och funktioner <em>%3</em>. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Skapa <strong>ny</strong> %2 partition med monteringspunkt <strong>%1</strong>%3. Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + Installera %2 på %3 system partition <strong>%1</strong> med funktioner <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. - + Skapa %3 partition <strong>%1</strong>med monteringspunkt <strong>%2</strong>och funktioner <em>%4</em>. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Skapa %3 partition <strong>%1</strong> med monteringspunkt <strong>%2</strong> %4. @@ -3961,29 +3965,31 @@ Installationen kan inte fortsätta.</p> Installation Completed - + Installationen är klar %1 has been installed on your computer.<br/> You may now restart into your new system, or continue using the Live environment. - + %1 har installerats på din dator. <br/> + Du kan nu starta om i ditt nya system eller fortsätta använda Live-miljön. Close Installer - + Stäng installationsprogrammet Restart System - + Starta om System <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> This log is copied to /var/log/installation.log of the target system.</p> - + <p>En fullständig logg över installationen är tillgänglig som installation.log i hemkatalogen av Live användaren.<br/> + Denna logg är kopierad till /var/log/installation.log på målsystemet.</p> From 4243d5f41a6145ad7b180c3a964b7a107ffc2446 Mon Sep 17 00:00:00 2001 From: Calamares CI Date: Fri, 19 Mar 2021 14:23:08 +0100 Subject: [PATCH 36/38] i18n: [python] Automatic merge of Transifex translations --- lang/python/az/LC_MESSAGES/python.po | 4 ++-- lang/python/az_AZ/LC_MESSAGES/python.po | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/python/az/LC_MESSAGES/python.po b/lang/python/az/LC_MESSAGES/python.po index 008666012..9e51b86ac 100644 --- a/lang/python/az/LC_MESSAGES/python.po +++ b/lang/python/az/LC_MESSAGES/python.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# xxmn77 , 2020 +# Xəyyam Qocayev , 2020 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-03-14 16:14+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: xxmn77 , 2020\n" +"Last-Translator: Xəyyam Qocayev , 2020\n" "Language-Team: Azerbaijani (https://www.transifex.com/calamares/teams/20061/az/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/lang/python/az_AZ/LC_MESSAGES/python.po b/lang/python/az_AZ/LC_MESSAGES/python.po index 6c5d277e1..e261162ea 100644 --- a/lang/python/az_AZ/LC_MESSAGES/python.po +++ b/lang/python/az_AZ/LC_MESSAGES/python.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# xxmn77 , 2020 +# Xəyyam Qocayev , 2020 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-03-14 16:14+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: xxmn77 , 2020\n" +"Last-Translator: Xəyyam Qocayev , 2020\n" "Language-Team: Azerbaijani (Azerbaijan) (https://www.transifex.com/calamares/teams/20061/az_AZ/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" From ba89f03d8edaa473ca13d96a721510123963eb48 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 14:37:38 +0100 Subject: [PATCH 37/38] Changes: post-release housekeeping - mention the *packages* service in CHANGES for the previous release --- CHANGES | 16 +++++++++++++++- CMakeLists.txt | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index cd243ec43..0c96bc47c 100644 --- a/CHANGES +++ b/CHANGES @@ -7,13 +7,27 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. +# 3.2.40 (unreleased) # + +This release contains contributions from (alphabetically by first name): + - No external contributors yet + +## Core ## + - No core changes yet + +## Modules ## + - No module changes yet + + # 3.2.39 (2021-03-19) # This release contains contributions from (alphabetically by first name): - Matti Hyttinen ## Core ## - - No core changes yet + - A *packages* service has been added to the core, for use by + *netinstall* module and any others that need to set up + package information for the *packages* module. ## Modules ## - The *mount* module has gained a configurable setup for btrfs volumes. diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d1a00615..7ad919c4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,11 +41,11 @@ # TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.39 + VERSION 3.2.40 LANGUAGES C CXX ) -set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development +set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development ### OPTIONS # From 6d4a0a1ba3b8eacf005902f6d7d826563f188fcc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Mar 2021 14:38:13 +0100 Subject: [PATCH 38/38] i18n: update the English source files --- lang/calamares_en.ts | 249 ++++++++++++++++++++++++------------------- lang/python.pot | 171 ++++++++++++++--------------- 2 files changed, 217 insertions(+), 203 deletions(-) diff --git a/lang/calamares_en.ts b/lang/calamares_en.ts index eb20be4c2..7da27b24c 100644 --- a/lang/calamares_en.ts +++ b/lang/calamares_en.ts @@ -102,22 +102,42 @@ Interface: - - Tools - Tools + + Crashes Calamares, so that Dr. Konqui can look at it. + - + + Reloads the stylesheet from the branding directory. + + + + + Uploads the session log to the configured pastebin. + + + + + Send Session Log + + + + Reload Stylesheet Reload Stylesheet - + + Displays the tree of widget names in the log (for stylesheet debugging). + + + + Widget Tree Widget Tree - + Debug information Debug information @@ -286,13 +306,13 @@ - + &Yes &Yes - + &No &No @@ -302,17 +322,17 @@ &Close - + Install Log Paste URL Install Log Paste URL - + The upload was unsuccessful. No web-paste was done. The upload was unsuccessful. No web-paste was done. - + Install log posted to %1 @@ -325,124 +345,124 @@ Link copied to clipboard Link copied to clipboard - + Calamares Initialization Failed Calamares Initialization Failed - + %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. - + <br/>The following modules could not be loaded: <br/>The following modules could not be loaded: - + Continue with setup? Continue with setup? - + Continue with installation? Continue with installation? - + The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> - + The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> - + &Set up now &Set up now - + &Install now &Install now - + Go &back Go &back - + &Set up &Set up - + &Install &Install - + Setup is complete. Close the setup program. Setup is complete. Close the setup program. - + The installation is complete. Close the installer. The installation is complete. Close the installer. - + Cancel setup without changing the system. Cancel setup without changing the system. - + Cancel installation without changing the system. Cancel installation without changing the system. - + &Next &Next - + &Back &Back - + &Done &Done - + &Cancel &Cancel - + Cancel setup? Cancel setup? - + Cancel installation? Cancel installation? - + Do you really want to cancel the current setup process? The setup program will quit and all changes will be lost. Do you really want to cancel the current setup process? The setup program will quit and all changes will be lost. - + Do you really want to cancel the current install process? The installer will quit and all changes will be lost. Do you really want to cancel the current install process? @@ -475,12 +495,12 @@ The installer will quit and all changes will be lost. CalamaresWindow - + %1 Setup Program %1 Setup Program - + %1 Installer %1 Installer @@ -488,7 +508,7 @@ The installer will quit and all changes will be lost. CheckerContainer - + Gathering system information... Gathering system information... @@ -736,22 +756,32 @@ The installer will quit and all changes will be lost. The numbers and dates locale will be set to %1. - + Network Installation. (Disabled: Incorrect configuration) Network Installation. (Disabled: Incorrect configuration) - + Network Installation. (Disabled: Received invalid groups data) Network Installation. (Disabled: Received invalid groups data) - - Network Installation. (Disabled: internal error) - Network Installation. (Disabled: internal error) + + Network Installation. (Disabled: Internal error) + - + + Network Installation. (Disabled: No package list) + + + + + Package selection + Package selection + + + Network Installation. (Disabled: Unable to fetch package lists, check your network connection) Network Installation. (Disabled: Unable to fetch package lists, check your network connection) @@ -846,42 +876,42 @@ The installer will quit and all changes will be lost. Your passwords do not match! - + Setup Failed Setup Failed - + Installation Failed Installation Failed - + The setup of %1 did not complete successfully. The setup of %1 did not complete successfully. - + The installation of %1 did not complete successfully. The installation of %1 did not complete successfully. - + Setup Complete Setup Complete - + Installation Complete Installation Complete - + The setup of %1 is complete. The setup of %1 is complete. - + The installation of %1 is complete. The installation of %1 is complete. @@ -1478,72 +1508,72 @@ The installer will quit and all changes will be lost. GeneralRequirements - + has at least %1 GiB available drive space has at least %1 GiB available drive space - + There is not enough drive space. At least %1 GiB is required. There is not enough drive space. At least %1 GiB is required. - + has at least %1 GiB working memory has at least %1 GiB working memory - + The system does not have enough working memory. At least %1 GiB is required. The system does not have enough working memory. At least %1 GiB is required. - + is plugged in to a power source is plugged in to a power source - + The system is not plugged in to a power source. The system is not plugged in to a power source. - + is connected to the Internet is connected to the Internet - + The system is not connected to the Internet. The system is not connected to the Internet. - + is running the installer as an administrator (root) is running the installer as an administrator (root) - + The setup program is not running with administrator rights. The setup program is not running with administrator rights. - + The installer is not running with administrator rights. The installer is not running with administrator rights. - + has a screen large enough to show the whole installer has a screen large enough to show the whole installer - + The screen is too small to display the setup program. The screen is too small to display the setup program. - + The screen is too small to display the installer. The screen is too small to display the installer. @@ -1611,7 +1641,7 @@ The installer will quit and all changes will be lost. Please install KDE Konsole and try again! - + Executing script: &nbsp;<code>%1</code> Executing script: &nbsp;<code>%1</code> @@ -1883,98 +1913,97 @@ The installer will quit and all changes will be lost. NetInstallViewStep - - + Package selection Package selection - + Office software Office software - + Office package Office package - + Browser software Browser software - + Browser package Browser package - + Web browser Web browser - + Kernel Kernel - + Services Services - + Login Login - + Desktop Desktop - + Applications Applications - + Communication Communication - + Development Development - + Office Office - + Multimedia Multimedia - + Internet Internet - + Theming Theming - + Gaming Gaming - + Utilities Utilities @@ -3708,12 +3737,12 @@ Output: UsersPage - + <small>If more than one person will use this computer, you can create multiple accounts after setup.</small> <small>If more than one person will use this computer, you can create multiple accounts after setup.</small> - + <small>If more than one person will use this computer, you can create multiple accounts after installation.</small> <small>If more than one person will use this computer, you can create multiple accounts after installation.</small> @@ -3721,7 +3750,7 @@ Output: UsersQmlViewStep - + Users Users @@ -4141,102 +4170,102 @@ Output: What is your name? - + Your Full Name Your Full Name - + What name do you want to use to log in? What name do you want to use to log in? - + Login Name Login Name - + If more than one person will use this computer, you can create multiple accounts after installation. If more than one person will use this computer, you can create multiple accounts after installation. - + What is the name of this computer? What is the name of this computer? - + Computer Name Computer Name - + This name will be used if you make the computer visible to others on a network. This name will be used if you make the computer visible to others on a network. - + Choose a password to keep your account safe. Choose a password to keep your account safe. - + Password Password - + Repeat Password Repeat Password - + Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals. Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals. - + Validate passwords quality Validate passwords quality - + When this box is checked, password-strength checking is done and you will not be able to use a weak password. When this box is checked, password-strength checking is done and you will not be able to use a weak password. - + Log in automatically without asking for the password Log in automatically without asking for the password - + Reuse user password as root password Reuse user password as root password - + Use the same password for the administrator account. Use the same password for the administrator account. - + Choose a root password to keep your account safe. Choose a root password to keep your account safe. - + Root Password Root Password - + Repeat Root Password Repeat Root Password - + Enter the same password twice, so that it can be checked for typing errors. Enter the same password twice, so that it can be checked for typing errors. diff --git a/lang/python.pot b/lang/python.pot index 1345aeb3f..28f17ae17 100644 --- a/lang/python.pot +++ b/lang/python.pot @@ -2,361 +2,346 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-14 16:14+0100\n" +"POT-Creation-Date: 2021-03-19 14:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: \n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: src/modules/grubcfg/main.py:28 msgid "Configure GRUB." -msgstr "Configure GRUB." +msgstr "" #: src/modules/mount/main.py:30 msgid "Mounting partitions." -msgstr "Mounting partitions." +msgstr "" -#: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:198 +#: src/modules/mount/main.py:125 src/modules/initcpiocfg/main.py:198 #: src/modules/initcpiocfg/main.py:202 #: src/modules/luksopenswaphookcfg/main.py:86 #: src/modules/luksopenswaphookcfg/main.py:90 src/modules/rawfs/main.py:164 #: src/modules/initramfscfg/main.py:85 src/modules/initramfscfg/main.py:89 #: src/modules/openrcdmcryptcfg/main.py:72 -#: src/modules/openrcdmcryptcfg/main.py:76 src/modules/fstab/main.py:373 -#: src/modules/fstab/main.py:379 src/modules/localecfg/main.py:135 +#: src/modules/openrcdmcryptcfg/main.py:76 src/modules/fstab/main.py:355 +#: src/modules/fstab/main.py:361 src/modules/localecfg/main.py:135 #: src/modules/networkcfg/main.py:39 msgid "Configuration Error" -msgstr "Configuration Error" +msgstr "" -#: src/modules/mount/main.py:146 src/modules/initcpiocfg/main.py:199 +#: src/modules/mount/main.py:126 src/modules/initcpiocfg/main.py:199 #: src/modules/luksopenswaphookcfg/main.py:87 src/modules/rawfs/main.py:165 #: src/modules/initramfscfg/main.py:86 src/modules/openrcdmcryptcfg/main.py:73 -#: src/modules/fstab/main.py:374 +#: src/modules/fstab/main.py:356 msgid "No partitions are defined for
{!s}
to use." -msgstr "No partitions are defined for
{!s}
to use." +msgstr "" #: src/modules/services-systemd/main.py:26 msgid "Configure systemd services" -msgstr "Configure systemd services" +msgstr "" #: src/modules/services-systemd/main.py:59 #: src/modules/services-openrc/main.py:93 msgid "Cannot modify service" -msgstr "Cannot modify service" +msgstr "" #: src/modules/services-systemd/main.py:60 msgid "" "systemctl {arg!s} call in chroot returned error code {num!s}." msgstr "" -"systemctl {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-systemd/main.py:63 #: src/modules/services-systemd/main.py:67 msgid "Cannot enable systemd service {name!s}." -msgstr "Cannot enable systemd service {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:65 msgid "Cannot enable systemd target {name!s}." -msgstr "Cannot enable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:69 msgid "Cannot disable systemd target {name!s}." -msgstr "Cannot disable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:71 msgid "Cannot mask systemd unit {name!s}." -msgstr "Cannot mask systemd unit {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:73 msgid "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." +"Unknown systemd commands {command!s} and {suffix!s} for unit {name!s}." msgstr "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." #: src/modules/umount/main.py:31 msgid "Unmount file systems." -msgstr "Unmount file systems." +msgstr "" #: src/modules/unpackfs/main.py:35 msgid "Filling up filesystems." -msgstr "Filling up filesystems." +msgstr "" #: src/modules/unpackfs/main.py:255 msgid "rsync failed with error code {}." -msgstr "rsync failed with error code {}." +msgstr "" #: src/modules/unpackfs/main.py:300 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "Unpacking image {}/{}, file {}/{}" +msgstr "" #: src/modules/unpackfs/main.py:315 msgid "Starting to unpack {}" -msgstr "Starting to unpack {}" +msgstr "" #: src/modules/unpackfs/main.py:324 src/modules/unpackfs/main.py:464 msgid "Failed to unpack image \"{}\"" -msgstr "Failed to unpack image \"{}\"" +msgstr "" #: src/modules/unpackfs/main.py:431 msgid "No mount point for root partition" -msgstr "No mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:432 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" -msgstr "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:437 msgid "Bad mount point for root partition" -msgstr "Bad mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:438 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "rootMountPoint is \"{}\", which does not exist, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:454 src/modules/unpackfs/main.py:458 #: src/modules/unpackfs/main.py:478 msgid "Bad unsquash configuration" -msgstr "Bad unsquash configuration" +msgstr "" #: src/modules/unpackfs/main.py:455 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "The filesystem for \"{}\" ({}) is not supported by your current kernel" +msgstr "" #: src/modules/unpackfs/main.py:459 msgid "The source filesystem \"{}\" does not exist" -msgstr "The source filesystem \"{}\" does not exist" +msgstr "" #: src/modules/unpackfs/main.py:465 msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" msgstr "" -"Failed to find unsquashfs, make sure you have the squashfs-tools package " -"installed" #: src/modules/unpackfs/main.py:479 msgid "The destination \"{}\" in the target system is not a directory" -msgstr "The destination \"{}\" in the target system is not a directory" +msgstr "" #: src/modules/displaymanager/main.py:514 msgid "Cannot write KDM configuration file" -msgstr "Cannot write KDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:515 msgid "KDM config file {!s} does not exist" -msgstr "KDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:576 msgid "Cannot write LXDM configuration file" -msgstr "Cannot write LXDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:577 msgid "LXDM config file {!s} does not exist" -msgstr "LXDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:660 msgid "Cannot write LightDM configuration file" -msgstr "Cannot write LightDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:661 msgid "LightDM config file {!s} does not exist" -msgstr "LightDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:735 msgid "Cannot configure LightDM" -msgstr "Cannot configure LightDM" +msgstr "" #: src/modules/displaymanager/main.py:736 msgid "No LightDM greeter installed." -msgstr "No LightDM greeter installed." +msgstr "" #: src/modules/displaymanager/main.py:767 msgid "Cannot write SLIM configuration file" -msgstr "Cannot write SLIM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:768 msgid "SLIM config file {!s} does not exist" -msgstr "SLIM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:894 msgid "No display managers selected for the displaymanager module." -msgstr "No display managers selected for the displaymanager module." +msgstr "" #: src/modules/displaymanager/main.py:895 msgid "" "The displaymanagers list is empty or undefined in both globalstorage and " "displaymanager.conf." msgstr "" -"The displaymanagers list is empty or undefined in both globalstorage and " -"displaymanager.conf." #: src/modules/displaymanager/main.py:977 msgid "Display manager configuration was incomplete" -msgstr "Display manager configuration was incomplete" +msgstr "" #: src/modules/initcpiocfg/main.py:28 msgid "Configuring mkinitcpio." -msgstr "Configuring mkinitcpio." +msgstr "" #: src/modules/initcpiocfg/main.py:203 #: src/modules/luksopenswaphookcfg/main.py:91 #: src/modules/initramfscfg/main.py:90 src/modules/openrcdmcryptcfg/main.py:77 -#: src/modules/fstab/main.py:380 src/modules/localecfg/main.py:136 +#: src/modules/fstab/main.py:362 src/modules/localecfg/main.py:136 #: src/modules/networkcfg/main.py:40 msgid "No root mount point is given for
{!s}
to use." -msgstr "No root mount point is given for
{!s}
to use." +msgstr "" #: src/modules/luksopenswaphookcfg/main.py:26 msgid "Configuring encrypted swap." -msgstr "Configuring encrypted swap." +msgstr "" #: src/modules/rawfs/main.py:26 msgid "Installing data." -msgstr "Installing data." +msgstr "" #: src/modules/services-openrc/main.py:29 msgid "Configure OpenRC services" -msgstr "Configure OpenRC services" +msgstr "" #: src/modules/services-openrc/main.py:57 msgid "Cannot add service {name!s} to run-level {level!s}." -msgstr "Cannot add service {name!s} to run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:59 msgid "Cannot remove service {name!s} from run-level {level!s}." -msgstr "Cannot remove service {name!s} from run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:61 msgid "" "Unknown service-action {arg!s} for service {name!s} in run-" "level {level!s}." msgstr "" -"Unknown service-action {arg!s} for service {name!s} in run-" -"level {level!s}." #: src/modules/services-openrc/main.py:94 msgid "" "rc-update {arg!s} call in chroot returned error code {num!s}." msgstr "" -"rc-update {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-openrc/main.py:101 msgid "Target runlevel does not exist" -msgstr "Target runlevel does not exist" +msgstr "" #: src/modules/services-openrc/main.py:102 msgid "" "The path for runlevel {level!s} is {path!s}, which does not " "exist." msgstr "" -"The path for runlevel {level!s} is {path!s}, which does not " -"exist." #: src/modules/services-openrc/main.py:110 msgid "Target service does not exist" -msgstr "Target service does not exist" +msgstr "" #: src/modules/services-openrc/main.py:111 msgid "" -"The path for service {name!s} is {path!s}, which does not " -"exist." +"The path for service {name!s} is {path!s}, which does not exist." msgstr "" -"The path for service {name!s} is {path!s}, which does not " -"exist." #: src/modules/plymouthcfg/main.py:27 msgid "Configure Plymouth theme" -msgstr "Configure Plymouth theme" +msgstr "" #: src/modules/packages/main.py:50 src/modules/packages/main.py:59 #: src/modules/packages/main.py:69 msgid "Install packages." -msgstr "Install packages." +msgstr "" #: src/modules/packages/main.py:57 #, python-format msgid "Processing packages (%(count)d / %(total)d)" -msgstr "Processing packages (%(count)d / %(total)d)" +msgstr "" #: src/modules/packages/main.py:62 #, python-format msgid "Installing one package." msgid_plural "Installing %(num)d packages." -msgstr[0] "Installing one package." -msgstr[1] "Installing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/packages/main.py:65 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." -msgstr[0] "Removing one package." -msgstr[1] "Removing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/bootloader/main.py:43 msgid "Install bootloader." -msgstr "Install bootloader." +msgstr "" #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." -msgstr "Setting hardware clock." +msgstr "" #: src/modules/mkinitfs/main.py:27 msgid "Creating initramfs with mkinitfs." -msgstr "Creating initramfs with mkinitfs." +msgstr "" #: src/modules/mkinitfs/main.py:49 msgid "Failed to run mkinitfs on the target" -msgstr "Failed to run mkinitfs on the target" +msgstr "" #: src/modules/mkinitfs/main.py:50 src/modules/dracut/main.py:50 msgid "The exit code was {}" -msgstr "The exit code was {}" +msgstr "" #: src/modules/dracut/main.py:27 msgid "Creating initramfs with dracut." -msgstr "Creating initramfs with dracut." +msgstr "" #: src/modules/dracut/main.py:49 msgid "Failed to run dracut on the target" -msgstr "Failed to run dracut on the target" +msgstr "" #: src/modules/initramfscfg/main.py:32 msgid "Configuring initramfs." -msgstr "Configuring initramfs." +msgstr "" #: src/modules/openrcdmcryptcfg/main.py:26 msgid "Configuring OpenRC dmcrypt service." -msgstr "Configuring OpenRC dmcrypt service." +msgstr "" #: src/modules/fstab/main.py:29 msgid "Writing fstab." -msgstr "Writing fstab." +msgstr "" #: src/modules/dummypython/main.py:35 msgid "Dummy python job." -msgstr "Dummy python job." +msgstr "" #: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:93 #: src/modules/dummypython/main.py:94 msgid "Dummy python step {}" -msgstr "Dummy python step {}" +msgstr "" #: src/modules/localecfg/main.py:30 msgid "Configuring locales." -msgstr "Configuring locales." +msgstr "" #: src/modules/networkcfg/main.py:28 msgid "Saving network configuration." -msgstr "Saving network configuration." +msgstr ""