diff --git a/CHANGES b/CHANGES index 96282452d..e0a44f40f 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. -# 3.2.42 (unreleased) # +# 3.2.43 (unreleased) # This release contains contributions from (alphabetically by first name): - No external contributors yet @@ -19,6 +19,46 @@ This release contains contributions from (alphabetically by first name): - No module changes yet +# 3.2.42 (2021-09-06) # + +This release contains contributions from (alphabetically by first name): + - Anke Boersma + - Artem Grinev + - Nico 'dr460nf1r3' (new contributor, welcome!) + - Waneon Kim (new contributor, welcome!) + +## Core ## + - No core changes yet + +## Modules ## + - BTRFS partitions are no longer listed as "check in phase 2" in + the *fstab* module. (Thanks Nico) + - The *keyboard* module (and *keyboardq*) now pick an English layout + (with Rupee) for keyboards when the language is English and locale is India, + rather than Hindi layout. + - The *localeq* module had the i18n.qml rewritten to make it easier + to customize. A bug in the layout has been fixed, and the overall + look has been updated. + - *networkcfg* now translates the "live user" on an ISO to the regular + user on the installed system, so that network configuration changes + made in the live system are automatically used after installation. #1755 + - *partition* no longer allows you to delete an extended partition with + children (which led to crashes). #1749 (Thanks Artem) + - *partition* complains in more detail about the state of the UEFI + boot partition (under manual partitioning schemes). #1761 + - *welcome* can now check multiple URLs to determine if internet connectivity + is available. It is still recommended to check the distro home-page or + some special "ping" page of the distro, although that has some privacy + implications; using example.com or google.com may work as well. Listing + multiple URLs will ping each of them in turn until one succeeds. #1669 + - The work to make a QML version available for all view modules is almost + completed. Two new QML modules have been added *packagechooserq* and *summaryq*. + Summaryq brings the option to present the summary page in a customizable + way, with a bit more of a contemporary look. Packagechooserq adds the option + to preselect an item and displays all options in one overview. + (Thanks Anke) + + # 3.2.41.1 (2021-08-05) # This is a hotfix release for a crash in the *partition* module, reported on diff --git a/CMakeLists.txt b/CMakeLists.txt index 44a88074f..27fcda865 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.42 + VERSION 3.2.43 LANGUAGES C CXX ) @@ -133,13 +133,14 @@ set( CALAMARES_DESCRIPTION_SUMMARY # `txstats.py -e`. See also # # Total 79 languages -set( _tx_complete az az_AZ ca fi_FI he hi hr ja lt sq sv uk zh_TW ) -set( _tx_good as be ca@valencia cs_CZ da de fr fur it_IT ko ml nl - pt_BR pt_PT ru sk tg tr_TR vi zh_CN ) +set( _tx_complete az az_AZ ca de fi_FI he hi hr ja ko lt pt_BR sq + sv uk zh_TW ) +set( _tx_good as be ca@valencia cs_CZ da fr fur it_IT ml nl pt_PT + ru sk tg tr_TR vi zh_CN ) set( _tx_ok ar ast bg bn el en_GB es es_MX es_PR et eu fa gl hu id - is mr nb pl ro sl sr sr@latin th zh_HK ) + is mr nb pl ro si sl sr sr@latin th zh_HK ) set( _tx_incomplete eo es_PE fr_CH gu id_ID ie kk kn ko_KR lo lv mk - ne ne_NP ru_RU si te ur uz zh ) + ne ne_NP ru_RU te ur uz zh ) ### Required versions # diff --git a/lang/calamares_de.ts b/lang/calamares_de.ts index cb48adb16..e682848c5 100644 --- a/lang/calamares_de.ts +++ b/lang/calamares_de.ts @@ -510,12 +510,13 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Set filesystem label on %1. - + Setze Dateisytem-Label für %1. Set filesystem label <strong>%1</strong> to partition <strong>%2</strong>. - + Setze Dateisytem-Label <strong>%1</strong> für Partition <strong>%2</strong>. + @@ -896,7 +897,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. OK! - + OK! @@ -1012,12 +1013,12 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Label for the filesystem - + Label für das Dateisystem FS Label: - + FS Label: @@ -1376,12 +1377,12 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Label for the filesystem - + Label für das Dateisystem FS Label: - + FS Label: @@ -1889,7 +1890,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Quit - + Beenden @@ -2113,7 +2114,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Select your preferred Region, or use the default settings. - + Wählen Sie Ihre bevorzugte Region oder nutzen Sie die Standardeinstellungen. @@ -2653,7 +2654,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. File System Label - + Dateisystem-Label @@ -4263,7 +4264,7 @@ Ausgabe: root is not allowed as username. - + root ist als Benutzername nicht erlaubt. @@ -4283,7 +4284,7 @@ Ausgabe: localhost is not allowed as hostname. - + localhost ist als Computername nicht erlaubt. @@ -4323,7 +4324,7 @@ Ausgabe: Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + Es sind nur Buchstaben, Zahlen, Unterstrich und Bindestrich erlaubt, minimal zwei Zeichen. diff --git a/lang/calamares_en.ts b/lang/calamares_en.ts index 5ff148ecc..53882fbb0 100644 --- a/lang/calamares_en.ts +++ b/lang/calamares_en.ts @@ -495,12 +495,12 @@ The installer will quit and all changes will be lost. CalamaresWindow - + %1 Setup Program %1 Setup Program - + %1 Installer %1 Installer @@ -539,149 +539,149 @@ The installer will quit and all changes will be lost. Form - + Select storage de&vice: Select storage de&vice: - - - - + + + + Current: Current: - + After: After: - + <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. - + Reuse %1 as home partition for %2. Reuse %1 as home partition for %2. - + <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> - + %1 will be shrunk to %2MiB and a new %3MiB partition will be created for %4. %1 will be shrunk to %2MiB and a new %3MiB partition will be created for %4. - + Boot loader location: Boot loader location: - + <strong>Select a partition to install on</strong> <strong>Select a partition to install on</strong> - + An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. - + The EFI system partition at %1 will be used for starting %2. The EFI system partition at %1 will be used for starting %2. - + EFI system partition: EFI system partition: - + This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - - - - + + + + <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. - - - - + + + + <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. - - - - + + + + <strong>Replace a partition</strong><br/>Replaces a partition with %1. <strong>Replace a partition</strong><br/>Replaces a partition with %1. - + This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device already has an operating system on it, but the partition table <strong>%1</strong> is different from the needed <strong>%2</strong>.<br/> This storage device already has an operating system on it, but the partition table <strong>%1</strong> is different from the needed <strong>%2</strong>.<br/> - + This storage device has one of its partitions <strong>mounted</strong>. This storage device has one of its partitions <strong>mounted</strong>. - + This storage device is a part of an <strong>inactive RAID</strong> device. This storage device is a part of an <strong>inactive RAID</strong> device. - + No Swap No Swap - + Reuse Swap Reuse Swap - + Swap (no Hibernate) Swap (no Hibernate) - + Swap (with Hibernate) Swap (with Hibernate) - + Swap to file Swap to file @@ -749,12 +749,12 @@ The installer will quit and all changes will be lost. Config - + Set keyboard model to %1.<br/> Set keyboard model to %1.<br/> - + Set keyboard layout to %1/%2. Set keyboard layout to %1/%2. @@ -804,47 +804,47 @@ The installer will quit and all changes will be lost. Network Installation. (Disabled: Unable to fetch package lists, check your network connection) - + This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> - + This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> - + This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. - + This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. - + This program will ask you some questions and set up %2 on your computer. This program will ask you some questions and set up %2 on your computer. - + <h1>Welcome to the Calamares setup program for %1</h1> <h1>Welcome to the Calamares setup program for %1</h1> - + <h1>Welcome to %1 setup</h1> <h1>Welcome to %1 setup</h1> - + <h1>Welcome to the Calamares installer for %1</h1> <h1>Welcome to the Calamares installer for %1</h1> - + <h1>Welcome to the %1 installer</h1> <h1>Welcome to the %1 installer</h1> @@ -939,15 +939,40 @@ The installer will quit and all changes will be lost. The installation of %1 is complete. - + Package Selection Package Selection - + Please pick a product from the list. The selected product will be installed. Please pick a product from the list. The selected product will be installed. + + + Install option: <strong>%1</strong> + + + + + None + + + + + Summary + Summary + + + + This is an overview of what will happen once you start the setup procedure. + This is an overview of what will happen once you start the setup procedure. + + + + This is an overview of what will happen once you start the install procedure. + This is an overview of what will happen once you start the install procedure. + ContextualProcessJob @@ -2446,6 +2471,14 @@ The installer will quit and all changes will be lost. Please pick a product from the list. The selected product will be installed. + + PackageChooserQmlViewStep + + + Packages + Packages + + PackageChooserViewStep @@ -2729,17 +2762,17 @@ The installer will quit and all changes will be lost. I&nstall boot loader on: - + Are you sure you want to create a new partition table on %1? Are you sure you want to create a new partition table on %1? - + Can not create new partition Can not create new partition - + The partition table on %1 already has %2 primary partitions, and no more can be added. Please remove one primary partition and add an extended partition, instead. The partition table on %1 already has %2 primary partitions, and no more can be added. Please remove one primary partition and add an extended partition, instead. @@ -2757,107 +2790,82 @@ The installer will quit and all changes will be lost. Partitions - - Install %1 <strong>alongside</strong> another operating system. - Install %1 <strong>alongside</strong> another operating system. - - - - <strong>Erase</strong> disk and install %1. - <strong>Erase</strong> disk and install %1. - - - - <strong>Replace</strong> a partition with %1. - <strong>Replace</strong> a partition with %1. - - - - <strong>Manual</strong> partitioning. - <strong>Manual</strong> partitioning. - - - - Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3). - Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3). - - - - <strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1. - <strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1. - - - - <strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1. - <strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1. - - - - <strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2). - <strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2). - - - - Disk <strong>%1</strong> (%2) - Disk <strong>%1</strong> (%2) - - - + Current: Current: - + After: After: - + No EFI system partition configured No EFI system partition configured - - An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. - An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. + + EFI system partition configured incorrectly + - - An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. - An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. + + An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a suitable filesystem. + - - EFI system partition flag not set - EFI system partition flag not set + + The filesystem must be mounted on <strong>%1</strong>. + - + + The filesystem must have type FAT32. + + + + + The filesystem must be at least %1 MiB in size. + + + + + The filesystem must have flag <strong>%1</strong> set. + + + + + You can continue without setting up an EFI system partition but your system may fail to start. + + + + Option to use GPT on BIOS Option to use GPT on BIOS - + A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. - + Boot partition not encrypted Boot partition not encrypted - + A separate boot partition was set up together with an encrypted root partition, but the boot partition is not encrypted.<br/><br/>There are security concerns with this kind of setup, because important system files are kept on an unencrypted partition.<br/>You may continue if you wish, but filesystem unlocking will happen later during system startup.<br/>To encrypt the boot partition, go back and recreate it, selecting <strong>Encrypt</strong> in the partition creation window. A separate boot partition was set up together with an encrypted root partition, but the boot partition is not encrypted.<br/><br/>There are security concerns with this kind of setup, because important system files are kept on an unencrypted partition.<br/>You may continue if you wish, but filesystem unlocking will happen later during system startup.<br/>To encrypt the boot partition, go back and recreate it, selecting <strong>Encrypt</strong> in the partition creation window. - + has at least one disk device available. has at least one disk device available. - + There are no partitions to install on. There are no partitions to install on. @@ -2992,7 +3000,7 @@ Output: QObject - + %1 (%2) %1 (%2) @@ -3318,44 +3326,16 @@ Output: ResultsListDialog - + For best results, please ensure that this computer: For best results, please ensure that this computer: - + System requirements System requirements - - ResultsListWidget - - - This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> - This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> - - - - This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> - This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> - - - - This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. - This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. - - - - This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. - This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. - - - - This program will ask you some questions and set up %2 on your computer. - This program will ask you some questions and set up %2 on your computer. - - ScanningDialog @@ -3647,27 +3627,6 @@ Output: %L1 / %L2 - - SummaryPage - - - This is an overview of what will happen once you start the setup procedure. - This is an overview of what will happen once you start the setup procedure. - - - - This is an overview of what will happen once you start the install procedure. - This is an overview of what will happen once you start the install procedure. - - - - SummaryViewStep - - - Summary - Summary - - TrackingInstallJob @@ -3999,7 +3958,7 @@ Output: WelcomeQmlViewStep - + Welcome Welcome @@ -4007,7 +3966,7 @@ Output: WelcomeViewStep - + Welcome Welcome @@ -4090,21 +4049,21 @@ Output: i18n - + <h1>Languages</h1> </br> The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>. <h1>Languages</h1> </br> The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>. - + <h1>Locales</h1> </br> The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>. <h1>Locales</h1> </br> The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>. - + Back Back @@ -4170,6 +4129,45 @@ Output: <p>These are example release notes.</p> + + packagechooserq + + + LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.<br/> + Default option. + + + + + LibreOffice + + + + + If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives. + + + + + No Office Suite + + + + + Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser. + + + + + Minimal Install + + + + + Please select an option for your install, or use the default: LibreOffice included. + + + release_notes @@ -4226,132 +4224,132 @@ Output: usersq - + Pick your user name and credentials to login and perform admin tasks Pick your user name and credentials to login and perform admin tasks - + What is your name? What is your name? - + Your Full Name Your Full Name - + What name do you want to use to log in? What name do you want to use to log in? - + Login Name Login Name - + If more than one person will use this computer, you can create multiple accounts after installation. If more than one person will use this computer, you can create multiple accounts after installation. - + Only lowercase letters, numbers, underscore and hyphen are allowed. Only lowercase letters, numbers, underscore and hyphen are allowed. - + root is not allowed as username. root is not allowed as username. - + What is the name of this computer? What is the name of this computer? - + Computer Name Computer Name - + This name will be used if you make the computer visible to others on a network. This name will be used if you make the computer visible to others on a network. - + localhost is not allowed as hostname. localhost is not allowed as hostname. - + Choose a password to keep your account safe. Choose a password to keep your account safe. - + Password Password - + Repeat Password Repeat Password - + Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals. Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals. - + Validate passwords quality Validate passwords quality - + When this box is checked, password-strength checking is done and you will not be able to use a weak password. When this box is checked, password-strength checking is done and you will not be able to use a weak password. - + Log in automatically without asking for the password Log in automatically without asking for the password - + Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + Reuse user password as root password Reuse user password as root password - + Use the same password for the administrator account. Use the same password for the administrator account. - + Choose a root password to keep your account safe. Choose a root password to keep your account safe. - + Root Password Root Password - + Repeat Root Password Repeat Root Password - + Enter the same password twice, so that it can be checked for typing errors. Enter the same password twice, so that it can be checked for typing errors. diff --git a/lang/calamares_ko.ts b/lang/calamares_ko.ts index e8fa92dd6..695ccfc42 100644 --- a/lang/calamares_ko.ts +++ b/lang/calamares_ko.ts @@ -4312,7 +4312,7 @@ Output: Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + 문자, 숫자, 밑줄 및 하이픈만 허용되며, 최소 2자 이상이어야 합니다. diff --git a/lang/calamares_lt.ts b/lang/calamares_lt.ts index fc2dc392d..88b7ecc97 100644 --- a/lang/calamares_lt.ts +++ b/lang/calamares_lt.ts @@ -232,7 +232,7 @@ Boost.Python error in job "%1". - Boost.Python klaida užduotyje "%1". + Boost.Python klaida užduotyje „%1“. @@ -1225,7 +1225,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. The installer failed to deactivate a volume group named %1. - Diegimo programai nepavyko pasyvinti tomų grupės, pavadinimu "%1". + Diegimo programai nepavyko pasyvinti tomų grupės, pavadinimu „%1“. @@ -1309,7 +1309,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Skip writing LUKS configuration for Dracut: "/" partition is not encrypted - Praleisti LUKS konfigūracijos, kuri yra skirta Dracut, įrašymą: "/" skaidinys nėra užšifruotas + Praleisti LUKS konfigūracijos, kuri yra skirta Dracut, įrašymą: „/“ skaidinys nėra užšifruotas @@ -2162,7 +2162,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti. Memory allocation error when setting '%1' - Atminties paskirstymo klaida, nustatant "%1" + Atminties paskirstymo klaida, nustatant „%1“ @@ -3123,7 +3123,7 @@ Išvestis: The installer failed to remove a volume group named '%1'. - Diegimo programai nepavyko pašalinti tomų grupės, pavadinimu "%1". + Diegimo programai nepavyko pašalinti tomų grupės, pavadinimu „%1“. diff --git a/lang/calamares_ml.ts b/lang/calamares_ml.ts index 452c86b3b..f2f7a0885 100644 --- a/lang/calamares_ml.ts +++ b/lang/calamares_ml.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + ഓട്ടോ-മൗണ്ട് ക്രമീകരണങ്ങൾ സജ്ജീകരിക്കുക @@ -4024,7 +4024,7 @@ Output: Back - + പുറകോട്ട് @@ -4082,7 +4082,7 @@ Output: Back - + പുറകോട്ട് @@ -4175,7 +4175,7 @@ Output: Back - + പുറകോട്ട് @@ -4203,7 +4203,7 @@ Output: Login Name - + പ്രവേശന നാമം @@ -4238,7 +4238,7 @@ Output: localhost is not allowed as hostname. - + localhost അനുവദനീയമായ ഒരു ഹോസ്റ്റ്‌നെയിം അല്ല. @@ -4263,7 +4263,7 @@ Output: Validate passwords quality - + രഹസ്യവാക്കിന്റെ ഗുണനിലവാരം ഉറപ്പുവരുത്തുക @@ -4273,17 +4273,17 @@ Output: Log in automatically without asking for the password - + രഹസ്യവാക്ക് ചോദിക്കാതെ സ്വയം പ്രവേശിക്കുക Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + അക്ഷരങ്ങൾ, അക്കങ്ങൾ, ഹൈഫൻ, അണ്ടർസ്കോർ എന്നിവ മാത്രമേ അനുവദിക്കപ്പെട്ടിട്ടുള്ളൂ, കുറഞ്ഞത് രണ്ടെണ്ണമെങ്കിലും. Reuse user password as root password - + ഉപയോക്തൃ രഹസ്യവാക്ക് റൂട്ട് രഹസ്യവാക്കായി പുനരുപയോഗിക്കുക @@ -4293,22 +4293,22 @@ Output: 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. - + ടൈപ്പിങ്ങ് പിഴവുകളില്ല എന്നുറപ്പിക്കുന്നതിനായി ഒരേ രഹസ്യവാക്ക് രണ്ട് തവണ നൽകുക. @@ -4322,27 +4322,27 @@ Output: About - + വിവരം Support - + സഹായം Known issues - + അറിയാവുന്ന പ്രശ്നങ്ങൾ Release notes - + പ്രകാശനക്കുറിപ്പുകൾ Donate - + സംഭാവന diff --git a/lang/calamares_pt_BR.ts b/lang/calamares_pt_BR.ts index 039b689ae..4bf0ac14d 100644 --- a/lang/calamares_pt_BR.ts +++ b/lang/calamares_pt_BR.ts @@ -24,7 +24,7 @@ This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. - Este sistema foi iniciado utilizando o <strong>BIOS</strong> como ambiente de inicialização.<br><br>Para configurar a inicialização em um ambiente BIOS, este instalador deve instalar um gerenciador de boot, como o <strong>GRUB</strong>, no começo de uma partição ou no <strong>Master Boot Record</strong>, perto do começo da tabela de partições (recomendado). Esse processo é automático, a não ser que você escolha o particionamento manual, onde você deverá configurá-lo manualmente. + Este sistema foi iniciado utilizando o <strong>BIOS</strong> como ambiente de inicialização.<br><br>Para configurar a inicialização em um ambiente BIOS, este instalador deve instalar um gerenciador de inicialização, como o <strong>GRUB</strong>, no começo de uma partição ou no <strong>Master Boot Record</strong>, perto do começo da tabela de partições (recomendado). Esse processo é automático, a não ser que você escolha o particionamento manual, onde você deverá configurá-lo manualmente. @@ -510,12 +510,12 @@ O instalador será fechado e todas as alterações serão perdidas. Set filesystem label on %1. - + Definir etiqueta do sistema de arquivos em %1. Set filesystem label <strong>%1</strong> to partition <strong>%2</strong>. - + Definir etiqueta do sistema de arquivos <strong>%1</strong> para partição <strong>%2</strong>. @@ -896,7 +896,7 @@ O instalador será fechado e todas as alterações serão perdidas. OK! - + OK! @@ -1012,12 +1012,12 @@ O instalador será fechado e todas as alterações serão perdidas. Label for the filesystem - + Etiqueta para o sistema de arquivos FS Label: - + Etiqueta do FS: @@ -1376,12 +1376,12 @@ O instalador será fechado e todas as alterações serão perdidas. Label for the filesystem - + Etiqueta para o sistema de arquivos FS Label: - + Etiqueta do FS: @@ -1889,7 +1889,7 @@ O instalador será fechado e todas as alterações serão perdidas. Quit - + Sair @@ -2113,7 +2113,7 @@ O instalador será fechado e todas as alterações serão perdidas. Select your preferred Region, or use the default settings. - + Selecione sua região preferida ou use as configurações predefinidas. @@ -2653,7 +2653,7 @@ O instalador será fechado e todas as alterações serão perdidas. File System Label - + Etiqueta do Sistema de Arquivos @@ -2844,7 +2844,7 @@ O instalador será fechado e todas as alterações serão perdidas. Boot partition not encrypted - Partição de boot não criptografada + Partição de inicialização não criptografada @@ -4263,7 +4263,7 @@ Saída: root is not allowed as username. - + root não é permitido como um nome de usuário. @@ -4283,7 +4283,7 @@ Saída: localhost is not allowed as hostname. - + localhost não é permitido como hostname. @@ -4323,7 +4323,7 @@ Saída: Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + São permitidos apenas letras, números, sublinhado e hífen, com no mínimo dois caracteres. diff --git a/lang/calamares_ru.ts b/lang/calamares_ru.ts index 113a679d5..a1d34b9bb 100644 --- a/lang/calamares_ru.ts +++ b/lang/calamares_ru.ts @@ -277,7 +277,7 @@ (% секунда) (% секунд) (% секунд) - (% секунд) + (%n секунд) @@ -1011,12 +1011,12 @@ The installer will quit and all changes will be lost. Label for the filesystem - + Метка файловой системы FS Label: - + Метка ФС: @@ -1054,7 +1054,7 @@ The installer will quit and all changes will be lost. Create new %1MiB partition on %3 (%2). - + Создать новый раздел %1МиБ на %3 (%2). @@ -1069,7 +1069,7 @@ The installer will quit and all changes will be lost. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + Создать новый раздел <strong>%1МиБ</strong> на <strong>%3</strong> (%2). @@ -1375,12 +1375,12 @@ The installer will quit and all changes will be lost. Label for the filesystem - + Метка файловой системы FS Label: - + Метка ФС: @@ -1442,7 +1442,7 @@ The installer will quit and all changes will be lost. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + Настроить <strong>новый</strong> %2 раздел с точкой монтирования <strong>%1</strong> %3. @@ -1457,7 +1457,7 @@ The installer will quit and all changes will be lost. Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. - + Настроить %3 раздел <strong>%1</strong> с точкой монтирования <strong>%2</strong>%4. @@ -2525,7 +2525,7 @@ The installer will quit and all changes will be lost. login - + Вход @@ -2668,7 +2668,7 @@ The installer will quit and all changes will be lost. File System Label - + Метка файловой системы @@ -3053,7 +3053,7 @@ Output: Directory not found - + Папка не найдена @@ -3088,7 +3088,7 @@ Output: <p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/> Setup can continue, but some features might be disabled.</p> - + <p>Этот компьютер соответствует не всем рекомендуемым требованиям для установки %1.<br/>Можно продолжить установку, но некоторые возможности могут быть недоступны.</p> @@ -3206,7 +3206,7 @@ Output: <p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/> Setup can continue, but some features might be disabled.</p> - + <p>Этот компьютер соответствует не всем рекомендуемым требованиям для установки %1.<br/>Можно продолжить установку, но некоторые возможности могут быть недоступны.</p> @@ -3657,7 +3657,7 @@ Output: %L1 / %L2 slide counter, %1 of %2 (numeric) - + %L1 / %L2 @@ -3714,13 +3714,13 @@ Output: Configuring KDE user feedback. - + Настройка обратной связи KDE Error in KDE user feedback configuration. - + Ошибка в настройке обратной связи KDE @@ -3936,7 +3936,7 @@ Output: &Donate - + Пожертвовать @@ -4062,7 +4062,7 @@ Output: Installation Completed - + Установка завершена @@ -4073,7 +4073,7 @@ Output: Close Installer - + Закрыть установщик @@ -4117,7 +4117,7 @@ Output: Layouts - + Раскладки @@ -4127,7 +4127,7 @@ Output: Click your preferred keyboard model to select layout and variant, or use the default one based on the detected hardware. - + Выберете предпочитаемую модель клавиатуры, чтобы выбрать раскладку и вариант, или используйте модель по умолчанию в зависимости от обнаруженного оборудования. @@ -4231,7 +4231,7 @@ Output: If more than one person will use this computer, you can create multiple accounts after installation. - + Если этот компьютер используется несколькими людьми, Вы сможете создать соответствующие учетные записи сразу после установки. @@ -4241,7 +4241,7 @@ Output: root is not allowed as username. - + root не допускается в качестве имени пользователя. @@ -4261,7 +4261,7 @@ Output: localhost is not allowed as hostname. - + localhost не допускается в качестве имени пользователя. @@ -4296,7 +4296,7 @@ Output: Log in automatically without asking for the password - + Входить автоматически, не спрашивая пароль @@ -4326,12 +4326,12 @@ Output: Repeat Root Password - + Повторите пароль от root Enter the same password twice, so that it can be checked for typing errors. - + Введите пароль повторно, чтобы не допустить ошибок при вводе diff --git a/lang/calamares_si.ts b/lang/calamares_si.ts index 0b46d0858..7783b17b1 100644 --- a/lang/calamares_si.ts +++ b/lang/calamares_si.ts @@ -73,7 +73,7 @@ GlobalStorage - + ගෝලීය ආචයනය @@ -88,7 +88,7 @@ Type: - + වර්ගය: @@ -99,7 +99,7 @@ Interface: - + අතුරුමුහුණත: @@ -240,7 +240,7 @@ Loading ... - + පූරණය වෙමින්... @@ -308,18 +308,18 @@ &Yes - + ඔව් (Y) &No - + නැහැ (N) &Close - + වසන්න (C) @@ -388,7 +388,7 @@ Link copied to clipboard Go &back - + ආපසු යන්න @@ -428,7 +428,7 @@ Link copied to clipboard &Back - + ආපසු (B) @@ -448,7 +448,7 @@ Link copied to clipboard Cancel installation? - + ස්ථාපනය අවලංගු කරනවාද? @@ -543,7 +543,7 @@ The installer will quit and all changes will be lost. Current: - + වත්මන්: @@ -845,7 +845,7 @@ The installer will quit and all changes will be lost. Your username is too long. - + පරිශීලක නාමය දිග වැඩිය. @@ -890,7 +890,7 @@ The installer will quit and all changes will be lost. OK! - + හරි! @@ -961,7 +961,7 @@ The installer will quit and all changes will be lost. Si&ze: - + ප්‍රමාණය: @@ -986,7 +986,7 @@ The installer will quit and all changes will be lost. Fi&le System: - + ගොනු පද්ධතිය: @@ -1139,12 +1139,12 @@ The installer will quit and all changes will be lost. Create user %1 - + %1 පරිශීලක සාදන්න Create user <strong>%1</strong>. - + <strong>%1</strong> පරිශීලක සාදන්න. @@ -1155,12 +1155,12 @@ The installer will quit and all changes will be lost. Creating user %1 - + %1 පරිශීලක සෑදෙමින් Configuring user %1 - + %1 පරිශීලක වින්‍යාසගත වෙමින් @@ -1280,13 +1280,13 @@ The installer will quit and all changes will be lost. %1 - %2 (%3) device[name] - size[number] (device-node[name]) - + %1 - %2 (%3) %1 - (%2) device[name] - (device-node[name]) - + %1 - (%2) @@ -1350,7 +1350,7 @@ The installer will quit and all changes will be lost. Si&ze: - + ප්‍රමාණය: @@ -1360,7 +1360,7 @@ The installer will quit and all changes will be lost. Fi&le System: - + ගොනු පද්ධතිය: @@ -1706,7 +1706,7 @@ The installer will quit and all changes will be lost. Keyboard - + යතුරුපුවරුව @@ -1714,7 +1714,7 @@ The installer will quit and all changes will be lost. Keyboard - + යතුරුපුවරුව @@ -1788,7 +1788,7 @@ The installer will quit and all changes will be lost. License - + බලපත්‍රය @@ -1796,7 +1796,7 @@ The installer will quit and all changes will be lost. URL: %1 - + ඒ.ස.නි.: %1 @@ -1833,7 +1833,7 @@ The installer will quit and all changes will be lost. File: %1 - + ගොනුව: %1 @@ -1867,7 +1867,7 @@ The installer will quit and all changes will be lost. &Change... - + වෙනස් කරන්න... @@ -1875,7 +1875,7 @@ The installer will quit and all changes will be lost. Location - + ස්ථානය @@ -1883,7 +1883,7 @@ The installer will quit and all changes will be lost. Quit - + ඉවත් වන්න @@ -1891,7 +1891,7 @@ The installer will quit and all changes will be lost. Location - + ස්ථානය @@ -1973,27 +1973,27 @@ The installer will quit and all changes will be lost. Office software - + කාර්යාලීය මෘදුකාංගය Office package - + කාර්යාලීය ඇසුරුම Browser software - + අතිරික්සු මෘදුකාංගය Browser package - + අතිරික්සු ඇසුරුම Web browser - + වියමන අතිරික්සුව @@ -2003,7 +2003,7 @@ The installer will quit and all changes will be lost. Services - + සේවා @@ -2018,32 +2018,32 @@ The installer will quit and all changes will be lost. Applications - + යෙදුම් Communication - + සන්නිවේදනය Development - + සංවර්ධනය Office - + කාර්යාලීය Multimedia - + බහුමාධ්‍ය Internet - + අන්තර්ජාලය @@ -2066,7 +2066,7 @@ The installer will quit and all changes will be lost. Notes - + සටහන් @@ -2135,12 +2135,12 @@ The installer will quit and all changes will be lost. Password is too short - + මුරපදය ඉතා කෙටිය Password is too long - + මුරපදය ඉතා දිගය @@ -2223,7 +2223,7 @@ The installer will quit and all changes will be lost. The password is too short - + මුරපදය ඉතා කෙටිය @@ -2796,7 +2796,7 @@ The installer will quit and all changes will be lost. Current: - + වත්මන්: diff --git a/lang/calamares_th.ts b/lang/calamares_th.ts index 27e961293..4525b3415 100644 --- a/lang/calamares_th.ts +++ b/lang/calamares_th.ts @@ -285,7 +285,7 @@ Setup Failed - + การตั้งค่าล้มเหลว @@ -306,18 +306,18 @@ &Yes - + &ใช่ &No - + &ไม่ &Close - + ปิ&ด @@ -376,7 +376,7 @@ Link copied to clipboard &Set up now - &ตั้งค่าตอนนี้ + ตั้&งค่าตอนนี้ @@ -391,12 +391,12 @@ Link copied to clipboard &Set up - &ตั้งค่า + ตั้&งค่า &Install - &ติดตั้ง + ติ&ดตั้ง @@ -534,7 +534,7 @@ The installer will quit and all changes will be lost. Select storage de&vice: - + เลือกอุปก&รณ์จัดเก็บ: @@ -562,7 +562,7 @@ The installer will quit and all changes will be lost. <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> - + <strong>เลือกพาร์ทิชันที่จะลดขนาด แล้วลากแถบด้านล่างเพื่อปรับขนาด</strong> @@ -597,7 +597,7 @@ The installer will quit and all changes will be lost. This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - ดูเหมือนว่าอุปกรณ์จัดเก็บนี้ไม่มีระบบปฏิบัติการ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บของคุณ + ดูเหมือนว่าอุปกรณ์จัดเก็บข้อมูลนี้ไม่มีระบบปฏิบัติการ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บข้อมูลของคุณ @@ -605,7 +605,7 @@ The installer will quit and all changes will be lost. <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. - + <strong>ล้างดิสก์</strong><br/>การกระทำนี้จะ<font color="red">ลบ</font>ข้อมูลทั้งหมดที่อยู่บนอุปกรณ์จัดเก็บข้อมูลที่เลือก @@ -626,17 +626,17 @@ The installer will quit and all changes will be lost. This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - อุปกรณ์จัดเก็บนี้มีระบบปฏิบัติการ %1 อยู่ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บของคุณ + อุปกรณ์จัดเก็บข้อมูลนี้มีระบบปฏิบัติการ %1 อยู่ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บข้อมูลของคุณ This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - อุปกรณ์จัดเก็บนี้มีระบบปฏิบัติการอยู่แล้ว คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บของคุณ + อุปกรณ์จัดเก็บข้อมูลนี้มีระบบปฏิบัติการอยู่แล้ว คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บข้อมูลของคุณ This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - อุปกรณ์จัดเก็บนี้มีหลายระบบปฏิบัติการ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บของคุณ + อุปกรณ์จัดเก็บข้อมูลนี้มีหลายระบบปฏิบัติการ คุณต้องการทำอย่างไร?<br/>คุณจะสามารถทบทวนและยืนยันตัวเลือกของคุณก่อนที่จะกระทำการเปลี่ยนแปลงไปยังอุปกรณ์จัดเก็บข้อมูลของคุณ @@ -819,7 +819,7 @@ The installer will quit and all changes will be lost. This program will ask you some questions and set up %2 on your computer. - โปรแกรมนี้จะถามตำถามต่าง ๆ เพื่อติดตั้ง %2 ลงในคอมพิวเตอร์ของคุณ + โปรแกรมนี้จะถามคำถามต่าง ๆ เพื่อติดตั้ง %2 ลงในคอมพิวเตอร์ของคุณ @@ -894,7 +894,7 @@ The installer will quit and all changes will be lost. Setup Failed - + การตั้งค่าล้มเหลว @@ -3329,7 +3329,7 @@ Output: This program will ask you some questions and set up %2 on your computer. - โปรแกรมนี้จะถามคุณบางอย่าง เพื่อติดตั้ง %2 ไว้ในคอมพิวเตอร์ของคุณ + โปรแกรมนี้จะถามคำถามต่าง ๆ เพื่อติดตั้ง %2 ลงในคอมพิวเตอร์ของคุณ @@ -3889,7 +3889,7 @@ Output: &About - &A เกี่ยวกับ + &เกี่ยวกับ diff --git a/lang/calamares_zh_CN.ts b/lang/calamares_zh_CN.ts index a98615982..a2a9757eb 100644 --- a/lang/calamares_zh_CN.ts +++ b/lang/calamares_zh_CN.ts @@ -105,7 +105,7 @@ Crashes Calamares, so that Dr. Konqui can look at it. - + 使 Calamares 崩溃,以便 Konqui 医生可以查看它。 @@ -130,7 +130,7 @@ Displays the tree of widget names in the log (for stylesheet debugging). - + 在日志中显示小部件名称树(用于样式表调试)。 @@ -514,7 +514,7 @@ The installer will quit and all changes will be lost. Set filesystem label <strong>%1</strong> to partition <strong>%2</strong>. - + 设置文件系统标签 <strong>%1</strong> 至分区 <strong>%2</strong>。 @@ -1056,7 +1056,7 @@ The installer will quit and all changes will be lost. Create new %1MiB partition on %3 (%2). - + 在 %3 (%2) 上建立新的 %1MiB 分区。 @@ -1071,7 +1071,7 @@ The installer will quit and all changes will be lost. Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). - + 在<strong>%3</strong>(%2)上创建新的<strong>%1MiB</strong>分区 @@ -1445,12 +1445,12 @@ The installer will quit and all changes will be lost. Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. - + 设置 <strong>新的</strong> 含挂载点 <strong>%1</strong>%3 的 %2 分区。 Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. - + 在具有功能<em>%4</em>的 %3 系统分区<strong>%1</strong>上安装 %2。 @@ -4319,7 +4319,7 @@ Output: Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. - + 只允许字母、数组、下划线"_" 和 连字符"-",最少两个字符。 diff --git a/lang/calamares_zh_HK.ts b/lang/calamares_zh_HK.ts index 6c592a6d3..db1ecd4d9 100644 --- a/lang/calamares_zh_HK.ts +++ b/lang/calamares_zh_HK.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + 管理自動掛載設定 @@ -14,12 +14,12 @@ The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. - + 這個系統的<strong>開機環境</strong>。<br><br>較舊的 x86 系統只支援 <strong>BIOS</strong>。<br>現時的系統則通常使用 <strong>EFI</strong>,但若使用相容模式 (CSM),也可能顯示為 BIOS。 This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. - + 這個系統以 <strong>EFI</strong> 開機。<br><br>要從 EFI 環境開機,本安裝程式必須安裝開機載入器程式,像是 <strong>GRUB</strong> 或 <strong>systemd-boot</strong> 在 <strong>EFI 系統分割區</strong>。這是自動的,除非選擇手動分割;在這種情況,您必須自行選取或建立它。 diff --git a/lang/python.pot b/lang/python.pot index a3d128ca7..6bd8bfd92 100644 --- a/lang/python.pot +++ b/lang/python.pot @@ -2,406 +2,381 @@ # 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-07-14 12:55+0200\n" +"POT-Creation-Date: 2021-09-06 11:40+0200\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." - -#: src/modules/mount/main.py:30 -msgid "Mounting partitions." -msgstr "Mounting partitions." - -#: src/modules/mount/main.py:144 src/modules/initcpiocfg/main.py:197 -#: src/modules/initcpiocfg/main.py:201 -#: 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:355 -#: src/modules/fstab/main.py:361 src/modules/fstab/main.py:388 -#: src/modules/localecfg/main.py:135 src/modules/networkcfg/main.py:39 -msgid "Configuration Error" -msgstr "Configuration Error" - -#: src/modules/mount/main.py:145 src/modules/initcpiocfg/main.py:198 -#: 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:356 -msgid "No partitions are defined for
{!s}
to use." -msgstr "No partitions are defined for
{!s}
to use." - -#: src/modules/services-systemd/main.py:26 -msgid "Configure systemd services" -msgstr "Configure systemd services" - -#: src/modules/services-systemd/main.py:59 -#: src/modules/services-openrc/main.py:93 -msgid "Cannot modify service" -msgstr "Cannot modify service" - -#: src/modules/services-systemd/main.py:60 -msgid "" -"systemctl {arg!s} call in chroot returned error code {num!s}." +#: src/modules/bootloader/main.py:43 +msgid "Install bootloader." 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}." - -#: src/modules/services-systemd/main.py:65 -msgid "Cannot enable systemd target {name!s}." -msgstr "Cannot enable systemd target {name!s}." - -#: src/modules/services-systemd/main.py:69 -msgid "Cannot disable systemd target {name!s}." -msgstr "Cannot disable systemd target {name!s}." - -#: src/modules/services-systemd/main.py:71 -msgid "Cannot mask systemd unit {name!s}." -msgstr "Cannot mask systemd unit {name!s}." - -#: src/modules/services-systemd/main.py:73 -msgid "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." +#: src/modules/bootloader/main.py:508 +msgid "Bootloader installation error" 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." - -#: src/modules/unpackfs/main.py:35 -msgid "Filling up filesystems." -msgstr "Filling up filesystems." - -#: src/modules/unpackfs/main.py:255 -msgid "rsync failed with error code {}." -msgstr "rsync failed with error code {}." - -#: src/modules/unpackfs/main.py:300 -msgid "Unpacking image {}/{}, file {}/{}" -msgstr "Unpacking image {}/{}, file {}/{}" - -#: src/modules/unpackfs/main.py:315 -msgid "Starting to unpack {}" -msgstr "Starting to unpack {}" - -#: src/modules/unpackfs/main.py:324 src/modules/unpackfs/main.py:464 -msgid "Failed to unpack image \"{}\"" -msgstr "Failed to unpack image \"{}\"" - -#: src/modules/unpackfs/main.py:431 -msgid "No mount point for root partition" -msgstr "No mount point for root partition" - -#: 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" - -#: src/modules/unpackfs/main.py:437 -msgid "Bad mount point for root partition" -msgstr "Bad mount point for root partition" - -#: src/modules/unpackfs/main.py:438 -msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "rootMountPoint is \"{}\", which does not exist, doing nothing" - -#: 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" - -#: 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" - -#: src/modules/unpackfs/main.py:459 -msgid "The source filesystem \"{}\" does not exist" -msgstr "The source filesystem \"{}\" does not exist" - -#: src/modules/unpackfs/main.py:465 +#: src/modules/bootloader/main.py:509 msgid "" -"Failed to find unsquashfs, make sure you have the squashfs-tools package " -"installed" +"The bootloader could not be installed. The installation command
{!s} returned error code {!s}."
 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"
 
 #: src/modules/displaymanager/main.py:526
 msgid "Cannot write KDM configuration file"
