diff --git a/.github/workflows/nightly-debian.yml b/.github/workflows/nightly-debian.yml index eb96fe40e..d64617a5b 100644 --- a/.github/workflows/nightly-debian.yml +++ b/.github/workflows/nightly-debian.yml @@ -11,6 +11,8 @@ env: CMAKE_ARGS: | -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Debug + -DBUILD_APPSTREAM=ON + -DBUILD_APPDATA=ON jobs: build: diff --git a/.github/workflows/nightly-fedora-qt6.yml b/.github/workflows/nightly-fedora-qt6.yml index 8c14ce807..fbd40e087 100644 --- a/.github/workflows/nightly-fedora-qt6.yml +++ b/.github/workflows/nightly-fedora-qt6.yml @@ -12,6 +12,8 @@ env: -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Debug -DWITH_QT6=ON + -DBUILD_APPSTREAM=ON + -DBUILD_APPDATA=ON jobs: build: diff --git a/.github/workflows/nightly-opensuse.yml b/.github/workflows/nightly-opensuse.yml index ad70063f9..5b742b704 100644 --- a/.github/workflows/nightly-opensuse.yml +++ b/.github/workflows/nightly-opensuse.yml @@ -13,6 +13,8 @@ env: -DCMAKE_BUILD_TYPE=Debug -DBUILD_SCHEMA_TESTING=ON -DBUILD_TESTING=ON + -DBUILD_APPSTREAM=ON + -DBUILD_APPDATA=ON jobs: build: diff --git a/.github/workflows/nightly-ubuntu.yml b/.github/workflows/nightly-ubuntu.yml new file mode 100644 index 000000000..03adce748 --- /dev/null +++ b/.github/workflows/nightly-ubuntu.yml @@ -0,0 +1,36 @@ +name: nightly-ubuntu + +on: + schedule: + - cron: "12 23 * * *" + workflow_dispatch: + +env: + BUILDDIR: /build + SRCDIR: ${{ github.workspace }} + CMAKE_ARGS: | + -DKDE_INSTALL_USE_QT_SYS_PATHS=ON + -DCMAKE_BUILD_TYPE=Debug + -DBUILD_APPSTREAM=ON + -DBUILD_APPDATA=ON + +jobs: + build: + runs-on: ubuntu-latest + container: + image: docker://ubuntu:devel + options: --tmpfs /build:rw --user 0:0 + steps: + - name: "prepare git" + shell: bash + run: | + apt-get update + apt-get -y install git-core jq curl ninja-build + - name: "prepare source" + uses: calamares/actions/generic-checkout@v5 + - name: "install dependencies" + shell: bash + run: ./ci/deps-ubuntu.sh + - name: "build" + shell: bash + run: ./ci/build.sh diff --git a/CHANGES-3.3 b/CHANGES-3.3 index a5d9565ba..d5ae80112 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -8,6 +8,35 @@ changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for the history of the 3.2 series (2018-05 - 2022-08). +# 3.3.1 (unreleased) + +This release sets `BUILD_APPDATA` and `BUILD_APSTREAM` to default to **OFF**, +where previously they defaulted to **ON**. When enabled, the dependencies for +both features are required -- previously they would silently switch off if +the dependencies were not found. Distributions are strongly advised to check +their package-building instructions. + +This release contains contributions from (alphabetically by first name): + - Adriaan de Groot + - Aleksey Samoilov + - Emir Sari + - Simon Quigley + +## Core ## + - There has been internal code re-organization (e.g. not using functions + named `tr()`) to help translation tools. + - Strings everywhere have been given more context. (thanks Emir) + - In CMake, "view" is no longer accepted as an alias of the module + type "viewmodule" in function `calamares_add_plugin()`. + - Plain Ubuntu builds have been added to the CI roster. (thanks Simon) + - Commands that run in the target system (in the chroot) no longer + use the TMP-related environment variables from the host. #2269 + +## Modules ## + - The *displaymanager* module configuration for `greetd` has some more + options now. (thanks Aleksey) + + # 3.3.0 (2023-12-12) This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index effc36d4f..53e9f494e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,8 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(CALAMARES_VERSION 3.3.0) -set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release +set(CALAMARES_VERSION 3.3.1) +set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release if(CMAKE_SCRIPT_MODE_FILE) include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake) @@ -513,6 +513,7 @@ if(NOT CALAMARES_RELEASE_MODE) list(APPEND CALAMARES_TRANSLATION_LANGUAGES ${_tx_incomplete}) endif() list(SORT CALAMARES_TRANSLATION_LANGUAGES) +list(REMOVE_DUPLICATES CALAMARES_TRANSLATION_LANGUAGES) add_subdirectory(lang) # i18n tools diff --git a/CMakeModules/AppStreamHelper.cmake b/CMakeModules/AppStreamHelper.cmake new file mode 100644 index 000000000..9d32795cf --- /dev/null +++ b/CMakeModules/AppStreamHelper.cmake @@ -0,0 +1,86 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2023 Adriaan de Groot +# SPDX-License-Identifier: BSD-2-Clause +# +### +# +# Finds AppStream-Qt suitable for the Qt version that is in use. +# Creates target calamares::appstreamqt to alias whatever is found. +# Sets AppStreamQt_FOUND appropriately, regardless of the underlying +# variables (e.g. might be AppStreamQt6_FOUND). +# + +option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" OFF) + +if(TARGET calaappstream) + if(TARGET calamares::appstreamqt) + message(STATUS "AppStreamQt has already been found") + set(AppStreamQt_FOUND TRUE) + else() + message(STATUS "AppStreamQt has been searched-for and not found") + set(AppStreamQt_FOUND FALSE) + endif() + return() +endif() +if(NOT BUILD_APPSTREAM) + return() +endif() + +### FIND APPSTREAM +# +# First, look for a Qt-versioned variety of the package. +# If that is not found, look for an unversioned one. +set(HAVE_APPSTREAM OFF) +find_package(AppStream${qtname}) +# Not everyone renames the variables consistently +if(AppStream${qtname}_FOUND OR AppStreamQt_FOUND) + set(_appstream_name AppStream${qtname}) + set(HAVE_APPSTREAM ON) +else() + find_package(AppStreamQt) + if(AppStreamQt_FOUND) + set(_appstream_name AppStreamQt) + # TODO: how to check underlying Qt version? + set(HAVE_APPSTREAM ON) + endif() +endif() + +if(HAVE_APPSTREAM) + # Look for the directory name containing the headers + find_file(_appstream_header NAMES ${_appstream_name}/pool.h AppStreamQt/pool.h) + if(NOT _appstream_header) + set(HAVE_APPSTREAM OFF) + else() + if(_appstream_header MATCHES /${_appstream_name}/) + set(_appstream_header_directory ${_appstream_name}) + else() + set(_appstream_header_directory AppStreamQt) + endif() + endif() +else() + # Placeholder name + set(_appstream_name AppStreamQt) +endif() + +set(_appstream_dependency_type OPTIONAL) +if(BUILD_APPSTREAM) + set(_appstream_dependency_type REQUIRED) +endif() + +set_package_properties( + ${_appstream_name} + PROPERTIES + DESCRIPTION "Support for AppStream (cache) data" + URL "https://github.com/ximion/appstream" + PURPOSE "AppStream provides package data" + TYPE ${_appstream_dependency_type} +) + +add_library(calaappstream INTERFACE) # Always, but might not be populated +if(HAVE_APPSTREAM) + target_compile_definitions(calaappstream INTERFACE HAVE_APPSTREAM_VERSION=${${_appstream_name}_VERSION_MAJOR} HAVE_APPSTREAM_HEADERS=${_appstream_header_directory}) + target_link_libraries(calaappstream INTERFACE ${_appstream_name}) + add_library(calamares::appstreamqt ALIAS calaappstream) +endif() +set(AppStreamQt_FOUND ${HAVE_APPSTREAM}) diff --git a/CMakeModules/CalamaresAddPlugin.cmake b/CMakeModules/CalamaresAddPlugin.cmake index 34ade2bd6..891050626 100644 --- a/CMakeModules/CalamaresAddPlugin.cmake +++ b/CMakeModules/CalamaresAddPlugin.cmake @@ -19,7 +19,7 @@ # # calamares_add_plugin( # module-name -# TYPE +# TYPE # EXPORT_MACRO macro-name # SOURCES source-file... # UI ui-file... @@ -35,7 +35,7 @@ # [WEIGHT w] # ) # -# Function parameters: +# Function optional parameters: # - COMPILE_DEFINITIONS # Definitions are set on the resulting module with a suitable # flag (i.e. `-D`) so only state the name (optionally, also the value) @@ -65,6 +65,9 @@ # SKIPPED_MODULES is set in the parent (i.e. caller's) scope with the # reason why. This should rarely be a concern as AddModuleSubdirectory # already handles skip-reasons and collects them for reporting. +# +# The target defined this way is called "calamares__", +# e.g. "calamares_viewmodule_packagechooserq". include( CMakeParseArguments ) @@ -126,7 +129,7 @@ function( calamares_add_plugin ) set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" ) # automatic library linkage - if(PLUGIN_TYPE STREQUAL "view" OR PLUGIN_TYPE STREQUAL "viewmodule") + if(PLUGIN_TYPE STREQUAL "viewmodule") list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamaresui) elseif(PLUGIN_TYPE STREQUAL "job") list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamares) diff --git a/CMakeModules/CalamaresAddTranslations.cmake b/CMakeModules/CalamaresAddTranslations.cmake index 93440ba8e..785d2fa0b 100644 --- a/CMakeModules/CalamaresAddTranslations.cmake +++ b/CMakeModules/CalamaresAddTranslations.cmake @@ -10,7 +10,8 @@ # # This file has not yet been documented for use outside of Calamares itself. -include( CMakeParseArguments ) +include(CMakeParseArguments) +include(FeatureSummary) # The Gettext module is still old-fashioned, ALLCAPS variables find_package( Gettext ) diff --git a/ci/deps-opensuse.sh b/ci/deps-opensuse.sh index d0c9f6b67..748951c9b 100755 --- a/ci/deps-opensuse.sh +++ b/ci/deps-opensuse.sh @@ -43,4 +43,8 @@ zypper --non-interactive in \ # Not actual dependencies, but good to have zypper --non-interactive in python311-PyYAML python311-jsonschema +# vi to edit things inside the docker +zypper --non-interactive in vim +# noto so that running Calamares in the docker is readable +zypper --non-interactive in noto-sans-fonts true diff --git a/ci/deps-ubuntu.sh b/ci/deps-ubuntu.sh new file mode 100755 index 000000000..ddc41560b --- /dev/null +++ b/ci/deps-ubuntu.sh @@ -0,0 +1,47 @@ +#! /bin/sh +# +# Install dependencies for the nightly-ubuntu (devel) build +# These build dependencies are grabbed directly from the Debian package +# +apt-get update +apt-get -y install git-core jq curl ninja +apt-get -y install \ + build-essential \ + cmake \ + extra-cmake-modules \ + gettext \ + libappstreamqt5-dev \ + libkf5config-dev \ + libkf5coreaddons-dev \ + libkf5crash-dev \ + libkf5i18n-dev \ + libkf5iconthemes-dev \ + libkf5kio-dev \ + libkf5parts-dev \ + libkf5plasma-dev \ + libkf5service-dev \ + libkf5solid-dev \ + libkpmcore-dev \ + libparted-dev \ + libpolkit-qt5-1-dev \ + libpwquality-dev \ + libqt5svg5-dev \ + libqt5webkit5-dev \ + libyaml-cpp-dev \ + os-prober \ + pkg-config \ + pkg-kde-tools \ + polkitd \ + python3-dev \ + python3-jsonschema \ + python3-yaml \ + qml-module-qtquick-layouts \ + qml-module-qtquick-privatewidgets \ + qml-module-qtquick-window2 \ + qml-module-qtquick2 \ + qtbase5-dev \ + qtdeclarative5-dev \ + qtlocation5-dev \ + qttools5-dev \ + qttools5-dev-tools +true diff --git a/ci/txpush.sh b/ci/txpush.sh index 666cddc4a..001c8984c 100755 --- a/ci/txpush.sh +++ b/ci/txpush.sh @@ -105,6 +105,7 @@ fi # those are done separately. _srcdirs="src/calamares src/libcalamares src/libcalamaresui src/modules src/qml" $LUPDATE -no-obsolete $_srcdirs -ts lang/calamares_en.ts +grep '{1?}' lang/calamares_en.ts && { echo "lupdate has introduced weird markers." ; exit 1 ; } # Non-Transifex special-cases # # - timezone names can be translated, but that's 700+ strings I don't want diff --git a/lang/calamares_en.ts b/lang/calamares_en.ts index cd51a3dff..2af33e45b 100644 --- a/lang/calamares_en.ts +++ b/lang/calamares_en.ts @@ -120,11 +120,6 @@ Interface: Interface: - - - Crashes Calamares, so that Dr. Konqui can look at it. - Crashes Calamares, so that Dr. Konqui can look at it. - Reloads the stylesheet from the branding directory. @@ -145,6 +140,11 @@ Reload Stylesheet Reload Stylesheet + + + Crashes Calamares, so that Dr. Konqi can look at it. + + Displays the tree of widget names in the log (for stylesheet debugging). @@ -157,27 +157,30 @@ - Debug information - Debug information + Debug Information + @title + Calamares::ExecutionViewStep - + %p% Progress percentage indicator: %p is where the number 0..100 is placed - - Set up - Set up + + Set Up + @label + - + Install - Install + @label + Install @@ -212,70 +215,140 @@ Calamares::ProcessJob - - Run command '%1' in target system. - Run command '%1' in target system. + + Running command %1 in target system… + @status + - - Run command '%1'. - Run command '%1'. + + Running command %1… + @status + Running command %1… + + + + Calamares::Python::Job + + + Running %1 operation. + Running %1 operation. - - Running command %1 %2 - Running command %1 %2 + + Bad working directory path + Bad working directory path + + + + Working directory %1 for python job %2 is not readable. + Working directory %1 for python job %2 is not readable. + + + + + + + + + Bad main script file + Bad main script file + + + + Main script file %1 for python job %2 is not readable. + Main script file %1 for python job %2 is not readable. + + + + Bad internal script + + + + + Internal script for python job %1 raised an exception. + + + + + Main script file %1 for python job %2 could not be loaded because it raised an exception. + + + + + Main script file %1 for python job %2 raised an exception. + + + + + + Main script file %1 for python job %2 returned invalid results. + + + + + Main script file %1 for python job %2 does not contain a run() function. + Calamares::PythonJob - Running %1 operation. - Running %1 operation. + Running %1 operation… + @status + + + + + Bad working directory path + @error + Bad working directory path - Bad working directory path - Bad working directory path - - - Working directory %1 for python job %2 is not readable. - Working directory %1 for python job %2 is not readable. - - - - Bad main script file - Bad main script file + @error + Working directory %1 for python job %2 is not readable. + Bad main script file + @error + Bad main script file + + + Main script file %1 for python job %2 is not readable. - Main script file %1 for python job %2 is not readable. + @error + Main script file %1 for python job %2 is not readable. - Boost.Python error in job "%1". - Boost.Python error in job "%1". + Boost.Python error in job "%1" + @error + Calamares::QmlViewStep - - Loading ... - Loading ... + + Loading… + @status + - - QML Step <i>%1</i>. - QML Step <i>%1</i>. + + QML step <i>%1</i>. + @label + - + Loading failed. - Loading failed. + @info + Loading failed. @@ -283,20 +356,23 @@ Requirements checking for module '%1' is complete. + @info - Waiting for %n module(s). - - Waiting for %n module. - Waiting for %n modules. + Waiting for %n module(s)… + @status + + + (%n second(s)) - + @status + (%n second) (%n seconds) @@ -304,26 +380,12 @@ System-requirements checking is complete. - System-requirements checking is complete. + @info + System-requirements checking is complete. Calamares::ViewManager - - - Setup Failed - Setup Failed - - - - Installation Failed - Installation Failed - - - - Error - Error - &Yes @@ -339,6 +401,156 @@ &Close &Close + + + Setup Failed + @title + Setup Failed + + + + Installation Failed + @title + Installation Failed + + + + Error + @title + Error + + + + Calamares Initialization Failed + @title + Calamares Initialization Failed + + + + %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. + @info + %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. + + + + <br/>The following modules could not be loaded: + @info + <br/>The following modules could not be loaded: + + + + Continue with Setup? + @title + + + + + Continue with Installation? + @title + + + + + The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> + %1 is short product name, %2 is short product name with version + The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> + + + + The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> + %1 is short product name, %2 is short product name with version + The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> + + + + &Set Up Now + @button + + + + + &Install Now + @button + + + + + Go &Back + @button + + + + + &Set Up + @button + + + + + &Install + @button + &Install + + + + Setup is complete. Close the setup program. + @tooltip + Setup is complete. Close the setup program. + + + + The installation is complete. Close the installer. + @tooltip + The installation is complete. Close the installer. + + + + Cancel the setup process without changing the system. + @tooltip + + + + + Cancel the installation process without changing the system. + @tooltip + + + + + &Next + @button + &Next + + + + &Back + @button + &Back + + + + &Done + @button + &Done + + + + &Cancel + @button + &Cancel + + + + Cancel Setup? + @title + + + + + Cancel Installation? + @title + + Install Log Paste URL @@ -362,116 +574,6 @@ Link copied to clipboard Link copied to clipboard - - - Calamares Initialization Failed - Calamares Initialization Failed - - - - %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. - %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. - - - - <br/>The following modules could not be loaded: - <br/>The following modules could not be loaded: - - - - Continue with setup? - Continue with setup? - - - - Continue with installation? - Continue with installation? - - - - The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> - The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> - - - - The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> - The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> - - - - &Set up now - &Set up now - - - - &Install now - &Install now - - - - Go &back - Go &back - - - - &Set up - &Set up - - - - &Install - &Install - - - - Setup is complete. Close the setup program. - Setup is complete. Close the setup program. - - - - The installation is complete. Close the installer. - The installation is complete. Close the installer. - - - - Cancel setup without changing the system. - Cancel setup without changing the system. - - - - Cancel installation without changing the system. - Cancel installation without changing the system. - - - - &Next - &Next - - - - &Back - &Back - - - - &Done - &Done - - - - &Cancel - &Cancel - - - - Cancel setup? - Cancel setup? - - - - Cancel installation? - Cancel installation? - Do you really want to cancel the current setup process? @@ -492,33 +594,37 @@ The installer will quit and all changes will be lost. Unknown exception type - Unknown exception type + @error + Unknown exception type - unparseable Python error - unparseable Python error + Unparseable Python error + @error + - unparseable Python traceback - unparseable Python traceback + Unparseable Python traceback + @error + - Unfetchable Python error. - Unfetchable Python error. + Unfetchable Python error + @error + CalamaresWindow - + %1 Setup Program %1 Setup Program - + %1 Installer %1 Installer @@ -559,9 +665,9 @@ The installer will quit and all changes will be lost. - - - + + + Current: Current: @@ -571,131 +677,131 @@ The installer will quit and all changes will be lost. 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 @@ -776,31 +882,6 @@ 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. - - - - Set timezone to %1/%2. - Set timezone to %1/%2. - - - - The system language will be set to %1. - The system language will be set to %1. - - - - The numbers and dates locale will be set to %1. - The numbers and dates locale will be set to %1. - Network Installation. (Disabled: Incorrect configuration) @@ -926,46 +1007,6 @@ The installer will quit and all changes will be lost. OK! OK! - - - Setup Failed - Setup Failed - - - - Installation Failed - Installation Failed - - - - The setup of %1 did not complete successfully. - The setup of %1 did not complete successfully. - - - - The installation of %1 did not complete successfully. - The installation of %1 did not complete successfully. - - - - Setup Complete - Setup Complete - - - - Installation Complete - Installation Complete - - - - The setup of %1 is complete. - The setup of %1 is complete. - - - - The installation of %1 is complete. - The installation of %1 is complete. - Package Selection @@ -992,27 +1033,106 @@ The installer will quit and all changes will be lost. 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. + + + Setup Failed + @title + Setup Failed + + + + Installation Failed + @title + Installation Failed + + + + The setup of %1 did not complete successfully. + @info + The setup of %1 did not complete successfully. + + + + The installation of %1 did not complete successfully. + @info + The installation of %1 did not complete successfully. + + + + Setup Complete + @title + Setup Complete + + + + Installation Complete + @title + Installation Complete + + + + The setup of %1 is complete. + @info + The setup of %1 is complete. + + + + The installation of %1 is complete. + @info + The installation of %1 is complete. + + + + Keyboard model has been set to %1<br/>. + @label, %1 is keyboard model, as in Apple Magic Keyboard + + + + + Keyboard layout has been set to %1/%2. + @label, %1 is layout, %2 is layout variant + + + + + Set timezone to %1/%2 + @action + Set timezone to %1/%2 + + + + The system language will be set to %1. + @info + The system language will be set to %1. + + + + The numbers and dates locale will be set to %1. + @info + The numbers and dates locale will be set to %1. + ContextualProcessJob - Contextual Processes Job - Contextual Processes Job + Performing contextual processes' job… + @status + @@ -1362,26 +1482,30 @@ The installer will quit and all changes will be lost. DracutLuksCfgJob - Write LUKS configuration for Dracut to %1 - Write LUKS configuration for Dracut to %1 + Writing LUKS configuration for Dracut to %1… + @status + - Skip writing LUKS configuration for Dracut: "/" partition is not encrypted - Skip writing LUKS configuration for Dracut: "/" partition is not encrypted + Skipping writing LUKS configuration for Dracut: "/" partition is not encrypted + @info + Failed to open %1 - Failed to open %1 + @error + Failed to open %1 DummyCppJob - Dummy C++ Job - Dummy C++ Job + Performing dummy C++ job… + @status + @@ -1572,32 +1696,38 @@ The installer will quit and all changes will be lost. <h1>All done.</h1><br/>%1 has been set up on your computer.<br/>You may now start using your new system. - <h1>All done.</h1><br/>%1 has been set up on your computer.<br/>You may now start using your new system. + @info + <h1>All done.</h1><br/>%1 has been set up on your computer.<br/>You may now start using your new system. <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the setup program.</p></body></html> - <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the setup program.</p></body></html> + @tooltip + <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the setup program.</p></body></html> <h1>All done.</h1><br/>%1 has been installed on your computer.<br/>You may now restart into your new system, or continue using the %2 Live environment. - <h1>All done.</h1><br/>%1 has been installed on your computer.<br/>You may now restart into your new system, or continue using the %2 Live environment. + @info + <h1>All done.</h1><br/>%1 has been installed on your computer.<br/>You may now restart into your new system, or continue using the %2 Live environment. <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the installer.</p></body></html> - <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the installer.</p></body></html> + @tooltip + <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the installer.</p></body></html> <h1>Setup Failed</h1><br/>%1 has not been set up on your computer.<br/>The error message was: %2. - <h1>Setup Failed</h1><br/>%1 has not been set up on your computer.<br/>The error message was: %2. + @info, %1 is product name with version + <h1>Setup Failed</h1><br/>%1 has not been set up on your computer.<br/>The error message was: %2. <h1>Installation Failed</h1><br/>%1 has not been installed on your computer.<br/>The error message was: %2. - <h1>Installation Failed</h1><br/>%1 has not been installed on your computer.<br/>The error message was: %2. + @info, %1 is product name with version + <h1>Installation Failed</h1><br/>%1 has not been installed on your computer.<br/>The error message was: %2. @@ -1605,7 +1735,8 @@ The installer will quit and all changes will be lost. Finish - Finish + @label + Finish @@ -1613,7 +1744,8 @@ The installer will quit and all changes will be lost. Finish - Finish + @label + Finish @@ -1777,9 +1909,10 @@ The installer will quit and all changes will be lost. HostInfoJob - - Collecting information about your machine. - Collecting information about your machine. + + Collecting information about your machine… + @status + @@ -1812,34 +1945,39 @@ The installer will quit and all changes will be lost. InitcpioJob - Creating initramfs with mkinitcpio. - Creating initramfs with mkinitcpio. + Creating initramfs with mkinitcpio… + @status + InitramfsJob - Creating initramfs. - Creating initramfs. + Creating initramfs… + @status + InteractiveTerminalPage - Konsole not installed - Konsole not installed + Konsole not installed. + @error + Please install KDE Konsole and try again! - Please install KDE Konsole and try again! + @info + Please install KDE Konsole and try again! Executing script: &nbsp;<code>%1</code> - Executing script: &nbsp;<code>%1</code> + @info + Executing script: &nbsp;<code>%1</code> @@ -1847,7 +1985,8 @@ The installer will quit and all changes will be lost. Script - Script + @label + Script @@ -1855,7 +1994,8 @@ The installer will quit and all changes will be lost. Keyboard - Keyboard + @label + Keyboard @@ -1863,30 +2003,35 @@ The installer will quit and all changes will be lost. Keyboard - Keyboard + @label + Keyboard LCLocaleDialog - System locale setting - System locale setting + System Locale Setting + @title + The system locale setting affects the language and character set for some command line user interface elements.<br/>The current setting is <strong>%1</strong>. - The system locale setting affects the language and character set for some command line user interface elements.<br/>The current setting is <strong>%1</strong>. + @info + The system locale setting affects the language and character set for some command line user interface elements.<br/>The current setting is <strong>%1</strong>. &Cancel - &Cancel + @button + &Cancel &OK - &OK + @button + &OK @@ -1922,32 +2067,38 @@ The installer will quit and all changes will be lost. I accept the terms and conditions above. - I accept the terms and conditions above. + @info + I accept the terms and conditions above. Please review the End User License Agreements (EULAs). - Please review the End User License Agreements (EULAs). + @info + Please review the End User License Agreements (EULAs). This setup procedure will install proprietary software that is subject to licensing terms. - This setup procedure will install proprietary software that is subject to licensing terms. + @info + This setup procedure will install proprietary software that is subject to licensing terms. If you do not agree with the terms, the setup procedure cannot continue. - If you do not agree with the terms, the setup procedure cannot continue. + @info + If you do not agree with the terms, the setup procedure cannot continue. This setup procedure can install proprietary software that is subject to licensing terms in order to provide additional features and enhance the user experience. - This setup procedure can install proprietary software that is subject to licensing terms in order to provide additional features and enhance the user experience. + @info + This setup procedure can install proprietary software that is subject to licensing terms in order to provide additional features and enhance the user experience. If you do not agree with the terms, proprietary software will not be installed, and open source alternatives will be used instead. - If you do not agree with the terms, proprietary software will not be installed, and open source alternatives will be used instead. + @info + If you do not agree with the terms, proprietary software will not be installed, and open source alternatives will be used instead. @@ -1955,7 +2106,8 @@ The installer will quit and all changes will be lost. License - License + @label + License @@ -1963,59 +2115,70 @@ The installer will quit and all changes will be lost. URL: %1 - URL: %1 + @label + URL: %1 <strong>%1 driver</strong><br/>by %2 + @label, %1 is product name, %2 is product vendor %1 is an untranslatable product name, example: Creative Audigy driver - <strong>%1 driver</strong><br/>by %2 + <strong>%1 driver</strong><br/>by %2 <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> + @label, %1 is product name, %2 is product vendor %1 is usually a vendor name, example: Nvidia graphics driver - <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> + <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> - <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> + @label, %1 is product name, %2 is product vendor + <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> <strong>%1 codec</strong><br/><font color="Grey">by %2</font> - <strong>%1 codec</strong><br/><font color="Grey">by %2</font> + @label, %1 is product name, %2 is product vendor + <strong>%1 codec</strong><br/><font color="Grey">by %2</font> <strong>%1 package</strong><br/><font color="Grey">by %2</font> - <strong>%1 package</strong><br/><font color="Grey">by %2</font> + @label, %1 is product name, %2 is product vendor + <strong>%1 package</strong><br/><font color="Grey">by %2</font> <strong>%1</strong><br/><font color="Grey">by %2</font> - <strong>%1</strong><br/><font color="Grey">by %2</font> + @label, %1 is product name, %2 is product vendor + <strong>%1</strong><br/><font color="Grey">by %2</font> File: %1 - File: %1 + @label + File: %1 - Hide license text - Hide license text + Hide the license text + @tooltip + Show the license text - Show the license text + @tooltip + Show the license text - Open license agreement in browser. - Open license agreement in browser. + Open the license agreement in browser + @tooltip + @@ -2023,18 +2186,21 @@ The installer will quit and all changes will be lost. Region: - Region: + @label + Region: Zone: - Zone: + @label + Zone: - &Change... - &Change... + &Change… + @button + @@ -2042,7 +2208,8 @@ The installer will quit and all changes will be lost. Location - Location + @label + Location @@ -2058,7 +2225,8 @@ The installer will quit and all changes will be lost. Location - Location + @label + Location @@ -2094,34 +2262,73 @@ The installer will quit and all changes will be lost. MachineIdJob - + Generate machine-id. Generate machine-id. - + Configuration Error Configuration Error - + No root mount point is set for MachineId. No root mount point is set for MachineId. + + + + + + File not found + File not found + + + + Path <pre>%1</pre> must be an absolute path. + Path <pre>%1</pre> must be an absolute path. + + + + Could not create new random file <pre>%1</pre>. + Could not create new random file <pre>%1</pre>. + Map Timezone: %1 - Timezone: %1 + @label + Timezone: %1 Please select your preferred location on the map so the installer can suggest the locale and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. - Please select your preferred location on the map so the installer can suggest the locale + @info + Please select your preferred location on the map so the installer can suggest the locale + and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging + to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. + + + + Map-qt6 + + + Timezone: %1 + @label + Timezone: %1 + + + + Please select your preferred location on the map so the installer can suggest the locale + and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging + to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. + @label + Please select your preferred location on the map so the installer can suggest the locale and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. @@ -2279,30 +2486,70 @@ The installer will quit and all changes will be lost. Offline - Select your preferred Region, or use the default settings. - Select your preferred Region, or use the default settings. + Select your preferred region, or use the default settings + @label + Timezone: %1 - Timezone: %1 + @label + Timezone: %1 - Select your preferred Zone within your Region. - Select your preferred Zone within your Region. + Select your preferred zone within your region + @label + Zones - Zones + @button + Zones - You can fine-tune Language and Locale settings below. - You can fine-tune Language and Locale settings below. + You can fine-tune language and locale settings below + @label + + + + + Offline-qt6 + + + Select your preferred region, or use the default settings + @label + + + + + + + Timezone: %1 + @label + Timezone: %1 + + + + Select your preferred zone within your region + @label + + + + + Zones + @button + Zones + + + + You can fine-tune language and locale settings below + @label + @@ -2574,11 +2821,6 @@ The installer will quit and all changes will be lost. Unknown error Unknown error - - - Password is empty - Password is empty - PackageChooserPage @@ -2625,8 +2867,8 @@ The installer will quit and all changes will be lost. Page_Keyboard - Keyboard Model: - Keyboard Model: + Keyboard model: + @@ -2635,7 +2877,8 @@ The installer will quit and all changes will be lost. - Keyboard Switch: + Switch Keyboard: + shortcut for switching between keyboard layouts @@ -2769,7 +3012,7 @@ The installer will quit and all changes will be lost. New partition - + %1 %2 size[number] filesystem[name] %1 %2 @@ -2790,27 +3033,27 @@ The installer will quit and all changes will be lost. New partition - + Name Name - + File System File System - + File System Label File System Label - + Mount Point Mount Point - + Size Size @@ -2926,72 +3169,93 @@ The installer will quit and all changes will be lost. After: - + + An EFI system partition is necessary to start %1.<br/><br/>The EFI system partition does not meet recommendations. It is recommended to go back and select or create a suitable filesystem. + + + + + The minimum recommended size for the filesystem is %1 MiB. + + + + + You can continue with this EFI system partition configuration but your system may fail to start. + + + + No EFI system partition configured No EFI system partition configured - + EFI system partition configured incorrectly EFI system partition configured incorrectly - + 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. 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. - + The filesystem must be mounted on <strong>%1</strong>. The filesystem must be mounted on <strong>%1</strong>. - + The filesystem must have type FAT32. The filesystem must have type FAT32. - + + The filesystem must be at least %1 MiB in size. The filesystem must be at least %1 MiB in size. - + The filesystem must have flag <strong>%1</strong> set. 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. You can continue without setting up an EFI system partition but your system may fail to start. - + + EFI system partition recommendation + + + + 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>%2</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>%2</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. @@ -3013,12 +3277,12 @@ The installer will quit and all changes will be lost. PlasmaLnfPage - + Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is set up. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is set up. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. - + Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is installed. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is installed. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. @@ -3052,14 +3316,14 @@ The installer will quit and all changes will be lost. ProcessResult - + There was no output from the command. There was no output from the command. - + Output: @@ -3068,52 +3332,52 @@ Output: - + External command crashed. External command crashed. - + Command <i>%1</i> crashed. Command <i>%1</i> crashed. - + External command failed to start. External command failed to start. - + Command <i>%1</i> failed to start. Command <i>%1</i> failed to start. - + Internal error when starting command. Internal error when starting command. - + Bad parameters for process job call. Bad parameters for process job call. - + External command failed to finish. External command failed to finish. - + Command <i>%1</i> failed to finish in %2 seconds. Command <i>%1</i> failed to finish in %2 seconds. - + External command finished with errors. External command finished with errors. - + Command <i>%1</i> finished with exit code %2. Command <i>%1</i> finished with exit code %2. @@ -3121,30 +3385,10 @@ Output: QObject - + %1 (%2) %1 (%2) - - - unknown - unknown - - - - extended - extended - - - - unformatted - unformatted - - - - swap - swap - @@ -3152,26 +3396,12 @@ Output: Default - - - - - File not found - File not found - - - - Path <pre>%1</pre> must be an absolute path. - Path <pre>%1</pre> must be an absolute path. - - - + Directory not found Directory not found - - + Could not create new random file <pre>%1</pre>. Could not create new random file <pre>%1</pre>. @@ -3195,6 +3425,30 @@ Output: Unpartitioned space or unknown partition table Unpartitioned space or unknown partition table + + + unknown + @partition info + unknown + + + + extended + @partition info + extended + + + + unformatted + @partition info + unformatted + + + + swap + @partition info + swap + Recommended @@ -3254,69 +3508,86 @@ Output: ResizeFSJob - Resize Filesystem Job - Resize Filesystem Job - - - - Invalid configuration - Invalid configuration + Performing file system resize… + @status + + Invalid configuration + @error + Invalid configuration + + + The file-system resize job has an invalid configuration and will not run. - The file-system resize job has an invalid configuration and will not run. + @error + The file-system resize job has an invalid configuration and will not run. - - KPMCore not Available - KPMCore not Available + + KPMCore not available + @error + - - Calamares cannot start KPMCore for the file-system resize job. - Calamares cannot start KPMCore for the file-system resize job. - - - - - - - - Resize Failed - Resize Failed - - - - The filesystem %1 could not be found in this system, and cannot be resized. - The filesystem %1 could not be found in this system, and cannot be resized. + + Calamares cannot start KPMCore for the file system resize job. + @error + + Resize failed. + @error + + + + + The filesystem %1 could not be found in this system, and cannot be resized. + @info + The filesystem %1 could not be found in this system, and cannot be resized. + + + The device %1 could not be found in this system, and cannot be resized. - The device %1 could not be found in this system, and cannot be resized. + @info + The device %1 could not be found in this system, and cannot be resized. - - + + + + + Resize Failed + @error + Resize Failed + + + + The filesystem %1 cannot be resized. - The filesystem %1 cannot be resized. + @error + The filesystem %1 cannot be resized. - - + + The device %1 cannot be resized. - The device %1 cannot be resized. + @error + The device %1 cannot be resized. - - The filesystem %1 must be resized, but cannot. - The filesystem %1 must be resized, but cannot. + + The file system %1 must be resized, but cannot. + @info + - + The device %1 must be resized, but cannot - The device %1 must be resized, but cannot + @info + The device %1 must be resized, but cannot @@ -3424,30 +3695,45 @@ Output: SetKeyboardLayoutJob - Set keyboard model to %1, layout to %2-%3 - Set keyboard model to %1, layout to %2-%3 + Setting keyboard model to %1, layout as %2-%3… + @status, %1 model, %2 layout, %3 variant + - + Failed to write keyboard configuration for the virtual console. - Failed to write keyboard configuration for the virtual console. + @error + Failed to write keyboard configuration for the virtual console. - - - + Failed to write to %1 - Failed to write to %1 + @error, %1 is virtual console configuration path + Failed to write to %1 - + Failed to write keyboard configuration for X11. - Failed to write keyboard configuration for X11. + @error + Failed to write keyboard configuration for X11. - + + Failed to write to %1 + @error, %1 is keyboard configuration path + Failed to write to %1 + + + Failed to write keyboard configuration to existing /etc/default directory. - Failed to write keyboard configuration to existing /etc/default directory. + @error + Failed to write keyboard configuration to existing /etc/default directory. + + + + Failed to write to %1 + @error, %1 is default keyboard path + Failed to write to %1 @@ -3546,28 +3832,28 @@ Output: Setting password for user %1. - + Bad destination system path. Bad destination system path. - + rootMountPoint is %1 rootMountPoint is %1 - + Cannot disable root account. Cannot disable root account. - + Cannot set password for user %1. Cannot set password for user %1. - - + + usermod terminated with error code %1. usermod terminated with error code %1. @@ -3576,38 +3862,40 @@ Output: SetTimezoneJob - Set timezone to %1/%2 - Set timezone to %1/%2 - - - - Cannot access selected timezone path. - Cannot access selected timezone path. + Setting timezone to %1/%2… + @status + + Cannot access selected timezone path. + @error + Cannot access selected timezone path. + + + Bad path: %1 - Bad path: %1 + @error + Bad path: %1 - + + Cannot set timezone. - Cannot set timezone. + @error + Cannot set timezone. - + Link creation failed, target: %1; link name: %2 - Link creation failed, target: %1; link name: %2 + @info + Link creation failed, target: %1; link name: %2 - - Cannot set timezone, - Cannot set timezone, - - - + Cannot open /etc/timezone for writing - Cannot open /etc/timezone for writing + @info + Cannot open /etc/timezone for writing @@ -3989,13 +4277,15 @@ Output: - About %1 setup - About %1 setup + About %1 Setup + @title + - About %1 installer - About %1 installer + About %1 Installer + @title + @@ -4062,24 +4352,36 @@ Output: calamares-sidebar - About About - Debug Debug + + + About + @button + About + Show information about Calamares + @tooltip - + + Debug + @button + Debug + + + Show debug information + @tooltip @@ -4115,57 +4417,136 @@ Output: This log is copied to /var/log/installation.log of the target system.</p> + + finishedq-qt6 + + + Installation Completed + @title + Installation Completed + + + + %1 has been installed on your computer.<br/> + You may now restart into your new system, or continue using the Live environment. + @info, %1 is the product name + %1 has been installed on your computer.<br/> + You may now restart into your new system, or continue using the Live environment. + + + + Close Installer + @button + Close Installer + + + + Restart System + @button + Restart System + + + + <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> + This log is copied to /var/log/installation.log of the target system.</p> + @info + <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> + This log is copied to /var/log/installation.log of the target system.</p> + + finishedq@mobile Installation Completed - Installation Completed + @title + Installation Completed %1 has been installed on your computer.<br/> You may now restart your device. - %1 has been installed on your computer.<br/> + @info, %1 is the product name + %1 has been installed on your computer.<br/> You may now restart your device. - + Close - Close + @button + Close - + Restart - Restart + @button + Restart keyboardq - To activate keyboard preview, select a layout. - To activate keyboard preview, select a layout. + Select a layout to activate keyboard preview + @label + - <b>Keyboard Model:&nbsp;&nbsp;</b> + <b>Keyboard model:&nbsp;&nbsp;</b> + @label Layout + @label Variant + @label - Type here to test your keyboard - Type here to test your keyboard + Type here to test your keyboard… + @label + + + + + keyboardq-qt6 + + + Select a layout to activate keyboard preview + @label + + + + + <b>Keyboard model:&nbsp;&nbsp;</b> + @label + + + + + Layout + @label + + + + + Variant + @label + + + + + Type here to test your keyboard… + @label + @@ -4174,18 +4555,45 @@ Output: Change - Change + @button + Change <h3>Languages</h3> </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>. + @info <h3>Locales</h3> </br> The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>. + @info + + + + + localeq-qt6 + + + + Change + @button + Change + + + + <h3>Languages</h3> </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>. + @info + + + + + <h3>Locales</h3> </br> + The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>. + @info @@ -4239,6 +4647,46 @@ Output: Please select an option for your install, or use the default: LibreOffice included. + + packagechooserq-qt6 + + + 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 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 + 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. + 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 + 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. + 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 + Minimal Install + + + + Please select an option for your install, or use the default: LibreOffice included. + Please select an option for your install, or use the default: LibreOffice included. + + release_notes @@ -4425,34 +4873,197 @@ Output: Enter the same password twice, so that it can be checked for typing errors. + + usersq-qt6 + + + 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. + + + + Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. + Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. + + + + 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. + + + + 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. + + + + Log in automatically without asking for the password + Log in automatically without asking for the password + + + + 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. + + welcomeq - + <h3>Welcome to the %1 <quote>%2</quote> installer</h3> <p>This program will ask you some questions and set up %1 on your computer.</p> <h3>Welcome to the %1 <quote>%2</quote> installer</h3> <p>This program will ask you some questions and set up %1 on your computer.</p> - + Support Support - + Known issues Known issues - + Release notes Release notes - + Donate Donate + + welcomeq-qt6 + + + <h3>Welcome to the %1 <quote>%2</quote> installer</h3> + <p>This program will ask you some questions and set up %1 on your computer.</p> + <h3>Welcome to the %1 <quote>%2</quote> installer</h3> + <p>This program will ask you some questions and set up %1 on your computer.</p> + + + + Support + Support + + + + Known issues + Known issues + + + + Release notes + Release notes + + + + Donate + Donate + + diff --git a/lang/python.pot b/lang/python.pot index ff75d12e7..7e6a6f974 100644 --- a/lang/python.pot +++ b/lang/python.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-28 22:49+0200\n" +"POT-Creation-Date: 2023-12-27 20:44+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,15 +22,15 @@ msgstr "" msgid "Install bootloader." msgstr "" -#: src/modules/bootloader/main.py:644 +#: src/modules/bootloader/main.py:666 msgid "Failed to install grub, no partitions defined in global storage" msgstr "" -#: src/modules/bootloader/main.py:899 +#: src/modules/bootloader/main.py:926 msgid "Bootloader installation error" msgstr "" -#: src/modules/bootloader/main.py:900 +#: src/modules/bootloader/main.py:927 msgid "" "The bootloader could not be installed. The installation command
{!s} returned error code {!s}."
@@ -99,8 +99,8 @@ msgstr ""
 msgid "Dummy python job."
 msgstr ""
 
