diff --git a/CHANGES b/CHANGES
index 7f4f18ab7..0c96bc47c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,20 +7,40 @@ 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.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.
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
+ retrieved. Older configurations with a single string are
+ treated like a one-item list. #1579
- The *usersq* module now connects to the internal configuration
object and may be usable for regular installations.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7377c265..7ad919c4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@
# 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
)
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
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 @@
-
+ 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.
-
+ La configuració de %1 no s'ha completat correctament.
-
+ 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.
-
+ Crea una partició nova de %1 MiB a %3 (%2) amb entrades %4.
-
+ 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.
-
+ Crea una partició nova de <strong>%1 MiB</strong> a <strong>%3</strong> (%2) amb entrades <em>%4</em>.
-
+ 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.
-
+ 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.
-
+ Estableix la partició <strong>nova</strong> %2 amb el punt de muntatge <strong>%1</strong> i funcions <em>%3</em>.
-
+ Estableix la partició <strong>nova</strong> %2 amb el punt de muntatge <strong>%1</strong> %3.
-
+ Instal·la %2 a la partició de sistema %3 <strong>%1</strong> amb funcions <em>%4</em>.
-
+ Estableix la partició %3 <strong>%1</strong> amb el punt de muntatge <strong>%2</strong> i funcions <em>%4</em>.
-
+ 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
-
+ Instal·lació acabada
-
+ %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.
-
+ Tanca l'instal·lador
-
+ Reinicia el sistema
-
+ <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_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
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reload Stylesheet
-
+
+
+
+
+
+ Widget Tree
-
+ Debug information
@@ -286,13 +306,13 @@
-
+ &Yes
-
+ &No
@@ -302,17 +322,17 @@
&Close
-
+ Install Log Paste URL
-
+ The upload was unsuccessful. No web-paste was done.
-
+
Link copied to clipboard
-
+ 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.
-
+ <br/>The following modules could not be loaded:
-
+ Continue with setup?
-
+ 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 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
-
+ &Install now
-
+ Go &back
-
+ &Set up
-
+ &Install
-
+ Setup is complete. Close the setup program.
-
+ The installation is complete. Close the installer.
-
+ Cancel setup without changing the system.
-
+ Cancel installation without changing the system.
-
+ &Next
-
+ &Back
-
+ &Done
-
+ &Cancel
-
+ Cancel setup?
-
+ 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 install process?
@@ -475,12 +495,12 @@ The installer will quit and all changes will be lost.CalamaresWindow
-
+ %1 Setup Program
-
+ %1 Installer
@@ -488,7 +508,7 @@ The installer will quit and all changes will be lost.
CheckerContainer
-
+ 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: Received invalid groups data)
-
-
- Network Installation. (Disabled: internal error)
+
+
+
-
+
+
+
+
+
+
+
+ Package selection
+
+
+ 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
-
+ Installation Failed
-
+ The setup of %1 did not complete successfully.
-
+ The installation of %1 did not complete successfully.
-
+ Setup Complete
-
+ Installation Complete
-
+ The setup 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
-
+ There is not enough drive space. At least %1 GiB is required.
-
+ has at least %1 GiB working memory
-
+ The system does not have enough working memory. At least %1 GiB is required.
-
+ is plugged in to a power source
-
+ The system is not plugged in to a power source.
-
+ is connected to the Internet
-
+ The system is not connected to the Internet.
-
+ is running the installer as an administrator (root)
-
+ The setup program is not running with administrator rights.
-
+ The installer is not running with administrator rights.
-
+ 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 installer.
@@ -1611,7 +1641,7 @@ The installer will quit and all changes will be lost.
Please install KDE Konsole and try again!
-
+ Executing script: <code>%1</code>
@@ -1883,98 +1913,97 @@ The installer will quit and all changes will be lost.
NetInstallViewStep
-
-
+ Package selection
-
+ Office software
-
+ Office package
-
+ Browser software
-
+ Browser package
-
+ Web browser
-
+ Kernel
-
+ Services
-
+ Login
-
+ Desktop
-
+ Applications
-
+ Communication
-
+ Development
-
+ Office
-
+ Multimedia
-
+ Internet
-
+ Theming
-
+ Gaming
-
+ 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 installation.</small>
@@ -3721,7 +3750,7 @@ Output:
UsersQmlViewStep
-
+ Users
@@ -4141,102 +4170,102 @@ Output:
What is your name?
-
+ Your Full Name
-
+ What name do you want to use to log in?
-
+ Login Name
-
+ If more than one person will use this computer, you can create multiple accounts after installation.
-
+ What is the name of this computer?
-
+ Computer Name
-
+ This name will be used if you make the computer visible to others on a network.
-
+ Choose a password to keep your account safe.
-
+ 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.
-
+ Validate passwords quality
-
+ 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
-
+ Reuse user password as root password
-
+ Use the same password for the administrator account.
-
+ Choose a root password to keep your account safe.
-
+ Root Password
-
+ Repeat Root Password
-
+ Enter the same password twice, so that it can be checked for typing errors.
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 @@
-
+ Retadreso de la alglua servilo
-
+ 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 @@
-
+ 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ä.
-
+ Määrityksen %1 asennus ei onnistunut.
-
+ Asennus %1 ei onnistunut.
@@ -974,12 +978,12 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä.
-
+ Luo uusi %1MiB osio kohteeseen %3 (%2), jossa on %4.
-
+ Luo uusi %1MiB osio kohteeseen %3 (%2).
@@ -989,12 +993,12 @@ Asennus voi jatkua, mutta jotkin toiminnot saattavat olla pois käytöstä.
-
+ Luo uusi <strong>%1MiB</strong> osio kohteeseen <strong>%3</strong> (%2) jossa on <em>%4</em>.
-
+ 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ä.
-
+ 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ä.
-
+ Määritä <strong>uusi</strong> %2 osio liitospisteellä <strong>%1</strong> ja ominaisuuksilla <em>%3</em>.
-
+ Määritä <strong>uusi</strong> %2 osio liitospisteellä <strong>%1</strong>%3.
-
+ Asenna %2 - %3 järjestelmäosio <strong>%1</strong> ominaisuuksilla <em>%4</em>.
-
+ Määritä %3 osio <strong>%1</strong> liitospisteellä <strong>%2</strong> ja ominaisuuksilla <em>%4</em>.
-
+ 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ä.
-
+ Asennus suoritettu
-
+ %1 on asennettu tietokoneellesi.<br/>
+ Voit käynnistää nyt uuden järjestelmän tai jatkaa Live-ympäristön käyttöä.
-
+ Sulje asennusohjelma
-
+ Käynnistä järjestelmä
-
+ <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 @@
-
+ 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.
-
+ %1 sąranka nebuvo užbaigta sėkmingai.
-
+ %1 nebuvo užbaigtas sėkmingai.
@@ -977,12 +981,12 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti.
-
+ Sukurti naują %1MiB skaidinį ties %3 (%2) su įrašais %4.
-
+ Sukurti naują %1MiB skaidinį ties %3 (%2).
@@ -992,12 +996,12 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti.
-
+ Sukurti naują <strong>%1MiB</strong> skaidinį ties <strong>%3</strong> (%2) su įrašais <em>%4</em>.
-
+ 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.
-
+ Į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.
-
+ Nustatyti <strong>naują</strong> %2 skaidinį su prijungimo tašku <strong>%1</strong> ir ypatybėmis <em>%3</em>.
-
+ Nustatyti <strong>naują</strong> %2 skaidinį su prijungimo tašku <strong>%1</strong>%3.
-
+ Įdiegti %2 sistemą %3 sistemos skaidinyje <strong>%1</strong> su ypatybėmis <em>%4</em>.
-
+ Nustatyti %3 skaidinį <strong>%1</strong> su prijungimo tašku <strong>%2</strong> ir ypatybėmis <em>%4</em>.
-
+ Nustatyti %3 skaidinį <strong>%1</strong> su prijungimo tašku <strong>%2</strong>%4.
@@ -3983,29 +3987,31 @@ Išvestis:
-
+ Diegimas užbaigtas
-
+ %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.
-
+ Užverti diegimo programą
-
+ Paleisti sistemą iš naujo
-
+ <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 @@
-
+ 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.
-
+ A configuração de %1 não foi concluída com sucesso.
-
+ 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.
-
+ Criar nova partição de %1MiB em %3 (%2) com entradas %4.
-
+ 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.
-
+ Criar nova partição de <strong>%1MiB</strong> em <strong>%3</strong> (%2) com entradas <em>%4</em>.
-
+ 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.
-
+ 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.
-
+ Configurar <strong>nova</strong> partição %2 com ponto de montagem <strong>%1</strong> e funcionalidades <em>%3</em>.
-
+ Configurar <strong>nova</strong> partição %2 com ponto de montagem <strong>%1</strong>%3.
-
+ Instalar %2 em %3 partição do sistema <strong>%1</strong> com funcionalidades <em>%4</em>.
-
+ Configurar %3 partição <strong>%1</strong> com ponto de montagem <strong>%2</strong> e funcionalidades <em>%4</em>.
-
+ Configurar %3 partição <strong>%1</strong> com ponto de montagem <strong>%2</strong>%4.
@@ -3961,29 +3965,31 @@ Saída de Dados:
-
+ Instalação Concluída
-
+ %1 foi instalado no seu computador.<br/>
+ Pode agora reiniciar no seu novo sistema, ou continuar a utilizar o ambiente Live.
-
+ Fechar Instalador
-
+ Reiniciar Sistema
-
+ <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)
@@ -2888,7 +2888,7 @@ Output:
-
+ %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 @@
-
+ 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.
-
+ Installationen av %1 slutfördes inte korrekt.
-
+ Installationen av %1 slutfördes inte korrekt.
@@ -972,12 +976,12 @@ Alla ändringar kommer att gå förlorade.
-
+ Skapa ny %1MiB partition på %3 (%2) med poster %4.
-
+ Skapa ny %1MiB partition på %3 (%2).
@@ -987,12 +991,12 @@ Alla ändringar kommer att gå förlorade.
-
+ Skapa ny <strong>%1MiB</strong> partition på <strong>%3</strong> (%2) med poster <em>%4</em>.
-
+ Skapa ny <strong>%1MiB</strong> partition på <strong>%3</strong> (%2).
@@ -1340,7 +1344,7 @@ Alla ändringar kommer att gå förlorade.
-
+ 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.
-
+ Skapa <strong>ny</strong>%2 partition med monteringspunkt <strong>%1</strong> och funktioner <em>%3</em>.
-
+ Skapa <strong>ny</strong> %2 partition med monteringspunkt <strong>%1</strong>%3.
-
+ Installera %2 på %3 system partition <strong>%1</strong> med funktioner <em>%4</em>.
-
+ Skapa %3 partition <strong>%1</strong>med monteringspunkt <strong>%2</strong>och funktioner <em>%4</em>.
-
+ Skapa %3 partition <strong>%1</strong> med monteringspunkt <strong>%2</strong> %4.
@@ -3961,29 +3965,31 @@ Installationen kan inte fortsätta.</p>
-
+ Installationen är klar
-
+ %1 har installerats på din dator. <br/>
+ Du kan nu starta om i ditt nya system eller fortsätta använda Live-miljön.
-
+ Stäng installationsprogrammet
-
+ Starta om System
-
+ <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>
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}"
+"code> 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 ""
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"
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..b5fd899d4 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,7 +214,11 @@ DebugWindow::DebugWindow()
}
} );
- CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); )
+ // 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::doLogUploadUI( 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..1b163d49d 100644
--- a/src/calamares/DebugWindow.ui
+++ b/src/calamares/DebugWindow.ui
@@ -21,7 +21,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- 2
+ 0
@@ -92,49 +92,64 @@ SPDX-License-Identifier: GPL-3.0-or-later
-
-
- Tools
-
-
-
-
-
- Crash now
-
-
-
-
-
-
- Reload Stylesheet
-
-
-
-
-
-
- Widget Tree
-
-
-
-
-
-
- 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
+
+
+
+
+
+
+
+
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/modulesystem/Config.cpp b/src/libcalamares/modulesystem/Config.cpp
index 71210a9cb..68d7b6514 100644
--- a/src/libcalamares/modulesystem/Config.cpp
+++ b/src/libcalamares/modulesystem/Config.cpp
@@ -94,26 +94,41 @@ Config::ApplyPresets::apply( const char* fieldName )
if ( !prop.isValid() )
{
cWarning() << "Applying invalid property" << fieldName;
+ return *this;
+ }
+
+ 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 } );
}
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 } );
- }
+ // 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;
}
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/libcalamares/packages/Globals.cpp b/src/libcalamares/packages/Globals.cpp
new file mode 100644
index 000000000..c5e882436
--- /dev/null
+++ b/src/libcalamares/packages/Globals.cpp
@@ -0,0 +1,68 @@
+/* === 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 "utils/Logger.h"
+
+bool
+CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
+ 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)
+ QVariantList packageOperations = gs->contains( PACKAGEOP ) ? gs->value( PACKAGEOP ).toList() : QVariantList();
+ cDebug() << "Existing package operations length" << packageOperations.length();
+
+ 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
+ // 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..a47cf5ae1
--- /dev/null
+++ b/src/libcalamares/packages/Globals.h
@@ -0,0 +1,36 @@
+/* === 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 "GlobalStorage.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.
+ *
+ * Returns @c true if anything was changed, @c false otherwise.
+ */
+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 );
+} // 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..0a9be3a20
--- /dev/null
+++ b/src/libcalamares/packages/Tests.cpp
@@ -0,0 +1,88 @@
+/* === 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 "utils/Logger.h"
+
+#include
+
+class PackagesTests : public QObject
+{
+ Q_OBJECT
+public:
+ PackagesTests() {}
+ ~PackagesTests() override {}
+private Q_SLOTS:
+ void initTestCase();
+
+ void testEmpty();
+ void testAdd();
+};
+
+void
+PackagesTests::initTestCase()
+{
+ Logger::setupLogLevel( Logger::LOGDEBUG );
+}
+
+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 ) );
+}
+
+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 )
+
+#include "utils/moc-warnings.h"
+
+#include "Tests.moc"
diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h
index f318c78a6..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[] );
@@ -57,7 +59,8 @@ 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& );
+ friend CDebug& operator<<( CDebug&&, Once& );
private:
QString m_msg;
@@ -65,11 +68,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&
@@ -285,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/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..704655c8b 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 );
}
@@ -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/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 );
}
diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp
index 2f0cfa143..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;
@@ -126,3 +130,41 @@ 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()
+{
+ 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..c77625415 100644
--- a/src/libcalamaresui/utils/Paste.h
+++ b/src/libcalamaresui/utils/Paste.h
@@ -13,17 +13,30 @@
#include
class QObject;
+class QWidget;
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 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.
+ */
+bool isEnabled();
} // namespace Paste
} // namespace CalamaresUtils
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.";
}
}
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/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;
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/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 e69b3c2a4..2d663829c 100644
--- a/src/modules/netinstall/Config.cpp
+++ b/src/modules/netinstall/Config.cpp
@@ -12,10 +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/Yaml.h"
+#include "utils/Retranslator.h"
+#include "utils/Variant.h"
#include
@@ -23,10 +28,20 @@ Config::Config( QObject* parent )
: QObject( parent )
, m_model( new PackageModel( this ) )
{
+ CALAMARES_RETRANSLATE_SLOT( &Config::retranslate );
}
Config::~Config() {}
+void
+Config::retranslate()
+{
+ emit statusChanged( status() );
+ emit sidebarLabelChanged( sidebarLabel() );
+ emit titleLabelChanged( titleLabel() );
+}
+
+
QString
Config::status() const
{
@@ -39,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();
}
@@ -54,92 +71,114 @@ 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 )
{
m_model->setupModelData( groupData );
+ if ( m_model->rowCount() < 1 )
+ {
+ cWarning() << "NetInstall groups data was empty.";
+ setStatus( Status::FailedNoData );
+ }
+ else
+ {
+ setStatus( Status::Ok );
+ }
emit statusReady();
}
void
-Config::loadGroupList( const QUrl& url )
+Config::loadingDone()
{
- if ( !url.isValid() )
+ if ( m_queue )
{
- setStatus( Status::FailedBadConfiguration );
+ m_queue->deleteLater();
+ m_queue = nullptr;
+ }
+}
+
+
+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 );
+ // 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", className );
+ }
+ if ( label.contains( "title" ) )
+ {
+ m_titleLabel = new CalamaresUtils::Locale::TranslatedString( label, "title", className );
}
- 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 )
+ // Lastly, load the groups data
+ const QString key = QStringLiteral( "groupsUrl" );
+ const auto& groupsUrlVariant = configurationMap.value( key );
+ if ( groupsUrlVariant.type() == QVariant::String )
{
- cDebug() << Logger::Continuation << "request failed immediately.";
- setStatus( Status::FailedBadConfiguration );
+ m_queue = new LoaderQueue( this );
+ m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) );
}
- else
+ else if ( groupsUrlVariant.type() == QVariant::List )
{
- m_reply = reply;
- connect( reply, &QNetworkReply::finished, this, &Config::receivedGroupData );
+ m_queue = new LoaderQueue( this );
+ for ( const auto& s : groupsUrlVariant.toStringList() )
+ {
+ m_queue->append( SourceItem::makeSourceItem( s, configurationMap ) );
+ }
+ }
+ if ( m_queue && m_queue->count() > 0 )
+ {
+ cDebug() << "Loading netinstall from" << m_queue->count() << "alternate sources.";
+ connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone );
+ m_queue->load();
}
}
void
-Config::receivedGroupData()
+Config::finalizeGlobalStorage( const Calamares::ModuleSystem::InstanceKey& key )
{
- if ( !m_reply || !m_reply->isFinished() )
+ 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 )
{
- 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() )
+ if ( package->isCritical() )
{
- loadGroupList( CalamaresUtils::yamlSequenceToVariant( groups ) );
- }
- else if ( groups.IsMap() )
- {
- auto map = CalamaresUtils::yamlMapToVariant( groups );
- loadGroupList( map.value( "groups" ).toList() );
+ installPackages.append( package->toOperation() );
}
else
{
- cWarning() << "NetInstall groups data does not form a sequence.";
- }
- if ( m_model->rowCount() < 1 )
- {
- cWarning() << "NetInstall groups data was empty.";
+ tryInstallPackages.append( package->toOperation() );
}
}
- catch ( YAML::Exception& e )
- {
- CalamaresUtils::explainYamlException( e, yamlData, "netinstall groups data" );
- setStatus( Status::FailedBadData );
- }
+
+ 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 13eb098c6..b676a7d39 100644
--- a/src/modules/netinstall/Config.h
+++ b/src/modules/netinstall/Config.h
@@ -14,10 +14,15 @@
#include "PackageModel.h"
-#include
-#include
+#include "locale/TranslatableConfiguration.h"
+#include "modulesystem/InstanceKey.h"
-class QNetworkReply;
+#include
+#include
+
+#include
+
+class LoaderQueue;
class Config : public QObject
{
@@ -26,17 +31,25 @@ 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,
FailedBadConfiguration,
FailedInternalError,
FailedNetworkError,
- FailedBadData
+ FailedBadData,
+ FailedNoData
+
};
QString status() const;
@@ -45,12 +58,10 @@ public:
bool required() const { return m_required; }
void setRequired( bool r ) { m_required = r; }
- /** @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 );
+ PackageModel* model() const { return m_model; }
+
+ QString sidebarLabel() const;
+ QString titleLabel() const;
/** @brief Fill model from parsed data.
*
@@ -59,18 +70,28 @@ public:
*/
void loadGroupList( const QVariantList& groupData );
- PackageModel* model() const { return m_model; }
+ /** @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:
+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();
+ 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;
- QNetworkReply* m_reply = nullptr; // For fetching data
+ 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
new file mode 100644
index 000000000..f8ba17cff
--- /dev/null
+++ b/src/modules/netinstall/LoaderQueue.cpp
@@ -0,0 +1,194 @@
+/*
+ * 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
+
+/** @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 )
+{
+ 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::load()
+{
+ QMetaObject::invokeMethod( this, "fetchNext", Qt::QueuedConnection );
+}
+
+
+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 )
+{
+ FetchNextUnless next( this );
+
+ if ( !url.isValid() )
+ {
+ m_config->setStatus( Config::Status::FailedBadConfiguration );
+ cDebug() << "Invalid URL" << url;
+ return;
+ }
+
+ 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::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 );
+ }
+}
+
+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..d7baf58d4
--- /dev/null
+++ b/src/modules/netinstall/LoaderQueue.h
@@ -0,0 +1,77 @@
+/*
+ * 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 );
+};
+
+/** @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
+public:
+ LoaderQueue( Config* parent );
+
+ void append( SourceItem&& i );
+ int count() const { return m_queue.count(); }
+
+public Q_SLOTS:
+ void load();
+
+ void fetchNext();
+ 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
diff --git a/src/modules/netinstall/NetInstallPage.cpp b/src/modules/netinstall/NetInstallPage.cpp
index 75175a941..a1a86294e 100644
--- a/src/modules/netinstall/NetInstallPage.cpp
+++ b/src/modules/netinstall/NetInstallPage.cpp
@@ -33,40 +33,16 @@ 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::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 );
-
- 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()
{
@@ -82,12 +58,6 @@ NetInstallPage::expandGroups()
}
}
-void
-NetInstallPage::setStatus( QString s )
-{
- ui->netinst_status->setText( s );
-}
-
void
NetInstallPage::onActivate()
{
diff --git a/src/modules/netinstall/NetInstallPage.h b/src/modules/netinstall/NetInstallPage.h
index 1c97423da..72375d0f0 100644
--- a/src/modules/netinstall/NetInstallPage.h
+++ b/src/modules/netinstall/NetInstallPage.h
@@ -37,23 +37,8 @@ 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 );
-
/** @brief Expand entries that should be pre-expanded.
*
* Follows the *expanded* key / the startExpanded field in the
@@ -64,8 +49,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 d92058e51..2ac0e73c9 100644
--- a/src/modules/netinstall/NetInstallViewStep.cpp
+++ b/src/modules/netinstall/NetInstallViewStep.cpp
@@ -11,12 +11,6 @@
#include "NetInstallViewStep.h"
-#include "GlobalStorage.h"
-#include "JobQueue.h"
-
-#include "utils/Logger.h"
-#include "utils/Variant.h"
-
#include "NetInstallPage.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( NetInstallViewStepFactory, registerPlugin< NetInstallViewStep >(); )
@@ -24,7 +18,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,20 +30,22 @@ 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();
// 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" );
@@ -125,70 +120,7 @@ NetInstallViewStep::onActivate()
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.
- QVariantList installPackages;
- QVariantList tryInstallPackages;
-
- for ( const auto& package : packages )
- {
- if ( package->isCritical() )
- {
- installPackages.append( package->toOperation() );
- }
- else
- {
- tryInstallPackages.append( package->toOperation() );
- }
- }
-
- 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 );
- }
+ m_config.finalizeGlobalStorage( moduleInstanceKey() );
}
void
@@ -201,35 +133,5 @@ 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 );
- }
- }
-
- 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(
- new CalamaresUtils::Locale::TranslatedString( label, "title", metaObject()->className() ) );
- }
+ m_config.setConfigurationMap( configurationMap );
}
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;
};
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
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/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..ba7552c76 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 ); );
}
@@ -1303,7 +1303,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 +1337,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 +1358,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 +1383,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
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(); );
}
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/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 )
{
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();
}