-msgstr "Cannot write KDM configuration file"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:527
 msgid "KDM config file {!s} does not exist"
-msgstr "KDM config file {!s} does not exist"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:588
 msgid "Cannot write LXDM configuration file"
-msgstr "Cannot write LXDM configuration file"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:589
 msgid "LXDM config file {!s} does not exist"
-msgstr "LXDM config file {!s} does not exist"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:672
 msgid "Cannot write LightDM configuration file"
-msgstr "Cannot write LightDM configuration file"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:673
 msgid "LightDM config file {!s} does not exist"
-msgstr "LightDM config file {!s} does not exist"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:747
 msgid "Cannot configure LightDM"
-msgstr "Cannot configure LightDM"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:748
 msgid "No LightDM greeter installed."
-msgstr "No LightDM greeter installed."
+msgstr ""
 
 #: src/modules/displaymanager/main.py:779
 msgid "Cannot write SLIM configuration file"
-msgstr "Cannot write SLIM configuration file"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:780
 msgid "SLIM config file {!s} does not exist"
-msgstr "SLIM config file {!s} does not exist"
+msgstr ""
 
 #: src/modules/displaymanager/main.py:906
 msgid "No display managers selected for the displaymanager module."
-msgstr "No display managers selected for the displaymanager module."
+msgstr ""
 
 #: src/modules/displaymanager/main.py:907
 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:989
 msgid "Display manager configuration was incomplete"