-#: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:93
-#: src/modules/dummypython/main.py:94
+#: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:104
+#: src/modules/dummypython/main.py:105
 msgid "Dummy python step {}"
 msgstr ""
 
@@ -112,20 +112,20 @@ msgstr ""
 #: src/modules/fstab/main.py:411 src/modules/initcpiocfg/main.py:256
 #: src/modules/initcpiocfg/main.py:260 src/modules/initramfscfg/main.py:85
 #: src/modules/initramfscfg/main.py:89 src/modules/localecfg/main.py:140
-#: src/modules/mount/main.py:329 src/modules/networkcfg/main.py:105
+#: src/modules/mount/main.py:334 src/modules/networkcfg/main.py:106
 #: 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:378 src/modules/initramfscfg/main.py:86
-#: src/modules/mount/main.py:330 src/modules/openrcdmcryptcfg/main.py:73
+#: src/modules/mount/main.py:335 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:384 src/modules/initramfscfg/main.py:90 -#: src/modules/localecfg/main.py:141 src/modules/networkcfg/main.py:106 +#: src/modules/localecfg/main.py:141 src/modules/networkcfg/main.py:107 #: src/modules/openrcdmcryptcfg/main.py:77 msgid "No root mount point is given for
{!s}
to use." msgstr "" @@ -134,7 +134,7 @@ msgstr "" msgid "No
{!s}
configuration is given for
{!s}
to use." msgstr "" -#: src/modules/grubcfg/main.py:29 +#: src/modules/grubcfg/main.py:30 msgid "Configure GRUB." msgstr "" @@ -194,11 +194,11 @@ msgstr "" msgid "Failed to set zfs mountpoint" msgstr "" -#: src/modules/mount/main.py:365 +#: src/modules/mount/main.py:370 msgid "zfs mounting error" msgstr "" -#: src/modules/networkcfg/main.py:29 +#: src/modules/networkcfg/main.py:30 msgid "Saving network configuration." msgstr "" diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index ce821b967..ce05969a8 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -190,7 +190,7 @@ install( DESTINATION include/libcalamares ) # Install each subdir-worth of header files -foreach(subdir geoip locale modulesystem network partition utils) +foreach(subdir geoip locale modulesystem network partition utils compat packages) file(GLOB subdir_headers "${subdir}/*.h") install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir}) endforeach() diff --git a/src/libcalamares/locale/Tests.cpp b/src/libcalamares/locale/Tests.cpp index 6ab78b488..3e463596c 100644 --- a/src/libcalamares/locale/Tests.cpp +++ b/src/libcalamares/locale/Tests.cpp @@ -378,7 +378,7 @@ LocaleTests::testTZLookup() QVERIFY( zones.find( "America", "New_York" ) ); QCOMPARE( zones.find( "America", "New_York" )->zone(), QStringLiteral( "New_York" ) ); - QCOMPARE( zones.find( "America", "New_York" )->tr(), QStringLiteral( "New York" ) ); + QCOMPARE( zones.find( "America", "New_York" )->translated(), QStringLiteral( "New York" ) ); QVERIFY( !zones.find( "Europe", "New_York" ) ); QVERIFY( !zones.find( "America", "New York" ) ); diff --git a/src/libcalamares/locale/TimeZone.cpp b/src/libcalamares/locale/TimeZone.cpp index f39aede68..0115618b7 100644 --- a/src/libcalamares/locale/TimeZone.cpp +++ b/src/libcalamares/locale/TimeZone.cpp @@ -76,7 +76,7 @@ TimeZoneData::TimeZoneData( const QString& region, } QString -TimeZoneData::tr() const +TimeZoneData::translated() const { // NOTE: context name must match what's used in zone-extractor.py return QObject::tr( m_human, "tz_names" ); @@ -86,11 +86,11 @@ class RegionData : public TranslatableString { public: using TranslatableString::TranslatableString; - QString tr() const override; + QString translated() const override; }; QString -RegionData::tr() const +RegionData::translated() const { // NOTE: context name must match what's used in zone-extractor.py return QObject::tr( m_human, "tz_regions" ); @@ -276,7 +276,7 @@ RegionsModel::data( const QModelIndex& index, int role ) const const auto& region = m_private->m_regions[ index.row() ]; if ( role == NameRole ) { - return region->tr(); + return region->translated(); } if ( role == KeyRole ) { @@ -292,13 +292,13 @@ RegionsModel::roleNames() const } QString -RegionsModel::tr( const QString& region ) const +RegionsModel::translated( const QString& region ) const { for ( const auto* p : m_private->m_regions ) { if ( p->key() == region ) { - return p->tr(); + return p->translated(); } } return region; @@ -330,7 +330,7 @@ ZonesModel::data( const QModelIndex& index, int role ) const switch ( role ) { case NameRole: - return zone->tr(); + return zone->translated(); case KeyRole: return zone->key(); case RegionRole: diff --git a/src/libcalamares/locale/TimeZone.h b/src/libcalamares/locale/TimeZone.h index 17043032c..88f841ffd 100644 --- a/src/libcalamares/locale/TimeZone.h +++ b/src/libcalamares/locale/TimeZone.h @@ -48,7 +48,7 @@ class TimeZoneData : public QObject, TranslatableString Q_PROPERTY( QString region READ region CONSTANT ) Q_PROPERTY( QString zone READ zone CONSTANT ) - Q_PROPERTY( QString name READ tr CONSTANT ) + Q_PROPERTY( QString name READ translated CONSTANT ) Q_PROPERTY( QString countryCode READ country CONSTANT ) public: @@ -60,7 +60,7 @@ public: TimeZoneData( const TimeZoneData& ) = delete; TimeZoneData( TimeZoneData&& ) = delete; - QString tr() const override; + QString translated() const override; QString region() const { return m_region; } QString zone() const { return key(); } @@ -106,7 +106,7 @@ public Q_SLOTS: * Returns @p region unchanged if there is no such region * or no translation for the region's name. */ - QString tr( const QString& region ) const; + QString translated( const QString& region ) const; private: Private* m_private; diff --git a/src/libcalamares/locale/TranslatableString.h b/src/libcalamares/locale/TranslatableString.h index 005370b23..438a948bd 100644 --- a/src/libcalamares/locale/TranslatableString.h +++ b/src/libcalamares/locale/TranslatableString.h @@ -41,7 +41,7 @@ public: virtual ~TranslatableString(); /// @brief Give the localized human-readable form - virtual QString tr() const = 0; + virtual QString translated() const = 0; QString key() const { return m_key; } bool operator==( const TranslatableString& other ) const { return m_key == other.m_key; } diff --git a/src/libcalamares/utils/Runner.cpp b/src/libcalamares/utils/Runner.cpp index 632f32028..6a1eb85f8 100644 --- a/src/libcalamares/utils/Runner.cpp +++ b/src/libcalamares/utils/Runner.cpp @@ -128,6 +128,14 @@ Calamares::Utils::Runner::run() { auto env = QProcessEnvironment::systemEnvironment(); env.insert( "LC_ALL", "C" ); + // No guarantees that host settings for /tmp/ make sense in target + if ( m_location == RunLocation::RunInTarget ) + { + env.remove( "TEMP" ); + env.remove( "TEMPDIR" ); + env.remove( "TMP" ); + env.remove( "TMPDIR" ); + } process.setProcessEnvironment( env ); } process.setProcessChannelMode( QProcess::MergedChannels ); diff --git a/src/libcalamaresui/viewpages/ExecutionViewStep.cpp b/src/libcalamaresui/viewpages/ExecutionViewStep.cpp index 80301a5da..cce87ebe5 100644 --- a/src/libcalamaresui/viewpages/ExecutionViewStep.cpp +++ b/src/libcalamaresui/viewpages/ExecutionViewStep.cpp @@ -73,7 +73,9 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent ) { m_widget->setObjectName( "slideshow" ); m_progressBar->setObjectName( "exec-progress" ); - m_progressBar->setFormat( tr( "%p%", "Progress percentage indicator: %p is where the number 0..100 is placed" ) ); + CALAMARES_RETRANSLATE( + m_progressBar->setFormat( tr( "%p%", "Progress percentage indicator: %p is where the number 0..100 is placed" ) ); + ); m_label->setObjectName( "exec-message" ); QVBoxLayout* layout = new QVBoxLayout( m_widget ); diff --git a/src/modules/displaymanager/displaymanager.conf b/src/modules/displaymanager/displaymanager.conf index 81469bd58..e83cb33a5 100644 --- a/src/modules/displaymanager/displaymanager.conf +++ b/src/modules/displaymanager/displaymanager.conf @@ -65,11 +65,14 @@ sysconfigSetup: false # greetd has configurable user and group; the user and group is created if it # does not exist, and the user is set as default-session user. # +# Some greeters for greetd (e.g gtkgreet or regreet) have support for a user's GTK CSS style to change appearance. +# # lightdm has a list of greeters to look for, preferring them in order if # they are installed (if not, picks the alphabetically first greeter that is installed). # greetd: greeter_user: "tom_bombadil" greeter_group: "wheel" + greeter_css_location: "/etc/greetd/style.css" lightdm: preferred_greeters: ["lightdm-greeter.desktop", "slick-greeter.desktop"] diff --git a/src/modules/displaymanager/displaymanager.schema.yaml b/src/modules/displaymanager/displaymanager.schema.yaml index ab89c0ada..0fa438536 100644 --- a/src/modules/displaymanager/displaymanager.schema.yaml +++ b/src/modules/displaymanager/displaymanager.schema.yaml @@ -25,6 +25,7 @@ properties: properties: greeter_user: { type: string } greeter_group: { type: string } + greeter_css_location: { type: string } additionalProperties: false lightdm: type: object diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index 2102a253b..ce4aa0014 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -781,6 +781,7 @@ class DMgreetd(DisplayManager): executable = "greetd" greeter_user = "greeter" greeter_group = "greetd" + greeter_css_location = None config_data = {} def os_path(self, path): @@ -848,6 +849,8 @@ class DMgreetd(DisplayManager): de_command = default_desktop_environment.executable if os.path.exists(self.os_path("usr/bin/gtkgreet")) and os.path.exists(self.os_path("usr/bin/cage")): self.config_data['default_session']['command'] = "cage -d -s -- gtkgreet" + if self.greeter_css_location: + self.config_data['default_session']['command'] += f" -s {self.greeter_css_location}" elif os.path.exists(self.os_path("usr/bin/tuigreet")): tuigreet_base_cmd = "tuigreet --remember --time --issue --asterisks --cmd " self.config_data['default_session']['command'] = tuigreet_base_cmd + de_command diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index 15f84fe75..54ff5eb64 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -390,7 +390,7 @@ Config::currentTimezoneName() const { if ( m_currentLocation ) { - return m_regionModel->tr( m_currentLocation->region() ) + '/' + m_currentLocation->tr(); + return m_regionModel->translated( m_currentLocation->region() ) + '/' + m_currentLocation->translated(); } return QString(); } @@ -407,15 +407,13 @@ localeLabel( const QString& s ) QString Config::currentLanguageStatus() const { - return tr( "The system language will be set to %1", "@info" ) - .arg( localeLabel( m_selectedLocaleConfiguration.language() ) ); + return tr( "The system language will be set to %1.", "@info" ).arg( localeLabel( m_selectedLocaleConfiguration.language() ) ); } QString Config::currentLCStatus() const { - return tr( "The numbers and dates locale will be set to %1", "@info" ) - .arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) ); + return tr( "The numbers and dates locale will be set to %1.", "@info" ).arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) ); } QString diff --git a/src/modules/locale/timezonewidget/timezonewidget.cpp b/src/modules/locale/timezonewidget/timezonewidget.cpp index 519b3fa29..e1d31631f 100644 --- a/src/modules/locale/timezonewidget/timezonewidget.cpp +++ b/src/modules/locale/timezonewidget/timezonewidget.cpp @@ -144,7 +144,7 @@ TimeZoneWidget::paintEvent( QPaintEvent* ) #else auto textwidth = [ & ]( const QString& s ) { return fontMetrics.width( s ); }; #endif - const int textWidth = textwidth( m_currentLocation ? m_currentLocation->tr() : QString() ); + const int textWidth = textwidth( m_currentLocation ? m_currentLocation->translated() : QString() ); const int textHeight = fontMetrics.height(); QRect rect = QRect( point.x() - textWidth / 2 - 5, point.y() - textHeight - 8, textWidth + 10, textHeight - 2 ); @@ -170,7 +170,7 @@ TimeZoneWidget::paintEvent( QPaintEvent* ) painter.setBrush( QColor( 40, 40, 40 ) ); painter.drawRoundedRect( rect, 3, 3 ); painter.setPen( Qt::white ); - painter.drawText( rect.x() + 5, rect.bottom() - 4, m_currentLocation ? m_currentLocation->tr() : QString() ); + painter.drawText( rect.x() + 5, rect.bottom() - 4, m_currentLocation ? m_currentLocation->translated() : QString() ); #endif } diff --git a/src/modules/machineid/MachineIdJob.cpp b/src/modules/machineid/MachineIdJob.cpp index 9bc1b3f6f..87ebb0e40 100644 --- a/src/modules/machineid/MachineIdJob.cpp +++ b/src/modules/machineid/MachineIdJob.cpp @@ -23,13 +23,13 @@ #include -const NamedEnumTable< MachineId::SystemdMachineIdStyle >& +const NamedEnumTable< SystemdMachineIdStyle >& styleNames() { - using T = MachineId::SystemdMachineIdStyle; + using T = SystemdMachineIdStyle; // *INDENT-OFF* // clang-format off - static const NamedEnumTable< MachineId::SystemdMachineIdStyle > names { + static const NamedEnumTable< SystemdMachineIdStyle > names { { QStringLiteral( "none" ), T::Blank }, { QStringLiteral( "blank" ), T::Blank }, { QStringLiteral( "uuid" ), T::Uuid }, @@ -101,8 +101,8 @@ MachineIdJob::exec() QObject::tr( "Directory not found" ), QObject::tr( "Could not create new random file
%1
." ).arg( entropy_file ) ); } - auto r = MachineId::createEntropy( m_entropy_copy ? MachineId::EntropyGeneration::CopyFromHost - : MachineId::EntropyGeneration::New, + auto r = createEntropy( m_entropy_copy ? EntropyGeneration::CopyFromHost + : EntropyGeneration::New, root, entropy_file ); if ( !r ) @@ -116,7 +116,7 @@ MachineIdJob::exec() { cWarning() << "Could not create systemd data-directory."; } - auto r = MachineId::createSystemdMachineId( m_systemd_style, root, target_systemd_machineid_file ); + auto r = createSystemdMachineId( m_systemd_style, root, target_systemd_machineid_file ); if ( !r ) { return r; @@ -130,7 +130,7 @@ MachineIdJob::exec() } if ( m_dbus_symlink && QFile::exists( root + target_systemd_machineid_file ) ) { - auto r = MachineId::createDBusLink( root, target_dbus_machineid_file, target_systemd_machineid_file ); + auto r = createDBusLink( root, target_dbus_machineid_file, target_systemd_machineid_file ); if ( !r ) { return r; @@ -138,7 +138,7 @@ MachineIdJob::exec() } else { - auto r = MachineId::createDBusMachineId( root, target_dbus_machineid_file ); + auto r = createDBusMachineId( root, target_dbus_machineid_file ); if ( !r ) { return r; @@ -157,7 +157,7 @@ MachineIdJob::setConfigurationMap( const QVariantMap& map ) const auto style = Calamares::getString( map, "systemd-style", QString() ); if ( !style.isEmpty() ) { - m_systemd_style = styleNames().find( style, MachineId::SystemdMachineIdStyle::Uuid ); + m_systemd_style = styleNames().find( style, SystemdMachineIdStyle::Uuid ); } m_dbus = Calamares::getBool( map, "dbus", false ); @@ -179,7 +179,7 @@ MachineIdJob::setConfigurationMap( const QVariantMap& map ) m_entropy_files = Calamares::getStringList( map, "entropy-files" ); if ( Calamares::getBool( map, "entropy", false ) ) { - cWarning() << "MachineId:: configuration setting *entropy* is deprecated, use *entropy-files* instead."; + cWarning() << " configuration setting *entropy* is deprecated, use *entropy-files* instead."; m_entropy_files.append( QStringLiteral( "/var/lib/urandom/random-seed" ) ); } m_entropy_files.removeDuplicates(); diff --git a/src/modules/machineid/MachineIdJob.h b/src/modules/machineid/MachineIdJob.h index b564b3708..102918228 100644 --- a/src/modules/machineid/MachineIdJob.h +++ b/src/modules/machineid/MachineIdJob.h @@ -48,7 +48,7 @@ public: private: bool m_systemd = false; ///< write systemd's files - MachineId::SystemdMachineIdStyle m_systemd_style = MachineId::SystemdMachineIdStyle::Uuid; + SystemdMachineIdStyle m_systemd_style = SystemdMachineIdStyle::Uuid; bool m_dbus = false; ///< write dbus files bool m_dbus_symlink = false; ///< .. or just symlink to systemd diff --git a/src/modules/machineid/Tests.cpp b/src/modules/machineid/Tests.cpp index 9209f7998..915812814 100644 --- a/src/modules/machineid/Tests.cpp +++ b/src/modules/machineid/Tests.cpp @@ -127,18 +127,18 @@ MachineIdTests::testCopyFile() QVERIFY( source.exists() ); // This should fail since "example" isn't standard in our test directory - auto r0 = MachineId::copyFile( tempRoot.path(), "example" ); + auto r0 = copyFile( tempRoot.path(), "example" ); QVERIFY( !r0 ); const QString sampleFile = QStringLiteral( "CMakeCache.txt" ); if ( QFile::exists( sampleFile ) ) { - auto r1 = MachineId::copyFile( tempRoot.path(), sampleFile ); + auto r1 = copyFile( tempRoot.path(), sampleFile ); // Also fail, because it's not an absolute path QVERIFY( !r1 ); QVERIFY( QFile::copy( sampleFile, tempISOdir.path() + '/' + sampleFile ) ); - auto r2 = MachineId::copyFile( tempRoot.path(), tempISOdir.path() + '/' + sampleFile ); + auto r2 = copyFile( tempRoot.path(), tempISOdir.path() + '/' + sampleFile ); QVERIFY( r2 ); } } diff --git a/src/modules/machineid/Workers.cpp b/src/modules/machineid/Workers.cpp index 1dd2321cf..fe86401d5 100644 --- a/src/modules/machineid/Workers.cpp +++ b/src/modules/machineid/Workers.cpp @@ -12,6 +12,8 @@ #include "Workers.h" +#include "MachineIdJob.h" + #include "utils/Entropy.h" #include "utils/Logger.h" #include "utils/System.h" @@ -46,9 +48,6 @@ getUrandomPoolSize() return ( poolSize >= minimumPoolSize ) ? poolSize : minimumPoolSize; } -namespace MachineId -{ - static inline bool isAbsolutePath( const QString& fileName ) { @@ -61,19 +60,19 @@ copyFile( const QString& rootMountPoint, const QString& fileName ) if ( !isAbsolutePath( fileName ) ) { return Calamares::JobResult::internalError( - QObject::tr( "File not found" ), - QObject::tr( "Path
%1
must be an absolute path." ).arg( fileName ), + MachineIdJob::tr( "File not found" ), + MachineIdJob::tr( "Path
%1
must be an absolute path." ).arg( fileName ), 0 ); } QFile f( fileName ); if ( !f.exists() ) { - return Calamares::JobResult::error( QObject::tr( "File not found" ), fileName ); + return Calamares::JobResult::error( MachineIdJob::tr( "File not found" ), fileName ); } if ( !f.copy( rootMountPoint + fileName ) ) { - return Calamares::JobResult::error( QObject::tr( "File not found" ), rootMountPoint + fileName ); + return Calamares::JobResult::error( MachineIdJob::tr( "File not found" ), rootMountPoint + fileName ); } return Calamares::JobResult::ok(); } @@ -90,8 +89,8 @@ createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fi if ( !entropyFile.open( QIODevice::WriteOnly ) ) { return Calamares::JobResult::error( - QObject::tr( "File not found" ), - QObject::tr( "Could not create new random file
%1
." ).arg( fileName ) ); + MachineIdJob::tr( "File not found" ), + MachineIdJob::tr( "Could not create new random file
%1
." ).arg( fileName ) ); } QByteArray data; @@ -190,5 +189,3 @@ createDBusLink( const QString& rootMountPoint, const QString& fileName, const QS Q_UNUSED( rootMountPoint ) return runCmd( QStringList { QStringLiteral( "ln" ), QStringLiteral( "-sf" ), systemdFileName, fileName }, true ); } - -} // namespace MachineId diff --git a/src/modules/machineid/Workers.h b/src/modules/machineid/Workers.h index 577090a46..7665a1571 100644 --- a/src/modules/machineid/Workers.h +++ b/src/modules/machineid/Workers.h @@ -7,14 +7,11 @@ * */ -#ifndef WORKERS_H -#define WORKERS_H +#ifndef MACHINEID_WORKERS_H +#define MACHINEID_WORKERS_H #include "Job.h" -/// @brief Utility functions for doing the random-data stuff for MachineId -namespace MachineId -{ /** @brief Utility functions * * These probably belong in libcalamares, since they're general utilities @@ -70,7 +67,4 @@ enum class SystemdMachineIdStyle Calamares::JobResult createSystemdMachineId( SystemdMachineIdStyle style, const QString& rootMountPoint, const QString& fileName ); - -} // namespace MachineId - #endif // WORKERS_H diff --git a/src/modules/packagechooser/CMakeLists.txt b/src/modules/packagechooser/CMakeLists.txt index 1f517fd33..b878fef1c 100644 --- a/src/modules/packagechooser/CMakeLists.txt +++ b/src/modules/packagechooser/CMakeLists.txt @@ -10,9 +10,9 @@ set(_extra_src "") ### OPTIONAL AppData XML support in PackageModel # # -option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON) +option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF) if(BUILD_APPDATA) - find_package(${qtname} COMPONENTS Xml) + find_package(${qtname} REQUIRED COMPONENTS Xml) if(TARGET ${qtname}::Xml) add_definitions(-DHAVE_APPDATA) list(APPEND _extra_libraries ${qtname}::Xml) @@ -23,23 +23,7 @@ endif() ### OPTIONAL AppStream support in PackageModel # # -option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON) -if(BUILD_APPSTREAM) - find_package(AppStreamQt) - set_package_properties( - AppStreamQt - PROPERTIES - DESCRIPTION "Support for AppStream (cache) data" - URL "https://github.com/ximion/appstream" - PURPOSE "AppStream provides package data" - TYPE OPTIONAL - ) - if(AppStreamQt_FOUND) - add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR}) - list(APPEND _extra_libraries AppStreamQt) - list(APPEND _extra_src ItemAppStream.cpp) - endif() -endif() +include(AppStreamHelper) calamares_add_plugin(packagechooser TYPE viewmodule @@ -59,6 +43,11 @@ calamares_add_plugin(packagechooser SHARED_LIB ) +if(AppStreamQt_FOUND) + target_link_libraries(calamares_viewmodule_packagechooser PRIVATE calamares::appstreamqt) + target_sources(calamares_viewmodule_packagechooser PRIVATE ItemAppStream.cpp) +endif() + calamares_add_test( packagechoosertest GUI diff --git a/src/modules/packagechooser/Config.cpp b/src/modules/packagechooser/Config.cpp index 931071a4e..642311b33 100644 --- a/src/modules/packagechooser/Config.cpp +++ b/src/modules/packagechooser/Config.cpp @@ -16,7 +16,6 @@ #ifdef HAVE_APPSTREAM_VERSION #include "ItemAppStream.h" -#include #include #endif diff --git a/src/modules/packagechooser/ItemAppStream.cpp b/src/modules/packagechooser/ItemAppStream.cpp index 7592c8308..a3b6e248d 100644 --- a/src/modules/packagechooser/ItemAppStream.cpp +++ b/src/modules/packagechooser/ItemAppStream.cpp @@ -7,20 +7,16 @@ * */ -/** @brief Loading items from AppData XML files. +/** @brief Loading items from AppStream database. * - * Only used if QtXML is found, implements PackageItem::fromAppData(). + * Only used if AppStreamQt is found, implements PackageItem::fromAppStream(). */ -#include "PackageModel.h" +#include "ItemAppStream.h" #include "locale/TranslationsModel.h" #include "utils/Logger.h" #include "utils/Variant.h" -#include -#include -#include - /// @brief Return number of pixels in a size, for < ordering purposes static inline quint64 sizeOrder( const QSize& size ) diff --git a/src/modules/packagechooser/ItemAppStream.h b/src/modules/packagechooser/ItemAppStream.h index 5d92ab443..a087a56dc 100644 --- a/src/modules/packagechooser/ItemAppStream.h +++ b/src/modules/packagechooser/ItemAppStream.h @@ -12,10 +12,28 @@ #include "PackageModel.h" -namespace AppStream -{ -class Pool; -} // namespace AppStream +/* + * This weird include mechanism is because an #include line is allowed + * to consist of preprocessor-tokens, which are expanded, and then + * the #include is *re*processed. But if it starts with < or ", then + * preprocessor tokens are not expanded. So we build up a #include <> + * style line with a suitable path -- if we are given a value for + * HAVE_APPSTREAM_HEADERS, that is the directory that the AppStreamQt + * headers live in. + */ +#define CALAMARES_LT < +#define CALAMARES_GT > + +#ifndef HAVE_APPSTREAM_HEADERS +#define HAVE_APPSTREAM_HEADERS AppStreamQt +#endif + +#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/pool.h CALAMARES_GT +#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/image.h CALAMARES_GT +#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/screenshot.h CALAMARES_GT + +#undef CALAMARES_LT +#undef CALAMARES_GT /** @brief Loads an item from AppStream data. * diff --git a/src/modules/packagechooserq/CMakeLists.txt b/src/modules/packagechooserq/CMakeLists.txt index b0b1f738d..12c992b68 100644 --- a/src/modules/packagechooserq/CMakeLists.txt +++ b/src/modules/packagechooserq/CMakeLists.txt @@ -10,9 +10,8 @@ if(NOT WITH_QML) endif() find_package(${qtname} ${QT_VERSION} CONFIG REQUIRED Core) - -# Add optional libraries here -set(USER_EXTRA_LIB) +set(_extra_libraries "") +set(_extra_src "") # include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser ) set(_packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser) @@ -21,9 +20,9 @@ include_directories(${_packagechooser}) ### OPTIONAL AppData XML support in PackageModel # # -option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON) +option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF) if(BUILD_APPDATA) - find_package(${qtname} COMPONENTS Xml) + find_package(${qtname} REQUIRED COMPONENTS Xml) if(TARGET ${qtname}::Xml) add_definitions(-DHAVE_APPDATA) list(APPEND _extra_libraries ${qtname}::Xml) @@ -34,23 +33,7 @@ endif() ### OPTIONAL AppStream support in PackageModel # # -option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON) -if(BUILD_APPSTREAM) - find_package(AppStreamQt) - set_package_properties( - AppStreamQt - PROPERTIES - DESCRIPTION "Support for AppStream (cache) data" - URL "https://github.com/ximion/appstream" - PURPOSE "AppStream provides package data" - TYPE OPTIONAL - ) - if(AppStreamQt_FOUND) - add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR}) - list(APPEND _extra_libraries AppStreamQt) - list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp) - endif() -endif() +include(AppStreamHelper) calamares_add_plugin(packagechooserq TYPE viewmodule @@ -67,3 +50,8 @@ calamares_add_plugin(packagechooserq ${_extra_libraries} SHARED_LIB ) + +if(AppStreamQt_FOUND) + target_link_libraries(calamares_viewmodule_packagechooserq PRIVATE calamares::appstreamqt) + target_sources(calamares_viewmodule_packagechooserq PRIVATE ${_packagechooser}/ItemAppStream.cpp) +endif() diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index 9bf9e2642..0fabe26e1 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -53,7 +53,7 @@ PartitionViewStep::PartitionViewStep( QObject* parent ) m_waitingWidget = new WaitingWidget( QString() ); m_widget->addWidget( m_waitingWidget ); CALAMARES_RETRANSLATE( - if ( m_waitingWidget ) { m_waitingWidget->setText( tr( "Gathering system information..." ) ); } ); + if ( m_waitingWidget ) { m_waitingWidget->setText( tr( "Gathering system information…", "@status" ) ); } ); m_core = new PartitionCoreModule( this ); // Unusable before init is complete! // We're not done loading, but we need the configuration map first. @@ -104,7 +104,7 @@ PartitionViewStep::~PartitionViewStep() QString PartitionViewStep::prettyName() const { - return tr( "Partitions" ); + return tr( "Partitions", "@label" ); } /** @brief Gather the pretty descriptions of all the partitioning jobs @@ -140,17 +140,17 @@ modeDescription( Config::InstallChoice choice ) switch ( choice ) { case Config::InstallChoice::Alongside: - return QCoreApplication::translate( context, "Install %1 alongside another operating system." ) + return QCoreApplication::translate( context, "Install %1 alongside another operating system", "@label" ) .arg( branding->shortVersionedName() ); case Config::InstallChoice::Erase: - return QCoreApplication::translate( context, "Erase disk and install %1." ) + return QCoreApplication::translate( context, "Erase disk and install %1", "@label" ) .arg( branding->shortVersionedName() ); case Config::InstallChoice::Replace: - return QCoreApplication::translate( context, "Replace a partition with %1." ) + return QCoreApplication::translate( context, "Replace a partition with %1", "@label" ) .arg( branding->shortVersionedName() ); case Config::InstallChoice::NoChoice: case Config::InstallChoice::Manual: - return QCoreApplication::translate( context, "Manual partitioning." ); + return QCoreApplication::translate( context, "Manual partitioning", "@label" ); } return QString(); } @@ -176,26 +176,26 @@ diskDescription( int listLength, const PartitionCoreModule::SummaryInfo& info, C return QCoreApplication::translate( context, "Install %1 alongside another operating system on disk " - "%2 (%3)." ) + "%2 (%3)", "@info" ) .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); case Config::Erase: return QCoreApplication::translate( context, - "Erase disk %2 (%3) and install %1." ) + "Erase disk %2 (%3) and install %1", "@info" ) .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); case Config::Replace: return QCoreApplication::translate( - context, "Replace a partition on disk %2 (%3) with %1." ) + context, "Replace a partition on disk %2 (%3) with %1", "@info" ) .arg( branding->shortVersionedName() ) .arg( info.deviceNode ) .arg( info.deviceName ); case Config::NoChoice: case Config::Manual: return QCoreApplication::translate( - context, "Manual partitioning on disk %1 (%2)." ) + context, "Manual partitioning on disk %1 (%2)", "@info" ) .arg( info.deviceNode ) .arg( info.deviceName ); } @@ -203,7 +203,7 @@ diskDescription( int listLength, const PartitionCoreModule::SummaryInfo& info, C } else // multiple disk previews! { - return QCoreApplication::translate( context, "Disk %1 (%2)" ) + return QCoreApplication::translate( context, "Disk %1 (%2)", "@info" ) .arg( info.deviceNode ) .arg( info.deviceName ); } @@ -293,7 +293,7 @@ PartitionViewStep::createSummaryWidget() const field->setSpacing( 6 ); field->addWidget( preview ); field->addWidget( previewLabels ); - formLayout->addRow( tr( "Current:" ), field ); + formLayout->addRow( tr( "Current:", "@label" ), field ); preview = new PartitionBarsView; preview->setNestedPartitionsMode( mode ); @@ -311,7 +311,7 @@ PartitionViewStep::createSummaryWidget() const field->setSpacing( 6 ); field->addWidget( preview ); field->addWidget( previewLabels ); - formLayout->addRow( tr( "After:" ), field ); + formLayout->addRow( tr( "After:", "@label" ), field ); } const QStringList jobsLines = jobDescriptions( jobs() ); if ( !jobsLines.isEmpty() ) diff --git a/src/modules/partition/core/BootLoaderModel.cpp b/src/modules/partition/core/BootLoaderModel.cpp index f659fc593..1e5e75f07 100644 --- a/src/modules/partition/core/BootLoaderModel.cpp +++ b/src/modules/partition/core/BootLoaderModel.cpp @@ -57,7 +57,7 @@ BootLoaderModel::createMbrItems() { for ( auto device : m_devices ) { - QString text = tr( "Master Boot Record of %1" ).arg( device->name() ); + QString text = tr( "Master Boot Record of %1", "@info" ).arg( device->name() ); appendRow( createBootLoaderItem( text, device->deviceNode(), false ) ); } } @@ -90,14 +90,14 @@ BootLoaderModel::updateInternal() Partition* partition = KPMHelpers::findPartitionByMountPoint( m_devices, "/boot" ); if ( partition ) { - partitionText = tr( "Boot Partition" ); + partitionText = tr( "Boot Partition", "@info" ); } else { partition = KPMHelpers::findPartitionByMountPoint( m_devices, "/" ); if ( partition ) { - partitionText = tr( "System Partition" ); + partitionText = tr( "System Partition", "@info" ); } } @@ -128,7 +128,7 @@ BootLoaderModel::updateInternal() } // Create "don't install bootloader" item. This is always available, // also if there was no /boot or / partition found. - appendRow( createBootLoaderItem( tr( "Do not install a boot loader" ), QString(), false ) ); + appendRow( createBootLoaderItem( tr( "Do not install a boot loader", "@label" ), QString(), false ) ); } diff --git a/src/modules/partition/core/PartitionModel.cpp b/src/modules/partition/core/PartitionModel.cpp index a0594a4c3..a9d49dc37 100644 --- a/src/modules/partition/core/PartitionModel.cpp +++ b/src/modules/partition/core/PartitionModel.cpp @@ -154,11 +154,11 @@ PartitionModel::data( const QModelIndex& index, int role ) const { if ( isPartitionFreeSpace( partition ) ) { - return tr( "Free Space" ); + return tr( "Free Space", "@title" ); } else { - return isPartitionNew( partition ) ? tr( "New partition" ) : partition->partitionPath(); + return isPartitionNew( partition ) ? tr( "New Partition", "@title" ) : partition->partitionPath(); } } if ( col == FileSystemColumn ) @@ -198,11 +198,11 @@ PartitionModel::data( const QModelIndex& index, int role ) const { if ( isPartitionFreeSpace( partition ) ) { - name = tr( "Free Space" ); + name = tr( "Free Space", "@title" ); } else { - name = isPartitionNew( partition ) ? tr( "New partition" ) : partition->partitionPath(); + name = isPartitionNew( partition ) ? tr( "New Partition", "@title" ) : partition->partitionPath(); } } QString prettyFileSystem = Calamares::Partition::prettyNameForFileSystemType( partition->fileSystem().type() ); @@ -304,15 +304,15 @@ PartitionModel::headerData( int section, Qt::Orientation, int role ) const switch ( section ) { case NameColumn: - return tr( "Name" ); + return tr( "Name", "@title" ); case FileSystemColumn: - return tr( "File System" ); + return tr( "File System", "@title" ); case FileSystemLabelColumn: - return tr( "File System Label" ); + return tr( "File System Label", "@title" ); case MountPointColumn: - return tr( "Mount Point" ); + return tr( "Mount Point", "@title" ); case SizeColumn: - return tr( "Size" ); + return tr( "Size", "@title" ); default: cDebug() << "Unknown column" << section; return QVariant(); diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 8e7f36258..34d94356f 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -134,9 +134,9 @@ void ChoicePage::retranslate() { retranslateUi( this ); - m_drivesLabel->setText( tr( "Select storage de&vice:" ) ); - m_previewBeforeLabel->setText( tr( "Current:" ) ); - m_previewAfterLabel->setText( tr( "After:" ) ); + m_drivesLabel->setText( tr( "Select storage de&vice:", "@label" ) ); + m_previewBeforeLabel->setText( tr( "Current:", "@label" ) ); + m_previewAfterLabel->setText( tr( "After:", "@label" ) ); updateSwapChoicesTr(); updateChoiceButtonsTr(); @@ -893,7 +893,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current ) m_reuseHomeCheckBox->setVisible( !homePartitionPath->isEmpty() ); if ( !homePartitionPath->isEmpty() ) { - m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." ) + m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2", "@label" ) .arg( *homePartitionPath ) .arg( Calamares::Branding::instance()->shortProductName() ) ); } @@ -1031,7 +1031,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) { m_encryptWidget->show(); } - m_previewBeforeLabel->setText( tr( "Current:" ) ); + m_previewBeforeLabel->setText( tr( "Current:", "@label" ) ); m_selectLabel->setText( tr( "Select a partition to shrink, " "then drag the bottom bar to resize" ) ); m_selectLabel->show(); @@ -1057,7 +1057,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) Q_UNUSED( path ) sizeLabel->setText( tr( "%1 will be shrunk to %2MiB and a new " - "%3MiB partition will be created for %4." ) + "%3MiB partition will be created for %4.", "@info, %1 is partition name, %4 is product name" ) .arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() ) .arg( Calamares::BytesToMiB( size ) ) .arg( Calamares::BytesToMiB( sizeNext ) ) @@ -1082,7 +1082,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) case InstallChoice::Replace: { m_encryptWidget->setVisible( shouldShowEncryptWidget( choice ) ); - m_previewBeforeLabel->setText( tr( "Current:" ) ); + m_previewBeforeLabel->setText( tr( "Current:", "@label" ) ); m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame ); m_afterPartitionBarsView->setNestedPartitionsMode( mode ); m_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame ); @@ -1126,7 +1126,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) m_beforePartitionLabelsView->setSelectionFilter( filter ); m_selectLabel->show(); - m_selectLabel->setText( tr( "Select a partition to install on" ) ); + m_selectLabel->setText( tr( "Select a partition to install on", "@label" ) ); } break; @@ -1135,7 +1135,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice ) case InstallChoice::Manual: m_selectLabel->hide(); m_previewAfterFrame->hide(); - m_previewBeforeLabel->setText( tr( "Current:" ) ); + m_previewBeforeLabel->setText( tr( "Current:", "@label" ) ); m_previewAfterLabel->hide(); m_encryptWidget->hide(); break; @@ -1188,21 +1188,21 @@ ChoicePage::setupEfiSystemPartitionSelector() { m_efiLabel->setText( tr( "An EFI system partition cannot be found anywhere " "on this system. Please go back and use manual " - "partitioning to set up %1." ) + "partitioning to set up %1.", "@info, %1 is product name" ) .arg( Calamares::Branding::instance()->shortProductName() ) ); updateNextEnabled(); } else if ( efiSystemPartitions.count() == 1 ) //probably most usual situation { m_efiLabel->setText( tr( "The EFI system partition at %1 will be used for " - "starting %2." ) + "starting %2.", "@info, %1 is partition path, %2 is product name" ) .arg( efiSystemPartitions.first()->partitionPath() ) .arg( Calamares::Branding::instance()->shortProductName() ) ); } else { m_efiComboBox->show(); - m_efiLabel->setText( tr( "EFI system partition:" ) ); + m_efiLabel->setText( tr( "EFI system partition:", "@label" ) ); for ( int i = 0; i < efiSystemPartitions.count(); ++i ) { Partition* efiPartition = efiSystemPartitions.at( i ); @@ -1505,12 +1505,12 @@ ChoicePage::setupActions() { if ( atLeastOneIsMounted ) { - m_messageLabel->setText( tr( "This storage device has one of its partitions mounted." ) ); + m_messageLabel->setText( tr( "This storage device has one of its partitions mounted.", "@info" ) ); } else { m_messageLabel->setText( - tr( "This storage device is a part of an inactive RAID device." ) ); + tr( "This storage device is a part of an inactive RAID device.", "@info" ) ); } m_messageLabel->show(); @@ -1625,7 +1625,7 @@ ChoicePage::updateSwapChoicesTr() // toInt() returns 0 on failure, so check for ok if ( ok ) // It was explicitly set to 0 { - m_eraseSwapChoiceComboBox->setItemText( index, tr( "No Swap" ) ); + m_eraseSwapChoiceComboBox->setItemText( index, tr( "No swap", "@label" ) ); } else { @@ -1634,16 +1634,16 @@ ChoicePage::updateSwapChoicesTr() } break; case SwapChoice::ReuseSwap: - m_eraseSwapChoiceComboBox->setItemText( index, tr( "Reuse Swap" ) ); + m_eraseSwapChoiceComboBox->setItemText( index, tr( "Reuse swap", "@label" ) ); break; case SwapChoice::SmallSwap: - m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (no Hibernate)" ) ); + m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (no Hibernate)", "@label" ) ); break; case SwapChoice::FullSwap: - m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (with Hibernate)" ) ); + m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (with Hibernate)", "@label" ) ); break; case SwapChoice::SwapFile: - m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap to file" ) ); + m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap to file", "@label" ) ); break; default: cWarning() << "Box item" << index << m_eraseSwapChoiceComboBox->itemText( index ) << "has role" << value; @@ -1684,7 +1684,7 @@ ChoicePage::createBootloaderPanel() mainLayout->setContentsMargins( 0, 0, 0, 0 ); QLabel* widgetLabel = new QLabel( panelWidget ); mainLayout->addWidget( widgetLabel ); - widgetLabel->setText( tr( "Boot loader location:" ) ); + widgetLabel->setText( tr( "Bootloader location:", "@label" ) ); QComboBox* comboForBootloader = new QComboBox( panelWidget ); comboForBootloader->setModel( m_core->bootLoaderModel() ); diff --git a/src/modules/partition/gui/CreatePartitionDialog.cpp b/src/modules/partition/gui/CreatePartitionDialog.cpp index d33949397..d18676138 100644 --- a/src/modules/partition/gui/CreatePartitionDialog.cpp +++ b/src/modules/partition/gui/CreatePartitionDialog.cpp @@ -64,7 +64,7 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, , m_usedMountPoints( usedMountPoints ) { m_ui->setupUi( this ); - m_ui->encryptWidget->setText( tr( "En&crypt" ) ); + m_ui->encryptWidget->setText( tr( "En&crypt", "@action" ) ); m_ui->encryptWidget->hide(); if ( m_device->type() != Device::Type::LVM_Device ) @@ -192,12 +192,12 @@ CreatePartitionDialog::initMbrPartitionTypeUi() if ( !parentIsPartitionTable ) { m_role = PartitionRole( PartitionRole::Logical ); - fixedPartitionString = tr( "Logical" ); + fixedPartitionString = tr( "Logical", "@label" ); } else if ( m_device->partitionTable()->hasExtended() ) { m_role = PartitionRole( PartitionRole::Primary ); - fixedPartitionString = tr( "Primary" ); + fixedPartitionString = tr( "Primary", "@label" ); } if ( fixedPartitionString.isEmpty() ) @@ -216,7 +216,7 @@ void CreatePartitionDialog::initGptPartitionTypeUi() { m_role = PartitionRole( PartitionRole::Primary ); - m_ui->fixedPartitionLabel->setText( tr( "GPT" ) ); + m_ui->fixedPartitionLabel->setText( tr( "GPT", "@label" ) ); m_ui->primaryRadioButton->hide(); m_ui->extendedRadioButton->hide(); } diff --git a/src/modules/partition/gui/CreateVolumeGroupDialog.cpp b/src/modules/partition/gui/CreateVolumeGroupDialog.cpp index d0eacb725..3d13687bb 100644 --- a/src/modules/partition/gui/CreateVolumeGroupDialog.cpp +++ b/src/modules/partition/gui/CreateVolumeGroupDialog.cpp @@ -25,7 +25,7 @@ CreateVolumeGroupDialog::CreateVolumeGroupDialog( QString& vgName, , m_selectedPVs( selectedPVs ) , m_peSize( pSize ) { - setWindowTitle( tr( "Create Volume Group" ) ); + setWindowTitle( tr( "Create Volume Group", "@title" ) ); peSize()->setValue( pSize ); diff --git a/src/modules/partition/gui/EncryptWidget.cpp b/src/modules/partition/gui/EncryptWidget.cpp index cd0062e4d..176a7c610 100644 --- a/src/modules/partition/gui/EncryptWidget.cpp +++ b/src/modules/partition/gui/EncryptWidget.cpp @@ -150,12 +150,12 @@ EncryptWidget::updateState( const bool notify ) if ( p1.isEmpty() && p2.isEmpty() ) { applyPixmap( m_ui->m_iconLabel, Calamares::StatusWarning ); - m_ui->m_iconLabel->setToolTip( tr( "Please enter the same passphrase in both boxes." ) ); + m_ui->m_iconLabel->setToolTip( tr( "Please enter the same passphrase in both boxes.", "@tooltip" ) ); } else if ( m_filesystem == FileSystem::Zfs && p1.length() < ZFS_MIN_LENGTH ) { applyPixmap( m_ui->m_iconLabel, Calamares::StatusError ); - m_ui->m_iconLabel->setToolTip( tr( "Password must be a minimum of %1 characters" ).arg( ZFS_MIN_LENGTH ) ); + m_ui->m_iconLabel->setToolTip( tr( "Password must be a minimum of %1 characters.", "@tooltip" ).arg( ZFS_MIN_LENGTH ) ); } else if ( p1 == p2 ) { @@ -165,7 +165,7 @@ EncryptWidget::updateState( const bool notify ) else { applyPixmap( m_ui->m_iconLabel, Calamares::StatusError ); - m_ui->m_iconLabel->setToolTip( tr( "Please enter the same passphrase in both boxes." ) ); + m_ui->m_iconLabel->setToolTip( tr( "Please enter the same passphrase in both boxes.", "@tooltip" ) ); } } diff --git a/src/modules/partition/gui/PartitionDialogHelpers.cpp b/src/modules/partition/gui/PartitionDialogHelpers.cpp index 1ba110338..b41c12cc9 100644 --- a/src/modules/partition/gui/PartitionDialogHelpers.cpp +++ b/src/modules/partition/gui/PartitionDialogHelpers.cpp @@ -88,12 +88,12 @@ validateMountPoint( const QString& mountPoint, const QStringList& inUse, QLabel* if ( inUse.contains( mountPoint ) ) { - msg = CreatePartitionDialog::tr( "Mountpoint already in use. Please select another one." ); + msg = CreatePartitionDialog::tr( "Mountpoint already in use. Please select another one.", "@info" ); ok = false; } else if ( !mountPoint.isEmpty() && !mountPoint.startsWith( '/' ) ) { - msg = CreatePartitionDialog::tr( "Mountpoint must start with a /." ); + msg = CreatePartitionDialog::tr( "Mountpoint must start with a /.", "@info" ); ok = false; } diff --git a/src/modules/partition/gui/PartitionLabelsView.cpp b/src/modules/partition/gui/PartitionLabelsView.cpp index a9c940d37..e338da252 100644 --- a/src/modules/partition/gui/PartitionLabelsView.cpp +++ b/src/modules/partition/gui/PartitionLabelsView.cpp @@ -36,7 +36,7 @@ static const int CORNER_RADIUS = 2; static QStringList buildUnknownDisklabelTexts( Device* dev ) { - QStringList texts = { QObject::tr( "Unpartitioned space or unknown partition table" ), + QStringList texts = { QObject::tr( "Unpartitioned space or unknown partition table", "@info" ), formatByteSize( dev->totalLogical() * dev->logicalSize() ) }; return texts; } @@ -179,28 +179,28 @@ PartitionLabelsView::buildTexts( const QModelIndex& index ) const } else if ( mountPoint == "/home" ) { - firstLine = tr( "Home" ); + firstLine = tr( "Home", "@label" ); } else if ( mountPoint == "/boot" ) { - firstLine = tr( "Boot" ); + firstLine = tr( "Boot", "@label" ); } else if ( mountPoint.contains( "/efi" ) && index.data( PartitionModel::FileSystemTypeRole ).toInt() == FileSystem::Fat32 ) { - firstLine = tr( "EFI system" ); + firstLine = tr( "EFI system", "@label" ); } else if ( index.data( PartitionModel::FileSystemTypeRole ).toInt() == FileSystem::LinuxSwap ) { - firstLine = tr( "Swap" ); + firstLine = tr( "Swap", "@label" ); } else if ( !mountPoint.isEmpty() ) { - firstLine = tr( "New partition for %1" ).arg( mountPoint ); + firstLine = tr( "New partition for %1", "@label" ).arg( mountPoint ); } else { - firstLine = tr( "New partition" ); + firstLine = tr( "New partition", "@label" ); } } } diff --git a/src/modules/partition/gui/ResizeVolumeGroupDialog.cpp b/src/modules/partition/gui/ResizeVolumeGroupDialog.cpp index d0103954d..d0d7e7e30 100644 --- a/src/modules/partition/gui/ResizeVolumeGroupDialog.cpp +++ b/src/modules/partition/gui/ResizeVolumeGroupDialog.cpp @@ -27,7 +27,7 @@ ResizeVolumeGroupDialog::ResizeVolumeGroupDialog( LvmDevice* device, : VolumeGroupBaseDialog( device->name(), device->physicalVolumes(), parent ) , m_selectedPVs( selectedPVs ) { - setWindowTitle( tr( "Resize Volume Group" ) ); + setWindowTitle( tr( "Resize Volume Group", "@title" ) ); for ( int i = 0; i < pvList()->count(); i++ ) { diff --git a/src/modules/partition/gui/ScanningDialog.cpp b/src/modules/partition/gui/ScanningDialog.cpp index 7dd85ff86..8418d8ec8 100644 --- a/src/modules/partition/gui/ScanningDialog.cpp +++ b/src/modules/partition/gui/ScanningDialog.cpp @@ -65,7 +65,7 @@ ScanningDialog::run( const QFuture< void >& future, void ScanningDialog::run( const QFuture< void >& future, const std::function< void() >& callback, QWidget* parent ) { - ScanningDialog::run( future, tr( "Scanning storage devices..." ), tr( "Partitioning" ), callback, parent ); + ScanningDialog::run( future, tr( "Scanning storage devices…", "@status" ), tr( "Partitioning…", "@status" ), callback, parent ); } void diff --git a/src/modules/partition/jobs/AutoMountManagementJob.cpp b/src/modules/partition/jobs/AutoMountManagementJob.cpp index 4e78084bf..c62c41b89 100644 --- a/src/modules/partition/jobs/AutoMountManagementJob.cpp +++ b/src/modules/partition/jobs/AutoMountManagementJob.cpp @@ -19,7 +19,7 @@ AutoMountManagementJob::AutoMountManagementJob( bool disable ) QString AutoMountManagementJob::prettyName() const { - return tr( "Manage auto-mount settings" ); + return tr( "Managing auto-mount settings…", "@status" ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/ChangeFilesystemLabelJob.cpp b/src/modules/partition/jobs/ChangeFilesystemLabelJob.cpp index 4cdb2532e..915cad4b7 100644 --- a/src/modules/partition/jobs/ChangeFilesystemLabelJob.cpp +++ b/src/modules/partition/jobs/ChangeFilesystemLabelJob.cpp @@ -31,15 +31,14 @@ ChangeFilesystemLabelJob::ChangeFilesystemLabelJob( Device* device, Partition* p QString ChangeFilesystemLabelJob::prettyName() const { - return tr( "Set filesystem label on %1." ).arg( partition()->partitionPath() ); + return tr( "Set filesystem label on %1", "@title" ).arg( partition()->partitionPath() ); } QString ChangeFilesystemLabelJob::prettyDescription() const { - return tr( "Set filesystem label %1 to partition " - "%2." ) + return tr( "Set filesystem label %1 to partition %2", "@info" ) .arg( m_label ) .arg( partition()->partitionPath() ); } @@ -48,7 +47,9 @@ ChangeFilesystemLabelJob::prettyDescription() const QString ChangeFilesystemLabelJob::prettyStatusMessage() const { - return prettyDescription(); + return tr( "Setting filesystem label %1 to partition %2…", "@status" ) + .arg( m_label ) + .arg( partition()->partitionPath() ); } @@ -68,7 +69,7 @@ ChangeFilesystemLabelJob::exec() return Calamares::JobResult::ok(); } return Calamares::JobResult::error( - tr( "The installer failed to update partition table on disk '%1'." ).arg( m_device->name() ) ); + tr( "The installer failed to update partition table on disk '%1'.", "@info" ).arg( m_device->name() ) ); } Report report( nullptr ); @@ -80,5 +81,6 @@ ChangeFilesystemLabelJob::exec() return Calamares::JobResult::ok(); } return Calamares::JobResult::error( - tr( "The installer failed to update partition table on disk '%1'." ).arg( m_device->name() ), report.toText() ); + tr( "The installer failed to update partition table on disk '%1'.", "@info" ).arg( m_device->name() ), + report.toText() ); } diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index 00075c415..bbe77f09b 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -368,13 +368,13 @@ ClearMountsJob::ClearMountsJob( Device* device ) QString ClearMountsJob::prettyName() const { - return tr( "Clear mounts for partitioning operations on %1" ).arg( m_deviceNode ); + return tr( "Clear mounts for partitioning operations on %1", "@title" ).arg( m_deviceNode ); } QString ClearMountsJob::prettyStatusMessage() const { - return tr( "Clearing mounts for partitioning operations on %1." ).arg( m_deviceNode ); + return tr( "Clearing mounts for partitioning operations on %1…", "@status" ).arg( m_deviceNode ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/ClearTempMountsJob.cpp b/src/modules/partition/jobs/ClearTempMountsJob.cpp index 59902650f..cb0fb572e 100644 --- a/src/modules/partition/jobs/ClearTempMountsJob.cpp +++ b/src/modules/partition/jobs/ClearTempMountsJob.cpp @@ -30,14 +30,14 @@ ClearTempMountsJob::ClearTempMountsJob() QString ClearTempMountsJob::prettyName() const { - return tr( "Clear all temporary mounts." ); + return tr( "Clearing all temporary mounts…", "@status" ); } QString ClearTempMountsJob::prettyStatusMessage() const { - return tr( "Clearing all temporary mounts." ); + return tr( "Clearing all temporary mounts…", "@status" ); } diff --git a/src/modules/partition/jobs/CreatePartitionJob.cpp b/src/modules/partition/jobs/CreatePartitionJob.cpp index 1a5f4b5ae..429bf26ff 100644 --- a/src/modules/partition/jobs/CreatePartitionJob.cpp +++ b/src/modules/partition/jobs/CreatePartitionJob.cpp @@ -178,7 +178,7 @@ CreatePartitionJob::prettyName() const QString entries = prettyGptEntries( m_partition ); if ( !entries.isEmpty() ) { - return tr( "Create new %1MiB partition on %3 (%2) with entries %4." ) + return tr( "Create new %1MiB partition on %3 (%2) with entries %4", "@title" ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) .arg( m_device->deviceNode() ) @@ -186,14 +186,14 @@ CreatePartitionJob::prettyName() const } else { - return tr( "Create new %1MiB partition on %3 (%2)." ) + return tr( "Create new %1MiB partition on %3 (%2)", "@title" ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) .arg( m_device->deviceNode() ); } } - return tr( "Create new %2MiB partition on %4 (%3) with file system %1." ) + return tr( "Create new %2MiB partition on %4 (%3) with file system %1", "@title" ) .arg( userVisibleFS( m_partition->fileSystem() ) ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) @@ -210,7 +210,8 @@ CreatePartitionJob::prettyDescription() const if ( !entries.isEmpty() ) { return tr( "Create new %1MiB partition on %3 (%2) with entries " - "%4." ) + "%4", + "@info" ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) .arg( m_device->deviceNode() ) @@ -218,7 +219,7 @@ CreatePartitionJob::prettyDescription() const } else { - return tr( "Create new %1MiB partition on %3 (%2)." ) + return tr( "Create new %1MiB partition on %3 (%2)", "@info" ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) .arg( m_device->deviceNode() ); @@ -226,7 +227,8 @@ CreatePartitionJob::prettyDescription() const } return tr( "Create new %2MiB partition on %4 " - "(%3) with file system %1." ) + "(%3) with file system %1", + "@info" ) .arg( userVisibleFS( m_partition->fileSystem() ) ) .arg( Calamares::BytesToMiB( m_partition->capacity() ) ) .arg( m_device->name() ) @@ -249,10 +251,10 @@ CreatePartitionJob::prettyStatusMessage() const type = userVisibleFS( m_partition->fileSystem() ); } - return tr( "Creating new %1 partition on %2." ).arg( type ).arg( m_device->deviceNode() ); + return tr( "Creating new %1 partition on %2…", "@status" ).arg( type ).arg( m_device->deviceNode() ); } - return tr( "Creating new %1 partition on %2." ) + return tr( "Creating new %1 partition on %2…", "@status" ) .arg( userVisibleFS( m_partition->fileSystem() ) ) .arg( m_device->deviceNode() ); } @@ -269,7 +271,7 @@ CreatePartitionJob::exec() return KPMHelpers::execute( NewOperation( *m_device, m_partition ), - tr( "The installer failed to create partition on disk '%1'." ).arg( m_device->name() ) ); + tr( "The installer failed to create partition on disk '%1'.", "@info" ).arg( m_device->name() ) ); } void diff --git a/src/modules/partition/jobs/CreatePartitionTableJob.cpp b/src/modules/partition/jobs/CreatePartitionTableJob.cpp index 481db4e2a..f75e647a9 100644 --- a/src/modules/partition/jobs/CreatePartitionTableJob.cpp +++ b/src/modules/partition/jobs/CreatePartitionTableJob.cpp @@ -38,7 +38,7 @@ CreatePartitionTableJob::CreatePartitionTableJob( Device* device, PartitionTable QString CreatePartitionTableJob::prettyName() const { - return tr( "Create new %1 partition table on %2." ) + return tr( "Creating new %1 partition table on %2…", "@status" ) .arg( PartitionTable::tableTypeToName( m_type ) ) .arg( m_device->deviceNode() ); } @@ -46,7 +46,7 @@ CreatePartitionTableJob::prettyName() const QString CreatePartitionTableJob::prettyDescription() const { - return tr( "Create new %1 partition table on %2 (%3)." ) + return tr( "Creating new %1 partition table on %2 (%3)…", "@status" ) .arg( PartitionTable::tableTypeToName( m_type ).toUpper() ) .arg( m_device->deviceNode() ) .arg( m_device->name() ); @@ -55,7 +55,7 @@ CreatePartitionTableJob::prettyDescription() const QString CreatePartitionTableJob::prettyStatusMessage() const { - return tr( "Creating new %1 partition table on %2." ) + return tr( "Creating new %1 partition table on %2…", "@status" ) .arg( PartitionTable::tableTypeToName( m_type ).toUpper() ) .arg( m_device->deviceNode() ); } diff --git a/src/modules/partition/jobs/CreateVolumeGroupJob.cpp b/src/modules/partition/jobs/CreateVolumeGroupJob.cpp index 683913b7f..638d05e6b 100644 --- a/src/modules/partition/jobs/CreateVolumeGroupJob.cpp +++ b/src/modules/partition/jobs/CreateVolumeGroupJob.cpp @@ -29,19 +29,19 @@ CreateVolumeGroupJob::CreateVolumeGroupJob( Device*, QString CreateVolumeGroupJob::prettyName() const { - return tr( "Create new volume group named %1." ).arg( m_vgName ); + return tr( "Creating new volume group named %1…", "@status" ).arg( m_vgName ); } QString CreateVolumeGroupJob::prettyDescription() const { - return tr( "Create new volume group named %1." ).arg( m_vgName ); + return tr( "Creating new volume group named %1…", "@status" ).arg( m_vgName ); } QString CreateVolumeGroupJob::prettyStatusMessage() const { - return tr( "Creating new volume group named %1." ).arg( m_vgName ); + return tr( "Creating new volume group named %1…", "@status" ).arg( m_vgName ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/DeactivateVolumeGroupJob.cpp b/src/modules/partition/jobs/DeactivateVolumeGroupJob.cpp index 65920a84e..6a4203bc3 100644 --- a/src/modules/partition/jobs/DeactivateVolumeGroupJob.cpp +++ b/src/modules/partition/jobs/DeactivateVolumeGroupJob.cpp @@ -23,19 +23,19 @@ DeactivateVolumeGroupJob::DeactivateVolumeGroupJob( LvmDevice* device ) QString DeactivateVolumeGroupJob::prettyName() const { - return tr( "Deactivate volume group named %1." ).arg( m_device->name() ); + return tr( "Deactivating volume group named %1…", "@status" ).arg( m_device->name() ); } QString DeactivateVolumeGroupJob::prettyDescription() const { - return tr( "Deactivate volume group named %1." ).arg( m_device->name() ); + return tr( "Deactivating volume group named %1…", "@status" ).arg( m_device->name() ); } QString DeactivateVolumeGroupJob::prettyStatusMessage() const { - return tr( "Deactivate volume group named %1." ).arg( m_device->name() ); + return tr( "Deactivating volume group named %1…", "@status" ).arg( m_device->name() ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/DeletePartitionJob.cpp b/src/modules/partition/jobs/DeletePartitionJob.cpp index 2903ecf85..f806dab62 100644 --- a/src/modules/partition/jobs/DeletePartitionJob.cpp +++ b/src/modules/partition/jobs/DeletePartitionJob.cpp @@ -70,19 +70,19 @@ DeletePartitionJob::DeletePartitionJob( Device* device, Partition* partition ) QString DeletePartitionJob::prettyName() const { - return tr( "Delete partition %1." ).arg( m_partition->partitionPath() ); + return tr( "Deleting partition %1…", "@status" ).arg( m_partition->partitionPath() ); } QString DeletePartitionJob::prettyDescription() const { - return tr( "Delete partition %1." ).arg( m_partition->partitionPath() ); + return tr( "Deleting partition %1…", "@status" ).arg( m_partition->partitionPath() ); } QString DeletePartitionJob::prettyStatusMessage() const { - return tr( "Deleting partition %1." ).arg( m_partition->partitionPath() ); + return tr( "Deleting partition %1…", "@status" ).arg( m_partition->partitionPath() ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index 5f92b5041..357c1e210 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -176,7 +176,7 @@ FillGlobalStorageJob::FillGlobalStorageJob( const Config*, QList< Device* > devi QString FillGlobalStorageJob::prettyName() const { - return tr( "Set partition information" ); + return tr( "Set partition information", "@title" ); } @@ -206,14 +206,15 @@ FillGlobalStorageJob::prettyDescription() const if ( !features.isEmpty() ) { lines.append( tr( "Install %1 on new %2 system partition " - "with features %3" ) + "with features %3", + "@info" ) .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) .arg( features ) ); } else { - lines.append( tr( "Install %1 on new %2 system partition." ) + lines.append( tr( "Install %1 on new %2 system partition", "@info" ) .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) ); } @@ -223,7 +224,8 @@ FillGlobalStorageJob::prettyDescription() const if ( !features.isEmpty() ) { lines.append( tr( "Set up new %2 partition with mount point " - "%1 and features %3." ) + "%1 and features %3", + "@info" ) .arg( mountPoint ) .arg( fsType ) .arg( features ) ); @@ -231,7 +233,8 @@ FillGlobalStorageJob::prettyDescription() const else { lines.append( tr( "Set up new %2 partition with mount point " - "%1%3." ) + "%1%3", + "@info" ) .arg( mountPoint ) .arg( fsType ) .arg( features ) ); @@ -245,7 +248,8 @@ FillGlobalStorageJob::prettyDescription() const if ( !features.isEmpty() ) { lines.append( tr( "Install %2 on %3 system partition %1" - " with features %4." ) + " with features %4", + "@info" ) .arg( path ) .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) @@ -253,7 +257,7 @@ FillGlobalStorageJob::prettyDescription() const } else { - lines.append( tr( "Install %2 on %3 system partition %1." ) + lines.append( tr( "Install %2 on %3 system partition %1", "@info" ) .arg( path ) .arg( Calamares::Branding::instance()->shortProductName() ) .arg( fsType ) ); @@ -264,7 +268,8 @@ FillGlobalStorageJob::prettyDescription() const if ( !features.isEmpty() ) { lines.append( tr( "Set up %3 partition %1 with mount point " - "%2 and features %4." ) + "%2 and features %4", + "@info" ) .arg( path ) .arg( mountPoint ) .arg( fsType ) @@ -273,7 +278,8 @@ FillGlobalStorageJob::prettyDescription() const else { lines.append( tr( "Set up %3 partition %1 with mount point " - "%2%4." ) + "%2%4…", + "@info" ) .arg( path ) .arg( mountPoint ) .arg( fsType ) @@ -287,7 +293,7 @@ FillGlobalStorageJob::prettyDescription() const QVariant bootloaderMap = createBootLoaderMap(); if ( !m_bootLoaderPath.isEmpty() ) { - lines.append( tr( "Install boot loader on %1." ).arg( m_bootLoaderPath ) ); + lines.append( tr( "Install boot loader on %1…", "@info" ).arg( m_bootLoaderPath ) ); } return lines.join( "
" ); } @@ -296,7 +302,7 @@ FillGlobalStorageJob::prettyDescription() const QString FillGlobalStorageJob::prettyStatusMessage() const { - return tr( "Setting up mount points." ); + return tr( "Setting up mount points…", "@status" ); } diff --git a/src/modules/partition/jobs/FormatPartitionJob.cpp b/src/modules/partition/jobs/FormatPartitionJob.cpp index 434b39016..e373cec40 100644 --- a/src/modules/partition/jobs/FormatPartitionJob.cpp +++ b/src/modules/partition/jobs/FormatPartitionJob.cpp @@ -36,7 +36,7 @@ FormatPartitionJob::FormatPartitionJob( Device* device, Partition* partition ) QString FormatPartitionJob::prettyName() const { - return tr( "Format partition %1 (file system: %2, size: %3 MiB) on %4." ) + return tr( "Format partition %1 (file system: %2, size: %3 MiB) on %4", "@title" ) .arg( m_partition->partitionPath() ) .arg( userVisibleFS( m_partition->fileSystem() ) ) .arg( m_partition->capacity() / 1024 / 1024 ) @@ -47,7 +47,8 @@ QString FormatPartitionJob::prettyDescription() const { return tr( "Format %3MiB partition %1 with " - "file system %2." ) + "file system %2", + "@info" ) .arg( m_partition->partitionPath() ) .arg( userVisibleFS( m_partition->fileSystem() ) ) .arg( m_partition->capacity() / 1024 / 1024 ); @@ -60,8 +61,7 @@ FormatPartitionJob::prettyStatusMessage() const ? m_partition->partitionPath() : tr( "%1 (%2)", "partition label %1 (device path %2)" ) .arg( m_partition->label(), m_partition->partitionPath() ); - return tr( "Formatting partition %1 with " - "file system %2." ) + return tr( "Formatting partition %1 with file system %2…", "@status" ) .arg( partitionLabel, userVisibleFS( m_partition->fileSystem() ) ); } diff --git a/src/modules/partition/jobs/RemoveVolumeGroupJob.cpp b/src/modules/partition/jobs/RemoveVolumeGroupJob.cpp index 227351064..b139d93a8 100644 --- a/src/modules/partition/jobs/RemoveVolumeGroupJob.cpp +++ b/src/modules/partition/jobs/RemoveVolumeGroupJob.cpp @@ -23,19 +23,19 @@ RemoveVolumeGroupJob::RemoveVolumeGroupJob( Device*, LvmDevice* device ) QString RemoveVolumeGroupJob::prettyName() const { - return tr( "Remove Volume Group named %1." ).arg( m_device->name() ); + return tr( "Removing Volume Group named %1…", "@status" ).arg( m_device->name() ); } QString RemoveVolumeGroupJob::prettyDescription() const { - return tr( "Remove Volume Group named %1." ).arg( m_device->name() ); + return tr( "Removing Volume Group named %1…", "@status" ).arg( m_device->name() ); } QString RemoveVolumeGroupJob::prettyStatusMessage() const { - return tr( "Remove Volume Group named %1." ).arg( m_device->name() ); + return tr( "Removing Volume Group named %1…", "@status" ).arg( m_device->name() ); } Calamares::JobResult diff --git a/src/modules/partition/jobs/ResizePartitionJob.cpp b/src/modules/partition/jobs/ResizePartitionJob.cpp index 0ef715496..3aec41358 100644 --- a/src/modules/partition/jobs/ResizePartitionJob.cpp +++ b/src/modules/partition/jobs/ResizePartitionJob.cpp @@ -36,16 +36,13 @@ ResizePartitionJob::ResizePartitionJob( Device* device, Partition* partition, qi QString ResizePartitionJob::prettyName() const { - // FIXME: Copy PM ResizeOperation code which generates a description of the - // operation - return tr( "Resize partition %1." ).arg( partition()->partitionPath() ); + return tr( "Resize partition %1", "@title" ).arg( partition()->partitionPath() ); } QString ResizePartitionJob::prettyDescription() const { - return tr( "Resize %2MiB partition %1 to " - "%3MiB." ) + return tr( "Resize %2MiB partition %1 to %3MiB", "@info" ) .arg( partition()->partitionPath() ) .arg( ( BytesToMiB( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() ) ) .arg( ( BytesToMiB( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() ) ); @@ -54,8 +51,7 @@ ResizePartitionJob::prettyDescription() const QString ResizePartitionJob::prettyStatusMessage() const { - return tr( "Resizing %2MiB partition %1 to " - "%3MiB." ) + return tr( "Resizing %2MiB partition %1 to %3MiB…", "@status" ) .arg( partition()->partitionPath() ) .arg( ( BytesToMiB( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() ) ) .arg( ( BytesToMiB( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() ) ); diff --git a/src/modules/partition/jobs/ResizeVolumeGroupJob.cpp b/src/modules/partition/jobs/ResizeVolumeGroupJob.cpp index f7a21d80d..a6427116e 100644 --- a/src/modules/partition/jobs/ResizeVolumeGroupJob.cpp +++ b/src/modules/partition/jobs/ResizeVolumeGroupJob.cpp @@ -25,7 +25,7 @@ ResizeVolumeGroupJob::ResizeVolumeGroupJob( Device*, LvmDevice* device, QVector< QString ResizeVolumeGroupJob::prettyName() const { - return tr( "Resize volume group named %1 from %2 to %3." ) + return tr( "Resize volume group named %1 from %2 to %3", "@title" ) .arg( m_device->name() ) .arg( currentPartitions() ) .arg( targetPartitions() ); @@ -34,7 +34,8 @@ ResizeVolumeGroupJob::prettyName() const QString ResizeVolumeGroupJob::prettyDescription() const { - return tr( "Resize volume group named %1 from %2 to %3." ) + return tr( "Resize volume group named %1 from %2 to %3", + "@info" ) .arg( m_device->name() ) .arg( currentPartitions() ) .arg( targetPartitions() ); @@ -43,7 +44,7 @@ ResizeVolumeGroupJob::prettyDescription() const QString ResizeVolumeGroupJob::prettyStatusMessage() const { - return tr( "Resize volume group named %1 from %2 to %3." ) + return tr( "Resizing volume group named %1 from %2 to %3…", "@status" ) .arg( m_device->name() ) .arg( currentPartitions() ) .arg( targetPartitions() ); diff --git a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp index c00ba1d2a..1eafc6394 100644 --- a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp +++ b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp @@ -41,17 +41,17 @@ SetPartFlagsJob::prettyName() const { if ( !partition()->partitionPath().isEmpty() ) { - return tr( "Set flags on partition %1." ).arg( partition()->partitionPath() ); + return tr( "Set flags on partition %1", "@title" ).arg( partition()->partitionPath() ); } QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); if ( !fsNameForUser.isEmpty() ) { - return tr( "Set flags on %1MiB %2 partition." ) + return tr( "Set flags on %1MiB %2 partition", "@title" ) .arg( BytesToMiB( partition()->capacity() ) ) .arg( fsNameForUser ); } - return tr( "Set flags on new partition." ); + return tr( "Set flags on new partition", "@title" ); } QString @@ -62,23 +62,22 @@ SetPartFlagsJob::prettyDescription() const { if ( !partition()->partitionPath().isEmpty() ) { - return tr( "Clear flags on partition %1." ).arg( partition()->partitionPath() ); + return tr( "Clear flags on partition %1", "@info" ).arg( partition()->partitionPath() ); } QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); if ( !fsNameForUser.isEmpty() ) { - return tr( "Clear flags on %1MiB %2 partition." ) + return tr( "Clear flags on %1MiB %2 partition", "@info" ) .arg( BytesToMiB( partition()->capacity() ) ) .arg( fsNameForUser ); } - return tr( "Clear flags on new partition." ); + return tr( "Clear flags on new partition", "@info" ); } if ( !partition()->partitionPath().isEmpty() ) { - return tr( "Flag partition %1 as " - "%2." ) + return tr( "Set flags on partition %1 to %2", "@info" ) .arg( partition()->partitionPath() ) .arg( flagsList.join( ", " ) ); } @@ -86,14 +85,13 @@ SetPartFlagsJob::prettyDescription() const QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); if ( !fsNameForUser.isEmpty() ) { - return tr( "Flag %1MiB %2 partition as " - "%3." ) + return tr( "Set flags on %1MiB %2 partition to %3", "@info" ) .arg( BytesToMiB( partition()->capacity() ) ) .arg( fsNameForUser ) .arg( flagsList.join( ", " ) ); } - return tr( "Flag new partition as %1." ).arg( flagsList.join( ", " ) ); + return tr( "Set flags on new partition to %1", "@info" ).arg( flagsList.join( ", " ) ); } QString @@ -104,24 +102,24 @@ SetPartFlagsJob::prettyStatusMessage() const { if ( !partition()->partitionPath().isEmpty() ) { - return tr( "Clearing flags on partition %1." ).arg( partition()->partitionPath() ); + return tr( "Clearing flags on partition %1…", "@status" ) + .arg( partition()->partitionPath() ); } QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); if ( !fsNameForUser.isEmpty() ) { - return tr( "Clearing flags on %1MiB %2 partition." ) + return tr( "Clearing flags on %1MiB %2 partition…", "@status" ) .arg( BytesToMiB( partition()->capacity() ) ) .arg( fsNameForUser ); } - return tr( "Clearing flags on new partition." ); + return tr( "Clearing flags on new partition…", "@status" ); } if ( !partition()->partitionPath().isEmpty() ) { - return tr( "Setting flags %2 on partition " - "%1." ) + return tr( "Setting flags %2 on partition %1…", "@status" ) .arg( partition()->partitionPath() ) .arg( flagsList.join( ", " ) ); } @@ -129,14 +127,13 @@ SetPartFlagsJob::prettyStatusMessage() const QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); if ( !fsNameForUser.isEmpty() ) { - return tr( "Setting flags %3 on " - "%1MiB %2 partition." ) + return tr( "Setting flags %3 on %1MiB %2 partition…", "@status" ) .arg( BytesToMiB( partition()->capacity() ) ) .arg( fsNameForUser ) .arg( flagsList.join( ", " ) ); } - return tr( "Setting flags %1 on new partition." ).arg( flagsList.join( ", " ) ); + return tr( "Setting flags %1 on new partition…", "@status" ).arg( flagsList.join( ", " ) ); } Calamares::JobResult diff --git a/src/modules/plasmalnf/PlasmaLnfJob.cpp b/src/modules/plasmalnf/PlasmaLnfJob.cpp index 44f3b59e7..4672e3478 100644 --- a/src/modules/plasmalnf/PlasmaLnfJob.cpp +++ b/src/modules/plasmalnf/PlasmaLnfJob.cpp @@ -30,7 +30,7 @@ PlasmaLnfJob::~PlasmaLnfJob() {} QString PlasmaLnfJob::prettyName() const { - return tr( "Plasma Look-and-Feel Job" ); + return tr( "Applying Plasma Look-and-Feel…", "@status" ); } Calamares::JobResult diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp index fd38bfab3..4f86758ee 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -40,7 +40,7 @@ PlasmaLnfViewStep::~PlasmaLnfViewStep() QString PlasmaLnfViewStep::prettyName() const { - return tr( "Look-and-Feel" ); + return tr( "Look-and-Feel", "@label" ); } diff --git a/src/modules/preservefiles/PreserveFiles.cpp b/src/modules/preservefiles/PreserveFiles.cpp index f902a0967..743b51fc4 100644 --- a/src/modules/preservefiles/PreserveFiles.cpp +++ b/src/modules/preservefiles/PreserveFiles.cpp @@ -53,7 +53,7 @@ PreserveFiles::~PreserveFiles() {} QString PreserveFiles::prettyName() const { - return tr( "Saving files for later ..." ); + return tr( "Saving files for later…", "@status" ); } Calamares::JobResult diff --git a/src/modules/removeuser/RemoveUserJob.cpp b/src/modules/removeuser/RemoveUserJob.cpp index 4c8b83f63..2eba510ff 100644 --- a/src/modules/removeuser/RemoveUserJob.cpp +++ b/src/modules/removeuser/RemoveUserJob.cpp @@ -29,7 +29,7 @@ RemoveUserJob::~RemoveUserJob() {} QString RemoveUserJob::prettyName() const { - return tr( "Remove live user from target system" ); + return tr( "Removing live user from the target system…", "@status" ); } Calamares::JobResult diff --git a/src/modules/shellprocess/ShellProcessJob.cpp b/src/modules/shellprocess/ShellProcessJob.cpp index 779871895..3fe8cc613 100644 --- a/src/modules/shellprocess/ShellProcessJob.cpp +++ b/src/modules/shellprocess/ShellProcessJob.cpp @@ -35,7 +35,7 @@ ShellProcessJob::prettyName() const { return m_name->get(); } - return tr( "Shell Processes Job" ); + return tr( "Running shell processes…", "@status" ); } Calamares::JobResult diff --git a/src/modules/summary/CMakeLists.txt b/src/modules/summary/CMakeLists.txt index 16f98ebb4..671cf569d 100644 --- a/src/modules/summary/CMakeLists.txt +++ b/src/modules/summary/CMakeLists.txt @@ -9,6 +9,7 @@ calamares_add_plugin(summary EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES Config.cpp + SummaryModel.cpp SummaryPage.cpp SummaryViewStep.cpp UI diff --git a/src/modules/summary/Config.cpp b/src/modules/summary/Config.cpp index 75fed6817..387b03075 100644 --- a/src/modules/summary/Config.cpp +++ b/src/modules/summary/Config.cpp @@ -10,6 +10,8 @@ #include "Config.h" +#include "SummaryModel.h" + #include "Branding.h" #include "Settings.h" #include "ViewManager.h" @@ -18,67 +20,6 @@ #include "utils/Retranslator.h" #include "viewpages/ExecutionViewStep.h" -SummaryModel::SummaryModel( QObject* parent ) - : QAbstractListModel( parent ) -{ -} - -QHash< int, QByteArray > -SummaryModel::roleNames() const -{ - // Not including WidgetRole here because that wouldn't make sense - // in a QML context which is where the roleNames are important. - return { { TitleRole, "title" }, { MessageRole, "message" } }; -} - -QVariant -SummaryModel::data( const QModelIndex& index, int role ) const -{ - if ( !index.isValid() ) - { - return QVariant(); - } - auto& item = m_summary.at( index.row() ); - switch ( role ) - { - case TitleRole: - return item.title; - case MessageRole: - return item.message; - case WidgetRole: - return item.widget ? QVariant::fromValue( item.widget ) : QVariant(); - default: - return QVariant(); - } -} - -int -SummaryModel::rowCount( const QModelIndex& ) const -{ - return m_summary.count(); -} - -void -SummaryModel::setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets ) -{ - 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 }; - } - endResetModel(); -} - Config::Config( QObject* parent ) : QObject( parent ) , m_summary( new SummaryModel( this ) ) @@ -91,7 +32,7 @@ Config::Config( QObject* parent ) void Config::retranslate() { - m_title = tr( "Summary" ); + m_title = tr( "Summary", "@label" ); if ( Calamares::Settings::instance()->isSetupMode() ) { diff --git a/src/modules/summary/Config.h b/src/modules/summary/Config.h index f0732f448..25381b126 100644 --- a/src/modules/summary/Config.h +++ b/src/modules/summary/Config.h @@ -11,60 +11,10 @@ #ifndef SUMMARY_CONFIG_H #define SUMMARY_CONFIG_H +#include "SummaryModel.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: - enum Roles : int - { - TitleRole = Qt::DisplayRole, // Name of the step - MessageRole = Qt::UserRole, // String saying what it will do - WidgetRole, // Pointer to widget - }; - - 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 diff --git a/src/modules/summary/SummaryModel.cpp b/src/modules/summary/SummaryModel.cpp new file mode 100644 index 000000000..be8b062e0 --- /dev/null +++ b/src/modules/summary/SummaryModel.cpp @@ -0,0 +1,74 @@ +/* === 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 "SummaryModel.h" + +#include + +SummaryModel::SummaryModel( QObject* parent ) + : QAbstractListModel( parent ) +{ +} + +QHash< int, QByteArray > +SummaryModel::roleNames() const +{ + // Not including WidgetRole here because that wouldn't make sense + // in a QML context which is where the roleNames are important. + return { { TitleRole, "title" }, { MessageRole, "message" } }; +} + +QVariant +SummaryModel::data( const QModelIndex& index, int role ) const +{ + if ( !index.isValid() ) + { + return QVariant(); + } + auto& item = m_summary.at( index.row() ); + switch ( role ) + { + case TitleRole: + return item.title; + case MessageRole: + return item.message; + case WidgetRole: + return item.widget ? QVariant::fromValue( item.widget ) : QVariant(); + default: + return QVariant(); + } +} + +int +SummaryModel::rowCount( const QModelIndex& ) const +{ + return m_summary.count(); +} + +void +SummaryModel::setSummaryList( const Calamares::ViewStepList& steps, bool withWidgets ) +{ + 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 }; + } + endResetModel(); +} diff --git a/src/modules/summary/SummaryModel.h b/src/modules/summary/SummaryModel.h new file mode 100644 index 000000000..919b5d585 --- /dev/null +++ b/src/modules/summary/SummaryModel.h @@ -0,0 +1,67 @@ +/* === 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_SUMMARYMODEL_H +#define SUMMARY_SUMMARYMODEL_H + +#include "viewpages/ViewStep.h" + +#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: + enum Roles : int + { + TitleRole = Qt::DisplayRole, // Name of the step + MessageRole = Qt::UserRole, // String saying what it will do + WidgetRole, // Pointer to widget + }; + + 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; +}; + +#endif diff --git a/src/modules/summaryq/CMakeLists.txt b/src/modules/summaryq/CMakeLists.txt index e63640597..75dd68aea 100644 --- a/src/modules/summaryq/CMakeLists.txt +++ b/src/modules/summaryq/CMakeLists.txt @@ -17,6 +17,7 @@ calamares_add_plugin(summaryq SOURCES SummaryQmlViewStep.cpp ${_summary}/Config.cpp + ${_summary}/SummaryModel.cpp UI RESOURCES summaryq${QT_VERSION_SUFFIX}.qrc diff --git a/src/modules/tracking/TrackingJobs.cpp b/src/modules/tracking/TrackingJobs.cpp index c8e3cfc63..53a97b702 100644 --- a/src/modules/tracking/TrackingJobs.cpp +++ b/src/modules/tracking/TrackingJobs.cpp @@ -103,7 +103,7 @@ TrackingInstallJob::prettyName() const QString TrackingInstallJob::prettyStatusMessage() const { - return QCoreApplication::translate( "TrackingInstallJob", "Sending installation feedback." ); + return QCoreApplication::translate( "TrackingInstallJob", "Sending installation feedback…", "@status" ); } Calamares::JobResult @@ -138,7 +138,7 @@ TrackingMachineUpdateManagerJob::prettyName() const QString TrackingMachineUpdateManagerJob::prettyStatusMessage() const { - return QCoreApplication::translate( "TrackingMachineUpdateManagerJob", "Configuring machine feedback." ); + return QCoreApplication::translate( "TrackingMachineUpdateManagerJob", "Configuring machine feedback…", "@status" ); } Calamares::JobResult @@ -195,7 +195,7 @@ TrackingKUserFeedbackJob::prettyName() const QString TrackingKUserFeedbackJob::prettyStatusMessage() const { - return QCoreApplication::translate( "TrackingKUserFeedbackJob", "Configuring KDE user feedback." ); + return QCoreApplication::translate( "TrackingKUserFeedbackJob", "Configuring KDE user feedback…", "@status" ); } Calamares::JobResult diff --git a/src/modules/tracking/TrackingViewStep.cpp b/src/modules/tracking/TrackingViewStep.cpp index dd18ee87e..37f2912c3 100644 --- a/src/modules/tracking/TrackingViewStep.cpp +++ b/src/modules/tracking/TrackingViewStep.cpp @@ -46,7 +46,7 @@ TrackingViewStep::~TrackingViewStep() QString TrackingViewStep::prettyName() const { - return tr( "Feedback" ); + return tr( "Feedback", "@title" ); } diff --git a/src/modules/umount/UmountJob.cpp b/src/modules/umount/UmountJob.cpp index 93c0ceb80..83cf2f10e 100644 --- a/src/modules/umount/UmountJob.cpp +++ b/src/modules/umount/UmountJob.cpp @@ -36,7 +36,7 @@ UmountJob::~UmountJob() {} QString UmountJob::prettyName() const { - return tr( "Unmount file systems." ); + return tr( "Unmounting file systems…", "@status" ); } static Calamares::JobResult diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index 4d20bc4a4..4e36c5081 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -36,13 +36,13 @@ CreateUserJob::prettyName() const QString CreateUserJob::prettyDescription() const { - return tr( "Create user %1." ).arg( m_config->loginName() ); + return tr( "Create user %1" ).arg( m_config->loginName() ); } QString CreateUserJob::prettyStatusMessage() const { - return m_status.isEmpty() ? tr( "Creating user %1" ).arg( m_config->loginName() ) : m_status; + return m_status.isEmpty() ? tr( "Creating user %1…", "@status" ).arg( m_config->loginName() ) : m_status; } static Calamares::JobResult @@ -117,7 +117,7 @@ CreateUserJob::exec() // This GS setting comes from the **partitioning** module. if ( reuseHome ) { - m_status = tr( "Preserving home directory" ); + m_status = tr( "Preserving home directory…", "@status" ); emit progress( 0.2 ); QString shellFriendlyHome = "/home/" + m_config->loginName(); QDir existingHome( destDir.absolutePath() + shellFriendlyHome ); @@ -134,7 +134,7 @@ CreateUserJob::exec() cDebug() << "[CREATEUSER]: creating user"; - m_status = tr( "Creating user %1" ).arg( m_config->loginName() ); + m_status = tr( "Creating user %1…", "@status" ).arg( m_config->loginName() ); emit progress( 0.5 ); auto useraddResult = createUser( m_config->loginName(), m_config->fullName(), m_config->userShell() ); if ( !useraddResult ) @@ -142,7 +142,7 @@ CreateUserJob::exec() return useraddResult; } - m_status = tr( "Configuring user %1" ).arg( m_config->loginName() ); + m_status = tr( "Configuring user %1", "@status" ).arg( m_config->loginName() ); emit progress( 0.8 ); auto usergroupsResult = setUserGroups( m_config->loginName(), m_config->groupsForThisUser() ); if ( !usergroupsResult ) @@ -150,7 +150,7 @@ CreateUserJob::exec() return usergroupsResult; } - m_status = tr( "Setting file permissions" ); + m_status = tr( "Setting file permissions…", "@status" ); emit progress( 0.9 ); QString userGroup = QString( "%1:%2" ).arg( m_config->loginName() ).arg( m_config->loginName() ); QString homeDir = QString( "/home/%1" ).arg( m_config->loginName() ); diff --git a/src/modules/users/MiscJobs.cpp b/src/modules/users/MiscJobs.cpp index 851f6a9d4..75aba41d7 100644 --- a/src/modules/users/MiscJobs.cpp +++ b/src/modules/users/MiscJobs.cpp @@ -31,7 +31,7 @@ SetupSudoJob::SetupSudoJob( const QString& group, Config::SudoStyle style ) QString SetupSudoJob::prettyName() const { - return tr( "Configure
sudo
users." ); + return tr( "Configuring
sudo
users…", "@status" ); } static QString @@ -178,7 +178,7 @@ SetupGroupsJob::SetupGroupsJob( const Config* config ) QString SetupGroupsJob::prettyName() const { - return tr( "Preparing groups." ); + return tr( "Preparing groups…", "@status" ); } Calamares::JobResult diff --git a/src/modules/users/SetHostNameJob.cpp b/src/modules/users/SetHostNameJob.cpp index 42da6c58d..f08c1da2f 100644 --- a/src/modules/users/SetHostNameJob.cpp +++ b/src/modules/users/SetHostNameJob.cpp @@ -45,7 +45,7 @@ SetHostNameJob::prettyDescription() const QString SetHostNameJob::prettyStatusMessage() const { - return tr( "Setting hostname %1." ).arg( m_config->hostname() ); + return tr( "Setting hostname %1…", "@status" ).arg( m_config->hostname() ); } STATICTEST bool diff --git a/src/modules/users/SetPasswordJob.cpp b/src/modules/users/SetPasswordJob.cpp index 4d326ccf0..f0c8b0b71 100644 --- a/src/modules/users/SetPasswordJob.cpp +++ b/src/modules/users/SetPasswordJob.cpp @@ -41,7 +41,7 @@ SetPasswordJob::prettyName() const QString SetPasswordJob::prettyStatusMessage() const { - return tr( "Setting password for user %1." ).arg( m_userName ); + return tr( "Setting password for user %1…", "@status" ).arg( m_userName ); } #ifndef HAVE_CRYPT_GENSALT diff --git a/src/modules/usersq/usersq-qt6.qml b/src/modules/usersq/usersq-qt6.qml index 4b379e6dc..ea17ac4ee 100644 --- a/src/modules/usersq/usersq-qt6.qml +++ b/src/modules/usersq/usersq-qt6.qml @@ -59,7 +59,7 @@ Kirigami.ScrollablePage { id: _userNameField width: parent.width enabled: config.isEditable("fullName") - placeholderText: qsTr("Your Full Name") + placeholderText: qsTr("Your full name") text: config.fullName onTextChanged: config.setFullName(text) @@ -83,7 +83,7 @@ Kirigami.ScrollablePage { id: _userLoginField width: parent.width enabled: config.isEditable("loginName") - placeholderText: qsTr("Login Name") + placeholderText: qsTr("Login name") text: config.loginName validator: RegularExpressionValidator { regularExpression: /[a-z_][a-z0-9_-]*[$]?$/ } @@ -149,7 +149,7 @@ Kirigami.ScrollablePage { TextField { id: _hostName width: parent.width - placeholderText: qsTr("Computer Name") + placeholderText: qsTr("Computer name") text: config.hostname validator: RegularExpressionValidator { regularExpression: /[a-zA-Z0-9][-a-zA-Z0-9_]+/ } @@ -234,7 +234,7 @@ Kirigami.ScrollablePage { TextField { id: _verificationPasswordField width: parent.width / 2 - 10 - placeholderText: qsTr("Repeat Password") + placeholderText: qsTr("Repeat password") text: config.userPasswordSecondary onTextChanged: _passwordField.text === _verificationPasswordField.text @@ -324,7 +324,7 @@ Kirigami.ScrollablePage { TextField { id: _rootPasswordField width: parent.width / 2 -10 - placeholderText: qsTr("Root Password") + placeholderText: qsTr("Root password") text: config.rootPassword onTextChanged: config.setRootPassword(text) @@ -342,7 +342,7 @@ Kirigami.ScrollablePage { TextField { id: _verificationRootPasswordField width: parent.width / 2 -10 - placeholderText: qsTr("Repeat Root Password") + placeholderText: qsTr("Repeat root password") text: config.rootPasswordSecondary onTextChanged: _rootPasswordField.text === _verificationRootPasswordField.text diff --git a/src/modules/usersq/usersq.qml b/src/modules/usersq/usersq.qml index febdb5be5..d057f6454 100644 --- a/src/modules/usersq/usersq.qml +++ b/src/modules/usersq/usersq.qml @@ -60,7 +60,7 @@ Kirigami.ScrollablePage { id: _userNameField width: parent.width enabled: config.isEditable("fullName") - placeholderText: qsTr("Your Full Name") + placeholderText: qsTr("Your full name") text: config.fullName onTextChanged: config.setFullName(text) @@ -84,7 +84,7 @@ Kirigami.ScrollablePage { id: _userLoginField width: parent.width enabled: config.isEditable("loginName") - placeholderText: qsTr("Login Name") + placeholderText: qsTr("Login name") text: config.loginName validator: RegularExpressionValidator { regularExpression: /[a-z_][a-z0-9_-]*[$]?$/ } @@ -150,7 +150,7 @@ Kirigami.ScrollablePage { TextField { id: _hostName width: parent.width - placeholderText: qsTr("Computer Name") + placeholderText: qsTr("Computer name") text: config.hostname validator: RegularExpressionValidator { regularExpression: /[a-zA-Z0-9][-a-zA-Z0-9_]+/ } @@ -235,7 +235,7 @@ Kirigami.ScrollablePage { TextField { id: _verificationPasswordField width: parent.width / 2 - 10 - placeholderText: qsTr("Repeat Password") + placeholderText: qsTr("Repeat password") text: config.userPasswordSecondary onTextChanged: _passwordField.text === _verificationPasswordField.text @@ -325,7 +325,7 @@ Kirigami.ScrollablePage { TextField { id: _rootPasswordField width: parent.width / 2 -10 - placeholderText: qsTr("Root Password") + placeholderText: qsTr("Root password") text: config.rootPassword onTextChanged: config.setRootPassword(text) @@ -343,7 +343,7 @@ Kirigami.ScrollablePage { TextField { id: _verificationRootPasswordField width: parent.width / 2 -10 - placeholderText: qsTr("Repeat Root Password") + placeholderText: qsTr("Repeat root password") text: config.rootPasswordSecondary onTextChanged: _rootPasswordField.text === _verificationRootPasswordField.text diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index d0ca70444..5689bb2b1 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -209,7 +209,7 @@ WelcomePage::retranslate() ui->mainText->setText( message.arg( Calamares::Branding::instance()->versionedName() ) ); ui->retranslateUi( this ); - ui->supportButton->setText( tr( "%1 support" ).arg( Calamares::Branding::instance()->shortProductName() ) ); + ui->supportButton->setText( tr( "%1 Support", "@action" ).arg( Calamares::Branding::instance()->shortProductName() ) ); } void diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index df42271fc..f9c59eb73 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -43,7 +43,7 @@ WelcomeViewStep::~WelcomeViewStep() QString WelcomeViewStep::prettyName() const { - return tr( "Welcome" ); + return tr( "Welcome", "@title" ); } diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.cpp b/src/modules/welcomeq/WelcomeQmlViewStep.cpp index a13911b18..7bd866b41 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.cpp +++ b/src/modules/welcomeq/WelcomeQmlViewStep.cpp @@ -37,7 +37,7 @@ WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent ) QString WelcomeQmlViewStep::prettyName() const { - return tr( "Welcome" ); + return tr( "Welcome", "@title" ); } bool diff --git a/src/modules/welcomeq/welcomeq-qt6.qml b/src/modules/welcomeq/welcomeq-qt6.qml index 65e43fecf..7cc8c6403 100644 --- a/src/modules/welcomeq/welcomeq-qt6.qml +++ b/src/modules/welcomeq/welcomeq-qt6.qml @@ -77,7 +77,7 @@ Page Button { Layout.fillWidth: true - text: qsTr("Known issues") + text: qsTr("Known Issues") icon.name: "tools-report-bug" Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4) Kirigami.Theme.textColor: Kirigami.Theme.textColor @@ -88,7 +88,7 @@ Page Button { Layout.fillWidth: true - text: qsTr("Release notes") + text: qsTr("Release Notes") icon.name: "folder-text" Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4) Kirigami.Theme.textColor: Kirigami.Theme.textColor diff --git a/src/modules/welcomeq/welcomeq.qml b/src/modules/welcomeq/welcomeq.qml index 736130bcf..d3150cf94 100644 --- a/src/modules/welcomeq/welcomeq.qml +++ b/src/modules/welcomeq/welcomeq.qml @@ -77,7 +77,7 @@ Page Button { Layout.fillWidth: true - text: qsTr("Known issues") + text: qsTr("Known Issues") icon.name: "tools-report-bug" Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4) Kirigami.Theme.textColor: Kirigami.Theme.textColor @@ -88,7 +88,7 @@ Page Button { Layout.fillWidth: true - text: qsTr("Release notes") + text: qsTr("Release Notes") icon.name: "folder-text" Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4) Kirigami.Theme.textColor: Kirigami.Theme.textColor diff --git a/src/modules/zfs/ZfsJob.cpp b/src/modules/zfs/ZfsJob.cpp index c98de5e65..7181656e6 100644 --- a/src/modules/zfs/ZfsJob.cpp +++ b/src/modules/zfs/ZfsJob.cpp @@ -99,7 +99,7 @@ ZfsJob::~ZfsJob() {} QString ZfsJob::prettyName() const { - return tr( "Create ZFS pools and datasets" ); + return tr( "Creating ZFS pools and datasets…", "@status" ); } void