-msgstr "Display manager configuration was incomplete"
+msgstr ""
+
+#: src/modules/dracut/main.py:27
+msgid "Creating initramfs with dracut."
+msgstr ""
+
+#: src/modules/dracut/main.py:49
+msgid "Failed to run dracut on the target"
+msgstr ""
+
+#: src/modules/dracut/main.py:50 src/modules/mkinitfs/main.py:50
+msgid "The exit code was {}"
+msgstr ""
+
+#: src/modules/dummypython/main.py:35
+msgid "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 ""
+
+#: src/modules/fstab/main.py:29
+msgid "Writing fstab."
+msgstr ""
+
+#: src/modules/fstab/main.py:355 src/modules/fstab/main.py:361
+#: src/modules/fstab/main.py:388 src/modules/initcpiocfg/main.py:197
+#: src/modules/initcpiocfg/main.py:201 src/modules/initramfscfg/main.py:85
+#: src/modules/initramfscfg/main.py:89 src/modules/localecfg/main.py:135
+#: src/modules/luksopenswaphookcfg/main.py:86
+#: src/modules/luksopenswaphookcfg/main.py:90 src/modules/mount/main.py:144
+#: src/modules/networkcfg/main.py:42 src/modules/openrcdmcryptcfg/main.py:72
+#: src/modules/openrcdmcryptcfg/main.py:76 src/modules/rawfs/main.py:164
+msgid "Configuration Error"
+msgstr ""
+
+#: src/modules/fstab/main.py:356 src/modules/initcpiocfg/main.py:198
+#: src/modules/initramfscfg/main.py:86
+#: src/modules/luksopenswaphookcfg/main.py:87 src/modules/mount/main.py:145
+#: src/modules/openrcdmcryptcfg/main.py:73 src/modules/rawfs/main.py:165
+msgid "No partitions are defined for 
{!s}
to use." +msgstr "" + +#: src/modules/fstab/main.py:362 src/modules/initcpiocfg/main.py:202 +#: src/modules/initramfscfg/main.py:90 src/modules/localecfg/main.py:136 +#: src/modules/luksopenswaphookcfg/main.py:91 src/modules/networkcfg/main.py:43 +#: src/modules/openrcdmcryptcfg/main.py:77 +msgid "No root mount point is given for
{!s}
to use." +msgstr "" + +#: src/modules/fstab/main.py:389 +msgid "No
{!s}
configuration is given for
{!s}
to use." +msgstr "" + +#: src/modules/grubcfg/main.py:28 +msgid "Configure GRUB." +msgstr "" + +#: src/modules/hwclock/main.py:26 +msgid "Setting hardware clock." +msgstr "" #: src/modules/initcpiocfg/main.py:28 msgid "Configuring mkinitcpio." -msgstr "Configuring mkinitcpio." +msgstr "" -#: src/modules/initcpiocfg/main.py:202 -#: src/modules/luksopenswaphookcfg/main.py:91 -#: src/modules/initramfscfg/main.py:90 src/modules/openrcdmcryptcfg/main.py:77 -#: 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." +#: src/modules/initramfscfg/main.py:32 +msgid "Configuring initramfs." +msgstr "" + +#: src/modules/localecfg/main.py:30 +msgid "Configuring locales." +msgstr "" #: src/modules/luksopenswaphookcfg/main.py:26 msgid "Configuring encrypted swap." -msgstr "Configuring encrypted swap." +msgstr "" + +#: src/modules/mkinitfs/main.py:27 +msgid "Creating initramfs with mkinitfs." +msgstr "" + +#: src/modules/mkinitfs/main.py:49 +msgid "Failed to run mkinitfs on the target" +msgstr "" + +#: src/modules/mount/main.py:30 +msgid "Mounting partitions." +msgstr "" + +#: src/modules/networkcfg/main.py:29 +msgid "Saving network configuration." +msgstr "" + +#: src/modules/openrcdmcryptcfg/main.py:26 +msgid "Configuring OpenRC dmcrypt service." +msgstr "" + +#: src/modules/packages/main.py:50 src/modules/packages/main.py:59 +#: src/modules/packages/main.py:69 +msgid "Install packages." +msgstr "" + +#: src/modules/packages/main.py:57 +#, python-format +msgid "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] "" +msgstr[1] "" + +#: src/modules/packages/main.py:65 +#, python-format +msgid "Removing one package." +msgid_plural "Removing %(num)d packages." +msgstr[0] "" +msgstr[1] "" + +#: src/modules/packages/main.py:638 src/modules/packages/main.py:650 +#: src/modules/packages/main.py:678 +msgid "Package Manager error" +msgstr "" + +#: src/modules/packages/main.py:639 +msgid "" +"The package manager could not prepare updates. The command
{!s}
" +"returned error code {!s}." +msgstr "" + +#: src/modules/packages/main.py:651 +msgid "" +"The package manager could not update the system. The command
{!s}
" +"returned error code {!s}." +msgstr "" + +#: src/modules/packages/main.py:679 +msgid "" +"The package manager could not make changes to the installed system. The " +"command
{!s}
returned error code {!s}." +msgstr "" + +#: src/modules/plymouthcfg/main.py:27 +msgid "Configure Plymouth theme" +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:93 +#: src/modules/services-systemd/main.py:59 +msgid "Cannot modify service" +msgstr "" #: 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" +#: src/modules/services-systemd/main.py:26 +msgid "Configure systemd services" +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." - -#: src/modules/packages/main.py:57 -#, python-format -msgid "Processing packages (%(count)d / %(total)d)" -msgstr "Processing packages (%(count)d / %(total)d)" - -#: 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." - -#: 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." - -#: src/modules/packages/main.py:588 src/modules/packages/main.py:600 -#: src/modules/packages/main.py:628 -msgid "Package Manager error" -msgstr "Package Manager error" - -#: src/modules/packages/main.py:589 +#: src/modules/services-systemd/main.py:60 msgid "" -"The package manager could not prepare updates. The command
{!s}
" -"returned error code {!s}." +"systemctl {arg!s} call in chroot returned error code {num!s}." msgstr "" -"The package manager could not prepare updates. The command
{!s}
" -"returned error code {!s}." -#: src/modules/packages/main.py:601 +#: src/modules/services-systemd/main.py:63 +#: src/modules/services-systemd/main.py:67 +msgid "Cannot enable systemd service {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:65 +msgid "Cannot enable systemd target {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:69 +msgid "Cannot disable systemd target {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:71 +msgid "Cannot mask systemd unit {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:73 msgid "" -"The package manager could not update the system. The command
{!s}
" -" returned error code {!s}." +"Unknown systemd commands {command!s} and {suffix!s} for unit {name!s}." msgstr "" -"The package manager could not update the system. The command
{!s}
" -" returned error code {!s}." -#: src/modules/packages/main.py:629 +#: src/modules/umount/main.py:31 +msgid "Unmount file systems." +msgstr "" + +#: src/modules/unpackfs/main.py:35 +msgid "Filling up filesystems." +msgstr "" + +#: src/modules/unpackfs/main.py:255 +msgid "rsync failed with error code {}." +msgstr "" + +#: src/modules/unpackfs/main.py:300 +msgid "Unpacking image {}/{}, file {}/{}" +msgstr "" + +#: src/modules/unpackfs/main.py:315 +msgid "Starting to unpack {}" +msgstr "" + +#: src/modules/unpackfs/main.py:324 src/modules/unpackfs/main.py:464 +msgid "Failed to unpack image \"{}\"" +msgstr "" + +#: src/modules/unpackfs/main.py:431 +msgid "No mount point for root partition" +msgstr "" + +#: src/modules/unpackfs/main.py:432 +msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" +msgstr "" + +#: src/modules/unpackfs/main.py:437 +msgid "Bad mount point for root partition" +msgstr "" + +#: src/modules/unpackfs/main.py:438 +msgid "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 "" + +#: src/modules/unpackfs/main.py:455 +msgid "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 "" + +#: src/modules/unpackfs/main.py:465 msgid "" -"The package manager could not make changes to the installed system. The " -"command
{!s}
returned error code {!s}." +"Failed to find unsquashfs, make sure you have the squashfs-tools package " +"installed" msgstr "" -"The package manager could not make changes to the installed system. The " -"command
{!s}
returned error code {!s}." -#: src/modules/bootloader/main.py:43 -msgid "Install bootloader." -msgstr "Install bootloader." - -#: src/modules/bootloader/main.py:502 -msgid "Bootloader installation error" -msgstr "Bootloader installation error" - -#: src/modules/bootloader/main.py:503 -msgid "" -"The bootloader could not be installed. The installation command " -"
{!s}
returned error code {!s}." +#: src/modules/unpackfs/main.py:479 +msgid "The destination \"{}\" in the target system is not a directory" msgstr "" -"The bootloader could not be installed. The installation command " -"
{!s}
returned error code {!s}." - -#: src/modules/hwclock/main.py:26 -msgid "Setting hardware clock." -msgstr "Setting hardware clock." - -#: src/modules/mkinitfs/main.py:27 -msgid "Creating initramfs with mkinitfs." -msgstr "Creating initramfs with mkinitfs." - -#: src/modules/mkinitfs/main.py:49 -msgid "Failed to run mkinitfs on the target" -msgstr "Failed to run mkinitfs on the target" - -#: src/modules/mkinitfs/main.py:50 src/modules/dracut/main.py:50 -msgid "The exit code was {}" -msgstr "The exit code was {}" - -#: src/modules/dracut/main.py:27 -msgid "Creating initramfs with dracut." -msgstr "Creating initramfs with dracut." - -#: src/modules/dracut/main.py:49 -msgid "Failed to run dracut on the target" -msgstr "Failed to run dracut on the target" - -#: src/modules/initramfscfg/main.py:32 -msgid "Configuring initramfs." -msgstr "Configuring initramfs." - -#: src/modules/openrcdmcryptcfg/main.py:26 -msgid "Configuring OpenRC dmcrypt service." -msgstr "Configuring OpenRC dmcrypt service." - -#: src/modules/fstab/main.py:29 -msgid "Writing fstab." -msgstr "Writing fstab." - -#: src/modules/fstab/main.py:389 -msgid "No
{!s}
configuration is given for
{!s}
to use." -msgstr "No
{!s}
configuration is given for
{!s}
to use." - -#: src/modules/dummypython/main.py:35 -msgid "Dummy python job." -msgstr "Dummy python job." - -#: 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 {}" - -#: src/modules/localecfg/main.py:30 -msgid "Configuring locales." -msgstr "Configuring locales." - -#: src/modules/networkcfg/main.py:28 -msgid "Saving network configuration." -msgstr "Saving network configuration." diff --git a/lang/python/az/LC_MESSAGES/python.po b/lang/python/az/LC_MESSAGES/python.po index d47e30acd..f3f3693a4 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: -# Xəyyam Qocayev , 2021 +# xxmn77 , 2021 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-14 12:55+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Xəyyam Qocayev , 2021\n" +"Last-Translator: xxmn77 , 2021\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 d1e805fac..ba5c1f5d2 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: -# Xəyyam Qocayev , 2021 +# xxmn77 , 2021 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-14 12:55+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Xəyyam Qocayev , 2021\n" +"Last-Translator: xxmn77 , 2021\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/lang/python/cs_CZ/LC_MESSAGES/python.po b/lang/python/cs_CZ/LC_MESSAGES/python.po index 50002805d..9ac7c6b82 100644 --- a/lang/python/cs_CZ/LC_MESSAGES/python.po +++ b/lang/python/cs_CZ/LC_MESSAGES/python.po @@ -5,7 +5,7 @@ # # Translators: # pavelrz, 2017 -# LiberteCzech , 2020 +# LiberteCzech , 2020 # Pavel Borecki , 2020 # #, fuzzy diff --git a/lang/python/de/LC_MESSAGES/python.po b/lang/python/de/LC_MESSAGES/python.po index 555d4636f..b1e0beed9 100644 --- a/lang/python/de/LC_MESSAGES/python.po +++ b/lang/python/de/LC_MESSAGES/python.po @@ -5,8 +5,8 @@ # # Translators: # Adriaan de Groot , 2020 -# Gustav Gyges, 2020 # Andreas Eitel , 2020 +# Gustav Gyges, 2021 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-14 12:55+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Andreas Eitel , 2020\n" +"Last-Translator: Gustav Gyges, 2021\n" "Language-Team: German (https://www.transifex.com/calamares/teams/20061/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -319,25 +319,31 @@ msgstr[1] "Entferne %(num)d Pakete." #: src/modules/packages/main.py:588 src/modules/packages/main.py:600 #: src/modules/packages/main.py:628 msgid "Package Manager error" -msgstr "" +msgstr "Fehler im Paketmanager" #: src/modules/packages/main.py:589 msgid "" "The package manager could not prepare updates. The command
{!s}
" "returned error code {!s}." msgstr "" +"Der Paketmanager konnte die Aktualisierungen nicht vorbereiten. Der Befehl " +"
{!s}
erzeugte Fehlercode {!s}." #: src/modules/packages/main.py:601 msgid "" "The package manager could not update the system. The command
{!s}
" " returned error code {!s}." msgstr "" +"Der Paketmanager konnte das System nicht aktualisieren. Der Befehl " +"
{!s}
erzeugte Fehlercode {!s}." #: src/modules/packages/main.py:629 msgid "" "The package manager could not make changes to the installed system. The " "command
{!s}
returned error code {!s}." msgstr "" +"Der Paketmanager konnte das installierte System nicht verändern. Der Befehl " +"
{!s}
erzeugte Fehlercode {!s}." #: src/modules/bootloader/main.py:43 msgid "Install bootloader." @@ -345,13 +351,15 @@ msgstr "Installiere Bootloader." #: src/modules/bootloader/main.py:502 msgid "Bootloader installation error" -msgstr "" +msgstr "Fehler beim Installieren des Bootloaders" #: src/modules/bootloader/main.py:503 msgid "" "The bootloader could not be installed. The installation command " "
{!s}
returned error code {!s}." msgstr "" +"Der Bootloader konnte nicht installiert werden. Der Installationsbefehl " +"
{!s}
erzeugte Fehlercode {!s}." #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." @@ -392,6 +400,8 @@ msgstr "Schreibe fstab." #: src/modules/fstab/main.py:389 msgid "No
{!s}
configuration is given for
{!s}
to use." msgstr "" +"Keine
{!s}
Konfiguration gegeben die
{!s}
benutzen " +"könnte." #: src/modules/dummypython/main.py:35 msgid "Dummy python job." diff --git a/lang/python/es/LC_MESSAGES/python.po b/lang/python/es/LC_MESSAGES/python.po index 960e280c4..f1fe11a61 100644 --- a/lang/python/es/LC_MESSAGES/python.po +++ b/lang/python/es/LC_MESSAGES/python.po @@ -7,7 +7,7 @@ # strel, 2017 # Francisco Sánchez López de Lerma , 2018 # Guido Grasso , 2018 -# Adolfo Jayme Barrientos, 2019 +# Adolfo Jayme-Barrientos, 2019 # Miguel Mayol , 2020 # Pier Jose Gotta Perez , 2020 # diff --git a/lang/python/ko/LC_MESSAGES/python.po b/lang/python/ko/LC_MESSAGES/python.po index e6f1f1c8b..6d3f2b5f5 100644 --- a/lang/python/ko/LC_MESSAGES/python.po +++ b/lang/python/ko/LC_MESSAGES/python.po @@ -320,6 +320,7 @@ msgid "" "The package manager could not make changes to the installed system. The " "command
{!s}
returned error code {!s}." msgstr "" +"패키지 관리자가 설치된 시스템을 변경할 수 없습니다.
{!s}
명령에서 {!s} 오류 코드를 반환했습니다." #: src/modules/bootloader/main.py:43 msgid "Install bootloader." diff --git a/lang/python/lt/LC_MESSAGES/python.po b/lang/python/lt/LC_MESSAGES/python.po index 6ceb39a27..d1c10622e 100644 --- a/lang/python/lt/LC_MESSAGES/python.po +++ b/lang/python/lt/LC_MESSAGES/python.po @@ -137,7 +137,7 @@ msgstr "Bloga unsquash konfigūracija" #: src/modules/unpackfs/main.py:455 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "Jūsų branduolys nepalaiko failų sistemos, kuri skirta \"{}\" ({})" +msgstr "Jūsų branduolys nepalaiko failų sistemos, kuri skirta „{}“ ({})" #: src/modules/unpackfs/main.py:459 msgid "The source filesystem \"{}\" does not exist" diff --git a/lang/python/pt_BR/LC_MESSAGES/python.po b/lang/python/pt_BR/LC_MESSAGES/python.po index 8a9f235b4..3ceeeb09a 100644 --- a/lang/python/pt_BR/LC_MESSAGES/python.po +++ b/lang/python/pt_BR/LC_MESSAGES/python.po @@ -5,7 +5,7 @@ # # Translators: # André Marcelo Alvarenga , 2020 -# Guilherme Marçal Silva, 2020 +# Guilherme Marçal Silva, 2021 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-14 12:55+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Guilherme Marçal Silva, 2020\n" +"Last-Translator: Guilherme Marçal Silva, 2021\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/calamares/teams/20061/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -317,39 +317,47 @@ msgstr[1] "Removendo %(num)d pacotes." #: src/modules/packages/main.py:588 src/modules/packages/main.py:600 #: src/modules/packages/main.py:628 msgid "Package Manager error" -msgstr "" +msgstr "Erro do Gerenciador de Pacotes" #: src/modules/packages/main.py:589 msgid "" "The package manager could not prepare updates. The command
{!s}
" "returned error code {!s}." msgstr "" +"O gerenciador de pacotes não pôde preparar as atualizações. O comando " +"
{!s}
retornou o código de erro {!s}." #: src/modules/packages/main.py:601 msgid "" "The package manager could not update the system. The command
{!s}
" " returned error code {!s}." msgstr "" +"O gerenciador de pacotes não pôde atualizar o sistema. O comando " +"
{!s}
retornou o código de erro {!s}." #: src/modules/packages/main.py:629 msgid "" "The package manager could not make changes to the installed system. The " "command
{!s}
returned error code {!s}." msgstr "" +"O gerenciador de pacotes não pôde fazer mudanças no sistema instalado. O " +"comando
{!s}
retornou o código de erro {!s}." #: src/modules/bootloader/main.py:43 msgid "Install bootloader." -msgstr "Instalar bootloader." +msgstr "Instalar carregador de inicialização." #: src/modules/bootloader/main.py:502 msgid "Bootloader installation error" -msgstr "" +msgstr "Erro de instalação do carregador de inicialização" #: src/modules/bootloader/main.py:503 msgid "" "The bootloader could not be installed. The installation command " "
{!s}
returned error code {!s}." msgstr "" +"O carregador de inicialização não pôde ser instalado. O comando de " +"instalação
{!s}
retornou o código de erro {!s}." #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." @@ -390,6 +398,8 @@ msgstr "Escrevendo fstab." #: src/modules/fstab/main.py:389 msgid "No
{!s}
configuration is given for
{!s}
to use." msgstr "" +"Nenhuma configuração
{!s}
é dada para que
{!s}
possa " +"utilizar." #: src/modules/dummypython/main.py:35 msgid "Dummy python job." diff --git a/lang/python/si/LC_MESSAGES/python.po b/lang/python/si/LC_MESSAGES/python.po index dc92f2203..bfe7ba323 100644 --- a/lang/python/si/LC_MESSAGES/python.po +++ b/lang/python/si/LC_MESSAGES/python.po @@ -3,6 +3,9 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +# Translators: +# Hela Basa, 2021 +# #, fuzzy msgid "" msgstr "" @@ -10,6 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-14 12:55+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" +"Last-Translator: Hela Basa, 2021\n" "Language-Team: Sinhala (https://www.transifex.com/calamares/teams/20061/si/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -216,7 +220,7 @@ msgstr "" #: src/modules/rawfs/main.py:26 msgid "Installing data." -msgstr "" +msgstr "දත්ත ස්ථාපනය වෙමින්." #: src/modules/services-openrc/main.py:29 msgid "Configure OpenRC services" @@ -268,7 +272,7 @@ msgstr "" #: src/modules/packages/main.py:50 src/modules/packages/main.py:59 #: src/modules/packages/main.py:69 msgid "Install packages." -msgstr "" +msgstr "ඇසුරුම් ස්ථාපනය කරන්න." #: src/modules/packages/main.py:57 #, python-format @@ -279,15 +283,15 @@ msgstr "" #, python-format msgid "Installing one package." msgid_plural "Installing %(num)d packages." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "ඇසුරුමක් ස්ථාපනය වෙමින්." +msgstr[1] "ඇසුරුම් %(num)d ක් ස්ථාපනය වෙමින්." #: src/modules/packages/main.py:65 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "ඇසුරුමක් ඉවත් වෙමින්." +msgstr[1] "ඇසුරුම් %(num)d ක් ඉවත් වෙමින්." #: src/modules/packages/main.py:588 src/modules/packages/main.py:600 #: src/modules/packages/main.py:628 @@ -328,7 +332,7 @@ msgstr "" #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." -msgstr "" +msgstr "දෘඩාංග ඔරලෝසුව සැකසෙමින්." #: src/modules/mkinitfs/main.py:27 msgid "Creating initramfs with mkinitfs." @@ -381,4 +385,4 @@ msgstr "" #: src/modules/networkcfg/main.py:28 msgid "Saving network configuration." -msgstr "" +msgstr "ජාල වින්‍යාසය සුරැකෙමින්." diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index 9453075b6..2620b8563 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -104,6 +104,10 @@ Settings* Settings::s_instance = nullptr; Settings* Settings::instance() { + if ( !s_instance ) + { + cWarning() << "Getting nullptr Settings instance."; + } return s_instance; } @@ -238,6 +242,9 @@ Settings::Settings( bool debugMode ) , m_disableCancel( false ) , m_disableCancelDuringExec( false ) { + cWarning() << "Using bogus Calamares settings in" + << ( debugMode ? QStringLiteral( "debug" ) : QStringLiteral( "regular" ) ) << "mode"; + s_instance = this; } Settings::Settings( const QString& settingsFilePath, bool debugMode ) diff --git a/src/libcalamares/network/Manager.cpp b/src/libcalamares/network/Manager.cpp index 79db1a587..6cb270ecd 100644 --- a/src/libcalamares/network/Manager.cpp +++ b/src/libcalamares/network/Manager.cpp @@ -20,6 +20,8 @@ #include #include +#include + namespace CalamaresUtils { namespace Network @@ -27,7 +29,7 @@ namespace Network void RequestOptions::applyToRequest( QNetworkRequest* request ) const { -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) +#if QT_VERSION < QT_VERSION_CHECK( 5, 15, 0 ) constexpr const auto RedirectPolicyAttribute = QNetworkRequest::FollowRedirectsAttribute; #else constexpr const auto RedirectPolicyAttribute = QNetworkRequest::RedirectPolicyAttribute; @@ -60,8 +62,9 @@ public slots: void cleanupNam(); public: - QUrl m_hasInternetUrl; - bool m_hasInternet; + QVector< QUrl > m_hasInternetUrls; + bool m_hasInternet = false; + int m_lastCheckedUrlIndex = -1; Private(); @@ -155,14 +158,47 @@ Manager::hasInternet() bool Manager::checkHasInternet() { + if ( d->m_hasInternetUrls.empty() ) + { + return false; + } + // It's possible that access was switched off (see below, if the check + // fails) so we want to turn it back on first. Otherwise all the + // checks will fail **anyway**, defeating the point of the checks. +#if ( QT_VERSION < QT_VERSION_CHECK( 5, 15, 0 ) ) + if ( !d->m_hasInternet ) + { + d->nam()->setNetworkAccessible( QNetworkAccessManager::Accessible ); + } +#endif + if ( d->m_lastCheckedUrlIndex < 0 ) + { + d->m_lastCheckedUrlIndex = 0; + } + int attempts = 0; + do + { + // Start by pinging the same one as last time + d->m_hasInternet = synchronousPing( d->m_hasInternetUrls.at( d->m_lastCheckedUrlIndex ) ); + // if it's not responding, **then** move on to the next one, + // and wrap around if needed + if ( !d->m_hasInternet ) + { + if ( ++( d->m_lastCheckedUrlIndex ) >= d->m_hasInternetUrls.size() ) + { + d->m_lastCheckedUrlIndex = 0; + } + } + // keep track of how often we've tried, because there's no point in + // going around more than once. + attempts++; + } while ( !d->m_hasInternet && ( attempts < d->m_hasInternetUrls.size() ) ); - d->m_hasInternet = synchronousPing( d->m_hasInternetUrl ); // For earlier Qt versions (< 5.15.0), set the accessibility flag to // NotAccessible if synchronous ping has failed, so that any module // using Qt's networkAccessible method to determine whether or not -// internet connection is actually avaialable won't get confused over -// virtualization technologies. +// internet connection is actually available won't get confused. #if ( QT_VERSION < QT_VERSION_CHECK( 5, 15, 0 ) ) if ( !d->m_hasInternet ) { @@ -177,7 +213,40 @@ Manager::checkHasInternet() void Manager::setCheckHasInternetUrl( const QUrl& url ) { - d->m_hasInternetUrl = url; + d->m_lastCheckedUrlIndex = -1; + d->m_hasInternetUrls.clear(); + if ( url.isValid() ) + { + d->m_hasInternetUrls.append( url ); + } +} + +void +Manager::setCheckHasInternetUrl( const QVector< QUrl >& urls ) +{ + d->m_lastCheckedUrlIndex = -1; + d->m_hasInternetUrls = urls; + auto it = std::remove_if( + d->m_hasInternetUrls.begin(), d->m_hasInternetUrls.end(), []( const QUrl& u ) { return !u.isValid(); } ); + if ( it != d->m_hasInternetUrls.end() ) + { + d->m_hasInternetUrls.erase( it, d->m_hasInternetUrls.end() ); + } +} + +void +Manager::addCheckHasInternetUrl( const QUrl& url ) +{ + if ( url.isValid() ) + { + d->m_hasInternetUrls.append( url ); + } +} + +QVector< QUrl > +Manager::getCheckInternetUrls() const +{ + return d->m_hasInternetUrls; } /** @brief Does a request asynchronously, returns the (pending) reply @@ -200,6 +269,7 @@ asynchronousRun( QNetworkAccessManager* nam, const QUrl& url, const RequestOptio // Bail out early if the request is bad if ( reply->error() ) { + cWarning() << "Early reply error" << reply->error() << reply->errorString(); reply->deleteLater(); return nullptr; } diff --git a/src/libcalamares/network/Manager.h b/src/libcalamares/network/Manager.h index a038dceae..6a906c883 100644 --- a/src/libcalamares/network/Manager.h +++ b/src/libcalamares/network/Manager.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -89,6 +90,7 @@ class DLLEXPORT Manager : public QObject { Q_OBJECT Q_PROPERTY( bool hasInternet READ hasInternet NOTIFY hasInternetChanged FINAL ) + Q_PROPERTY( QVector< QUrl > checkInternetUrls READ getCheckInternetUrls WRITE setCheckHasInternetUrl ) Manager(); @@ -122,6 +124,15 @@ public: /// @brief Set the URL which is used for the general "is there internet" check. void setCheckHasInternetUrl( const QUrl& url ); + /// @brief Adds an (extra) URL to check + void addCheckHasInternetUrl( const QUrl& url ); + + /// @brief Set a collection of URLs used for the general "is there internet" check. + void setCheckHasInternetUrl( const QVector< QUrl >& urls ); + + /// @brief What URLs are used to check for internet connectivity? + QVector< QUrl > getCheckInternetUrls() const; + /** @brief Do a network request asynchronously. * * Returns a pointer to the reply-from-the-request. diff --git a/src/libcalamares/network/Tests.cpp b/src/libcalamares/network/Tests.cpp index d42a74115..e5bd34c23 100644 --- a/src/libcalamares/network/Tests.cpp +++ b/src/libcalamares/network/Tests.cpp @@ -30,6 +30,7 @@ NetworkTests::testInstance() { auto& nam = CalamaresUtils::Network::Manager::instance(); QVERIFY( !nam.hasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 0 ); } void @@ -60,3 +61,87 @@ NetworkTests::testPing() QVERIFY( canPing_www_kde_org ); } } + +void +NetworkTests::testCheckUrl() +{ + using namespace CalamaresUtils::Network; + Logger::setupLogLevel( Logger::LOGVERBOSE ); + auto& nam = Manager::instance(); + + { + QUrl u( "http://example.com" ); + QVERIFY( u.isValid() ); + nam.setCheckHasInternetUrl( u ); + QVERIFY( nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 1 ); // Valid URL + } + { + QUrl u( "http://nonexistent.example.com" ); + QVERIFY( u.isValid() ); + nam.setCheckHasInternetUrl( u ); + QVERIFY( !nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 1 ); // Valid URL even if it doesn't resolve + } + { + QUrl u; + QVERIFY( !u.isValid() ); + nam.setCheckHasInternetUrl( u ); + QVERIFY( !nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 0 ); // Invalid URL tried + } +} + +void +NetworkTests::testCheckMultiUrl() +{ + using namespace CalamaresUtils::Network; + Logger::setupLogLevel( Logger::LOGVERBOSE ); + auto& nam = Manager::instance(); + + { + QUrl u0( "http://example.com" ); + QUrl u1( "https://kde.org" ); + QVERIFY( u0.isValid() ); + QVERIFY( u1.isValid() ); + nam.setCheckHasInternetUrl( { u0, u1 } ); + QVERIFY( nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 2 ); + } + { + QUrl u0( "http://nonexistent.example.com" ); + QUrl u1( "http://bogus.example.com" ); + QVERIFY( u0.isValid() ); + QVERIFY( u1.isValid() ); + nam.setCheckHasInternetUrl( { u0, u1 } ); + QVERIFY( !nam.checkHasInternet() ); + QVERIFY( !nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 2 ); // Both are valid URLs + nam.addCheckHasInternetUrl( QUrl( "http://example.com" ) ); + QVERIFY( nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 3 ); + } + { + QUrl u0( "http://nonexistent.example.com" ); + QUrl u1; + QVERIFY( u0.isValid() ); + QVERIFY( !u1.isValid() ); + nam.setCheckHasInternetUrl( { u0, u1 } ); + QVERIFY( !nam.checkHasInternet() ); + QVERIFY( !nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 1 ); // Only valid URL added + nam.addCheckHasInternetUrl( QUrl( "http://example.com" ) ); + QVERIFY( nam.checkHasInternet() ); + QCOMPARE( nam.getCheckInternetUrls().count(), 2 ); + } + { + QUrl u0( "http://nonexistent.example.com" ); + QUrl u1; + QVERIFY( u0.isValid() ); + QVERIFY( !u1.isValid() ); + nam.setCheckHasInternetUrl( { u1, u1, u1, u1 } ); + QCOMPARE( nam.getCheckInternetUrls().count(), 0 ); + nam.setCheckHasInternetUrl( { u1, u1, u0, u1 } ); + QCOMPARE( nam.getCheckInternetUrls().count(), 1 ); + } +} diff --git a/src/libcalamares/network/Tests.h b/src/libcalamares/network/Tests.h index 6000e227a..d72da574a 100644 --- a/src/libcalamares/network/Tests.h +++ b/src/libcalamares/network/Tests.h @@ -24,6 +24,9 @@ private Q_SLOTS: void testInstance(); void testPing(); + + void testCheckUrl(); + void testCheckMultiUrl(); }; #endif diff --git a/src/libcalamares/partition/Mount.cpp b/src/libcalamares/partition/Mount.cpp index 0fd204df4..89e17a885 100644 --- a/src/libcalamares/partition/Mount.cpp +++ b/src/libcalamares/partition/Mount.cpp @@ -92,7 +92,7 @@ struct TemporaryMount::Private TemporaryMount::TemporaryMount( const QString& devicePath, const QString& filesystemName, const QString& options ) - : m_d( new Private ) + : m_d( std::make_unique() ) { m_d->m_devicePath = devicePath; m_d->m_mountDir.setAutoRemove( false ); @@ -100,8 +100,7 @@ TemporaryMount::TemporaryMount( const QString& devicePath, const QString& filesy if ( r ) { cWarning() << "Mount of" << devicePath << "on" << m_d->m_mountDir.path() << "failed, code" << r; - delete m_d; - m_d = nullptr; + m_d.reset(); } } @@ -115,8 +114,6 @@ TemporaryMount::~TemporaryMount() cWarning() << "UnMount of temporary" << m_d->m_devicePath << "on" << m_d->m_mountDir.path() << "failed, code" << r; } - delete m_d; - m_d = nullptr; } } diff --git a/src/libcalamares/partition/Mount.h b/src/libcalamares/partition/Mount.h index 6a2ef9f8b..d088b108f 100644 --- a/src/libcalamares/partition/Mount.h +++ b/src/libcalamares/partition/Mount.h @@ -17,6 +17,8 @@ #include #include +#include + namespace CalamaresUtils { namespace Partition @@ -58,12 +60,12 @@ public: TemporaryMount& operator=( const TemporaryMount& ) = delete; ~TemporaryMount(); - bool isValid() const { return m_d; } + bool isValid() const { return bool( m_d ); } QString path() const; private: struct Private; - Private* m_d = nullptr; + std::unique_ptr< Private > m_d; }; } // namespace Partition diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index 29f743743..df578a862 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -102,7 +102,7 @@ System::instance() if ( !s_instance ) { cError() << "No Calamares system-object has been created."; - cError() << Logger::SubEntry << "using a bogus instance instead."; + cDebug() << Logger::SubEntry << "using a bogus instance instead."; return new System( true, nullptr ); } return s_instance; diff --git a/src/libcalamares/utils/Variant.h b/src/libcalamares/utils/Variant.h index ab9e73f90..d0d893dc3 100644 --- a/src/libcalamares/utils/Variant.h +++ b/src/libcalamares/utils/Variant.h @@ -34,7 +34,7 @@ DLLEXPORT QString getString( const QVariantMap& map, const QString& key, const Q /** @brief Get a string list from a mapping with a given key; returns @p d if no value. * - * This is slightly more lenient that getString(), and a single-string value will + * This is slightly more lenient than getString(), and a single-string value will * be returned as a 1-item list. */ DLLEXPORT QStringList getStringList( const QVariantMap& map, const QString& key, const QStringList& d = QStringList() ); diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index b9445ba83..5894c723d 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -49,6 +49,10 @@ Branding* Branding::s_instance = nullptr; Branding* Branding::instance() { + if ( !s_instance ) + { + cWarning() << "No Branding instance created yet."; + } return s_instance; } diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 7192df75c..68cbddd0e 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -133,6 +133,12 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker "root=/dev/mapper/" + partition["luksMapperName"]] + # systemd-boot with a BTRFS root filesystem needs to be told + # about the root subvolume. + for partition in partitions: + if partition["mountPoint"] == "/" and partition["fs"] == "btrfs": + kernel_params.append("rootflags=subvol=@") + if cryptdevice_params: kernel_params.extend(cryptdevice_params) else: diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 61f6b0e9f..5312e7f5b 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -244,9 +244,9 @@ class FstabGenerator(object): if extra: options += "," + extra - if mount_point == "/": + if mount_point == "/" and filesystem != "btrfs": check = 1 - elif mount_point and mount_point != "swap": + elif mount_point and mount_point != "swap" and filesystem != "btrfs": check = 2 else: check = 0 diff --git a/src/modules/keyboard/Config.cpp b/src/modules/keyboard/Config.cpp index b77282a18..7140bd790 100644 --- a/src/modules/keyboard/Config.cpp +++ b/src/modules/keyboard/Config.cpp @@ -467,12 +467,12 @@ Config::guessLocaleKeyboardLayout() { "ar_TN", arabic }, { "ar_YE", arabic }, { "ca_ES", "cat_ES" }, /* Catalan */ - { "as_ES", "ast_ES" }, /* Asturian */ { "en_CA", "us" }, /* Canadian English */ { "el_CY", "gr" }, /* Greek in Cyprus */ - { "el_GR", "gr" }, /* Greek in Greeze */ + { "el_GR", "gr" }, /* Greek in Greece */ { "ig_NG", "igbo_NG" }, /* Igbo in Nigeria */ - { "ha_NG", "hausa_NG" } /* Hausa */ + { "ha_NG", "hausa_NG" }, /* Hausa */ + { "en_IN", "eng_in" }, /* India, English with Rupee */ } ); // Try to preselect a layout, depending on language and locale @@ -508,14 +508,7 @@ Config::guessLocaleKeyboardLayout() } if ( !lang.isEmpty() ) { - const auto langParts = lang.split( '_', SplitSkipEmptyParts ); - - // Note that this his string is not fit for display purposes! - // It doesn't come from QLocale::nativeCountryName. - QString country = QLocale::countryToString( QLocale( lang ).country() ); - cDebug() << Logger::SubEntry << "extracted country" << country << "::" << langParts; - - guessLayout( langParts, m_keyboardLayoutsModel, m_keyboardVariantsModel ); + guessLayout( lang.split( '_', SplitSkipEmptyParts ), m_keyboardLayoutsModel, m_keyboardVariantsModel ); } } diff --git a/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp b/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp index 572965de5..0bb1add87 100644 --- a/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp +++ b/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp @@ -124,10 +124,7 @@ KeyBoardPreview::loadCodes() return false; } - QStringList param; - param << "-model" - << "pc106" - << "-layout" << layout << "-compact"; + QStringList param { "-model", "pc106", "-layout", layout, "-compact" }; if ( !variant.isEmpty() ) { param << "-variant" << variant; @@ -140,13 +137,18 @@ KeyBoardPreview::loadCodes() process.start( "ckbcomp", param ); if ( !process.waitForStarted() ) { - cWarning() << "ckbcomp not found , keyboard preview disabled"; + static bool need_warning = true; + if ( need_warning ) + { + cWarning() << "ckbcomp not found , keyboard preview disabled"; + need_warning = false; + } return false; } if ( !process.waitForFinished() ) { - cWarning() << "ckbcomp failed, keyboard preview disabled"; + cWarning() << "ckbcomp failed, keyboard preview skipped for" << layout << variant; return false; } diff --git a/src/modules/localeq/i18n.qml b/src/modules/localeq/i18n.qml index 63cad8bf5..3ceae2ab8 100644 --- a/src/modules/localeq/i18n.qml +++ b/src/modules/localeq/i18n.qml @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * SPDX-FileCopyrightText: 2020 Anke Boersma + * SPDX-FileCopyrightText: 2020 - 2021 Anke Boersma * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -16,19 +16,23 @@ import QtQuick.Layouts 1.3 import org.kde.kirigami 2.7 as Kirigami Item { + readonly property color backgroundColor: Kirigami.Theme.backgroundColor //"#F5F5F5" + readonly property color headerBackgroundColor: Kirigami.Theme.alternateBackgroundColor //"#d3d3d3" + readonly property color backgroundLighterColor: "#ffffff" + readonly property color highlightColor: Kirigami.Theme.highlightColor //"#3498DB" + readonly property color textColor: Kirigami.Theme.textColor + readonly property color highlightedTextColor: Kirigami.Theme.highlightedTextColor + width: parent.width height: parent.height focus: true - MouseArea { - anchors.fill: parent - } Rectangle { id: textArea x: 28 y: 14 anchors.fill: parent - Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor + color: backgroundColor Column { id: languages @@ -38,7 +42,7 @@ Item { Rectangle { width: 250 height: 140 - color: "#d3d3d3" + color: headerBackgroundColor Text { anchors.top: parent.top width: 240 @@ -57,30 +61,43 @@ Item { id: scroll1 anchors.fill: parent contentHeight: 800 - clip: true + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ListView { id: list1 focus: true + clip: true + width: parent.width model: config.supportedLocales - currentIndex: -1 - highlight: Rectangle { - color: Kirigami.Theme.highlightColor - } - delegate: Text { - text: modelData + currentIndex: -1 //model.currentLanguageCodeIndex + delegate: ItemDelegate { - MouseArea { - hoverEnabled: true - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onEntered: { - color: "#0000ff" + hoverEnabled: true + width: parent.width + implicitHeight: 18 + highlighted: ListView.isCurrentItem + Label { + Layout.fillHeight: true + Layout.fillWidth: true + width: parent.width + height: 18 + color: highlighted ? highlightedTextColor : textColor + text: modelData + background: Rectangle { + + color: highlighted || hovered ? highlightColor : backgroundLighterColor + opacity: highlighted || hovered ? 0.5 : 0.9 } - onClicked: { - list1.currentIndex = index + + MouseArea { + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + list1.currentIndex = index + } } } } @@ -98,7 +115,7 @@ Item { Rectangle { width: 250 height: 140 - color: "#d3d3d3" + color: headerBackgroundColor Text { anchors.top: parent.top width: 240 @@ -117,28 +134,42 @@ Item { id: scroll2 anchors.fill: parent contentHeight: 800 - clip: true + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ListView { id: list2 - width: 180; height: 200 focus: true + clip: true model: config.supportedLocales - currentIndex: -1 - highlight: Rectangle { - color: Kirigami.Theme.highlightColor - } - delegate: Text { - text: modelData + currentIndex: -1 //model.currentLCCodeIndex + delegate: ItemDelegate { - MouseArea { - hoverEnabled: true - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: { - list2.currentIndex = index + hoverEnabled: true + width: parent.width + implicitHeight: 18 + highlighted: ListView.isCurrentItem + Label { + Layout.fillHeight: true + Layout.fillWidth: true + width: parent.width + height: 18 + color: highlighted ? highlightedTextColor : textColor + text: modelData + background: Rectangle { + + color: highlighted || hovered ? highlightColor : backgroundLighterColor + opacity: highlighted || hovered ? 0.5 : 0.9 + } + + MouseArea { + hoverEnabled: true + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { + list2.currentIndex = index + } } } } diff --git a/src/modules/networkcfg/main.py b/src/modules/networkcfg/main.py index 40d153031..35bf67d63 100644 --- a/src/modules/networkcfg/main.py +++ b/src/modules/networkcfg/main.py @@ -7,6 +7,7 @@ # SPDX-FileCopyrightText: 2014 Teo Mrnjavac # SPDX-FileCopyrightText: 2017 Alf Gaida # SPDX-FileCopyrightText: 2019 Adriaan de Groot +# SPDX-FileCopyrightText: 2021 Anke boersma # SPDX-License-Identifier: GPL-3.0-or-later # # Calamares is Free Software: see the License-Identifier above. @@ -33,6 +34,8 @@ def run(): Setup network configuration """ root_mount_point = libcalamares.globalstorage.value("rootMountPoint") + user = libcalamares.globalstorage.value("username") + live_user = os.getlogin() if root_mount_point is None: libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) @@ -60,6 +63,16 @@ def run(): try: shutil.copy(source_network, target_network, follow_symlinks=False) + if live_user in open(target_network).read(): + text = [] + with open(target_network, "r") as network_conf: + text = network_conf.readlines() + with open(target_network, "w") as network_conf: + for line in text: + if 'permissions=user:{}:;'.format(live_user) in line: + line = 'permissions=user:{}:;\n'.format(user) + network_conf.write(line) + network_conf.close() except FileNotFoundError: libcalamares.utils.debug( "Can't copy network configuration files in " diff --git a/src/modules/packagechooser/Config.cpp b/src/modules/packagechooser/Config.cpp index 106ae4538..5c0db5d91 100644 --- a/src/modules/packagechooser/Config.cpp +++ b/src/modules/packagechooser/Config.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-FileCopyrightText: 2021 Anke Boersma * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -94,14 +95,24 @@ Config::introductionPackage() const return *defaultIntroduction; } +static inline QString +make_gs_key( const Calamares::ModuleSystem::InstanceKey& key ) +{ + return QStringLiteral( "packagechooser_" ) + key.id(); +} + void Config::updateGlobalStorage( const QStringList& selected ) const { + if ( m_packageChoice.has_value() ) + { + cWarning() << "Inconsistent package choices -- both model and single-selection QML"; + } if ( m_method == PackageChooserMethod::Legacy ) { QString value = selected.join( ',' ); - Calamares::JobQueue::instance()->globalStorage()->insert( m_id, value ); - cDebug() << m_id<< "selected" << value; + Calamares::JobQueue::instance()->globalStorage()->insert( make_gs_key( m_defaultId ), value ); + cDebug() << m_defaultId << "selected" << value; } else if ( m_method == PackageChooserMethod::Packages ) { @@ -116,6 +127,55 @@ Config::updateGlobalStorage( const QStringList& selected ) const } } +void +Config::updateGlobalStorage() const +{ + if ( m_model->packageCount() > 0 ) + { + cWarning() << "Inconsistent package choices -- both model and single-selection QML"; + } + if ( m_method == PackageChooserMethod::Legacy ) + { + auto* gs = Calamares::JobQueue::instance()->globalStorage(); + if ( m_packageChoice.has_value() ) + { + gs->insert( make_gs_key( m_defaultId ), m_packageChoice.value() ); + } + else + { + gs->remove( make_gs_key( m_defaultId ) ); + } + } + else if ( m_method == PackageChooserMethod::Packages ) + { + cWarning() << "Unsupported single-selection packagechooser method 'Packages'"; + } + else + { + cWarning() << "Unknown packagechooser method" << smash( m_method ); + } +} + + +void +Config::setPackageChoice( const QString& packageChoice ) +{ + if ( packageChoice.isEmpty() ) + { + m_packageChoice.reset(); + } + else + { + m_packageChoice = packageChoice; + } + emit packageChoiceChanged( m_packageChoice.value_or( QString() ) ); +} + +QString +Config::prettyStatus() const +{ + return tr( "Install option: %1" ).arg( m_packageChoice.value_or( tr( "None" ) ) ); +} static void fillModel( PackageListModel* model, const QVariantList& items ) @@ -186,46 +246,35 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) if ( m_method == PackageChooserMethod::Legacy ) { - const QString configId = CalamaresUtils::getString( configurationMap, "id" ); - const QString base = QStringLiteral( "packagechooser_" ); - if ( configId.isEmpty() ) - { - if ( m_defaultId.id().isEmpty() ) - { - // We got nothing to work with - m_id = base; - } - else - { - m_id = base + m_defaultId.id(); - } - cDebug() << "Using default ID" << m_id << "from" << m_defaultId.toString(); - } - else - { - m_id = base + configId; - cDebug() << "Using configured ID" << m_id; - } + cDebug() << "Using module ID" << m_defaultId; } if ( configurationMap.contains( "items" ) ) { fillModel( m_model, configurationMap.value( "items" ).toList() ); - } - QString default_item_id = CalamaresUtils::getString( configurationMap, "default" ); - if ( !default_item_id.isEmpty() ) - { - for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n ) + QString default_item_id = CalamaresUtils::getString( configurationMap, "default" ); + if ( !default_item_id.isEmpty() ) { - QModelIndex item_idx = m_model->index( item_n, 0 ); - QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole ); - - if ( item_id.toString() == default_item_id ) + for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n ) { - m_defaultModelIndex = item_idx; - break; + QModelIndex item_idx = m_model->index( item_n, 0 ); + QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole ); + + if ( item_id.toString() == default_item_id ) + { + m_defaultModelIndex = item_idx; + break; + } } } } + else + { + setPackageChoice( CalamaresUtils::getString( configurationMap, "packageChoice" ) ); + if ( m_method != PackageChooserMethod::Legacy ) + { + cWarning() << "Single-selection QML module must use 'Legacy' method."; + } + } } diff --git a/src/modules/packagechooser/Config.h b/src/modules/packagechooser/Config.h index 5959e3ea4..32f1e8b57 100644 --- a/src/modules/packagechooser/Config.h +++ b/src/modules/packagechooser/Config.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-FileCopyrightText: 2021 Anke Boersma * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -16,6 +17,7 @@ #include "modulesystem/InstanceKey.h" #include +#include enum class PackageChooserMode { @@ -39,6 +41,18 @@ class Config : public Calamares::ModuleSystem::Config { Q_OBJECT + /** @brief This is the single-select package-choice + * + * For (QML) modules that support only a single selection and + * just want to do things in a straightforward pick-this-one + * way, the packageChoice property is a (the) way to go. + * + * Writing to this property means that any other form of package- + * choice or selection is ignored. + */ + Q_PROPERTY( QString packageChoice READ packageChoice WRITE setPackageChoice NOTIFY packageChoiceChanged ) + Q_PROPERTY( QString prettyStatus READ prettyStatus NOTIFY prettyStatusChanged FINAL ) + public: Config( QObject* parent = nullptr ); ~Config() override; @@ -71,8 +85,22 @@ public: * (and only) the packages in @p selected as selected. */ void updateGlobalStorage( const QStringList& selected ) const; - /// As updateGlobalStorage() with an empty selection list - void fillGSSecondaryConfiguration() const { updateGlobalStorage( QStringList() ); } + /** @brief Write selection to global storage + * + * Updates the GS keys for this packagechooser, marking **only** + * the package choice as selected. This assumes that the single- + * selection QML code is in use. + */ + void updateGlobalStorage() const; + + QString packageChoice() const { return m_packageChoice.value_or( QString() ); } + void setPackageChoice( const QString& packageChoice ); + + QString prettyStatus() const; + +signals: + void packageChoiceChanged( QString packageChoice ); + void prettyStatusChanged(); private: PackageListModel* m_model = nullptr; @@ -82,10 +110,14 @@ private: PackageChooserMode m_mode = PackageChooserMode::Optional; /// How this module stores to GS PackageChooserMethod m_method = PackageChooserMethod::Legacy; - /// Id (used to identify settings from this module in GS) - QString m_id; /// Value to use for id if none is set in the config file Calamares::ModuleSystem::InstanceKey m_defaultId; + /** @brief QML selection (for single-selection approaches) + * + * If there is no value, then there has been no selection. + * Reading the property will return an empty QString. + */ + std::optional< QString > m_packageChoice; }; diff --git a/src/modules/packagechooser/packagechooser.conf b/src/modules/packagechooser/packagechooser.conf index 6a0fd64f2..f618e8df2 100644 --- a/src/modules/packagechooser/packagechooser.conf +++ b/src/modules/packagechooser/packagechooser.conf @@ -15,11 +15,10 @@ mode: required # # - "legacy" or "custom" or "contextualprocess" # When set to "legacy", writes a GlobalStorage value for the choice that -# has been made. The key is *packagechooser_*. Normally, the module's +# has been made. The key is *packagechooser_*. The module's # instance name is used; see the *instances* section of `settings.conf`. # If there is just one packagechooser module, and no special instance is set, -# resulting GS key is probably *packagechooser@packagechooser*. -# You can set *id* to change that, but it is not recommended. +# resulting GS key is probably *packagechooser_packagechooser*. # # The GS value is a comma-separated list of the IDs of the selected # packages, or an empty string if none is selected. @@ -33,15 +32,12 @@ mode: required # consumption by the *packages* module (which should appear later # in the `exec` section. These package settings will then be handed # off to whatever package manager is configured there. -# The *id* key is not used. # # There is no need to put this module in the `exec` section. There # are no jobs that this module provides. You should put **other** # modules, either *contextualprocess* or *packages* or some custom # module, in the `exec` section to do the actual work. method: legacy -# The *id* key is used only in "legacy" mode -# id: "" # Human-visible strings in this module. These are all optional. @@ -51,13 +47,13 @@ method: legacy # Each key can have a [locale] added to it, which is used as # the translated string for that locale. For the strings # associated with the "no-selection" item, see *items*, below -# with the explicit id "". +# with the explicit item-*id* "". # labels: step: "Office Suite" step[de]: "Office-Paket" -# (Optional) 'id' of pre-selected list-view item. +# (Optional) item-*id* of pre-selected list-view item. # Pre-selects one of the items below. # default: kde diff --git a/src/modules/packagechooserq/CMakeLists.txt b/src/modules/packagechooserq/CMakeLists.txt new file mode 100644 index 000000000..51a17e215 --- /dev/null +++ b/src/modules/packagechooserq/CMakeLists.txt @@ -0,0 +1,69 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2020 Adriaan de Groot +# SPDX-FileCopyrightText: 2021 Anke Boersma +# SPDX-License-Identifier: BSD-2-Clause +# +if( NOT WITH_QML ) + calamares_skip_module( "packagechooserq (QML is not supported in this build)" ) + return() +endif() + +find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core ) + +# Add optional libraries here +set( USER_EXTRA_LIB ) + +# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser ) +set( _packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser ) +include_directories( ${_packagechooser} ) + +### OPTIONAL AppData XML support in PackageModel +# +# +# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares) +option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON ) +if ( WITH_APPDATA ) + find_package(Qt5 COMPONENTS Xml) + if ( Qt5Xml_FOUND ) + add_definitions( -DHAVE_APPDATA ) + list( APPEND _extra_libraries Qt5::Xml ) + list( APPEND _extra_src ${_packagechooser}/ItemAppData.cpp ) + endif() +endif() + +### OPTIONAL AppStream support in PackageModel +# +# +option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON ) +if ( WITH_APPSTREAM ) + find_package(AppStreamQt) + set_package_properties( + AppStreamQt PROPERTIES + DESCRIPTION "Support for AppStream (cache) data" + URL "https://github.com/ximion/appstream" + PURPOSE "AppStream provides package data" + TYPE OPTIONAL + ) + if ( AppStreamQt_FOUND ) + add_definitions( -DHAVE_APPSTREAM ) + list( APPEND _extra_libraries AppStreamQt ) + list( APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp ) + endif() +endif() + +calamares_add_plugin( packagechooserq + TYPE viewmodule + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + PackageChooserQmlViewStep.cpp + ${_packagechooser}/Config.cpp + ${_packagechooser}/PackageModel.cpp + ${_extra_src} + RESOURCES + packagechooserq.qrc + LINK_PRIVATE_LIBRARIES + calamaresui + ${_extra_libraries} + SHARED_LIB +) diff --git a/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp new file mode 100644 index 000000000..543c9771d --- /dev/null +++ b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp @@ -0,0 +1,86 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * SPDX-FileCopyrightText: 2021 Anke Boersma + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "PackageChooserQmlViewStep.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "locale/TranslatableConfiguration.h" +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Logger.h" +#include "utils/Variant.h" + +CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageChooserQmlViewStepFactory, registerPlugin< PackageChooserQmlViewStep >(); ) + +PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent ) + : Calamares::QmlViewStep( parent ) + , m_config( new Config( this ) ) +{ + emit nextStatusChanged( true ); +} + +QString +PackageChooserQmlViewStep::prettyName() const +{ + return tr( "Packages" ); +} + +QString +PackageChooserQmlViewStep::prettyStatus() const +{ + //QString option = m_pkgc; + //return tr( "Install option: %1" ).arg( option ); + return m_config->prettyStatus(); +} + +bool +PackageChooserQmlViewStep::isNextEnabled() const +{ + return true; +} + +bool +PackageChooserQmlViewStep::isBackEnabled() const +{ + return true; +} + +bool +PackageChooserQmlViewStep::isAtBeginning() const +{ + return true; +} + +bool +PackageChooserQmlViewStep::isAtEnd() const +{ + return true; +} + +Calamares::JobList +PackageChooserQmlViewStep::jobs() const +{ + Calamares::JobList l; + return l; +} + +void +PackageChooserQmlViewStep::onLeave() +{ + m_config->updateGlobalStorage(); +} + +void +PackageChooserQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) +{ + m_config->setDefaultId( moduleInstanceKey() ); + m_config->setConfigurationMap( configurationMap ); + Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last +} diff --git a/src/modules/packagechooserq/PackageChooserQmlViewStep.h b/src/modules/packagechooserq/PackageChooserQmlViewStep.h new file mode 100644 index 000000000..1ac2451c2 --- /dev/null +++ b/src/modules/packagechooserq/PackageChooserQmlViewStep.h @@ -0,0 +1,58 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * SPDX-FileCopyrightText: 2021 Anke Boersma + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef PACKAGECHOOSERQMLVIEWSTEP_H +#define PACKAGECHOOSERQMLVIEWSTEP_H + +// Config from packagechooser module +#include "Config.h" + +#include "DllMacro.h" +#include "locale/TranslatableConfiguration.h" +#include "utils/PluginFactory.h" +#include "viewpages/QmlViewStep.h" + +#include + +class Config; +class PackageChooserPage; + +class PLUGINDLLEXPORT PackageChooserQmlViewStep : public Calamares::QmlViewStep +{ + Q_OBJECT + +public: + explicit PackageChooserQmlViewStep( QObject* parent = nullptr ); + + QString prettyName() const override; + QString prettyStatus() const override; + + bool isNextEnabled() const override; + bool isBackEnabled() const override; + + bool isAtBeginning() const override; + bool isAtEnd() const override; + + //void onActivate() override; + void onLeave() override; + + Calamares::JobList jobs() const override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; + + QObject* getConfig() override { return m_config; } + +private: + Config* m_config; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserQmlViewStepFactory ) + +#endif // PACKAGECHOOSERQMLVIEWSTEP_H diff --git a/src/modules/packagechooserq/images/libreoffice.jpg b/src/modules/packagechooserq/images/libreoffice.jpg new file mode 100644 index 000000000..e216cc77a Binary files /dev/null and b/src/modules/packagechooserq/images/libreoffice.jpg differ diff --git a/src/modules/packagechooserq/images/libreoffice.jpg.license b/src/modules/packagechooserq/images/libreoffice.jpg.license new file mode 100644 index 000000000..5f43e650d --- /dev/null +++ b/src/modules/packagechooserq/images/libreoffice.jpg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2020 demmm +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/modules/packagechooserq/images/no-selection.png b/src/modules/packagechooserq/images/no-selection.png new file mode 100644 index 000000000..b32d21702 Binary files /dev/null and b/src/modules/packagechooserq/images/no-selection.png differ diff --git a/src/modules/packagechooserq/images/no-selection.png.license b/src/modules/packagechooserq/images/no-selection.png.license new file mode 100644 index 000000000..5f43e650d --- /dev/null +++ b/src/modules/packagechooserq/images/no-selection.png.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2020 demmm +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/modules/packagechooserq/images/plasma.png b/src/modules/packagechooserq/images/plasma.png new file mode 100644 index 000000000..e9e35a528 Binary files /dev/null and b/src/modules/packagechooserq/images/plasma.png differ diff --git a/src/modules/packagechooserq/images/plasma.png.license b/src/modules/packagechooserq/images/plasma.png.license new file mode 100644 index 000000000..16c11f071 --- /dev/null +++ b/src/modules/packagechooserq/images/plasma.png.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2021 pngegg +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/modules/packagechooserq/packagechooserq.conf b/src/modules/packagechooserq/packagechooserq.conf new file mode 100644 index 000000000..803c6f670 --- /dev/null +++ b/src/modules/packagechooserq/packagechooserq.conf @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Configuration for the low-density software chooser, QML implementation +# +# The example QML implementation uses single-selection, rather than +# a model for the available packages. That makes it simpler: the +# QML itself codes the available options, descriptions and images +# -- after all, this is **low density** selection, so a custom UI +# can make sense for the few choices that need to be made. +# +# + +--- +# Software installation method: +# +# - "legacy" or "custom" or "contextualprocess" +# When set to "legacy", writes a GlobalStorage value for the choice that +# has been made. The key is *packagechooser_*. The module's +# instance name is used; see the *instances* section of `settings.conf`. +# If there is just one packagechooserq module, and no special instance is set, +# resulting GS key is probably *packagechooser_packagechooserq*. +# (Do note that the prefix of the GS key remains "packagechooser_") +# +# The GS value is a comma-separated list of the IDs of the selected +# packages, or an empty string if none is selected. +# +# With "legacy" installation, you should have a contextualprocess or similar +# module somewhere in the `exec` phase to process the GlobalStorage key +# and actually **do** something for the packages. +# +# - "packages" +# When set to "packages", writes GlobalStorage values suitable for +# consumption by the *packages* module (which should appear later +# in the `exec` section. These package settings will then be handed +# off to whatever package manager is configured there. +# +# There is no need to put this module in the `exec` section. There +# are no jobs that this module provides. You should put **other** +# modules, either *contextualprocess* or *packages* or some custom +# module, in the `exec` section to do the actual work. +# +method: legacy + +# The *packageChoice* value is used for setting the default selection +# in the QML view; this should match one of the keys used in the QML +# module for package names. +# +# (e.g. the sample QML uses "no_office_suite", "minimal_install" and +# "libreoffice" as possible choices). +# +packageChoice: libreoffice + diff --git a/src/modules/packagechooserq/packagechooserq.qml b/src/modules/packagechooserq/packagechooserq.qml new file mode 100644 index 000000000..7d1613582 --- /dev/null +++ b/src/modules/packagechooserq/packagechooserq.qml @@ -0,0 +1,241 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Anke Boersma + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +import io.calamares.core 1.0 +import io.calamares.ui 1.0 + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.3 + +Item { + width: parent.width + height: parent.height + + Rectangle { + anchors.fill: parent + color: "#f2f2f2" + + ButtonGroup { + id: switchGroup + } + + Column { + id: column + anchors.centerIn: parent + spacing: 5 + + Rectangle { + //id: rectangle + width: 700 + height: 150 + color: "#ffffff" + radius: 10 + border.width: 0 + Text { + width: 450 + height: 104 + anchors.centerIn: parent + text: qsTr("LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.
+ Default option.") + font.pointSize: 10 + anchors.verticalCenterOffset: -10 + anchors.horizontalCenterOffset: 100 + wrapMode: Text.WordWrap + } + + Switch { + id: element2 + x: 500 + y: 110 + width: 187 + height: 14 + text: qsTr("LibreOffice") + checked: true + hoverEnabled: true + ButtonGroup.group: switchGroup + + indicator: Rectangle { + implicitWidth: 40 + implicitHeight: 14 + radius: 10 + color: element2.checked ? "#3498db" : "#B9B9B9" + border.color: element2.checked ? "#3498db" : "#cccccc" + + Rectangle { + x: element2.checked ? parent.width - width : 0 + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: 10 + color: element2.down ? "#cccccc" : "#ffffff" + border.color: element2.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999" + } + } + + onCheckedChanged: { + if ( checked ) { + config.packageChoice = "libreoffice" + } + } + } + + Image { + id: image2 + x: 8 + y: 25 + height: 100 + fillMode: Image.PreserveAspectFit + source: "images/libreoffice.jpg" + } + } + + Rectangle { + width: 700 + height: 150 + radius: 10 + border.width: 0 + Text { + width: 450 + height: 104 + anchors.centerIn: parent + text: qsTr("If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives.") + font.pointSize: 10 + anchors.verticalCenterOffset: -10 + anchors.horizontalCenterOffset: 100 + wrapMode: Text.WordWrap + } + + Switch { + id: element1 + x: 500 + y: 110 + width: 187 + height: 14 + text: qsTr("No Office Suite") + checked: false + hoverEnabled: true + ButtonGroup.group: switchGroup + + indicator: Rectangle { + implicitWidth: 40 + implicitHeight: 14 + radius: 10 + color: element1.checked ? "#3498db" : "#B9B9B9" + border.color: element1.checked ? "#3498db" : "#cccccc" + + Rectangle { + x: element1.checked ? parent.width - width : 0 + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: 10 + color: element1.down ? "#cccccc" : "#ffffff" + border.color: element1.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999" + } + } + + onCheckedChanged: { + if ( checked ) { + config.packageChoice = "no_office_suite" + } + } + } + + Image { + id: image + x: 8 + y: 25 + height: 100 + fillMode: Image.PreserveAspectFit + source: "images/no-selection.png" + } + + } + + Rectangle { + width: 700 + height: 150 + color: "#ffffff" + radius: 10 + border.width: 0 + Text { + width: 450 + height: 104 + anchors.centerIn: parent + text: qsTr("Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser.") + font.pointSize: 10 + anchors.verticalCenterOffset: -10 + anchors.horizontalCenterOffset: 100 + wrapMode: Text.WordWrap + } + + Switch { + id: element3 + x: 500 + y: 110 + width: 187 + height: 14 + text: qsTr("Minimal Install") + checked: false + hoverEnabled: true + ButtonGroup.group: switchGroup + + indicator: Rectangle { + implicitWidth: 40 + implicitHeight: 14 + radius: 10 + color: element3.checked ? "#3498db" : "#B9B9B9" + border.color: element3.checked ? "#3498db" : "#cccccc" + + Rectangle { + x: element3.checked ? parent.width - width : 0 + y: (parent.height - height) / 2 + width: 20 + height: 20 + radius: 10 + color: element3.down ? "#cccccc" : "#ffffff" + border.color: element3.checked ? (element3.down ? "#3498db" : "#3498db") : "#999999" + } + } + + onCheckedChanged: { + if ( checked ) { + config.packageChoice = "minimal_install" + } + } + } + + Image { + id: image3 + x: 8 + y: 25 + height: 100 + fillMode: Image.PreserveAspectFit + source: "images/plasma.png" + } + } + + Rectangle { + width: 700 + height: 25 + color: "#f2f2f2" + border.width: 0 + Text { + height: 25 + anchors.centerIn: parent + text: qsTr("Please select an option for your install, or use the default: LibreOffice included.") + font.pointSize: 10 + wrapMode: Text.WordWrap + } + } + } + } + +} diff --git a/src/modules/packagechooserq/packagechooserq.qrc b/src/modules/packagechooserq/packagechooserq.qrc new file mode 100644 index 000000000..1b892dce1 --- /dev/null +++ b/src/modules/packagechooserq/packagechooserq.qrc @@ -0,0 +1,8 @@ + + + packagechooserq.qml + images/libreoffice.jpg + images/no-selection.png + images/plasma.png + + diff --git a/src/modules/partition/Config.cpp b/src/modules/partition/Config.cpp index 82c0ad846..508231a75 100644 --- a/src/modules/partition/Config.cpp +++ b/src/modules/partition/Config.cpp @@ -227,7 +227,8 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu QString firmwareType( PartUtils::isEfiSystem() ? QStringLiteral( "efi" ) : QStringLiteral( "bios" ) ); gs->insert( "firmwareType", firmwareType ); - gs->insert( "efiSystemPartition", CalamaresUtils::getString( configurationMap, "efiSystemPartition", QStringLiteral( "/boot/efi" ) ) ); + gs->insert( "efiSystemPartition", + CalamaresUtils::getString( configurationMap, "efiSystemPartition", QStringLiteral( "/boot/efi" ) ) ); // Read and parse key efiSystemPartitionSize if ( configurationMap.contains( "efiSystemPartitionSize" ) ) @@ -243,7 +244,7 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu } void -Config::fillConfigurationFSTypes(const QVariantMap& configurationMap) +Config::fillConfigurationFSTypes( const QVariantMap& configurationMap ) { Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); @@ -256,15 +257,16 @@ Config::fillConfigurationFSTypes(const QVariantMap& configurationMap) if ( fsName.isEmpty() ) { cWarning() << "Partition-module setting *defaultFileSystemType* is missing, will use ext4"; - fsRealName = PartUtils::canonicalFilesystemName( QStringLiteral("ext4"), &fsType ); + fsRealName = PartUtils::canonicalFilesystemName( QStringLiteral( "ext4" ), &fsType ); } else { fsRealName = PartUtils::canonicalFilesystemName( fsName, &fsType ); if ( fsType == FileSystem::Type::Unknown ) { - cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << fsName << ") using ext4 instead"; - fsRealName = PartUtils::canonicalFilesystemName( QStringLiteral("ext4"), &fsType ); + cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << fsName + << ") using ext4 instead"; + fsRealName = PartUtils::canonicalFilesystemName( QStringLiteral( "ext4" ), &fsType ); } else if ( fsRealName != fsName ) { @@ -326,7 +328,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) m_requiredPartitionTableType = CalamaresUtils::getStringList( configurationMap, "requiredPartitionTableType" ); gs->insert( "requiredPartitionTableType", m_requiredPartitionTableType ); - fillGSConfigurationEFI(gs, configurationMap); + fillGSConfigurationEFI( gs, configurationMap ); fillConfigurationFSTypes( configurationMap ); } diff --git a/src/modules/partition/Config.h b/src/modules/partition/Config.h index 3365403fa..5f7e46821 100644 --- a/src/modules/partition/Config.h +++ b/src/modules/partition/Config.h @@ -27,7 +27,8 @@ class Config : public QObject Q_PROPERTY( SwapChoice swapChoice READ swapChoice WRITE setSwapChoice NOTIFY swapChoiceChanged ) ///@brief Name of the FS that will be used when erasing type disk (e.g. "default filesystem") - Q_PROPERTY( QString eraseModeFilesystem READ eraseFsType WRITE setEraseFsTypeChoice NOTIFY eraseModeFilesystemChanged ) + Q_PROPERTY( + QString eraseModeFilesystem READ eraseFsType WRITE setEraseFsTypeChoice NOTIFY eraseModeFilesystemChanged ) Q_PROPERTY( bool allowManualPartitioning READ allowManualPartitioning CONSTANT FINAL ) @@ -134,7 +135,7 @@ public Q_SLOTS: void setInstallChoice( InstallChoice ); void setSwapChoice( int ); ///< Translates a button ID or so to SwapChoice void setSwapChoice( SwapChoice ); - void setEraseFsTypeChoice( const QString& filesystemName ); ///< See property eraseModeFilesystem + void setEraseFsTypeChoice( const QString& filesystemName ); ///< See property eraseModeFilesystem Q_SIGNALS: void installChoiceChanged( InstallChoice ); diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index d3d45bc8a..1fe7bdfab 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -109,13 +109,142 @@ PartitionViewStep::prettyName() const return tr( "Partitions" ); } - -QWidget* -PartitionViewStep::widget() +/** @brief Gather the pretty descriptions of all the partitioning jobs + * + * Returns a QStringList of each job's pretty description, including + * empty strings and duplicates. The list is in-order of how the + * jobs will be run. + */ +static QStringList +jobDescriptions( const Calamares::JobList& jobs ) { - return m_widget; + QStringList jobsLines; + for ( const Calamares::job_ptr& job : qAsConst( jobs ) ) + { + if ( !job->prettyDescription().isEmpty() ) + { + jobsLines.append( job->prettyDescription() ); + } + } + return jobsLines; } +/** @brief A top-level description of what @p choice does + * + * Returns a (branded) string describing what @p choice will do. + */ +static QString +modeDescription( Config::InstallChoice choice ) +{ + const auto* branding = Calamares::Branding::instance(); + static const char context[] = "PartitionViewStep"; + + switch ( choice ) + { + case Config::InstallChoice::Alongside: + return QCoreApplication::translate( context, "Install %1 alongside another operating system." ) + .arg( branding->shortVersionedName() ); + break; + case Config::InstallChoice::Erase: + return QCoreApplication::translate( context, "Erase disk and install %1." ) + .arg( branding->shortVersionedName() ); + break; + case Config::InstallChoice::Replace: + return QCoreApplication::translate( context, "Replace a partition with %1." ) + .arg( branding->shortVersionedName() ); + break; + case Config::InstallChoice::NoChoice: + case Config::InstallChoice::Manual: + return QCoreApplication::translate( context, "Manual partitioning." ); + } + return QString(); +} + +/** @brief A top-level description of what @p choice does to disk @p info + * + * Returns a (branded, and device-specific) string describing what + * will be done to device @p info when @p choice is made. The @p listLength + * is used to provide context; when more than one disk is in use, the description + * works differently. + */ +static QString +diskDescription( int listLength, const PartitionCoreModule::SummaryInfo& info, Config::InstallChoice choice ) +{ + const auto* branding = Calamares::Branding::instance(); + static const char context[] = "PartitionViewStep"; + + if ( listLength == 1 ) // this is the only disk preview + { + switch ( choice ) + { + case Config::Alongside: + return QCoreApplication::translate( + context, + "Install %1 alongside another operating system on disk " + "%2 (%3)." ) + .arg( branding->shortVersionedName() ) + .arg( info.deviceNode ) + .arg( info.deviceName ); + break; + case Config::Erase: + return QCoreApplication::translate( context, + "Erase disk %2 (%3) and install %1." ) + .arg( branding->shortVersionedName() ) + .arg( info.deviceNode ) + .arg( info.deviceName ); + break; + case Config::Replace: + return QCoreApplication::translate( + context, "Replace a partition on disk %2 (%3) with %1." ) + .arg( branding->shortVersionedName() ) + .arg( info.deviceNode ) + .arg( info.deviceName ); + break; + case Config::NoChoice: + case Config::Manual: + return QCoreApplication::translate( + context, "Manual partitioning on disk %1 (%2)." ) + .arg( info.deviceNode ) + .arg( info.deviceName ); + } + return QString(); + } + else // multiple disk previews! + { + return QCoreApplication::translate( context, "Disk %1 (%2)" ) + .arg( info.deviceNode ) + .arg( info.deviceName ); + } +} + +QString +PartitionViewStep::prettyStatus() const +{ + QString jobsLabel, modeText, diskInfoLabel; + + const Config::InstallChoice choice = m_config->installChoice(); + const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); + + cDebug() << "Summary for Partition" << list.length() << choice; + if ( list.length() > 1 ) // There are changes on more than one disk + { + modeText = modeDescription( choice ); + } + + for ( const auto& info : list ) + { + // TODO: this overwrites each iteration + diskInfoLabel = diskDescription( list.length(), info, choice ); + } + + const QStringList jobsLines = jobDescriptions( jobs() ); + if ( !jobsLines.isEmpty() ) + { + jobsLabel = jobsLines.join( "
" ); + } + + return diskInfoLabel + "
" + jobsLabel; +} QWidget* PartitionViewStep::createSummaryWidget() const @@ -132,73 +261,19 @@ PartitionViewStep::createSummaryWidget() const formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN ); mainLayout->addLayout( formLayout ); - const auto* branding = Calamares::Branding::instance(); - QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); + const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); if ( list.length() > 1 ) // There are changes on more than one disk { //NOTE: all of this should only happen when Manual partitioning is active. // Any other choice should result in a list.length() == 1. QLabel* modeLabel = new QLabel; formLayout->addRow( modeLabel ); - QString modeText; - switch ( choice ) - { - case Config::InstallChoice::Alongside: - modeText = tr( "Install %1 alongside another operating system." ) - .arg( branding->shortVersionedName() ); - break; - case Config::InstallChoice::Erase: - modeText = tr( "Erase disk and install %1." ).arg( branding->shortVersionedName() ); - break; - case Config::InstallChoice::Replace: - modeText = tr( "Replace a partition with %1." ).arg( branding->shortVersionedName() ); - break; - case Config::InstallChoice::NoChoice: - case Config::InstallChoice::Manual: - modeText = tr( "Manual partitioning." ); - } - modeLabel->setText( modeText ); + modeLabel->setText( modeDescription( choice ) ); } for ( const auto& info : list ) { QLabel* diskInfoLabel = new QLabel; - if ( list.length() == 1 ) // this is the only disk preview - { - QString modeText; - switch ( choice ) - { - case Config::InstallChoice::Alongside: - modeText = tr( "Install %1 alongside another operating system on disk " - "%2 (%3)." ) - .arg( branding->shortVersionedName() ) - .arg( info.deviceNode ) - .arg( info.deviceName ); - break; - case Config::InstallChoice::Erase: - modeText = tr( "Erase disk %2 (%3) and install %1." ) - .arg( branding->shortVersionedName() ) - .arg( info.deviceNode ) - .arg( info.deviceName ); - break; - case Config::InstallChoice::Replace: - modeText = tr( "Replace a partition on disk %2 (%3) with %1." ) - .arg( branding->shortVersionedName() ) - .arg( info.deviceNode ) - .arg( info.deviceName ); - break; - case Config::InstallChoice::NoChoice: - case Config::InstallChoice::Manual: - modeText = tr( "Manual partitioning on disk %1 (%2)." ) - .arg( info.deviceNode ) - .arg( info.deviceName ); - } - diskInfoLabel->setText( modeText ); - } - else // multiple disk previews! - { - diskInfoLabel->setText( - tr( "Disk %1 (%2)" ).arg( info.deviceNode ).arg( info.deviceName ) ); - } + diskInfoLabel->setText( diskDescription( list.length(), info, choice ) ); formLayout->addRow( diskInfoLabel ); PartitionBarsView* preview; @@ -243,14 +318,7 @@ PartitionViewStep::createSummaryWidget() const field->addWidget( previewLabels ); formLayout->addRow( tr( "After:" ), field ); } - QStringList jobsLines; - foreach ( const Calamares::job_ptr& job, jobs() ) - { - if ( !job->prettyDescription().isEmpty() ) - { - jobsLines.append( job->prettyDescription() ); - } - } + const QStringList jobsLines = jobDescriptions( jobs() ); if ( !jobsLines.isEmpty() ) { QLabel* jobsLabel = new QLabel( widget ); @@ -265,6 +333,11 @@ PartitionViewStep::createSummaryWidget() const return widget; } +QWidget* +PartitionViewStep::widget() +{ + return m_widget; +} void PartitionViewStep::next() @@ -434,50 +507,66 @@ PartitionViewStep::onLeave() { const QString espMountPoint = Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString(); - const QString espFlagName = PartitionTable::flagName( #ifdef WITH_KPMCORE4API - PartitionTable::Flag::Boot + const auto espFlag = PartitionTable::Flag::Boot; #else - PartitionTable::FlagEsp + const auto espFlag = PartitionTable::FlagEsp; #endif - ); Partition* esp = m_core->findPartitionByMountPoint( espMountPoint ); QString message; QString description; - if ( !esp || ( esp && !PartUtils::isEfiFilesystemSuitable( esp ) ) ) + + Logger::Once o; + + const bool okType = esp && PartUtils::isEfiFilesystemSuitableType( esp ); + const bool okSize = esp && PartUtils::isEfiFilesystemSuitableSize( esp ); + const bool okFlag = esp && PartUtils::isEfiBootable( esp ); + + if ( !esp ) { message = tr( "No EFI system partition configured" ); - description = tr( "An EFI system partition is necessary to start %1." - "

" - "To configure an EFI system partition, go back and " - "select or create a FAT32 filesystem with the " - "%3 flag enabled and mount point " - "%2.

" - "You can continue without setting up an EFI system " - "partition but your system may fail to start." ) - .arg( branding->shortProductName() ) - .arg( espMountPoint, espFlagName ); } - else if ( esp && !PartUtils::isEfiBootable( esp ) ) + else if ( !(okType && okSize && okFlag ) ) { - message = tr( "EFI system partition flag not set" ); - description = tr( "An EFI system partition is necessary to start %1." - "

" - "A partition was configured with mount point " - "%2 but its %3 " - "flag is not set.
" - "To set the flag, go back and edit the partition." - "

" - "You can continue without setting the flag but your " - "system may fail to start." ) - .arg( branding->shortProductName() ) - .arg( espMountPoint, espFlagName ); + message = tr( "EFI system partition configured incorrectly" ); } + if ( !esp || !(okType&&okSize &&okFlag)) { + description = tr( "An EFI system partition is necessary to start %1." + "

" + "To configure an EFI system partition, go back and " + "select or create a suitable filesystem.").arg( branding->shortProductName() ); + } + if (!esp) { + cDebug() << o << "No ESP mounted"; + description.append(' '); + description.append(tr("The filesystem must be mounted on %1.").arg(espMountPoint)); + } + if (!okType) { + cDebug() << o << "ESP wrong type"; + description.append(' '); + description.append(tr("The filesystem must have type FAT32.")); + } + if (!okSize) { + cDebug() << o << "ESP too small"; + description.append(' '); + description.append(tr("The filesystem must be at least %1 MiB in size.").arg( PartUtils::efiFilesystemMinimumSize() )); + } + if (!okFlag) + { + cDebug() << o << "ESP missing flag"; + description.append(' '); + description.append(tr("The filesystem must have flag %1 set.").arg(PartitionTable::flagName( espFlag ))); + } + if (!description.isEmpty()) { + description.append( "

" ); + description.append( tr( + "You can continue without setting up an EFI system " + "partition but your system may fail to start." )); + } if ( !message.isEmpty() ) { - cWarning() << message; QMessageBox::warning( m_manualPartitionPage, message, description ); } } @@ -583,8 +672,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) QFuture< void > future = QtConcurrent::run( this, &PartitionViewStep::initPartitionCoreModule ); m_future->setFuture( future ); - m_core->initLayout( m_config->defaultFsType(), - configurationMap.value( "partitionLayout" ).toList() ); + m_core->initLayout( m_config->defaultFsType(), configurationMap.value( "partitionLayout" ).toList() ); } diff --git a/src/modules/partition/PartitionViewStep.h b/src/modules/partition/PartitionViewStep.h index 9f3da9f3d..ecba73f45 100644 --- a/src/modules/partition/PartitionViewStep.h +++ b/src/modules/partition/PartitionViewStep.h @@ -43,6 +43,7 @@ public: ~PartitionViewStep() override; QString prettyName() const override; + QString prettyStatus() const override; QWidget* createSummaryWidget() const override; QWidget* widget() override; diff --git a/src/modules/partition/core/DeviceList.cpp b/src/modules/partition/core/DeviceList.cpp index 6b770a982..c7de12e88 100644 --- a/src/modules/partition/core/DeviceList.cpp +++ b/src/modules/partition/core/DeviceList.cpp @@ -112,6 +112,11 @@ QList< Device* > getDevices( DeviceType which ) { CoreBackend* backend = CoreBackendManager::self()->backend(); + if ( !backend ) + { + cWarning() << "No KPM backend found."; + return {}; + } #if defined( WITH_KPMCORE4API ) DeviceList devices = backend->scanDevices( /* not includeReadOnly, not includeLoopback */ ScanFlag( 0 ) ); #else diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 4beac0db8..54f971f4e 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -447,31 +447,40 @@ isEfiSystem() } bool -isEfiFilesystemSuitable(const Partition* candidate) +isEfiFilesystemSuitableType( const Partition* candidate ) { auto type = candidate->fileSystem().type(); + + switch ( type ) + { + case FileSystem::Type::Fat32: + return true; +#ifdef WITH_KPMCORE4API + case FileSystem::Type::Fat12: +#endif + case FileSystem::Type::Fat16: + cWarning() << "FAT12 and FAT16 are probably not supported by EFI"; + return false; + default: + cWarning() << "EFI boot partition must be FAT32"; + return false; + } +} + +bool +isEfiFilesystemSuitableSize( const Partition* candidate ) +{ auto size = candidate->capacity(); // bytes using CalamaresUtils::Units::operator""_MiB; - - switch( type ) + if ( size >= 300_MiB ) { - case FileSystem::Type::Fat32: - if ( size >= 300_MiB ) - { - return true; - } - cWarning() << "FAT32 filesystem is too small (" << size << "bytes)"; - return false; -#ifdef WITH_KPMCORE4API - case FileSystem::Type::Fat12: -#endif - case FileSystem::Type::Fat16: - cWarning() << "FAT12 and FAT16 are probably not supported by EFI"; - return false; - default: - cWarning() << "EFI boot partition must be FAT32"; - return false; + return true; + } + else + { + cWarning() << "Filesystem for EFI is too small (" << size << "bytes)"; + return false; } } @@ -508,6 +517,15 @@ isEfiBootable( const Partition* candidate ) #endif } +// TODO: this is configurable via the config file **already** +size_t +efiFilesystemMinimumSize() +{ + using CalamaresUtils::Units::operator""_MiB; + return 300_MiB; +} + + QString canonicalFilesystemName( const QString& fsName, FileSystem::Type* fsType ) { diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index 6bf223921..dd4efc867 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -84,9 +84,24 @@ bool isEfiSystem(); /** * @brief Is the @p partition suitable as an EFI boot partition? - * Checks for filesystem type (FAT32) and size (300MiB at least). + * Checks for filesystem type (FAT32). */ -bool isEfiFilesystemSuitable( const Partition* candidate ); +bool isEfiFilesystemSuitableType( const Partition* candidate ); + +/** + * @brief Is the @p partition suitable as an EFI boot partition? + * Checks for filesystem size (300MiB, see efiFilesystemMinimumSize). + */ +bool isEfiFilesystemSuitableSize( const Partition* candidate ); + +/** @brief Returns the minimum size of an EFI boot partition. + * + * This is determined as 300MiB, based on the FAT32 standard + * and EFI documentation (and not a little discussion in Calamares + * issues about what works, what is effective, and what is mandated + * by the standard and how all of those are different). + */ +size_t efiFilesystemMinimumSize(); /** * @brief Is the given @p partition bootable in EFI? Depending on diff --git a/src/modules/partition/core/PartitionLayout.cpp b/src/modules/partition/core/PartitionLayout.cpp index 233f5117a..8ae904e92 100644 --- a/src/modules/partition/core/PartitionLayout.cpp +++ b/src/modules/partition/core/PartitionLayout.cpp @@ -138,61 +138,63 @@ PartitionLayout::init( FileSystem::Type defaultFsType, const QVariantList& confi } void -PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) +PartitionLayout::setDefaultFsType( FileSystem::Type defaultFsType ) { using FileSystem = FileSystem::Type; switch ( defaultFsType ) { - case FileSystem::Unknown: - case FileSystem::Unformatted: - case FileSystem::Extended: - case FileSystem::LinuxSwap: - case FileSystem::Luks: - case FileSystem::Ocfs2: - case FileSystem::Lvm2_PV: - case FileSystem::Udf: - case FileSystem::Iso9660: + case FileSystem::Unknown: + case FileSystem::Unformatted: + case FileSystem::Extended: + case FileSystem::LinuxSwap: + case FileSystem::Luks: + case FileSystem::Ocfs2: + case FileSystem::Lvm2_PV: + case FileSystem::Udf: + case FileSystem::Iso9660: #ifdef WITH_KPMCORE4API - case FileSystem::Luks2: - case FileSystem::LinuxRaidMember: - case FileSystem::BitLocker: + case FileSystem::Luks2: + case FileSystem::LinuxRaidMember: + case FileSystem::BitLocker: #endif - // bad bad - cWarning() << "The selected default FS" << defaultFsType << "is not suitable." << "Using ext4 instead."; - defaultFsType = FileSystem::Ext4; - break; - case FileSystem::Ext2: - case FileSystem::Ext3: - case FileSystem::Ext4: - case FileSystem::Fat32: - case FileSystem::Ntfs: - case FileSystem::Reiser4: - case FileSystem::ReiserFS: - case FileSystem::Xfs: - case FileSystem::Jfs: - case FileSystem::Btrfs: - case FileSystem::Exfat: - case FileSystem::F2fs: - // ok - break; - case FileSystem::Fat16: - case FileSystem::Hfs: - case FileSystem::HfsPlus: - case FileSystem::Ufs: - case FileSystem::Hpfs: - case FileSystem::Zfs: - case FileSystem::Nilfs2: + // bad bad + cWarning() << "The selected default FS" << defaultFsType << "is not suitable." + << "Using ext4 instead."; + defaultFsType = FileSystem::Ext4; + break; + case FileSystem::Ext2: + case FileSystem::Ext3: + case FileSystem::Ext4: + case FileSystem::Fat32: + case FileSystem::Ntfs: + case FileSystem::Reiser4: + case FileSystem::ReiserFS: + case FileSystem::Xfs: + case FileSystem::Jfs: + case FileSystem::Btrfs: + case FileSystem::Exfat: + case FileSystem::F2fs: + // ok + break; + case FileSystem::Fat16: + case FileSystem::Hfs: + case FileSystem::HfsPlus: + case FileSystem::Ufs: + case FileSystem::Hpfs: + case FileSystem::Zfs: + case FileSystem::Nilfs2: #ifdef WITH_KPMCORE4API - case FileSystem::Fat12: - case FileSystem::Apfs: - case FileSystem::Minix: + case FileSystem::Fat12: + case FileSystem::Apfs: + case FileSystem::Minix: #endif - // weird - cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; - break; - default: - cWarning() << "The selected default FS" << defaultFsType << "is not known to Calamares." << "Using ext4 instead."; - defaultFsType = FileSystem::Ext4; + // weird + cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; + break; + default: + cWarning() << "The selected default FS" << defaultFsType << "is not known to Calamares." + << "Using ext4 instead."; + defaultFsType = FileSystem::Ext4; } m_defaultFsType = defaultFsType; @@ -278,7 +280,7 @@ PartitionLayout::createPartitions( Device* dev, } } - auto correctFS = [d=m_defaultFsType]( FileSystem::Type t ) { return t == FileSystem::Type::Unknown ? d : t; }; + auto correctFS = [d = m_defaultFsType]( FileSystem::Type t ) { return t == FileSystem::Type::Unknown ? d : t; }; // Create the partitions. currentSector = firstSector; diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index 8444b9ddb..d22f6f01d 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -125,8 +125,8 @@ PartitionPage::~PartitionPage() {} void PartitionPage::updateButtons() { - bool create = false, createTable = false, edit = false, del = false, currentDeviceIsVG = false, - isDeactivable = false; + bool allow_create = false, allow_create_table = false, allow_edit = false, allow_delete = false; + bool currentDeviceIsVG = false, isDeactivable = false; bool isRemovable = false, isVGdeactivated = false; QModelIndex index = m_ui->partitionTreeView->currentIndex(); @@ -136,12 +136,21 @@ PartitionPage::updateButtons() Q_ASSERT( model ); Partition* partition = model->partitionForIndex( index ); Q_ASSERT( partition ); - bool isFree = CalamaresUtils::Partition::isPartitionFreeSpace( partition ); - bool isExtended = partition->roles().has( PartitionRole::Extended ); + const bool isFree = CalamaresUtils::Partition::isPartitionFreeSpace( partition ); + const bool isExtended = partition->roles().has( PartitionRole::Extended ); - bool isInVG = m_core->isInVG( partition ); + // An extended partition can have a "free space" child; that one does + // not count as a real child. If there are more children, at least one + // is a real one and we should not allow the extended partition to be + // deleted. + const bool hasChildren = isExtended + && ( partition->children().length() > 1 + || ( partition->children().length() == 1 + && !CalamaresUtils::Partition::isPartitionFreeSpace( partition->children().at( 0 ) ) ) ); - create = isFree; + const bool isInVG = m_core->isInVG( partition ); + + allow_create = isFree; // Keep it simple for now: do not support editing extended partitions as // it does not work with our current edit implementation which is @@ -150,8 +159,8 @@ PartitionPage::updateButtons() // inside them, so an edit must be applied without altering the job // order. // TODO: See if LVM PVs can be edited in Calamares - edit = !isFree && !isExtended; - del = !isFree && !isInVG; + allow_edit = !isFree && !isExtended; + allow_delete = !isFree && !isInVG && !hasChildren; } if ( m_ui->deviceComboBox->currentIndex() >= 0 ) @@ -168,14 +177,14 @@ PartitionPage::updateButtons() } else if ( device->type() != Device::Type::LVM_Device ) { - createTable = true; + allow_create_table = true; #ifdef WITH_KPMCORE4API if ( device->type() == Device::Type::SoftwareRAID_Device && static_cast< SoftwareRAID* >( device )->status() == SoftwareRAID::Status::Inactive ) { - createTable = false; - create = false; + allow_create_table = false; + allow_create = false; } #endif } @@ -197,10 +206,10 @@ PartitionPage::updateButtons() } } - m_ui->createButton->setEnabled( create ); - m_ui->editButton->setEnabled( edit ); - m_ui->deleteButton->setEnabled( del ); - m_ui->newPartitionTableButton->setEnabled( createTable ); + m_ui->createButton->setEnabled( allow_create ); + m_ui->editButton->setEnabled( allow_edit ); + m_ui->deleteButton->setEnabled( allow_delete ); + m_ui->newPartitionTableButton->setEnabled( allow_create_table ); m_ui->resizeVolumeGroupButton->setEnabled( currentDeviceIsVG && !isVGdeactivated ); m_ui->deactivateVolumeGroupButton->setEnabled( currentDeviceIsVG && isDeactivable && !isVGdeactivated ); m_ui->removeVolumeGroupButton->setEnabled( currentDeviceIsVG && isRemovable ); diff --git a/src/modules/partition/tests/CMakeLists.txt b/src/modules/partition/tests/CMakeLists.txt index 8edef484c..2839270fb 100644 --- a/src/modules/partition/tests/CMakeLists.txt +++ b/src/modules/partition/tests/CMakeLists.txt @@ -15,7 +15,7 @@ include_directories( ) calamares_add_test( - partitionjobtests + partitionjobtest SOURCES PartitionJobTests.cpp ${PartitionModule_SOURCE_DIR}/core/KPMHelpers.cpp @@ -31,7 +31,7 @@ calamares_add_test( ) calamares_add_test( - clearmountsjobtests + partitionclearmountsjobtest SOURCES ${PartitionModule_SOURCE_DIR}/jobs/ClearMountsJob.cpp ClearMountsJobTests.cpp @@ -42,27 +42,32 @@ calamares_add_test( calamares_add_test( - createlayoutstests + partitioncreatelayoutstest SOURCES + CreateLayoutsTests.cpp ${PartitionModule_SOURCE_DIR}/core/KPMHelpers.cpp ${PartitionModule_SOURCE_DIR}/core/PartitionInfo.cpp ${PartitionModule_SOURCE_DIR}/core/PartitionLayout.cpp ${PartitionModule_SOURCE_DIR}/core/PartUtils.cpp ${PartitionModule_SOURCE_DIR}/core/DeviceModel.cpp - CreateLayoutsTests.cpp LIBRARIES kpmcore - calamares - calamaresui - Qt5::Gui + Calamares::calamaresui DEFINITIONS ${_partition_defs} ) calamares_add_test( - automounttests + partitionautomounttest SOURCES ${PartitionModule_SOURCE_DIR}/jobs/AutoMountManagementJob.cpp AutoMountTests.cpp - LIBRARIES - calamares +) + +calamares_add_test( + partitiondevicestest + SOURCES + DevicesTests.cpp + ${PartitionModule_SOURCE_DIR}/core/DeviceList.cpp + LIBRARIES + kpmcore ) diff --git a/src/modules/partition/tests/DevicesTests.cpp b/src/modules/partition/tests/DevicesTests.cpp new file mode 100644 index 000000000..c63d7476d --- /dev/null +++ b/src/modules/partition/tests/DevicesTests.cpp @@ -0,0 +1,90 @@ +/* === 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 "core/DeviceList.h" + +#include "partition/KPMManager.h" +#include "utils/Logger.h" + +#include +#include + +#include +#include + +#include + +#include + +class DevicesTests : public QObject +{ + Q_OBJECT + +public: + DevicesTests(); + +private Q_SLOTS: + void testKPMScanDevices(); + void testPartUtilScanDevices(); + +private: + std::unique_ptr< CalamaresUtils::Partition::KPMManager > m_d; + bool m_isRoot = false; +}; + +DevicesTests::DevicesTests() + : m_d( std::make_unique< CalamaresUtils::Partition::KPMManager >() ) + , m_isRoot( geteuid() == 0 ) +{ +} + +void +DevicesTests::testKPMScanDevices() +{ + Logger::setupLogLevel( Logger::LOGVERBOSE ); + + cDebug() << "Getting devices via KPMCore"; + CoreBackend* backend = CoreBackendManager::self()->backend(); + QVERIFY( backend ); +#if defined( WITH_KPMCORE4API ) + auto flags = ScanFlag( ~0 ); +#else + auto flags = true; +#endif + auto devices = backend->scanDevices( flags ); // These flags try to get "all" + cDebug() << Logger::SubEntry << "Done getting devices."; + + if ( !m_isRoot ) + { + QEXPECT_FAIL( "", "Test invalid when not root", Continue ); + } + QVERIFY( devices.count() > 0 ); +} + +void +DevicesTests::testPartUtilScanDevices() +{ + Logger::setupLogLevel( Logger::LOGVERBOSE ); + + cDebug() << "Getting devices via PartUtils"; + auto devices = PartUtils::getDevices(); + cDebug() << Logger::SubEntry << "Done getting devices."; + + if ( !m_isRoot ) + { + QEXPECT_FAIL( "", "Test invalid when not root", Continue ); + } + QVERIFY( devices.count() > 0 ); +} + +QTEST_GUILESS_MAIN( DevicesTests ) + +#include "utils/moc-warnings.h" + +#include "DevicesTests.moc" diff --git a/src/modules/shellprocess/Tests.cpp b/src/modules/shellprocess/Tests.cpp index 77368db48..c1489c1ab 100644 --- a/src/modules/shellprocess/Tests.cpp +++ b/src/modules/shellprocess/Tests.cpp @@ -42,16 +42,11 @@ ShellProcessTests::testProcessListSampleConfig() { YAML::Node doc; - QStringList dirs { "src/modules/shellprocess", "." }; - for ( const auto& dir : dirs ) - { - QString filename = dir + "/shellprocess.conf"; - if ( QFileInfo::exists( filename ) ) - { - doc = YAML::LoadFile( filename.toStdString() ); - break; - } - } + QString filename = QStringLiteral( "shellprocess.conf" ); + QFile fi( QString( "%1/%2" ).arg( BUILD_AS_TEST, filename ) ); + + QVERIFY( fi.exists() ); + doc = YAML::LoadFile( fi.fileName().toStdString() ); CommandList cl( CalamaresUtils::yamlMapToVariant( doc ).value( "script" ) ); QVERIFY( !cl.isEmpty() ); diff --git a/src/modules/summary/CMakeLists.txt b/src/modules/summary/CMakeLists.txt index 2c30dc31a..e3c1a381c 100644 --- a/src/modules/summary/CMakeLists.txt +++ b/src/modules/summary/CMakeLists.txt @@ -8,8 +8,9 @@ calamares_add_plugin( summary TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES - SummaryViewStep.cpp + Config.cpp SummaryPage.cpp + SummaryViewStep.cpp UI SHARED_LIB NO_CONFIG diff --git a/src/modules/summary/Config.cpp b/src/modules/summary/Config.cpp new file mode 100644 index 000000000..5110e09a6 --- /dev/null +++ b/src/modules/summary/Config.cpp @@ -0,0 +1,127 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2020, Camilo Higuita + * SPDX-FileCopyrightText: 2021 Anke Boersma + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "Config.h" + +#include "Branding.h" +#include "Settings.h" +#include "ViewManager.h" +#include "utils/CalamaresUtilsGui.h" +#include "utils/Logger.h" +#include "utils/Retranslator.h" +#include "viewpages/ExecutionViewStep.h" + +SummaryModel::SummaryModel( QObject* parent ) + : QAbstractListModel( parent ) +{ +} + +QHash< int, QByteArray > +SummaryModel::roleNames() const +{ + return { { Qt::DisplayRole, "title" }, { Qt::UserRole, "message" } }; +} + +QVariant +SummaryModel::data( const QModelIndex& index, int role ) const +{ + if ( !index.isValid() ) + { + return QVariant(); + } + const auto item = m_summary.at( index.row() ); + return role == Qt::DisplayRole ? item.title : item.message; +} + +int +SummaryModel::rowCount( const QModelIndex& ) const +{ + return m_summary.count(); +} + +void +SummaryModel::setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets ) +{ + Q_EMIT beginResetModel(); + m_summary.clear(); + + for ( Calamares::ViewStep* step : steps ) + { + QString text = step->prettyStatus(); + QWidget* widget = withWidgets ? step->createSummaryWidget() : nullptr; + + if ( text.isEmpty() && !widget ) + { + continue; + } + + m_summary << StepSummary { step->prettyName(), text, widget }; + } + Q_EMIT endResetModel(); +} + +Config::Config( QObject* parent ) + : QObject( parent ) + , m_summary( new SummaryModel( this ) ) + +{ + CALAMARES_RETRANSLATE_SLOT( &Config::retranslate ); + retranslate(); +} + +void +Config::retranslate() +{ + m_title = tr( "Summary" ); + + if ( Calamares::Settings::instance()->isSetupMode() ) + { + m_message = tr( "This is an overview of what will happen once you start " + "the setup procedure." ); + } + else + { + m_message = tr( "This is an overview of what will happen once you start " + "the install procedure." ); + } + Q_EMIT titleChanged( m_title ); + Q_EMIT messageChanged( m_message ); +} + +void +Config::collectSummaries( const Calamares::ViewStep* upToHere ) +{ + Calamares::ViewStepList steps; + for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() ) + { + // *Assume* that if there's an exec step in the sequence, + // we don't need a summary for steps before it. This works in + // practice if there's a summary step before each exec -- + // and in practice, there's only one of each. + if ( qobject_cast< Calamares::ExecutionViewStep* >( step ) ) + { + steps.clear(); + continue; + } + + // Having reached the parent view-step of the Config object, + // we know we're providing a summary of steps up until this + // view step, so we now have steps since the previous exec, up + // to this summary. + if ( upToHere == step ) + { + break; + } + + steps.append( step ); + } + + m_summary->setSummaryList( steps ); +} diff --git a/src/modules/summary/Config.h b/src/modules/summary/Config.h new file mode 100644 index 000000000..15604d933 --- /dev/null +++ b/src/modules/summary/Config.h @@ -0,0 +1,96 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019-2020, Adriaan de Groot + * SPDX-FileCopyrightText: 2020, Camilo Higuita + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef SUMMARY_CONFIG_H +#define SUMMARY_CONFIG_H + +#include "viewpages/ViewStep.h" + +#include +#include +#include + +class Config; + +/** @brief Data for one step + * + * A step generally has a text description, but **may** have a + * QWidget. There is no ownership of the QWidget, that is assumed + * to be handed off to some owning parent-widget. + */ +struct StepSummary +{ + QString title; + QString message; + QWidget* widget = nullptr; +}; + +class SummaryModel : public QAbstractListModel +{ + Q_OBJECT + friend class Config; + +public: + explicit SummaryModel( QObject* parent = nullptr ); + int rowCount( const QModelIndex& = QModelIndex() ) const override; + QVariant data( const QModelIndex& index, int role ) const override; + +protected: + QHash< int, QByteArray > roleNames() const override; + +private: + /** @brief Sets the model data from @p steps + * + * Replaces the list of summaries with summaries given by + * the jobs and ViewSteps objects in @p steps. If @p withWidgets + * is @c true, then also queries for widget summaries alongside + * the text summaries for each step. + */ + void setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets = false ); + + QVector< StepSummary > m_summary; +}; + +class Config : public QObject +{ + Q_OBJECT + + ///@brief Name of this summary (generally, "Summary") + Q_PROPERTY( QString title READ title NOTIFY titleChanged ) + ///@brief Description of what the summary means + Q_PROPERTY( QString message READ message NOTIFY messageChanged ) + + Q_PROPERTY( QAbstractListModel* summaryModel READ summaryModel CONSTANT FINAL ) + +public: + explicit Config( QObject* parent = nullptr ); + + ///@brief Called later, to load the model once all viewsteps are there + void collectSummaries( const Calamares::ViewStep* upToHere ); + + QAbstractListModel* summaryModel() const { return m_summary; } + + QString title() const { return m_title; } + QString message() const { return m_message; } + +private: + Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const; + void retranslate(); + + SummaryModel* m_summary; + + QString m_title; + QString m_message; + +Q_SIGNALS: + void titleChanged( QString title ); + void messageChanged( QString message ); +}; +#endif diff --git a/src/modules/summary/SummaryPage.cpp b/src/modules/summary/SummaryPage.cpp index b56793e7e..8abfb8804 100644 --- a/src/modules/summary/SummaryPage.cpp +++ b/src/modules/summary/SummaryPage.cpp @@ -29,7 +29,7 @@ static const int SECTION_SPACING = 12; -SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent ) +SummaryPage::SummaryPage( Config* config, const SummaryViewStep* thisViewStep, QWidget* parent ) : QWidget() , m_thisViewStep( thisViewStep ) , m_contentWidget( nullptr ) @@ -37,6 +37,7 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent ) { Q_UNUSED( parent ) + this->setObjectName( "summaryStep" ); Q_ASSERT( m_thisViewStep ); @@ -45,11 +46,8 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent ) QLabel* headerLabel = new QLabel( this ); headerLabel->setObjectName( "summaryTitle" ); - CALAMARES_RETRANSLATE( if ( Calamares::Settings::instance()->isSetupMode() ) - 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." ) ); ); + headerLabel->setText( config->message() ); + connect( config, &Config::messageChanged, headerLabel, &QLabel::setText ); layout->addWidget( headerLabel ); layout->addWidget( m_scrollArea ); m_scrollArea->setWidgetResizable( true ); @@ -63,12 +61,45 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent ) } +static QLabel* +createTitleLabel( const QString& text, const QFont& titleFont ) +{ + QLabel* label = new QLabel( text ); + label->setObjectName( "summaryItemTitle" ); + label->setFont( titleFont ); + label->setContentsMargins( 0, 0, 0, 0 ); + + return label; +} + +static QLabel* +createBodyLabel( const QString& text, const QPalette& bodyPalette ) +{ + QLabel* label = new QLabel; + label->setObjectName( "summaryItemBody" ); + label->setMargin( CalamaresUtils::defaultFontHeight() / 2 ); + label->setAutoFillBackground( true ); + label->setPalette( bodyPalette ); + label->setText( text ); + return label; +} + // Adds a widget for those ViewSteps that want a summary; // see SummaryPage documentation and also ViewStep docs. void SummaryPage::onActivate() { - createContentWidget(); + delete m_contentWidget; // It might have been created previously + m_contentWidget = new QWidget; + m_layout = new QVBoxLayout( m_contentWidget ); + CalamaresUtils::unmarginLayout( m_layout ); + + QFont titleFont = font(); + titleFont.setWeight( QFont::Light ); + titleFont.setPointSize( CalamaresUtils::defaultFontSize() * 2 ); + + QPalette bodyPalette( palette() ); + bodyPalette.setColor( WindowBackground, palette().window().color().lighter( 108 ) ); bool first = true; const Calamares::ViewStepList steps = stepsForSummary( Calamares::ViewManager::instance()->viewSteps() ); @@ -92,7 +123,7 @@ SummaryPage::onActivate() m_layout->addSpacing( SECTION_SPACING ); } - m_layout->addWidget( createTitleLabel( step->prettyName() ) ); + m_layout->addWidget( createTitleLabel( step->prettyName(), titleFont ) ); QHBoxLayout* itemBodyLayout = new QHBoxLayout; m_layout->addSpacing( CalamaresUtils::defaultFontHeight() / 2 ); m_layout->addLayout( itemBodyLayout ); @@ -102,7 +133,7 @@ SummaryPage::onActivate() CalamaresUtils::unmarginLayout( itemBodyLayout ); if ( !text.isEmpty() ) { - itemBodyCoreLayout->addWidget( createBodyLabel( text ) ); + itemBodyCoreLayout->addWidget( createBodyLabel( text, bodyPalette ) ); } if ( widget ) { @@ -156,40 +187,9 @@ SummaryPage::stepsForSummary( const Calamares::ViewStepList& allSteps ) const return steps; } - void -SummaryPage::createContentWidget() +SummaryPage::onLeave() { delete m_contentWidget; - m_contentWidget = new QWidget; - m_layout = new QVBoxLayout( m_contentWidget ); - CalamaresUtils::unmarginLayout( m_layout ); -} - -QLabel* -SummaryPage::createTitleLabel( const QString& text ) const -{ - QLabel* label = new QLabel( text ); - label->setObjectName( "summaryItemTitle" ); - QFont fnt = font(); - fnt.setWeight( QFont::Light ); - fnt.setPointSize( CalamaresUtils::defaultFontSize() * 2 ); - label->setFont( fnt ); - label->setContentsMargins( 0, 0, 0, 0 ); - - return label; -} - -QLabel* -SummaryPage::createBodyLabel( const QString& text ) const -{ - QLabel* label = new QLabel; - label->setObjectName( "summaryItemBody" ); - label->setMargin( CalamaresUtils::defaultFontHeight() / 2 ); - QPalette pal( palette() ); - pal.setColor( WindowBackground, palette().window().color().lighter( 108 ) ); - label->setAutoFillBackground( true ); - label->setPalette( pal ); - label->setText( text ); - return label; + m_contentWidget = nullptr; } diff --git a/src/modules/summary/SummaryPage.h b/src/modules/summary/SummaryPage.h index 1adb67017..7d98cc711 100644 --- a/src/modules/summary/SummaryPage.h +++ b/src/modules/summary/SummaryPage.h @@ -14,10 +14,13 @@ #include +class Config; +class SummaryViewStep; + class QLabel; class QScrollArea; class QVBoxLayout; -class SummaryViewStep; + /** @brief Provide a summary view with to-be-done action descriptions. * @@ -42,10 +45,12 @@ class SummaryPage : public QWidget { Q_OBJECT public: - explicit SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent = nullptr ); + explicit SummaryPage( Config* config, const SummaryViewStep* thisViewStep, QWidget* parent = nullptr ); + /// @brief Create contents showing all of the summary void onActivate(); - void createContentWidget(); + /// @brief Clean up the widgets + void onLeave(); private: Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const; @@ -55,9 +60,6 @@ private: QVBoxLayout* m_layout = nullptr; QWidget* m_contentWidget = nullptr; - QLabel* createTitleLabel( const QString& text ) const; - QLabel* createBodyLabel( const QString& text ) const; - QScrollArea* m_scrollArea; }; diff --git a/src/modules/summary/SummaryViewStep.cpp b/src/modules/summary/SummaryViewStep.cpp index c5b6841ed..d4e439ae3 100644 --- a/src/modules/summary/SummaryViewStep.cpp +++ b/src/modules/summary/SummaryViewStep.cpp @@ -15,7 +15,8 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( SummaryViewStepFactory, registerPlugin< Sum SummaryViewStep::SummaryViewStep( QObject* parent ) : Calamares::ViewStep( parent ) - , m_widget( new SummaryPage( this ) ) + , m_config( new Config( this ) ) + , m_widget( new SummaryPage( m_config, this ) ) { emit nextStatusChanged( true ); } @@ -27,13 +28,14 @@ SummaryViewStep::~SummaryViewStep() { m_widget->deleteLater(); } + delete m_config; } QString SummaryViewStep::prettyName() const { - return tr( "Summary" ); + return m_config->title(); } @@ -72,16 +74,17 @@ SummaryViewStep::isAtEnd() const } -QList< Calamares::job_ptr > +Calamares::JobList SummaryViewStep::jobs() const { - return QList< Calamares::job_ptr >(); + return {}; } void SummaryViewStep::onActivate() { + m_config->collectSummaries( this ); m_widget->onActivate(); } @@ -89,5 +92,5 @@ SummaryViewStep::onActivate() void SummaryViewStep::onLeave() { - m_widget->createContentWidget(); + m_widget->onLeave(); } diff --git a/src/modules/summary/SummaryViewStep.h b/src/modules/summary/SummaryViewStep.h index c89efc42f..e2ee0566e 100644 --- a/src/modules/summary/SummaryViewStep.h +++ b/src/modules/summary/SummaryViewStep.h @@ -10,12 +10,11 @@ #ifndef SUMMARYPAGEPLUGIN_H #define SUMMARYPAGEPLUGIN_H -#include - -#include "utils/PluginFactory.h" -#include "viewpages/ViewStep.h" +#include "Config.h" #include "DllMacro.h" +#include "utils/PluginFactory.h" +#include "viewpages/ViewStep.h" class SummaryPage; @@ -37,13 +36,14 @@ public: bool isAtBeginning() const override; bool isAtEnd() const override; - QList< Calamares::job_ptr > jobs() const override; + Calamares::JobList jobs() const override; void onActivate() override; void onLeave() override; private: - SummaryPage* m_widget; + Config* m_config = nullptr; + SummaryPage* m_widget = nullptr; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( SummaryViewStepFactory ) diff --git a/src/modules/summaryq/CMakeLists.txt b/src/modules/summaryq/CMakeLists.txt new file mode 100644 index 000000000..8aac1bc2f --- /dev/null +++ b/src/modules/summaryq/CMakeLists.txt @@ -0,0 +1,26 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2021 Anke Boersma +# SPDX-License-Identifier: BSD-2-Clause +# +if( NOT WITH_QML ) + calamares_skip_module( "summaryq (QML is not supported in this build)" ) + return() +endif() + +set( _summary ${CMAKE_CURRENT_SOURCE_DIR}/../summary ) +include_directories( ${_summary} ) + +calamares_add_plugin( summaryq + TYPE viewmodule + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + SummaryQmlViewStep.cpp + ${_summary}/Config.cpp + UI + RESOURCES + summaryq.qrc + LINK_PRIVATE_LIBRARIES + calamaresui + SHARED_LIB +) diff --git a/src/modules/summaryq/SummaryQmlViewStep.cpp b/src/modules/summaryq/SummaryQmlViewStep.cpp new file mode 100644 index 000000000..23e18a861 --- /dev/null +++ b/src/modules/summaryq/SummaryQmlViewStep.cpp @@ -0,0 +1,73 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2014-2015, Teo Mrnjavac + * SPDX-FileCopyrightText: 2020, Camilo Higuita + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "SummaryQmlViewStep.h" + +CALAMARES_PLUGIN_FACTORY_DEFINITION( SummaryQmlViewStepFactory, registerPlugin< SummaryQmlViewStep >(); ) + +SummaryQmlViewStep::SummaryQmlViewStep( QObject* parent ) + : Calamares::QmlViewStep( parent ) + , m_config( new Config( this ) ) +{ + emit nextStatusChanged( true ); +} + + +SummaryQmlViewStep::~SummaryQmlViewStep() {} + +QString +SummaryQmlViewStep::prettyName() const +{ + return m_config->title(); +} + + +bool +SummaryQmlViewStep::isNextEnabled() const +{ + return true; +} + + +bool +SummaryQmlViewStep::isBackEnabled() const +{ + return true; +} + + +bool +SummaryQmlViewStep::isAtBeginning() const +{ + return true; +} + + +bool +SummaryQmlViewStep::isAtEnd() const +{ + return true; +} + + +Calamares::JobList +SummaryQmlViewStep::jobs() const +{ + return {}; +} + + +void +SummaryQmlViewStep::onActivate() +{ + // Collect the steps before this one: those need to have their + // summary (text or widget) displayed. + m_config->collectSummaries( this ); +} diff --git a/src/modules/summaryq/SummaryQmlViewStep.h b/src/modules/summaryq/SummaryQmlViewStep.h new file mode 100644 index 000000000..8668d0afe --- /dev/null +++ b/src/modules/summaryq/SummaryQmlViewStep.h @@ -0,0 +1,49 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2014-2015, Teo Mrnjavac + * SPDX-FileCopyrightText: 2020, Camilo Higuita + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef SUMMARYQMLVIEWSTEP_H +#define SUMMARYQMLVIEWSTEP_H + +#include "Config.h" + +#include "DllMacro.h" +#include "utils/PluginFactory.h" +#include "viewpages/QmlViewStep.h" + +class PLUGINDLLEXPORT SummaryQmlViewStep : public Calamares::QmlViewStep +{ + Q_OBJECT + +public: + explicit SummaryQmlViewStep( QObject* parent = nullptr ); + virtual ~SummaryQmlViewStep() override; + + QString prettyName() const override; + + + bool isNextEnabled() const override; + bool isBackEnabled() const override; + + bool isAtBeginning() const override; + bool isAtEnd() const override; + + Calamares::JobList jobs() const override; + + void onActivate() override; + + QObject* getConfig() override { return m_config; } + +private: + Config* m_config; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( SummaryQmlViewStepFactory ) + +#endif // SUMMARYQMLVIEWSTEP_H diff --git a/src/modules/summaryq/img/keyboard.svg b/src/modules/summaryq/img/keyboard.svg new file mode 100644 index 000000000..6227b788b --- /dev/null +++ b/src/modules/summaryq/img/keyboard.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/summaryq/img/keyboard.svg.license b/src/modules/summaryq/img/keyboard.svg.license new file mode 100644 index 000000000..e59dc6f9c --- /dev/null +++ b/src/modules/summaryq/img/keyboard.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2021 KDE Visual Design Group +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/modules/summaryq/img/lokalize.svg b/src/modules/summaryq/img/lokalize.svg new file mode 100644 index 000000000..83a7c9dcf --- /dev/null +++ b/src/modules/summaryq/img/lokalize.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/summaryq/img/lokalize.svg.license b/src/modules/summaryq/img/lokalize.svg.license new file mode 100644 index 000000000..e59dc6f9c --- /dev/null +++ b/src/modules/summaryq/img/lokalize.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2021 KDE Visual Design Group +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/src/modules/summaryq/summaryq.qml b/src/modules/summaryq/summaryq.qml new file mode 100644 index 000000000..626a42c40 --- /dev/null +++ b/src/modules/summaryq/summaryq.qml @@ -0,0 +1,112 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Anke Boersma + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +import io.calamares.core 1.0 +import io.calamares.ui 1.0 + +import QtQuick 2.15 +import QtQuick.Controls 2.13 +import QtQuick.Layouts 1.3 +import org.kde.kirigami 2.7 as Kirigami +import QtGraphicalEffects 1.0 +import QtQuick.Window 2.3 + +Kirigami.ScrollablePage { + width: 860 //parent.width //860 + height: 640 //parent.height //640 + + Kirigami.Theme.backgroundColor: "#EFF0F1" + Kirigami.Theme.textColor: "#1F1F1F" + + header: Kirigami.Heading { + Layout.fillWidth: true + height: 100 + horizontalAlignment: Qt.AlignHCenter + color: Kirigami.Theme.textColor + font.weight: Font.Medium + font.pointSize: 12 + text: config.message + + } + + RowLayout { + width: parent.width + + Component { + id: _delegate + + Rectangle { + id: rect + border.color: "#BDC3C7" + width: parent.width - 80 + implicitHeight: message.implicitHeight + title.implicitHeight + 20 + anchors.horizontalCenter: parent.horizontalCenter + + Item { + width: parent.width - 80 + implicitHeight: message.implicitHeight + title.implicitHeight + 20 + + Kirigami.FormLayout { + + GridLayout { + anchors { + //left: parent.left + top: parent.top + right: parent.right + } + rowSpacing: Kirigami.Units.largeSpacing + columnSpacing: Kirigami.Units.largeSpacing + columns: width > Kirigami.Units.gridUnit * 20 ? 4 : 2 + + Image { + id: image + Layout.maximumHeight: Kirigami.Units.iconSizes.huge + Layout.preferredWidth: height + Layout.alignment: Qt.AlignTop + fillMode: Image.PreserveAspectFit + source: index === 0 ? "img/lokalize.svg" + : ( index === 1 ? "img/keyboard.svg" + : ( index === 2 ? "qrc:/data/images/partition-manual.svg" + : "qrc:/data/images/partition-partition.svg" ) ) + } + ColumnLayout { + + Label { + id: title + Layout.fillWidth: true + wrapMode: Text.WordWrap + text: model.title + font.weight: Font.Medium + font.pointSize: 16 + } + Rectangle { + height: 2 + width: 200 + border.color: "#BDC3C7" + } + Label { + id: message + Layout.fillWidth: true + text: model.message + } + } + } + } + } + } + } + } + + ListView { + anchors.fill: parent + spacing: 20 + model: config.summaryModel + delegate: _delegate + } +} diff --git a/src/modules/summaryq/summaryq.qrc b/src/modules/summaryq/summaryq.qrc new file mode 100644 index 000000000..62bfe7899 --- /dev/null +++ b/src/modules/summaryq/summaryq.qrc @@ -0,0 +1,7 @@ + + + summaryq.qml + img/keyboard.svg + img/lokalize.svg + + diff --git a/src/modules/welcome/CMakeLists.txt b/src/modules/welcome/CMakeLists.txt index 924062652..01a89703a 100644 --- a/src/modules/welcome/CMakeLists.txt +++ b/src/modules/welcome/CMakeLists.txt @@ -8,26 +8,22 @@ find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network ) find_package( LIBPARTED ) if ( LIBPARTED_FOUND ) set( PARTMAN_SRC checker/partman_devices.c ) - set( CHECKER_LINK_LIBRARIES ${LIBPARTED_LIBRARY} ) + set( PARTMAN_LIB ${LIBPARTED_LIBRARY} ) else() set( PARTMAN_SRC ) - set( CHECKER_LINK_LIBRARIES ) + set( PARTMAN_LIB ) add_definitions( -DWITHOUT_LIBPARTED ) endif() -set( CHECKER_SOURCES - checker/CheckerContainer.cpp - checker/GeneralRequirements.cpp - checker/ResultWidget.cpp - checker/ResultsListWidget.cpp - ${PARTMAN_SRC} -) - calamares_add_plugin( welcome TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES - ${CHECKER_SOURCES} + checker/CheckerContainer.cpp + checker/GeneralRequirements.cpp + checker/ResultWidget.cpp + checker/ResultsListWidget.cpp + ${PARTMAN_SRC} WelcomeViewStep.cpp Config.cpp Config.h @@ -37,8 +33,23 @@ calamares_add_plugin( welcome RESOURCES welcome.qrc LINK_PRIVATE_LIBRARIES - ${CHECKER_LINK_LIBRARIES} + ${PARTMAN_LIB} Qt5::DBus Qt5::Network SHARED_LIB ) + +calamares_add_test( + welcometest + SOURCES + checker/GeneralRequirements.cpp + ${PARTMAN_SRC} + Config.cpp + Tests.cpp + LIBRARIES + ${PARTMAN_LIB} + Qt5::DBus + Qt5::Network + Qt5::Widgets + Calamares::calamaresui +) diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 48e92e628..b2a49552b 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -27,6 +27,7 @@ Config::Config( QObject* parent ) : QObject( parent ) , m_languages( CalamaresUtils::Locale::availableTranslations() ) , m_filtermodel( std::make_unique< QSortFilterProxyModel >() ) + , m_requirementsChecker( std::make_unique< GeneralRequirements >( this ) ) { initLanguages(); @@ -38,14 +39,16 @@ Config::Config( QObject* parent ) void Config::retranslate() { - m_genericWelcomeMessage = genericWelcomeMessage().arg( Calamares::Branding::instance()->versionedName() ); + const auto* branding = Calamares::Branding::instance(); + const auto* settings = Calamares::Settings::instance(); + m_genericWelcomeMessage = genericWelcomeMessage().arg( branding ? branding->versionedName() : QString() ); emit genericWelcomeMessageChanged( m_genericWelcomeMessage ); const auto* r = requirementsModel(); - if ( !r->satisfiedRequirements() ) + if ( r && !r->satisfiedRequirements() ) { QString message; - const bool setup = Calamares::Settings::instance()->isSetupMode(); + const bool setup = settings ? settings->isSetupMode() : false; if ( !r->satisfiedMandatory() ) { @@ -70,13 +73,13 @@ Config::retranslate() "might be disabled." ); } - m_warningMessage = message.arg( Calamares::Branding::instance()->shortVersionedName() ); + m_warningMessage = message.arg( branding ? branding->shortVersionedName() : QString() ); } else { m_warningMessage = tr( "This program will ask you some questions and " "set up %2 on your computer." ) - .arg( Calamares::Branding::instance()->productName() ); + .arg( branding ? branding->productName() : QString() ); } emit warningMessageChanged( m_warningMessage ); @@ -91,7 +94,8 @@ Config::languagesModel() const Calamares::RequirementsModel* Config::requirementsModel() const { - return Calamares::ModuleManager::instance()->requirementsModel(); + auto* manager = Calamares::ModuleManager::instance(); + return manager ? manager->requirementsModel() : nullptr; } QAbstractItemModel* @@ -150,8 +154,6 @@ Config::initLanguages() { QString name = m_languages->locale( matchedLocaleIndex ).name(); cDebug() << Logger::SubEntry << "Matched with index" << matchedLocaleIndex << name; - - CalamaresUtils::installTranslator( name, Calamares::Branding::instance()->translationsDirectory() ); setLocaleIndex( matchedLocaleIndex ); } else @@ -190,7 +192,8 @@ Config::setLocaleIndex( int index ) cDebug() << "Index" << index << "Selected locale" << selectedLocale; QLocale::setDefault( selectedLocale ); - CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory() ); + const auto* branding = Calamares::Branding::instance(); + CalamaresUtils::installTranslator( selectedLocale, branding ? branding->translationsDirectory() : QString() ); if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() ) { CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(), @@ -240,17 +243,19 @@ Config::genericWelcomeMessage() const { QString message; - if ( Calamares::Settings::instance()->isSetupMode() ) + const auto* settings = Calamares::Settings::instance(); + const auto* branding = Calamares::Branding::instance(); + const bool welcomeStyle = branding ? branding->welcomeStyleCalamares() : true; + + if ( settings ? settings->isSetupMode() : false ) { - message = Calamares::Branding::instance()->welcomeStyleCalamares() - ? tr( "

Welcome to the Calamares setup program for %1

" ) - : tr( "

Welcome to %1 setup

" ); + message = welcomeStyle ? tr( "

Welcome to the Calamares setup program for %1

" ) + : tr( "

Welcome to %1 setup

" ); } else { - message = Calamares::Branding::instance()->welcomeStyleCalamares() - ? tr( "

Welcome to the Calamares installer for %1

" ) - : tr( "

Welcome to the %1 installer

" ); + message = welcomeStyle ? tr( "

Welcome to the Calamares installer for %1

" ) + : tr( "

Welcome to the %1 installer

" ); } return message; @@ -393,4 +398,15 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) ::setLanguageIcon( this, configurationMap ); ::setGeoIP( this, configurationMap ); + + if ( configurationMap.contains( "requirements" ) + && configurationMap.value( "requirements" ).type() == QVariant::Map ) + { + m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); + } + else + { + cWarning() << "no valid requirements map found in welcome " + "module configuration."; + } } diff --git a/src/modules/welcome/Config.h b/src/modules/welcome/Config.h index a3f1276a6..6cce75f22 100644 --- a/src/modules/welcome/Config.h +++ b/src/modules/welcome/Config.h @@ -10,6 +10,8 @@ #ifndef WELCOME_CONFIG_H #define WELCOME_CONFIG_H +#include "checker/GeneralRequirements.h" + #include "locale/LabelModel.h" #include "modulesystem/RequirementsModel.h" @@ -100,6 +102,9 @@ public slots: QAbstractItemModel* unsatisfiedRequirements() const; + /// @brief Check the general requirements + Calamares::RequirementsList checkRequirements() const { return m_requirementsChecker->checkRequirements(); } + signals: void countryCodeChanged( QString countryCode ); void localeIndexChanged( int localeIndex ); @@ -118,6 +123,7 @@ private: CalamaresUtils::Locale::LabelModel* m_languages = nullptr; std::unique_ptr< QSortFilterProxyModel > m_filtermodel; + std::unique_ptr< GeneralRequirements > m_requirementsChecker; QString m_languageIcon; QString m_countryCode; diff --git a/src/modules/welcome/Tests.cpp b/src/modules/welcome/Tests.cpp new file mode 100644 index 000000000..1e1d07c4b --- /dev/null +++ b/src/modules/welcome/Tests.cpp @@ -0,0 +1,167 @@ +/* === 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 "Config.h" + +#include "Branding.h" +#include "Settings.h" +#include "network/Manager.h" +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Logger.h" +#include "utils/Yaml.h" + +#include + +class WelcomeTests : public QObject +{ + Q_OBJECT +public: + WelcomeTests(); + ~WelcomeTests() override {} + +private Q_SLOTS: + void initTestCase(); + + void testOneUrl(); + void testUrls_data(); + void testUrls(); + + void testBadConfigDoesNotResetUrls(); +}; + +WelcomeTests::WelcomeTests() {} + +void +WelcomeTests::initTestCase() +{ + Logger::setupLogLevel( Logger::LOGDEBUG ); + cDebug() << "Welcome test started."; + + // Ensure we have a system object, expect it to be a "bogus" one + CalamaresUtils::System* system = CalamaresUtils::System::instance(); + QVERIFY( system ); + cDebug() << Logger::SubEntry << "System @" << Logger::Pointer( system ); + + const auto* settings = Calamares::Settings::instance(); + if ( !settings ) + { + (void)new Calamares::Settings( true ); + } +} + +void +WelcomeTests::testOneUrl() +{ + Config c; + + // BUILD_AS_TEST is the source-directory path + QString filename = QStringLiteral( "1a-checkinternet.conf" ); + QFile fi( QString( "%1/tests/%2" ).arg( BUILD_AS_TEST, filename ) ); + QVERIFY( fi.exists() ); + + bool ok = false; + const auto map = CalamaresUtils::loadYaml( fi, &ok ); + QVERIFY( ok ); + QVERIFY( map.count() > 0 ); + QVERIFY( map.contains( "requirements" ) ); + + c.setConfigurationMap( map ); + QCOMPARE( CalamaresUtils::Network::Manager::instance().getCheckInternetUrls().count(), 1 ); +} + +void +WelcomeTests::testUrls_data() +{ + QTest::addColumn< QString >( "filename" ); + QTest::addColumn< int >( "result" ); + + QTest::newRow( "one " ) << QString( "1a-checkinternet.conf" ) << 1; + QTest::newRow( "none " ) << QString( "1b-checkinternet.conf" ) << 0; + QTest::newRow( "blank" ) << QString( "1c-checkinternet.conf" ) << 1; + QTest::newRow( "bogus" ) << QString( "1d-checkinternet.conf" ) << 1; + QTest::newRow( "[] " ) << QString( "1e-checkinternet.conf" ) << 1; + QTest::newRow( "-3 " ) << QString( "1f-checkinternet.conf" ) << 3; + QTest::newRow( "[3] " ) << QString( "1g-checkinternet.conf" ) << 3; + QTest::newRow( "some " ) << QString( "1h-checkinternet.conf" ) << 3; +} + +void +WelcomeTests::testUrls() +{ + QFETCH( QString, filename ); + QFETCH( int, result ); + + Config c; + + // BUILD_AS_TEST is the source-directory path + QFile fi( QString( "%1/tests/%2" ).arg( BUILD_AS_TEST, filename ) ); + QVERIFY( fi.exists() ); + + bool ok = false; + const auto map = CalamaresUtils::loadYaml( fi, &ok ); + QVERIFY( ok ); + + CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( QVector< QUrl > {} ); + QCOMPARE( CalamaresUtils::Network::Manager::instance().getCheckInternetUrls().count(), 0 ); + c.setConfigurationMap( map ); + QCOMPARE( CalamaresUtils::Network::Manager::instance().getCheckInternetUrls().count(), result ); +} + +void +WelcomeTests::testBadConfigDoesNotResetUrls() +{ + auto& nam = CalamaresUtils::Network::Manager::instance(); + CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( QVector< QUrl > {} ); + QCOMPARE( nam.getCheckInternetUrls().count(), 0 ); + nam.setCheckHasInternetUrl( QVector< QUrl > { QUrl( "http://example.com" ), QUrl( "https://www.kde.org" ) } ); + QCOMPARE( nam.getCheckInternetUrls().count(), 2 ); + + Config c; + + // This is slightly surprising: if there is **no** requirements + // configuration, the list of check-URLs is left unchanged. + { + const QString filename = QStringLiteral( "1b-checkinternet.conf" ); // "none" + + // BUILD_AS_TEST is the source-directory path + QFile fi( QString( "%1/tests/%2" ).arg( BUILD_AS_TEST, filename ) ); + QVERIFY( fi.exists() ); + + bool ok = false; + const auto map = CalamaresUtils::loadYaml( fi, &ok ); + QVERIFY( ok ); + + c.setConfigurationMap( map ); + } + QCOMPARE( nam.getCheckInternetUrls().count(), 2 ); + + // But if the config contains a requirements entry, even if broken, + // the list is changed (to the default). + { + const QString filename = QStringLiteral( "1d-checkinternet.conf" ); // "bogus" + + // BUILD_AS_TEST is the source-directory path + QFile fi( QString( "%1/tests/%2" ).arg( BUILD_AS_TEST, filename ) ); + QVERIFY( fi.exists() ); + + bool ok = false; + const auto map = CalamaresUtils::loadYaml( fi, &ok ); + QVERIFY( ok ); + + c.setConfigurationMap( map ); + } + QCOMPARE( nam.getCheckInternetUrls().count(), 1 ); +} + + +QTEST_GUILESS_MAIN( WelcomeTests ) + +#include "utils/moc-warnings.h" + +#include "Tests.moc" diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index 2a0d57bc4..df42271fc 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -12,7 +12,6 @@ #include "Config.h" #include "WelcomePage.h" -#include "checker/GeneralRequirements.h" #include "Branding.h" #include "modulesystem/ModuleManager.h" @@ -25,7 +24,6 @@ WelcomeViewStep::WelcomeViewStep( QObject* parent ) : Calamares::ViewStep( parent ) , m_conf( new Config( this ) ) , m_widget( new WelcomePage( m_conf ) ) - , m_requirementsChecker( new GeneralRequirements( this ) ) { connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, @@ -96,17 +94,6 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { m_conf->setConfigurationMap( configurationMap ); - if ( configurationMap.contains( "requirements" ) - && configurationMap.value( "requirements" ).type() == QVariant::Map ) - { - m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); - } - else - { - cWarning() << "no valid requirements map found in welcome " - "module configuration."; - } - //here init the qml or qwidgets needed bits m_widget->init(); } @@ -114,5 +101,5 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap ) Calamares::RequirementsList WelcomeViewStep::checkRequirements() { - return m_requirementsChecker->checkRequirements(); + return m_conf->checkRequirements(); } diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index 57632f7ac..dfc6f1169 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -66,7 +66,6 @@ public: private: Config* m_conf; WelcomePage* m_widget; - GeneralRequirements* m_requirementsChecker; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeViewStepFactory ) diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp index 07c352946..ca7219ca4 100644 --- a/src/modules/welcome/checker/GeneralRequirements.cpp +++ b/src/modules/welcome/checker/GeneralRequirements.cpp @@ -215,6 +215,58 @@ GeneralRequirements::checkRequirements() return checkEntries; } +/** @brief Loads the check-internet URLs + * + * There may be zero or one or more URLs specified; returns + * @c true if the configuration is incomplete or damaged in some way. + */ +static bool +getCheckInternetUrls( const QVariantMap& configurationMap ) +{ + const QString exampleUrl = QStringLiteral( "http://example.com" ); + + bool incomplete = false; + QStringList checkInternetSetting = CalamaresUtils::getStringList( configurationMap, "internetCheckUrl" ); + if ( !checkInternetSetting.isEmpty() ) + { + QVector< QUrl > urls; + for ( const auto& urlString : qAsConst( checkInternetSetting ) ) + { + QUrl url( urlString.trimmed() ); + if ( url.isValid() ) + { + urls.append( url ); + } + else + { + cWarning() << "GeneralRequirements entry 'internetCheckUrl' in welcome.conf contains invalid" + << urlString; + } + } + + if ( urls.empty() ) + { + cWarning() << "GeneralRequirements entry 'internetCheckUrl' contains no valid URLs, " + << "reverting to default (" << exampleUrl << ")."; + CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( QUrl( exampleUrl ) ); + incomplete = true; + } + else + { + CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( urls ); + } + } + else + { + cWarning() << "GeneralRequirements entry 'internetCheckUrl' is undefined in welcome.conf, " + "reverting to default (" + << exampleUrl << ")."; + CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( QUrl( exampleUrl ) ); + incomplete = true; + } + return incomplete; +} + void GeneralRequirements::setConfigurationMap( const QVariantMap& configurationMap ) @@ -302,30 +354,7 @@ GeneralRequirements::setConfigurationMap( const QVariantMap& configurationMap ) incompleteConfiguration = true; } - QUrl checkInternetUrl; - QString checkInternetSetting = CalamaresUtils::getString( configurationMap, "internetCheckUrl" ); - if ( !checkInternetSetting.isEmpty() ) - { - checkInternetUrl = QUrl( checkInternetSetting.trimmed() ); - if ( !checkInternetUrl.isValid() ) - { - cWarning() << "GeneralRequirements entry 'internetCheckUrl' is invalid in welcome.conf" - << checkInternetSetting << "reverting to default (http://example.com)."; - checkInternetUrl = QUrl( "http://example.com" ); - incompleteConfiguration = true; - } - } - else - { - cWarning() << "GeneralRequirements entry 'internetCheckUrl' is undefined in welcome.conf," - "reverting to default (http://example.com)."; - checkInternetUrl = "http://example.com"; - incompleteConfiguration = true; - } - if ( checkInternetUrl.isValid() ) - { - CalamaresUtils::Network::Manager::instance().setCheckHasInternetUrl( checkInternetUrl ); - } + incompleteConfiguration |= getCheckInternetUrls( configurationMap ); if ( incompleteConfiguration ) { diff --git a/src/modules/welcome/tests/1a-checkinternet.conf b/src/modules/welcome/tests/1a-checkinternet.conf new file mode 100644 index 000000000..d10a97d2a --- /dev/null +++ b/src/modules/welcome/tests/1a-checkinternet.conf @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +--- +requirements: + internetCheckUrl: http://example.com diff --git a/src/modules/welcome/tests/1b-checkinternet.conf b/src/modules/welcome/tests/1b-checkinternet.conf new file mode 100644 index 000000000..7cb9b4206 --- /dev/null +++ b/src/modules/welcome/tests/1b-checkinternet.conf @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Nothing at all +--- +bogus: 1 diff --git a/src/modules/welcome/tests/1c-checkinternet.conf b/src/modules/welcome/tests/1c-checkinternet.conf new file mode 100644 index 000000000..6dbfb8f37 --- /dev/null +++ b/src/modules/welcome/tests/1c-checkinternet.conf @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Set to blank +--- +requirements: + internetCheckUrl: "" diff --git a/src/modules/welcome/tests/1d-checkinternet.conf b/src/modules/welcome/tests/1d-checkinternet.conf new file mode 100644 index 000000000..0f5896ce1 --- /dev/null +++ b/src/modules/welcome/tests/1d-checkinternet.conf @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Set to something broken +--- +requirements: + internetCheckUrl: false diff --git a/src/modules/welcome/tests/1e-checkinternet.conf b/src/modules/welcome/tests/1e-checkinternet.conf new file mode 100644 index 000000000..98ff62695 --- /dev/null +++ b/src/modules/welcome/tests/1e-checkinternet.conf @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Empty list +--- +requirements: + internetCheckUrl: [] diff --git a/src/modules/welcome/tests/1f-checkinternet.conf b/src/modules/welcome/tests/1f-checkinternet.conf new file mode 100644 index 000000000..158025c62 --- /dev/null +++ b/src/modules/welcome/tests/1f-checkinternet.conf @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Multiple, all valid +--- +requirements: + internetCheckUrl: + - http://example.com + - http://bogus.example.com + - http://nonexistent.example.com diff --git a/src/modules/welcome/tests/1g-checkinternet.conf b/src/modules/welcome/tests/1g-checkinternet.conf new file mode 100644 index 000000000..1f4477f9f --- /dev/null +++ b/src/modules/welcome/tests/1g-checkinternet.conf @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Multiple, all valid, in short-list form +--- +requirements: + internetCheckUrl: [ http://example.com, http://bogus.example.com, http://nonexistent.example.com ] diff --git a/src/modules/welcome/tests/1h-checkinternet.conf b/src/modules/welcome/tests/1h-checkinternet.conf new file mode 100644 index 000000000..4984cf12b --- /dev/null +++ b/src/modules/welcome/tests/1h-checkinternet.conf @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# "0" is a valid URL (?) but "" is not +--- +requirements: + internetCheckUrl: + - http://example.com + - 0 + - "" + - http://nonexistent.example.com diff --git a/src/modules/welcome/welcome.conf b/src/modules/welcome/welcome.conf index b3da8d366..6e11817bf 100644 --- a/src/modules/welcome/welcome.conf +++ b/src/modules/welcome/welcome.conf @@ -43,6 +43,21 @@ requirements: # # The URL is only used if "internet" is in the *check* list below. internetCheckUrl: http://example.com + # + # This may be a single URL, or a list or URLs, in which case the + # URLs will be checked one-by-one; if any of them returns data, + # internet is assumed to be OK. This can be used to check via + # a number of places, where some domains may be down or blocked. + # + # To use a list of URLs, just use YAML list syntax (e.g. + # + # internetCheckUrl: + # - http://www.kde.org + # - http://www.freebsd.org + # + # or short-form + # + # internetCheckUrl: [ http://www.kde.org, http://www.freebsd.org ] # List conditions to check. Each listed condition will be # probed in some way, and yields true or false according to diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.cpp b/src/modules/welcomeq/WelcomeQmlViewStep.cpp index af32f2992..914ea4f3a 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.cpp +++ b/src/modules/welcomeq/WelcomeQmlViewStep.cpp @@ -26,7 +26,6 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent ) : Calamares::QmlViewStep( parent ) , m_config( new Config( this ) ) - , m_requirementsChecker( new GeneralRequirements( this ) ) { connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, @@ -58,7 +57,6 @@ WelcomeQmlViewStep::isBackEnabled() const bool WelcomeQmlViewStep::isAtBeginning() const { - // TODO: adjust to "pages" in the QML return true; } @@ -66,7 +64,6 @@ WelcomeQmlViewStep::isAtBeginning() const bool WelcomeQmlViewStep::isAtEnd() const { - // TODO: adjust to "pages" in the QML return true; } @@ -81,26 +78,13 @@ void WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { m_config->setConfigurationMap( configurationMap ); - - if ( configurationMap.contains( "requirements" ) - && configurationMap.value( "requirements" ).type() == QVariant::Map ) - { - m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); - } - else - { - cWarning() << "no valid requirements map found in welcomeq " - "module configuration."; - } - Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last - setContextProperty( "Welcome", m_config ); } Calamares::RequirementsList WelcomeQmlViewStep::checkRequirements() { - return m_requirementsChecker->checkRequirements(); + return m_config->checkRequirements(); } QObject* diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.h b/src/modules/welcomeq/WelcomeQmlViewStep.h index 4c68ea2ae..1ed90ce05 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.h +++ b/src/modules/welcomeq/WelcomeQmlViewStep.h @@ -29,9 +29,7 @@ class Handler; } } // namespace CalamaresUtils -class GeneralRequirements; -// TODO: Needs a generic Calamares::QmlViewStep as base class // TODO: refactor and move what makes sense to base class class PLUGINDLLEXPORT WelcomeQmlViewStep : public Calamares::QmlViewStep { @@ -65,7 +63,6 @@ public: private: Config* m_config; - GeneralRequirements* m_requirementsChecker; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeQmlViewStepFactory )