diff --git a/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp b/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp index 4c13e1da0..cd8fadcce 100644 --- a/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp +++ b/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -764,7 +765,7 @@ void KDSingleApplicationGuard::Private::create( const QStringList & arguments ) } const int maxWaitMSecs = 1000 * 60; // stop waiting after 60 seconds - QTime waitTimer; + QElapsedTimer waitTimer; waitTimer.start(); // lets wait till the other instance initialized the register diff --git a/CHANGES b/CHANGES index d6f5de059..64102fae8 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. -# 3.2.25 (unreleased) # +# 3.2.26 (unreleased) # This release contains contributions from (alphabetically by first name): - No external contributors yet @@ -15,6 +15,41 @@ This release contains contributions from (alphabetically by first name): - No module changes yet +# 3.2.25 (2020-06-06) # + +This release contains contributions from (alphabetically by first name): + - Anke Boersma + - Callum Farmer + - FLVAL + - Gaël PORTAY + +## Core ## + - The slideshow in `branding.desc` can be configured with QML (recommended, + as it has been for the past umpteen releases) or with a list of + images (new). + - It is possible to turn off all the new QML code -- navigation, slideshow, + QML-based modules -- with a single `-DWITH_QML=OFF` at CMake time. + This removes QML from Calamares' dependency footprint (but only saves + 200kB in Calamares itself). + - Tests have been extended and now support a tests/CMakeTests.txt file + for fine-tuning tests for Python modules. + - SPDX identifiers are used much more widely and consistently in Calamares. + (thanks Callum) + +## Modules ## + - The QML based *welcomeq* module is now a viable alternative to the + *welcome*(widgets based) module. Using QML files means it no longer + is needed to have pop-up windows for additional information or warnings, + all loads in the Calamares window itself. Additional features include the + option to customize the *About* info and load files like Release Notes + direct into Calamares, QML files added to the branding directory can be used. + - The *welcome* and *locale* modules that do GeoIP lookup can now also + use "fixed" style; this just negates the GeoIP lookup and substitutes a + constant (fixed) value; useful for testing specific locales. + - The *keyboard* module no longer uses *ca_eng* keyboards in Canada by + default, but sticks to the *us* keyboard. #1419 + + # 3.2.24 (2020-05-11) # This release contains contributions from (alphabetically by first name): diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ead0b7c4..020b83e80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### @@ -40,7 +40,7 @@ cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.25 + VERSION 3.2.26 LANGUAGES C CXX ) set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development @@ -50,11 +50,14 @@ set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during develop option( INSTALL_CONFIG "Install configuration files" OFF ) option( INSTALL_POLKIT "Install Polkit configuration" ON ) option( INSTALL_COMPLETION "Install shell completions" OFF ) -option( BUILD_TESTING "Build the testing tree." ON ) -option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) -option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF ) +# Options for the calamares executable option( WITH_KF5Crash "Enable crash reporting with KCrash." ON ) option( WITH_KF5DBus "Use DBus service for unique-application." OFF ) +# When adding WITH_* that affects the ABI offered by libcalamares, +# also update libcalamares/CalamaresConfig.h.in +option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) +option( WITH_PYTHONQT "Enable Python view modules API (deprecated, requires PythonQt)." OFF ) +option( WITH_QML "Enable QML UI options." ON ) # Possible debugging flags are: # - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone @@ -159,6 +162,7 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") ) endif() +include( CTest ) ### C++ SETUP # @@ -250,7 +254,10 @@ include( CMakeColors ) ### DEPENDENCIES # -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui Widgets LinguistTools Svg Quick QuickWidgets ) +find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTools Network Svg Widgets ) +if( WITH_QML ) + find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets ) +endif() if( Qt5_VERSION VERSION_GREATER 5.12.1 ) # At least Qt 5.12.2 seems to support Esperanto in QLocale if( "eo" IN_LIST _tx_incomplete ) @@ -312,10 +319,6 @@ if( NOT KF5DBusAddons_FOUND ) set( WITH_KF5DBus OFF ) endif() -if( BUILD_TESTING ) - enable_testing() -endif () - find_package( PythonLibs ${PYTHONLIBS_VERSION} ) set_package_properties( PythonLibs PROPERTIES @@ -496,7 +499,11 @@ if ( CALAMARES_VERSION_RC EQUAL 0 ) endif() # enforce using constBegin, constEnd for const-iterators -add_definitions( "-DQT_STRICT_ITERATORS" ) +add_definitions( + -DQT_STRICT_ITERATORS + -DQT_SHARED + -DQT_SHAREDPOINTER_TRACK_POINTERS +) # set paths set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) diff --git a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake index 80cf86f38..9283b48a7 100644 --- a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake +++ b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/CMakeModules/CalamaresAddLibrary.cmake b/CMakeModules/CalamaresAddLibrary.cmake index 0829d919e..6155293d7 100644 --- a/CMakeModules/CalamaresAddLibrary.cmake +++ b/CMakeModules/CalamaresAddLibrary.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/CMakeModules/CalamaresAddModuleSubdirectory.cmake b/CMakeModules/CalamaresAddModuleSubdirectory.cmake index 1af520ca8..fe4f34f94 100644 --- a/CMakeModules/CalamaresAddModuleSubdirectory.cmake +++ b/CMakeModules/CalamaresAddModuleSubdirectory.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### @@ -126,10 +126,10 @@ function( calamares_add_module_subdirectory ) endif() message( "" ) # We copy over the lang directory, if any - if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang" ) + if( IS_DIRECTORY "${_mod_dir}/lang" ) install_calamares_gettext_translations( ${SUBDIRECTORY} - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang" + SOURCE_DIR "${_mod_dir}/lang" FILENAME ${SUBDIRECTORY}.mo RENAME calamares-${SUBDIRECTORY}.mo ) @@ -162,6 +162,16 @@ function( calamares_add_module_subdirectory ) # may try to do things to the running system. Needs work to make that a # safe thing to do. # + # If the module has a tests/ subdirectory with *.global and *.job + # files (YAML files holding global and job-configurations for + # testing purposes) then those files are used to drive additional + # tests. The files must be numbered (starting from 1) for this to work; + # 1.global and 1.job together make the configuration for test 1. + # + # If the module has a tests/CMakeLists.txt while it doesn't have its + # own CMakeLists.txt (e.g. a Python module), then the subdirectory + # for tests/ is added on its own. + # if ( BUILD_TESTING AND _mod_enabled AND _mod_testing ) add_test( NAME load-${SUBDIRECTORY} @@ -170,7 +180,7 @@ function( calamares_add_module_subdirectory ) ) # Try it with the tests/ configurations shipped with the module set( _count 1 ) - set( _testdir ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/tests ) + set( _testdir ${_mod_dir}/tests ) while ( EXISTS "${_testdir}/${_count}.global" OR EXISTS "${_testdir}/${_count}.job" ) set( _dash_g "" ) set( _dash_j "" ) @@ -187,5 +197,8 @@ function( calamares_add_module_subdirectory ) ) math( EXPR _count "${_count} + 1" ) endwhile() + if ( EXISTS ${_testdir}/CMakeTests.txt AND NOT EXISTS ${_mod_dir}/CMakeLists.txt ) + include( ${_testdir}/CMakeTests.txt ) + endif() endif() endfunction() diff --git a/CMakeModules/CalamaresAddPlugin.cmake b/CMakeModules/CalamaresAddPlugin.cmake index c8f81e684..66536eda7 100644 --- a/CMakeModules/CalamaresAddPlugin.cmake +++ b/CMakeModules/CalamaresAddPlugin.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/CMakeModules/CalamaresAddTest.cmake b/CMakeModules/CalamaresAddTest.cmake index 65f9389e8..4dd673745 100644 --- a/CMakeModules/CalamaresAddTest.cmake +++ b/CMakeModules/CalamaresAddTest.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/CMakeModules/CalamaresAddTranslations.cmake b/CMakeModules/CalamaresAddTranslations.cmake index d74e4bdfb..bb15fb122 100644 --- a/CMakeModules/CalamaresAddTranslations.cmake +++ b/CMakeModules/CalamaresAddTranslations.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/CMakeModules/CalamaresAutomoc.cmake b/CMakeModules/CalamaresAutomoc.cmake index f8aa7faef..3de586ad2 100644 --- a/CMakeModules/CalamaresAutomoc.cmake +++ b/CMakeModules/CalamaresAutomoc.cmake @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/LICENSES/BSD2 b/LICENSES/BSD2 new file mode 100644 index 000000000..919d22d1c --- /dev/null +++ b/LICENSES/BSD2 @@ -0,0 +1,24 @@ + + Copyright 2019 Adriaan de Groot + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. diff --git a/calamares.desktop b/calamares.desktop index 6a5f91db5..68b70b3de 100644 --- a/calamares.desktop +++ b/calamares.desktop @@ -61,6 +61,10 @@ Name[eu]=Sistema instalatu Icon[eu]=calamares GenericName[eu]=Sistema instalatzailea Comment[eu]=Calamares - sistema instalatzailea +Name[fa]=نصب سامانه +Icon[fa]=کالامارس +GenericName[fa]=نصب‌کنندهٔ سامانه +Comment[fa]=کالامارس — نصب‌کنندهٔ سامانه Name[es_PR]=Instalar el sistema Name[fr]=Installer le système Icon[fr]=calamares diff --git a/io.calamares.calamares.appdata.xml b/io.calamares.calamares.appdata.xml index 355f485c2..d49a33b0f 100644 --- a/io.calamares.calamares.appdata.xml +++ b/io.calamares.calamares.appdata.xml @@ -2,7 +2,7 @@ io.calamares.calamares.desktop CC0-1.0 - GPL-3.0+ + GPL-3.0-or-later Calamares Calamares Calamares diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 37ea8356c..efc6d6188 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Calamares. If not, see . # -# SPDX-License-Identifier: GPL-3.0+ +# SPDX-License-Identifier: GPL-3.0-or-later # License-Filename: LICENSE # ### diff --git a/lang/calamares_da.ts b/lang/calamares_da.ts index 72c7f798f..2caa87006 100644 --- a/lang/calamares_da.ts +++ b/lang/calamares_da.ts @@ -232,7 +232,7 @@ Waiting for %n module(s). Venter på %n modul. - Venter på %n moduler. + Venter på %n modul(er). @@ -240,7 +240,7 @@ (%n second(s)) (%n sekund) - (%n sekunder) + (%n sekund(er)) diff --git a/lang/calamares_de.ts b/lang/calamares_de.ts index d1a705775..d4eccbf95 100644 --- a/lang/calamares_de.ts +++ b/lang/calamares_de.ts @@ -525,7 +525,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. Having a GPT partition table and <strong>fat32 512Mb /boot partition is a must for UEFI installs</strong>, either use an existing without formatting or create one. - + <strong>Manuelle Partitionierung</strong><br/>Sie können selbst Partitionen erstellen oder in der Größe verändern. Eine GPT-Partitionstabelle und eine <strong>fat32 512Mb /boot-Partition ist ein Muss für UEFI-Installationen</strong>, entweder eine vorhandene ohne Formatierung verwenden oder eine Neue erstellen. @@ -737,7 +737,7 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Network Installation. (Disabled: internal error) - + Netzwerk-Installation. (Deaktiviert: Interner Fehler) @@ -1830,42 +1830,42 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Communication - + Kommunikation Development - + Entwicklung Office - + Büro Multimedia - + Multimedia Internet - + Internet Theming - + Thema Gaming - + Spielen Utilities - + Dienstprogramme @@ -2556,12 +2556,12 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. - + Eine EFI Systempartition wird benötigt, um %1 zu starten.<br/><br/>Um eine EFI Systempartition einzurichten, gehen Sie zurück und wählen oder erstellen Sie ein FAT32-Dateisystem mit einer aktivierten <strong>%3</strong> Markierung sowie <strong>%2</strong> als Einhängepunkt .<br/><br/>Sie können ohne die Einrichtung einer EFI-Systempartition fortfahren, aber ihr System wird unter Umständen nicht starten können. An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. - + Eine EFI Systempartition wird benötigt, um %1 zu starten.<br/><br/>Eine Partition mit dem Einhängepunkt <strong>%2</strong> wurde eingerichtet, jedoch wurde dort keine <strong>%3</strong> Markierung gesetzt.<br/>Um diese Markierung zu setzen, gehen Sie zurück und bearbeiten Sie die Partition.<br/><br/>Sie können ohne diese Markierung fortfahren, aber ihr System wird unter Umständen nicht starten können. @@ -2571,12 +2571,12 @@ Dies wird das Installationsprogramm beenden und alle Änderungen gehen verloren. Option to use GPT on BIOS - + Option zur Verwendung von GPT im BIOS A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. - + Eine GPT-Partitionstabelle ist die beste Option für alle Systeme. Dieses Installationsprogramm unterstützt ein solches Setup auch für BIOS-Systeme.<br/><br/>Um eine GPT-Partitionstabelle im BIOS zu konfigurieren, gehen Sie (falls noch nicht geschehen) zurück und setzen Sie die Partitionstabelle auf GPT, als nächstes erstellen Sie eine 8 MB große unformatierte Partition mit aktiviertem <strong>bios_grub</strong>-Markierung.<br/><br/>Eine unformatierte 8 MB große Partition ist erforderlich, um %1 auf einem BIOS-System mit GPT zu starten. @@ -3666,7 +3666,7 @@ Ausgabe: <h1>%1</h1><br/><strong>%2<br/>for %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Thanks to <a href="https://calamares.io/team/">the Calamares team</a> and the <a href="https://www.transifex.com/calamares/calamares/">Calamares translators team</a>.<br/><br/><a href="https://calamares.io/">Calamares</a> development is sponsored by <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. - + <h1>%1</h1><br/><strong>%2<br/>for %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Danke an <a href="https://calamares.io/team/">das Calamares Team</a> und das <a href="https://www.transifex.com/calamares/calamares/">Calamares Übersetzerteam</a>.<br/><br/><a href="https://calamares.io/">Calamares</a> Entwicklung wird gesponsert von <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. @@ -3701,12 +3701,23 @@ Ausgabe: development is sponsored by <br/> <a href='http://www.blue-systems.com/'>Blue Systems</a> - Liberating Software. - + <h1>%1</h1><br/> +<strong>%2<br/> +for %3</strong><br/><br/> +Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/> +Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/> +Danke an das <a href='https://calamares.io/team/'>Calamares Team</a> +und an das <a href='https://www.transifex.com/calamares/calamares/'>Calamares +Übersetzerteam</a>.<br/><br/> +<a href='https://calamares.io/'>Calamares</a> +Entwicklung wird gesponsert von <br/> +<a href='http://www.blue-systems.com/'>Blue Systems</a> - +Liberating Software. Back - + Zurück @@ -3714,44 +3725,44 @@ Ausgabe: Keyboard Model - + Tastaturmodell Pick your preferred keyboard model or use the default one based on the detected hardware - + Wählen Sie Ihr bevorzugtes Tastaturmodell oder verwenden Sie das Standardmodell auf Grundlage der erkannten Hardware Refresh - + Aktualisieren Layouts - + Layouts Keyboard Layout - + Tastaturlayout Models - + Modelle Variants - + Varianten Test your keyboard - + Testen Sie Ihre Tastatur @@ -3789,12 +3800,32 @@ Ausgabe: </ul> <p>The vertical scrollbar is adjustable, current width set to 10.</p> - + <h3>%1</h3> +<p>Dies ist eine Beispiel-QML-Datei, die Optionen in RichText mit Flickable-Inhalt zeigt.</p> + +<p>QML mit RichText kann HTML-Tags verwenden, Flickable Inhalt ist nützlich für Touchscreens.</p> + +<p><b>Dies ist fetter Text.</b></p> +<p><i>Das ist kursiver Text.</i></p> +<p><u>Das ist unterstrichener Text.</u></p> +<p><center>Dieser Text ist mittig ausgerichtet.</center></p> +<p><s>Das ist durchgestrichen.</s></p> + +<p>Code Beispiel: +<code>ls -l /home</code></p> + +<p><b>Listen:</b></p> +<ul> +<li>Intel CPU Systeme</li> +<li>AMD CPU Systeme</li> +</ul> + +<p>Die vertikale Bildlaufleiste ist einstellbar, die aktuelle Breite ist auf 10 eingestellt.</p> Back - + Zurück @@ -3803,7 +3834,7 @@ Ausgabe: <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>Willkommen zum %1 <quote>%2</quote> Installationsprogramm</h3><p>Dieses Programm wird Ihnen einige Fragen stellen und %1 auf Ihrem Computer einrichten.</p> diff --git a/lang/calamares_es.ts b/lang/calamares_es.ts index 9325c653c..f54b26d8b 100644 --- a/lang/calamares_es.ts +++ b/lang/calamares_es.ts @@ -102,7 +102,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Reload Stylesheet - + Recargar Hoja de estilo @@ -120,7 +120,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Set up - + Instalar @@ -138,7 +138,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Programmed job failure was explicitly requested. - + Se solicitó de manera explícita la falla del trabajo programado. @@ -154,7 +154,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Example job (%1) - + Ejemplo de trabajo (%1) @@ -162,12 +162,12 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Run command '%1' in target system. - + Ejecutar el comando '% 1' en el sistema de destino. Run command '%1'. - + Ejecutar el comando '% 1'. @@ -213,17 +213,17 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Loading ... - + Cargando ... QML Step <i>%1</i>. - + Paso QML <i>%1</i>. Loading failed. - + La carga ha fallado. @@ -231,9 +231,9 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Waiting for %n module(s). - - - + + Esperando %n módulo (s). + Esperando %n módulo(s). @@ -247,7 +247,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar System-requirements checking is complete. - + La verificación de los requisitos del sistema está completa. @@ -255,7 +255,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Setup Failed - + Configuración Fallida @@ -265,7 +265,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Would you like to paste the install log to the web? - + ¿Desea pegar el registro de instalación en la web? @@ -292,12 +292,12 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Install Log Paste URL - + Pegar URL Registro de Instalación The upload was unsuccessful. No web-paste was done. - + La carga no tuvo éxito. No se realizó pegado web. @@ -322,12 +322,12 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Continue with installation? - + Continuar con la instalación? 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> - + El programa de instalación %1 está a punto de hacer cambios en el disco con el fin de configurar %2.<br/><strong>No podrá deshacer estos cambios.</strong> @@ -337,7 +337,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar &Set up now - + &Configurar ahora @@ -352,7 +352,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar &Set up - + &Instalar @@ -362,7 +362,7 @@ Para configurar el arranque desde un entorno BIOS, este instalador debe instalar Setup is complete. Close the setup program. - + La instalación se ha completado. Cierre el instalador. diff --git a/lang/calamares_fa.ts b/lang/calamares_fa.ts index 0375254d3..00b82036f 100644 --- a/lang/calamares_fa.ts +++ b/lang/calamares_fa.ts @@ -6,17 +6,17 @@ The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. - + <strong>محیط راه‌اندازی</strong> این سامانه. <br><br>سامانه‌های x86 قدیم‌تر فقط از <strong>بایوس</strong> پشتیبانی می‌کنند. <br>سامانه‌های نوین معمولا از <strong>ای‌اف‌آی</strong> استفاده می‌کنند، ولی اگر در حالت سازگاری روشن شوند، ممکن است به عنوان بایوس هم نمایش یابند. This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. - + سامانه با محیط راه‌اندازی <strong>ای‌اف‌آی</strong> روشن شد. <br><br>برای پیکربندی برپایی از محیط ای‌اف‌آی، باید این نصب‌کننده، برنامه بارکنندهٔ راه‌اندازی‌ای چون <strong>گراب</strong> یا <strong>راه‌انداز سیستم‌دی</strong> را روی یک <strong>افراز سامانه‌ای ای‌اف‌آی</strong> مستقر کند. این عمل به صورت خودکار انجام می‌شود، مگر آن که افرازش دستی را برگزینید که در آن صورت باید خودتان ایجادش کرده یا برگزینید. This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. - + سامانه با محیط راه‌اندازی <strong>بایوس</strong> روشن شد. <br><br>برای پیکربندی برپایی از یک محیط بایوس، باید این نصب‌کنده برنامهٔ بارکنندهٔ راه‌اندازی چون <strong>گراب</strong> را در ابتدای یک افراز یا (ترجیحاً) روی <strong>رکورد راه‌اندازی اصلی</strong> نزدیکابتدای جدول افراز نصب کند. این عمل به صورت خودکار انجام می‌شود، مگر آن که افرازش دستی را برگزینید که در آن صورت باید خودتان برپایش کنید. @@ -24,27 +24,27 @@ Master Boot Record of %1 - + رکورد راه اندازی اصلی %1 Boot Partition - + افراز راه‌اندازی System Partition - + افراز سامانه‌ای Do not install a boot loader - + نصب نکردن یک بارکنندهٔ راه‌اندازی %1 (%2) - + %1 (%2) @@ -52,7 +52,7 @@ Blank Page - + صفحهٔ خالی @@ -60,58 +60,58 @@ Form - + فرم GlobalStorage - + ذخیره‌سازی همگانی JobQueue - + صف کارها Modules - + پیمانه‌ها Type: - + گونه: none - + هیچ Interface: - + رابط: Tools - + ابزارها Reload Stylesheet - + بارگزاری مجدد برگه‌شیوه Widget Tree - + درخت ابزارک‌ها Debug information - + اطّلاعات اشکال‌زدایی @@ -119,12 +119,12 @@ Set up - + راه‌اندازی Install - + نصب @@ -132,12 +132,12 @@ Job failed (%1) - + کار شکست خورد. (%1) Programmed job failure was explicitly requested. - + عدم موفقیت کار برنامه ریزی شده به صورت صریح درخواست شد @@ -145,7 +145,7 @@ Done - + انجام شد. @@ -153,7 +153,7 @@ Example job (%1) - + کار نمونه (%1) @@ -161,17 +161,17 @@ Run command '%1' in target system. - + دستور '%1' را در سیستم هدف اجرا کنید Run command '%1'. - + دستور '%1' را اجرا کنید Running command %1 %2 - + اجرای دستور %1 %2 @@ -179,32 +179,32 @@ Running %1 operation. - + اجرا عملیات %1 Bad working directory path - + مسیر شاخهٔ جاری بد Working directory %1 for python job %2 is not readable. - + شاخهٔ کاری %1 برای کار پایتونی %2 خواندنی نیست Bad main script file - + پروندهٔ کدنوشتهٔ اصلی بد Main script file %1 for python job %2 is not readable. - + پروندهٔ کدنویسهٔ اصلی %1 برای کار پایتونی %2 قابل خواندن نیست. Boost.Python error in job "%1". - + خطای Boost.Python در کار %1. @@ -212,17 +212,17 @@ Loading ... - + در حال بارگذاری ... QML Step <i>%1</i>. - + مرحله QML <i>%1</i>. Loading failed. - + بارگذاری شکست خورد. @@ -230,23 +230,23 @@ Waiting for %n module(s). - - - + + منتظر ماندن برای n% ماژول + منتظر ماندن برای n% ماژول (ها). (%n second(s)) - - - + + (%n ثانیه) + (%n ثانیه) System-requirements checking is complete. - + چک کردن نیازمندی‌های سیستم تمام شد. @@ -254,171 +254,173 @@ Setup Failed - + راه‌اندازی شکست خورد. Installation Failed - + نصب شکست خورد Would you like to paste the install log to the web? - + آیا مایلید که گزارش‌ها در وب الصاق شوند؟ Error - + خطا &Yes - + &بله &No - + &خیر &Close - + &بسته Install Log Paste URL - + Install Log Paste URL The upload was unsuccessful. No web-paste was done. - + The upload was unsuccessful. No web-paste was done. 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 نمی‌تواند نصب شود. کالاماریس نمی‌تواند همه ماژول‌های پیکربندی را بالا بیاورد. این یک مشکل در نحوه استفاده کالاماریس توسط توزیع است. <br/>The following modules could not be loaded: - + <br/>این ماژول نمی‌تواند بالا بیاید: Continue with setup? - + ادامهٔ برپایی؟ Continue with installation? - + نصب ادامه یابد؟ The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> - + برنامه نصب %1 در شرف ایجاد تغییرات در دیسک شما به منظور راه‌اندازی %2 است. <br/><strong>شما قادر نخواهید بود تا این تغییرات را برگردانید.</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 می‌خواهد برای نصب %2 تغییراتی در دیسکتان بدهد. <br/><strong>نخواهید توانست این تغییرات را برگردانید.</strong> &Set up now - + &همین حالا راه‌انداری کنید &Install now - + &اکنون نصب شود Go &back - + &بازگشت &Set up - + &راه‌اندازی &Install - + &نصب Setup is complete. Close the setup program. - + نصب انجام شد. برنامه نصب را ببندید. The installation is complete. Close the installer. - + نصب انجام شد. نصاب را ببندید. Cancel setup without changing the system. - + لغو راه‌اندازی بدون تغییر سیستم. Cancel installation without changing the system. - + لغو نصب بدون تغییر کردن سیستم. &Next - + &بعدی &Back - + &پیشین &Done - + &انجام شد &Cancel - + &لغو Cancel setup? - + لغو راه‌اندازی؟ Cancel installation? - + لغو نصب؟ Do you really want to cancel the current setup process? The setup program will quit and all changes will be lost. - + آیا واقعا می‌خواهید روند راه‌اندازی فعلی رو لغو کنید؟ +برنامه راه اندازی ترک می شود و همه تغییرات از بین می روند. Do you really want to cancel the current install process? The installer will quit and all changes will be lost. - + واقعاً می خواهید فرایند نصب فعلی را لغو کنید؟ +نصب‌کننده بسته شده و تمامی تغییرات از بین خواهند رفت. @@ -426,22 +428,22 @@ The installer will quit and all changes will be lost. Unknown exception type - + گونهٔ استثنای ناشناخته unparseable Python error - + خطای پایتونی غیرقابل تجزیه unparseable Python traceback - + ردیابی پایتونی غیرقابل تجزیه Unfetchable Python error. - + خطای پایتونی غیرقابل دریافت. @@ -450,7 +452,8 @@ The installer will quit and all changes will be lost. Install log posted to: %1 - + نصب رخدادهای ارسال شده به: +%1 @@ -458,32 +461,32 @@ The installer will quit and all changes will be lost. Show debug information - + نمایش اطّلاعات اشکال‌زدایی &Back - + &قبلی &Next - + &بعدی &Cancel - + &لغو %1 Setup Program - + %1 برنامه راه‌اندازی %1 Installer - + نصب‌کنندهٔ %1 @@ -491,7 +494,7 @@ The installer will quit and all changes will be lost. Gathering system information... - + جمع‌آوری اطلاعات سیستم... @@ -499,12 +502,12 @@ The installer will quit and all changes will be lost. Form - + فرم Select storage de&vice: - + انتخاب &دستگاه ذخیره‌سازی: @@ -512,62 +515,62 @@ The installer will quit and all changes will be lost. Current: - + فعلی: After: - + بعد از: <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. Having a GPT partition table and <strong>fat32 512Mb /boot partition is a must for UEFI installs</strong>, either use an existing without formatting or create one. - + <strong>پارتیشن‌بندی دستی</strong><br/>شما می‌توانید خودتان پارتیشن‌ها را بسازید و یا تغییر سایز دهید. با داشتن یک جدول پارتیشن GPT و <strong>پارتیشن /boot با اندازه 512 مگابیتی fat32 برای نصب‌های UEFI الزامی است</strong>، چه با استفاده از نمونه موجود آن بدون قالب‌بندی یا ساخت آن. Reuse %1 as home partition for %2. - + استفاده مجدد از %1 به عنوان پارتیشن خانه برای %2. <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> - + <strong>انتخاب یک پارتیشن برای کوجک کردن و ایجاد پارتیشن جدید از آن، سپس نوار دکمه را بکشید تا تغییر اندازه دهد</strong> %1 will be shrunk to %2MiB and a new %3MiB partition will be created for %4. - + %1 تغییر سایز خواهد داد به %2 مبی‌بایت و یک پارتیشن %3 مبی‌بایتی برای %4 ساخته خواهد شد. Boot loader location: - + مکان بالاآورنده بوت: <strong>Select a partition to install on</strong> - + <strong>یک پارتیشن را برای نصب بر روی آن، انتخاب کنید</strong> An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. - + پارتیشن سیستم ای.اف.آی نمی‌تواند در هیچ جایی از این سیستم یافت شود. لطفا برگردید و از پارتیشن بندی دستی استفاده کنید تا %1 را راه‌اندازی کنید. The EFI system partition at %1 will be used for starting %2. - + پارتیشن سیستم ای.اف.آی در %1 برای شروع %2 استفاده خواهد شد. 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. - + به نظر می‌رسد در دستگاه ذخیره‌سازی هیچ سیستم‌عاملی وجود ندارد. تمایل به انجام چه کاری دارید؟<br/>شما می‌توانید انتخاب‌هایتان را قبل از اعمال هر تغییری در دستگاه ذخیره‌سازی، مرور و تأیید نمایید. @@ -575,7 +578,7 @@ The installer will quit and all changes will be lost. <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. - + <strong>پاک کردن دیسک</strong><br/>این کار تمام داده‌های موجود بر روی دستگاه ذخیره‌سازی انتخاب شده را <font color="red">حذف می‌کند</font>. @@ -583,7 +586,7 @@ The installer will quit and all changes will be lost. <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. - + <strong>نصب در امتداد</strong><br/>این نصاب از یک پارتیشن برای ساخت یک اتاق برای %1 استفاده می‌کند. @@ -591,7 +594,7 @@ The installer will quit and all changes will be lost. <strong>Replace a partition</strong><br/>Replaces a partition with %1. - + <strong>جایگزینی یک افراز</strong><br/>افرازی را با %1 جایگزین می‌کند. @@ -611,27 +614,27 @@ The installer will quit and all changes will be lost. No Swap - + بدون Swap Reuse Swap - + باز استفاده از مبادله Swap (no Hibernate) - + مبادله (بدون خواب‌زمستانی) Swap (with Hibernate) - + مبادله (با خواب‌زمستانی) Swap to file - + مبادله به پرونده @@ -639,17 +642,17 @@ The installer will quit and all changes will be lost. Clear mounts for partitioning operations on %1 - + پاک‌سازی اتّصال‌ها برای عملبات افراز روی %1 Clearing mounts for partitioning operations on %1. - + در حال پاک‌سازی اتّصال‌ها برای عملبات افراز روی %1 Cleared all mounts for %1 - + همهٔ اتّصال‌ها برای %1 پاک‌‌سازی شدند @@ -657,22 +660,22 @@ The installer will quit and all changes will be lost. Clear all temporary mounts. - + پاک‌سازی همهٔ اتّصال‌های موقّتی. Clearing all temporary mounts. - + در حال پاک‌سازی همهٔ اتّصال‌های موقّتی. Cannot get list of temporary mounts. - + نمی‌توان فهرست اتّصال‌های موقّتی را گرفت. Cleared all temporary mounts. - + همهٔ اتّصال‌های موقّتی پاک‌سازی شدند. @@ -681,17 +684,17 @@ The installer will quit and all changes will be lost. Could not run command. - + نمی‌توان دستور را اجرا کرد. The command runs in the host environment and needs to know the root path, but no rootMountPoint is defined. - + دستور در محیط میزبان اجرا می‌شود و نیاز دارد مسیر ریشه را بداند، ولی هیچ نقطهٔ اتّصال ریشه‌ای تعریف نشده. The command needs to know the user's name, but no username is defined. - + دستور نیاز دارد نام کاربر را بداند، ولی هیچ نام کاربری‌ای تعریف نشده. @@ -699,17 +702,17 @@ The installer will quit and all changes will be lost. Set keyboard model to %1.<br/> - + تنظیم مدل صفحه‌کلید به %1.<br/> Set keyboard layout to %1/%2. - + تنظیم چینش صفحه‌کلید به %1/%2. The system language will be set to %1. - + زبان سامانه به %1 تنظیم خواهد شد. @@ -719,72 +722,72 @@ The installer will quit and all changes will be lost. Set timezone to %1/%2.<br/> - + تنظیم منطقهٔ زمانی به %1/%2.<br/> Network Installation. (Disabled: Incorrect configuration) - + نصب شبکه‌ای. (از کار افتاده: پیکربندی نادرست) Network Installation. (Disabled: Received invalid groups data) - + نصب شبکه‌ای. (از کار افتاده: دریافت داده‌های گروه‌های نامعتبر) Network Installation. (Disabled: internal error) - + نصب شبکه‌ای. (از کار افتاده: خطای داخلی) Network Installation. (Disabled: Unable to fetch package lists, check your network connection) - + نصب شبکه‌ای. (از کار افتاده: ناتوان در گرفتن فهرست بسته‌ها. اتّصال شبکه‌تان را بررسی کنید) This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> - + رایانه کمینهٔ نیازمندی‌های برپاسازی %1 را ندارد.<br/>برپاسازی نمی‌تواند ادامه یابد. <a href="#details">جزییات…</a> This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> - + رایانه کمینهٔ نیازمندی‌های نصب %1 را ندارد.<br/>نصب نمی‌تواند ادامه یابد. <a href="#details">جزییات…</a> This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. - + رایانه کمینهٔ نیازمندی‌های برپاسازی %1 را ندارد.<br/>برپاسازی می‌تواند ادامه یابد، ولی ممکن است برخی ویژگی‌ها از کار افتاده باشند. This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. - + رایانه کمینهٔ نیازمندی‌های نصب %1 را ندارد.<br/>نصب می‌تواند ادامه یابد، ولی ممکن است برخی ویژگی‌ها از کار افتاده باشند. This program will ask you some questions and set up %2 on your computer. - + این برنامه تعدادی سوال از شما پرسیده و %2 را روی رایانه‌تان برپا می‌کند. <h1>Welcome to the Calamares setup program for %1.</h1> - + <h1>به برنامهٔ برپاسازی کالامارس برای %1 خوش آمدید.</h1> <h1>Welcome to %1 setup.</h1> - + <h1>به برپاسازی %1 خوش آمدید.</h1> <h1>Welcome to the Calamares installer for %1.</h1> - + <h1>به نصب‌کنندهٔ کالامارس برای %1 خوش آمدید.</h1> <h1>Welcome to the %1 installer.</h1> - + <h1>به نصب‌کنندهٔ %1 خوش آمدید.</h1> @@ -800,77 +803,77 @@ The installer will quit and all changes will be lost. Create a Partition - + ایجاد یک افراز Si&ze: - + اندا&زه: MiB - + می‌ب Partition &Type: - + &گونهٔ افراز &Primary - + &اصلی E&xtended - + &گسترش‌یافته Fi&le System: - + سامانه &پرونده: LVM LV name - + نام حجم منطقی &Mount Point: - + &نقطهٔ اتّصال: Flags: - + پرچم‌ها: En&crypt - + رمز&نگاری Logical - + منطقی Primary - + اصلی GPT - + GPT Mountpoint already in use. Please select another one. - + نقطهٔ اتّصال از پیش در حال استفاده است. لطفاً نقطهٔ دیگری برگزینید. @@ -878,17 +881,17 @@ The installer will quit and all changes will be lost. Create new %2MiB partition on %4 (%3) with file system %1. - + ایچاد افراز %2می‌ب جدید روی %4 (%3) با سامانهٔ پروندهٔ %1. Create new <strong>%2MiB</strong> partition on <strong>%4</strong> (%3) with file system <strong>%1</strong>. - + ایچاد افراز <strong>%2می‌ب</strong> جدید روی <strong>%</strong>4 (%3) با سامانهٔ پروندهٔ <strong>%</strong>1. Creating new %1 partition on %2. - + در حال ایجاد افراز %1 جدید روی %2. @@ -901,27 +904,27 @@ The installer will quit and all changes will be lost. Create Partition Table - + ایجاد جدول افراز Creating a new partition table will delete all existing data on the disk. - + ایجاد یک جدول افراز جدید، همهٔ داده‌های موجود روی دیسک را حذف خواهد کرد. What kind of partition table do you want to create? - + می‌خواهید چه جور جدول افرازی بسازید؟ Master Boot Record (MBR) - + رکورد راه‌اندازی اصلی (MBR) GUID Partition Table (GPT) - + جدول افراز گاید (GPT) @@ -929,17 +932,17 @@ The installer will quit and all changes will be lost. Create new %1 partition table on %2. - + ایجاد جدول افراز %1 جدید روی %2. Create new <strong>%1</strong> partition table on <strong>%2</strong> (%3). - + ایجاد جدول افراز <strong>%1</strong> جدید روی <strong>%2</strong> (%3). Creating new %1 partition table on %2. - + در حال ایجاد جدول افراز %1 جدید روی %2. @@ -952,37 +955,37 @@ The installer will quit and all changes will be lost. Create user %1 - + ایجاد کاربر %1 Create user <strong>%1</strong>. - + ایجاد کاربر <strong>%</strong>1. Creating user %1. - + در حال ایجاد کاربر %1. Sudoers dir is not writable. - + شاخهٔ sudoers قابل نوشتن نیست. Cannot create sudoers file for writing. - + نمی‌توان پروندهٔ sudoers را برای نوشتن ایجاد کرد. Cannot chmod sudoers file. - + نمی‌توان مالک پروندهٔ sudoers را تغییر داد. Cannot open groups file for reading. - + نمی‌توان پروندهٔ groups را برای خواندن گشود. @@ -990,7 +993,7 @@ The installer will quit and all changes will be lost. Create Volume Group - + ایجاد گروه حجمی @@ -998,17 +1001,17 @@ The installer will quit and all changes will be lost. Create new volume group named %1. - + ایجاد گروه حجمی جدید به نام %1. Create new volume group named <strong>%1</strong>. - + ایجاد گروه حجمی جدید به نام <strong>%1</strong>. Creating new volume group named %1. - + در حال ایجاد گروه حجمی جدید به نام %1. @@ -1022,12 +1025,12 @@ The installer will quit and all changes will be lost. Deactivate volume group named %1. - + از کار انداختن گروه حجمی با نام %1. Deactivate volume group named <strong>%1</strong>. - + از کار انداختن گروه حجمی با نام <strong>%1</strong>. @@ -1040,17 +1043,17 @@ The installer will quit and all changes will be lost. Delete partition %1. - + حذف افراز %1. Delete partition <strong>%1</strong>. - + حذف افراز <strong>%1</strong>. Deleting partition %1. - + در حال حذف افراز %1. @@ -1063,7 +1066,7 @@ The installer will quit and all changes will be lost. This device has a <strong>%1</strong> partition table. - + این افزاره یک جدول افراز <strong>%1</strong> دارد. @@ -1097,13 +1100,13 @@ The installer will quit and all changes will be lost. %1 - %2 (%3) device[name] - size[number] (device-node[name]) - + %1 - %2 (%3) %1 - (%2) device[name] - (device-node[name]) - + %1 - (%2) @@ -1111,7 +1114,7 @@ The installer will quit and all changes will be lost. Write LUKS configuration for Dracut to %1 - + Write LUKS configuration for Dracut to %1 @@ -1121,7 +1124,7 @@ The installer will quit and all changes will be lost. Failed to open %1 - + شکست در گشودن %1 @@ -1129,7 +1132,7 @@ The installer will quit and all changes will be lost. Dummy C++ Job - + کار سی‌پلاس‌پلاس الکی @@ -1137,57 +1140,57 @@ The installer will quit and all changes will be lost. Edit Existing Partition - + ویرایش افراز موجود Content: - + محتوا: &Keep - + &نگه‌داری Format - + قالب‌بندی Warning: Formatting the partition will erase all existing data. - + هشدار: قالب‌بندی افراز، همهٔ داده‌های موجود را پاک می‌کند. &Mount Point: - + &نقطهٔ اتّصال: Si&ze: - + اندا&زه: MiB - + می‌ب Fi&le System: - + سامانه &پرونده: Flags: - + پرچم‌ها: Mountpoint already in use. Please select another one. - + نقطهٔ اتّصال از پیش در حال استفاده است. لطفاً نقطهٔ دیگری برگزینید. @@ -1195,27 +1198,27 @@ The installer will quit and all changes will be lost. Form - + فرم En&crypt system - + رمز&نگاری سامانه Passphrase - + عبارت عبور Confirm passphrase - + تأیید عبارت عبور Please enter the same passphrase in both boxes. - + لطفاً عبارت عبور یکسانی را در هر دو جعبه وارد کنید. @@ -1223,7 +1226,7 @@ The installer will quit and all changes will be lost. Set partition information - + تنظیم اطّلاعات افراز @@ -1253,7 +1256,7 @@ The installer will quit and all changes will be lost. Setting up mount points. - + برپایی نقطه‌های اتّصال @@ -1261,12 +1264,12 @@ The installer will quit and all changes will be lost. Form - + فرم &Restart now - + &راه‌اندازی دوباره @@ -1281,7 +1284,7 @@ The installer will quit and all changes will be lost. <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>همه‌چیز انجام شد.</h1><br/>%1 روی رایانه‌تان نصب شد.<br/>ممکن است بخواهید به سامانهٔ جدیدتان وارد شده تا به استفاده از محیط زندهٔ %2 ادامه دهید. @@ -1304,27 +1307,27 @@ The installer will quit and all changes will be lost. Finish - + پایان Setup Complete - + برپایی کامل شد Installation Complete - + نصب کامل شد The setup of %1 is complete. - + برپایی %1 کامل شد. The installation of %1 is complete. - + نصب %1 کامل شد. @@ -1375,52 +1378,52 @@ The installer will quit and all changes will be lost. is plugged in to a power source - + به برق وصل است. The system is not plugged in to a power source. - + سامانه به برق وصل نیست. is connected to the Internet - + به اینترنت وصل است The system is not connected to the Internet. - + سامانه به اینترنت وصل نیست. is running the installer as an administrator (root) - + دارد نصب‌کننده را به عنوان یک مدیر (ریشه) اجرا می‌کند The setup program is not running with administrator rights. - + برنامهٔ برپایی با دسترسی‌های مدیر اجرا نشده‌است. The installer is not running with administrator rights. - + برنامهٔ نصب کننده با دسترسی‌های مدیر اجرا نشده‌است. has a screen large enough to show the whole installer - + صفحه‌ای با بزرگی کافی برای نمایش تمام نصب‌کننده دارد The screen is too small to display the setup program. - + صفحه برای نمایش برنامهٔ برپایی خیلی کوچک است. The screen is too small to display the installer. - + صفحه برای نمایش نصب‌کننده خیلی کوچک است. @@ -1428,7 +1431,7 @@ The installer will quit and all changes will be lost. Collecting information about your machine. - + در حال جمع‌آوری اطّلاعات دربارهٔ دستگاهتان. @@ -1444,17 +1447,17 @@ The installer will quit and all changes will be lost. Could not create directories <code>%1</code>. - + نمی‌توان شاخه‌های <code>%1</code> را ایجاد کرد. Could not open file <code>%1</code>. - + نمی‌توان پروندهٔ <code>%1</code> را گشود. Could not write to file <code>%1</code>. - + نمی‌توان در پروندهٔ <code>%1</code> نوشت. @@ -1462,7 +1465,7 @@ The installer will quit and all changes will be lost. Creating initramfs with mkinitcpio. - + در جال ایجاد initramfs با mkinitcpio. @@ -1470,7 +1473,7 @@ The installer will quit and all changes will be lost. Creating initramfs. - + در حال ایجاد initramfs. @@ -1478,17 +1481,17 @@ The installer will quit and all changes will be lost. Konsole not installed - + برنامهٔ Konsole نصب نیست Please install KDE Konsole and try again! - + لطفاً Konsole کی‌دی‌ای را نصب کرده و دوباره تلاش کنید! Executing script: &nbsp;<code>%1</code> - + در حال اجرای کدنوشته: &nbsp;<code>%1</code> @@ -1496,7 +1499,7 @@ The installer will quit and all changes will be lost. Script - + کدنوشته @@ -1504,12 +1507,12 @@ The installer will quit and all changes will be lost. Set keyboard model to %1.<br/> - + تنظیم مدل صفحه‌کلید به %1.<br/> Set keyboard layout to %1/%2. - + تنظیم چینش صفحه‌کلید به %1/%2. @@ -1517,7 +1520,7 @@ The installer will quit and all changes will be lost. Keyboard - + صفحه‌کلید @@ -1525,7 +1528,7 @@ The installer will quit and all changes will be lost. Keyboard - + صفحه‌کلید @@ -1533,22 +1536,22 @@ The installer will quit and all changes will be lost. System locale setting - + تنظیمات محلی سیستم 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>. - + تنظیمات محلی سیستم بر روی زبان و مجموعه کاراکتر برخی از عناصر رابط کاربری خط فرمان تأثیر می‌گذارد. <br/>تنظیمات فعلی <strong>%1</strong> است. &Cancel - + &لغو &OK - + &قبول @@ -1556,22 +1559,22 @@ The installer will quit and all changes will be lost. Form - + فرم <h1>License Agreement</h1> - + <h1>توافق پروانه</h1> I accept the terms and conditions above. - + شرایط و ضوابط فوق را می‌پذیرم. Please review the End User License Agreements (EULAs). - + لطفاً توافق پروانهٔ کاربر نهایی (EULAs) را بازبینی کنید. @@ -1599,7 +1602,7 @@ The installer will quit and all changes will be lost. License - + پروانه @@ -1607,13 +1610,13 @@ The installer will quit and all changes will be lost. URL: %1 - + نشانی اینترنتی: %1 <strong>%1 driver</strong><br/>by %2 %1 is an untranslatable product name, example: Creative Audigy driver - + <strong>راه‌انداز %1</strong><br/>از %2 @@ -1644,22 +1647,22 @@ The installer will quit and all changes will be lost. File: %1 - + پرونده: %1 Hide license text - + نهفتن متن پروانه Show the license text - + نمایش متن پروانه Open license agreement in browser. - + گشودن توافق پروانه در مرورگر. @@ -1667,23 +1670,23 @@ The installer will quit and all changes will be lost. Region: - + ناحیه: Zone: - + منطقه: &Change... - + &تغییر… The system language will be set to %1. - + زبان سامانه به %1 تنظیم خواهد شد. @@ -1693,7 +1696,7 @@ The installer will quit and all changes will be lost. Set timezone to %1/%2.<br/> - + تنظیم منطقهٔ زمانی به %1/%2.<br/> @@ -1701,7 +1704,7 @@ The installer will quit and all changes will be lost. Location - + موقعیت @@ -1709,7 +1712,7 @@ The installer will quit and all changes will be lost. Location - + موقعیت @@ -1717,20 +1720,20 @@ The installer will quit and all changes will be lost. Configuring LUKS key file. - + پیکربندی پروندهٔ کلید LUKS. No partitions are defined. - + هیچ افرازی تعریف نشده Encrypted rootfs setup error - + خطای برپاسازی rootfs رمزشده @@ -1753,12 +1756,12 @@ The installer will quit and all changes will be lost. Generate machine-id. - + تولید شناسهٔ دستگاه Configuration Error - + خطای پیکربندی @@ -1772,97 +1775,97 @@ The installer will quit and all changes will be lost. Package selection - + گزینش بسته‌ها Office software - + نرم‌افزار اداری Office package - + بستهٔ اداری Browser software - + نرم‌افزار مرورگر Browser package - + بستهٔ مرورگر Web browser - + مرورگر وب Kernel - + کرنل Services - + خدمت‌ها Login - + ورود Desktop - + میزکار Applications - + برنامه‌های کاربردی Communication - + ارتباطات Development - + توسعه Office - + اداری Multimedia - + چندرسانه‌ای Internet - + اینترنت Theming - + شخصی‌سازی Gaming - + بازی Utilities - + ابزارها @@ -1870,7 +1873,7 @@ The installer will quit and all changes will be lost. Notes - + یادداشت‌ها @@ -1896,7 +1899,7 @@ The installer will quit and all changes will be lost. OEM Configuration - + پیکربندی سازنده @@ -1909,72 +1912,72 @@ The installer will quit and all changes will be lost. Password is too short - + گذرواژه خیلی کوتاه است Password is too long - + گذرواژه خیلی بلند است Password is too weak - + گذرواژه خیلی ضعیف است Memory allocation error when setting '%1' - + خطای تخصیص حافظه هنگام تنظیم %1 Memory allocation error - + خطای تخصیص حافظه The password is the same as the old one - + گذرواژه همان قبلی است The password is a palindrome - + گذرواژه متقارن است The password differs with case changes only - + گذرواژه فقط در کوچکی و بزرگی متفاوت است The password is too similar to the old one - + گذرواژه خیلی شبیه قبلی است The password contains the user name in some form - + گذرواژه، شکلی از نام کاربری را داراست The password contains words from the real name of the user in some form - + گذرواژه شامل واژگانی از نام واقعی کاربر است The password contains forbidden words in some form - + گذرواژه شکلی از واژگان ممنوعه را دارد The password contains less than %1 digits - + گذرواژه کم‌تر از %1 رقم دارد The password contains too few digits - + گذرواژه، رقم‌های خیلی کمی دارد @@ -2009,17 +2012,17 @@ The installer will quit and all changes will be lost. The password is shorter than %1 characters - + گذرواژه کوتاه‌تر از %1 نویسه است The password is too short - + گذرواژه خیلی کوتاه است The password is just rotated old one - + گذرواژه معکوس قبلی است @@ -2064,7 +2067,7 @@ The installer will quit and all changes will be lost. No password supplied - + هیچ‌گذرواژه‌ای فراهم نشده @@ -2089,67 +2092,67 @@ The installer will quit and all changes will be lost. Unknown setting - %1 - + تنظیمات ناشناخته - %1 Unknown setting - + تنظیمات ناشناخته Bad integer value of setting - %1 - + مقدار صحیح بد در تنظیمات - %1 Bad integer value - + مقدار صحیح بد Setting %1 is not of integer type - + تنظیمات %1 از گونهٔ صحیح نیست Setting is not of integer type - + تنظیمات از گونهٔ صحیح نیست Setting %1 is not of string type - + تنظیمات %1 از گونهٔ رشته نیست Setting is not of string type - + تنظیمات از گونهٔ رشته نیست Opening the configuration file failed - + گشودن پروندهٔ پیکربندی شکست خورد The configuration file is malformed - + پروندهٔ پیکربندی بدریخت است Fatal failure - + خطای مهلک Unknown error - + خطای ناشناخته Password is empty - + گذرواژه خالی است @@ -2157,27 +2160,27 @@ The installer will quit and all changes will be lost. Form - + فرم Product Name - + نام محصول TextLabel - + TextLabel Long Product Description - + شرح محصول بلند Package Selection - + گزینش بسته‌ها @@ -2190,7 +2193,7 @@ The installer will quit and all changes will be lost. Packages - + بسته‌ها @@ -2198,12 +2201,12 @@ The installer will quit and all changes will be lost. Name - + نام Description - + شرح @@ -2211,17 +2214,17 @@ The installer will quit and all changes will be lost. Form - + فرم Keyboard Model: - + مدل صفحه‌کلید: Type here to test your keyboard - + برای آزمودن صفحه‌کلیدتان، این‌جا بنویسید @@ -2229,65 +2232,65 @@ The installer will quit and all changes will be lost. Form - + فرم What is your name? - + نامتان چیست؟ Your Full Name - + نام کاملتان What name do you want to use to log in? - + برای ورود می خواهید از چه نامی استفاده کنید؟ login - + ورود What is the name of this computer? - + نام این رایانه چیست؟ <small>This name will be used if you make the computer visible to others on a network.</small> - + <small>اگر رایانه‌تان را روی یک شبکه برای دیگران نمایان کنید، از این نام استفاده می‌شود.</small> Computer Name - + نام رایانه Choose a password to keep your account safe. - + برای امن نگه داشتن حسابتان، گذرواژه‌ای برگزینید. <small>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.</small> - + <small>همان گذرواژه را دوباره وارد کنید تا بتواند برای خطاهای نوشتاری بررسی شود. یک گذرواژهٔ خوب شامل ترکیبی از حروف، ارقام و علامت‌هاست که باید لااقل هست نویسه طول داشته باشد و در دوره‌های منظّم، عوض شود.</small> Password - + گذرواژه Repeat Password - + تکرار TextLabel @@ -2297,28 +2300,28 @@ The installer will quit and all changes will be lost. Require strong passwords. - + نباز به گذرواژهٔ قوی دارد. Log in automatically without asking for the password. - + ورود خودکار بدون پرسیدن گذرواژه. Use the same password for the administrator account. - + استفاده از گذرواژهٔ یکسان برای حساب مدیر. Choose a password for the administrator account. - + گذرواژه‌ای برای حساب مدیر برگزینید. <small>Enter the same password twice, so that it can be checked for typing errors.</small> - + <small>همان گذرواژه را دوباره وارد کنید تا بتواند برای خطاهای نوشتاری بررسی شود.</small> @@ -2326,43 +2329,43 @@ The installer will quit and all changes will be lost. Root - + ریشه Home - + خانه Boot - + بوت EFI system - + سیستم ای.اف.آی Swap - + Swap New partition for %1 - + پارتیشن جدید برای %1 New partition - + پارتیشن جدید %1 %2 size[number] filesystem[name] - + %1 %2 @@ -2371,33 +2374,33 @@ The installer will quit and all changes will be lost. Free Space - + فضای آزاد New partition - + افراز جدید Name - + نام File System - + سامانهٔ پرونده Mount Point - + نقطهٔ اتّصال Size - + اندازه @@ -2405,72 +2408,72 @@ The installer will quit and all changes will be lost. Form - + فرم Storage de&vice: - + ذخیره‌سازی و افزا&ره: &Revert All Changes - + &بازگردانی همهٔ تغییرات New Partition &Table - + &جدول افراز جدید Cre&ate - + ای&جاد &Edit - + &ویرایش &Delete - + &حذف New Volume Group - + گروه حجمی جدید Resize Volume Group - + تغییر اندازهٔ گروه حجمی Deactivate Volume Group - + از کار انداختن گروه حجمی Remove Volume Group - + برداشتن گروه حجمی I&nstall boot loader on: - + &نصب بارکنندهٔ راه‌اندازی روی: Are you sure you want to create a new partition table on %1? - + مطمئنید می‌خواهید روی %1 جدول افراز جدیدی بسازید؟ Can not create new partition - + نمی‌توان افراز جدید ساخت @@ -2483,32 +2486,32 @@ The installer will quit and all changes will be lost. Gathering system information... - + جمع‌آوری اطّلاعات سامانه… Partitions - + افرازها Install %1 <strong>alongside</strong> another operating system. - + نصب %1 <strong>در امتداد</strong> سیستم عامل دیگر. <strong>Erase</strong> disk and install %1. - + <strong>پاک کردن</strong> دیسک و نصب %1. <strong>Replace</strong> a partition with %1. - + <strong>جایگزینی</strong> یک پارتیشن و با %1 <strong>Manual</strong> partitioning. - + <strong>پارتیشن‌بندی</strong> دستی. @@ -2533,17 +2536,17 @@ The installer will quit and all changes will be lost. Disk <strong>%1</strong> (%2) - + دیسک <strong>%1</strong> (%2) Current: - + فعلی: After: - + بعد از: @@ -2578,7 +2581,7 @@ The installer will quit and all changes will be lost. Boot partition not encrypted - + پارتیشن بوت رمزشده نیست @@ -2593,7 +2596,7 @@ The installer will quit and all changes will be lost. There are no partitions to install on. - + هیچ پارتیشنی برای نصب وجود ندارد @@ -2615,7 +2618,7 @@ The installer will quit and all changes will be lost. Form - + فرم @@ -2633,7 +2636,7 @@ The installer will quit and all changes will be lost. Look-and-Feel - + ظاهر و احساس @@ -2641,7 +2644,7 @@ The installer will quit and all changes will be lost. Saving files for later ... - + ذخیرهٔ پرونده‌ها برای بعد @@ -2667,7 +2670,7 @@ There was no output from the command. Output: - + خروجی @@ -2725,7 +2728,7 @@ Output: %1 (%2) - + %1 (%2) @@ -2735,33 +2738,33 @@ Output: unknown - + ناشناخته extended - + گسترده unformatted - + قالب‌بندی نشده swap - + مبادله Default Keyboard Model - + مدل صفحه‌کلید پیش‌گزیده Default - + پیش گزیده @@ -2769,7 +2772,7 @@ Output: File not found - + پرونده پیدا نشد @@ -2784,22 +2787,22 @@ Output: No product - + بدون محصول No description provided. - + هیچ توضیحی وجود ندارد. (no mount point) - + (بدون نقطهٔ اتّصال) Unpartitioned space or unknown partition table - + فضای افرازنشده یا جدول افراز ناشناخته @@ -2807,7 +2810,7 @@ Output: Remove live user from target system - + برداشتن کاربر زنده از سامانهٔ هدف @@ -2834,7 +2837,7 @@ Output: Form - + فرم @@ -2896,12 +2899,12 @@ Output: The EFI system partition at %1 will be used for starting %2. - + پارتیشن سیستم ای.اف.آی در %1 برای شروع %2 استفاده خواهد شد. EFI system partition: - + پارتیشن سیستم ای.اف.آی @@ -2909,12 +2912,12 @@ Output: Resize Filesystem Job - + کار تغییر اندازهٔ سامانه‌پرونده Invalid configuration - + پیکربندی نامعتبر @@ -2938,7 +2941,7 @@ Output: Resize Failed - + تغییر اندازه شکست خورد @@ -2978,7 +2981,7 @@ Output: Resize partition %1. - + تغییر اندازهٔ افراز %1. @@ -3001,7 +3004,7 @@ Output: Resize Volume Group - + تغییر اندازهٔ گروه حجمی @@ -3033,7 +3036,7 @@ Output: System requirements - + نیازمندی‌های سامانه @@ -3041,27 +3044,27 @@ Output: This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> - + رایانه کمینهٔ نیازمندی‌های برپاسازی %1 را ندارد.<br/>برپاسازی نمی‌تواند ادامه یابد. <a href="#details">جزییات…</a> This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> - + رایانه کمینهٔ نیازمندی‌های نصب %1 را ندارد.<br/>نصب نمی‌تواند ادامه یابد. <a href="#details">جزییات…</a> This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. - + رایانه کمینهٔ نیازمندی‌های برپاسازی %1 را ندارد.<br/>برپاسازی می‌تواند ادامه یابد، ولی ممکن است برخی ویژگی‌ها از کار افتاده باشند. This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. - + رایانه کمینهٔ نیازمندی‌های نصب %1 را ندارد.<br/>نصب می‌تواند ادامه یابد، ولی ممکن است برخی ویژگی‌ها از کار افتاده باشند. This program will ask you some questions and set up %2 on your computer. - + این برنامه تعدادی سوال از شما پرسیده و %2 را روی رایانه‌تان برپا می‌کند. @@ -3069,12 +3072,12 @@ Output: Scanning storage devices... - + در حال پویش افزارهٔ ذخیره‌ساز… Partitioning - + افرازش @@ -3082,23 +3085,23 @@ Output: Set hostname %1 - + تنظیم نام میزبان %1 Set hostname <strong>%1</strong>. - + تنظیم نام میزبان <strong>%1</strong>. Setting hostname %1. - + تنظیم نام میزبان به %1. Internal Error - + خطای داخلی @@ -3225,7 +3228,7 @@ Output: Set password for user %1 - + تنظیم گذرواژه برای کاربر %1 @@ -3240,7 +3243,7 @@ Output: rootMountPoint is %1 - + نقطهٔ اتّصال ریشه %1 است @@ -3255,7 +3258,7 @@ Output: Cannot set password for user %1. - + نمی‌توان برای کاربر %1 گذرواژه تنظیم کرد. @@ -3268,22 +3271,22 @@ Output: Set timezone to %1/%2 - + تنظیم منطقهٔ زمانی به %1/%2 Cannot access selected timezone path. - + نمی‌توان به مسیر منطقهٔ زمانی گزیده دسترسی یافت. Bad path: %1 - + مسیر بد: %1 Cannot set timezone. - + نمی‌توان منطقهٔ زمانی را تنظیم کرد. @@ -3336,7 +3339,7 @@ Output: Summary - + خلاصه @@ -3396,7 +3399,7 @@ Output: Form - + فرم @@ -3439,7 +3442,7 @@ Output: Feedback - + بازخورد @@ -3457,7 +3460,7 @@ Output: Your username is too long. - + نام کاربریتان بیش از حد بلند است. @@ -3472,12 +3475,12 @@ Output: Your hostname is too short. - + نام میزبانتان بیش از حد کوتاه است. Your hostname is too long. - + نام میزبانتان بیش از حد بلند است. @@ -3487,7 +3490,7 @@ Output: Your passwords do not match! - + گذرواژه‌هایتان مطابق نیستند! @@ -3495,7 +3498,7 @@ Output: Users - + کاربران @@ -3503,12 +3506,12 @@ Output: Key - + کلید Value - + مقدار @@ -3516,22 +3519,22 @@ Output: Create Volume Group - + ایجاد گروه حجمی List of Physical Volumes - + فهرست حجم‌های فیزیکی Volume Group Name: - + نام گروه حجمی: Volume Group Type: - + گونهٔ گروه حجمی: @@ -3541,27 +3544,27 @@ Output: MiB - + می‌ب Total Size: - + اندازهٔ کل: Used Size: - + اندازهٔ استفاده‌شده: Total Sectors: - + کل شیارها: Quantity of LVs: - + کمیت حجم‌های منطقی: @@ -3569,7 +3572,7 @@ Output: Form - + فرم @@ -3580,82 +3583,82 @@ Output: &About - + &درباره Open donations website - + گشودن پایگاه وب اعانه‌ها &Donate - + ا&عانه Open help and support website - + گشودن پایگاه وب راهنمایی و پشتیبانی &Support - + &پشتیبانی Open issues and bug-tracking website - + گشودن پایگاه وب ردیاب مشکل &Known issues - + &مشکلات شناخته‌شده Open release notes website - + گشودن پاگاه وب یادداشت‌های انتشار &Release notes - + &یادداشت‌های انتشار <h1>Welcome to the Calamares setup program for %1.</h1> - + <h1>به برنامهٔ برپاسازی کالامارس برای %1 خوش آمدید.</h1> <h1>Welcome to %1 setup.</h1> - + <h1>به برپاسازی %1 خوش آمدید.</h1> <h1>Welcome to the Calamares installer for %1.</h1> - + <h1>به نصب‌کنندهٔ کالامارس برای %1 خوش آمدید.</h1> <h1>Welcome to the %1 installer.</h1> - + <h1>به نصب‌کنندهٔ %1 خوش آمدید.</h1> %1 support - + پشتیبانی %1 About %1 setup - + دربارهٔ برپاسازی %1 About %1 installer - + دربارهٔ نصب‌کنندهٔ %1 @@ -3668,7 +3671,7 @@ Output: Welcome - + خوش آمدید @@ -3676,7 +3679,7 @@ Output: Welcome - + خوش آمدید @@ -3700,7 +3703,7 @@ Output: Back - + بازگشت @@ -3708,44 +3711,44 @@ Output: Keyboard Model - + مدل صفحه‌کلید Pick your preferred keyboard model or use the default one based on the detected hardware - + برمبنای سخت‌افزار شناخته‌شده، مدل صفحه‌کلید دلخواهتان را برگزیده یا از مدل پیش‌گزیده استفاده کنید. Refresh - + تازه‌سازی Layouts - + چینش‌ها Keyboard Layout - + چینش صفحه‌کلید Models - + مدل‌ها Variants - + دگرگونه‌ها Test your keyboard - + صفحه‌کلیدتان را بیازمایید @@ -3787,7 +3790,7 @@ Output: Back - + بازگشت @@ -3801,27 +3804,27 @@ Output: About - + درباره Support - + پشتیبانی Known issues - + اشکالات شناخته‌شده Release notes - + یادداشت‌های انتشار Donate - + اعانه diff --git a/lang/calamares_it_IT.ts b/lang/calamares_it_IT.ts index fb92b4dd7..2599b2e37 100644 --- a/lang/calamares_it_IT.ts +++ b/lang/calamares_it_IT.ts @@ -2555,12 +2555,12 @@ Il programma d'installazione sarà terminato e tutte le modifiche andranno perse An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. - + Una partizione EFI è necessaria per avviare %1.<br/><br/> Per configurare una partizione EFI, tornare indietro e selezionare o creare un filesystem FAT32 con il parametro<strong>%3</strong>abilitato e punto di montaggio <strong>%2</strong>. <br/><br/>Si può continuare senza impostare una partizione EFI ma il sistema potrebbe non avviarsi correttamente. An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. - + Una partizione EFI è necessaria per avviare %1.<br/><br/> Una partizione è stata configurata con punto di montaggio <strong>%2</strong> ma il suo parametro <strong>%3</strong> non è impostato.<br/>Per impostare il flag, tornare indietro e modificare la partizione.<br/><br/>Si può continuare senza impostare il parametro ma il sistema potrebbe non avviarsi correttamente. @@ -3813,7 +3813,8 @@ Output: <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>Benvenuti al programma d'installazione %1 <quote>%2</quote></h3> +<p> diff --git a/lang/calamares_sq.ts b/lang/calamares_sq.ts index 166c62781..869a1f18c 100644 --- a/lang/calamares_sq.ts +++ b/lang/calamares_sq.ts @@ -11,12 +11,12 @@ This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. - Ky sistem qe nisur me një mjedis nisjesh <strong>EFI</strong>.<br><br>Që të formësojë nisjen nga një mjedis EFI, ky instalues duhet të vërë në punë një aplikacion ngarkuesi nisësi, të tillë si <strong>GRUB</strong> ose <strong>systemd-boot</strong> në një <strong>Pjesë EFI Sistemi</strong>. Kjo bëhet vetvetiu, hiq rastin kur zgjidhni pjesëzim dorazi, rast në të cilin duhet ta zgjidhni apo krijoni ju vetë. + Ky sistem qe nisur me një mjedis nisjesh <strong>EFI</strong>.<br><br>Që të formësojë nisjen nga një mjedis EFI, ky instalues duhet të vërë në punë një aplikacion ngarkuesi nisësi, të tillë si <strong>GRUB</strong> ose <strong>systemd-boot</strong> në një <strong>Pjesë EFI Sistemi</strong>. Kjo bëhet vetvetiu, hiq rastin kur zgjidhni pjesëtim dorazi, rast në të cilin duhet ta zgjidhni apo krijoni ju vetë. This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. - Ky sistem qe nisur me një mjedis nisjesh <strong>BIOS</strong>.<br><br>Që të formësojë nisjen nga një mjedis BIOS, ky instalues duhet të instalojë një ngarkues nisjesh, të tillë si <strong>GRUB</strong>, ose në krye të një pjese, ose te <strong>Master Boot Record</strong> pranë fillimit të tabelës së pjesëve (e parapëlqyer). Kjo bëhet vetvetiu, veç në zgjedhshi pjesëzim dorazi, rast në të cilin duhet ta rregulloni ju vetë. + Ky sistem qe nisur me një mjedis nisjesh <strong>BIOS</strong>.<br><br>Që të formësojë nisjen nga një mjedis BIOS, ky instalues duhet të instalojë një ngarkues nisjesh, të tillë si <strong>GRUB</strong>, ose në krye të një pjese, ose te <strong>Master Boot Record</strong> pranë fillimit të tabelës së pjesëve (e parapëlqyer). Kjo bëhet vetvetiu, veç në zgjedhshi pjesëtim dorazi, rast në të cilin duhet ta rregulloni ju vetë. @@ -525,7 +525,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. Having a GPT partition table and <strong>fat32 512Mb /boot partition is a must for UEFI installs</strong>, either use an existing without formatting or create one. - <strong>Pjesëzim dorazi</strong><br/>Mund të krijoni ose ripërmasoni pjesë ju vetë. Pasja e një tabele GPT pjesësh dhe <strong>512Mb fat32 /pjesë nisjeje është domosdoshmëri për instalime UEFI</strong>, ose përdorni një të tillë pa e formatuar, ose krijoni një të tillë. + <strong>Pjesëtim dorazi</strong><br/>Mund të krijoni ose ripërmasoni pjesë ju vetë. Pasja e një tabele GPT pjesësh dhe <strong>512Mb fat32 /pjesë nisjeje është domosdoshmëri për instalime UEFI</strong>, ose përdorni një të tillë pa e formatuar, ose krijoni një të tillë. @@ -555,7 +555,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. - Në këtë sistem s’gjendet gjëkundi një pjesë EFI sistemi. Ju lutemi, kthehuni mbrapsht dhe përdorni pjesëzimin dorazi që të rregulloni %1. + Në këtë sistem s’gjendet gjëkundi një pjesë EFI sistemi. Ju lutemi, kthehuni mbrapsht dhe përdorni pjesëtimin dorazi që të rregulloni %1. @@ -642,12 +642,12 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. Clear mounts for partitioning operations on %1 - Hiqi montimet për veprime pjesëzimi te %1 + Hiqi montimet për veprime pjesëtimi te %1 Clearing mounts for partitioning operations on %1. - Po hiqen montimet për veprime pjesëzimi te %1. + Po hiqen montimet për veprime pjesëtimi te %1. @@ -1076,7 +1076,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. This installer <strong>cannot detect a partition table</strong> on the selected storage device.<br><br>The device either has no partition table, or the partition table is corrupted or of an unknown type.<br>This installer can create a new partition table for you, either automatically, or through the manual partitioning page. - Ky instalues <strong>s’pikas dot tabelë pjesësh</strong> te pajisja e depozitimit e përzgjedhur.<br><br>Ose pajisja s’ka tabelë pjesësh, ose tabela e pjesëve është e dëmtuar ose e një lloji të panjohur.<br>Ky instalues mund të krijojë për ju një tabelë të re pjesësh, ose vetvetiu, ose përmes faqes së pjesëzimit dorazi. + Ky instalues <strong>s’pikas dot tabelë pjesësh</strong> te pajisja e depozitimit e përzgjedhur.<br><br>Ose pajisja s’ka tabelë pjesësh, ose tabela e pjesëve është e dëmtuar ose e një lloji të panjohur.<br>Ky instalues mund të krijojë për ju një tabelë të re pjesësh, ose vetvetiu, ose përmes faqes së pjesëtimit dorazi. @@ -2478,7 +2478,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. The partition table on %1 already has %2 primary partitions, and no more can be added. Please remove one primary partition and add an extended partition, instead. - Tabela e pjesëzimit te %1 ka tashmë %2 pjesë parësore, dhe s’mund të shtohen të tjera. Ju lutemi, në vend të kësaj, hiqni një pjesë parësore dhe shtoni një pjesë të zgjeruar. + Tabela e pjesëtimit te %1 ka tashmë %2 pjesë parësore, dhe s’mund të shtohen të tjera. Ju lutemi, në vend të kësaj, hiqni një pjesë parësore dhe shtoni një pjesë të zgjeruar. @@ -2511,7 +2511,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. <strong>Manual</strong> partitioning. - Pjesëzim <strong>dorazi</strong>. + Pjesëtim <strong>dorazi</strong>. @@ -2531,7 +2531,7 @@ Instaluesi do të mbyllet dhe krejt ndryshimet do të hidhen tej. <strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2). - Pjesëzim <strong>dorazi</strong> në diskun <strong>%1</strong> (%2). + Pjesëtim <strong>dorazi</strong> në diskun <strong>%1</strong> (%2). @@ -2805,7 +2805,7 @@ Përfundim: Unpartitioned space or unknown partition table - Hapësirë e papjesëzuar ose tabelë e panjohur pjesësh + Hapësirë e papjesëtuar ose tabelë e panjohur pjesësh @@ -2860,7 +2860,7 @@ Përfundim: %1 cannot be installed on an extended partition. Please select an existing primary or logical partition. - %1 s’mund të instalohet në një pjesë të llojit extended. Ju lutemi, përzgjidhni një pjesë parësore ose logjike ekzistuese. + %1 s’mund të instalohet në një pjesë të llojit “extended”. Ju lutemi, përzgjidhni një pjesë parësore ose logjike ekzistuese. @@ -2890,7 +2890,7 @@ Përfundim: <strong>%2</strong><br/><br/>An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. - <strong>%2</strong><br/><br/>Në këtë sistem s’gjendet dot ndonjë pjesë sistemi EFI. Ju lutemi, që të rregulloni %1, kthehuni mbrapsht dhe përdorni procesin e pjesëzimit dorazi. + <strong>%2</strong><br/><br/>Në këtë sistem s’gjendet dot ndonjë pjesë sistemi EFI. Ju lutemi, që të rregulloni %1, kthehuni mbrapsht dhe përdorni procesin e pjesëtimit dorazi. @@ -2902,7 +2902,7 @@ Përfundim: The EFI system partition at %1 will be used for starting %2. - Për nisjen e %2 do të përdoret ndarja EFI e sistemit te %1. + Për nisjen e %2 do të përdoret pjesa EFI e sistemit te %1. diff --git a/lang/calamares_zh_CN.ts b/lang/calamares_zh_CN.ts index 44fcb8272..7467aa120 100644 --- a/lang/calamares_zh_CN.ts +++ b/lang/calamares_zh_CN.ts @@ -2558,12 +2558,12 @@ The installer will quit and all changes will be lost. An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. - + 必须有 EFI 系统分区才能启动 %1 。<br/><br/>要配置 EFI 系统分区,后退一步,然后创建或选中一个 FAT32 分区并为之设置 <strong>%3</strong> 标记及挂载点 <strong>%2</strong>。<br/><br/>你可以不创建 EFI 系统分区并继续安装,但是你的系统可能无法启动。 An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. - + 必须有 EFI 系统分区才能启动 %1 。<br/><br/>已有挂载点为 <strong>%2</strong> 的分区,但是未设置 <strong>%3</strong> 标记。<br/>要设置此标记,后退并编辑分区。<br/><br/>你可以不创建 EFI 系统分区并继续安装,但是你的系统可能无法启动。 @@ -3804,7 +3804,28 @@ Output: </ul> <p>The vertical scrollbar is adjustable, current width set to 10.</p> - + <h3>%1</h3> + <p>这是一个QML 示例文件,显示了具有 Flickable 内容的 RichText 选项。</p> + + <p>带有 RichText 的 QML 可以使用 HTML 标签, + Flickable 内容对于触摸屏很有用。</p> + + <p><b>这是粗体字</b></p> + <p><i>这是斜体字</i></p> + <p><u>这是带下划线的文字</u></p> + <p><center>此文本将居中对齐。</center></p> + <p><s>这是删除线</s></p> + + <p>代码示例: + <code>ls -l /home</code></p> + + <p><b>列表:</b></p> + <ul> + <li>Intel CPU 系统</li> + <li>AMD CPU 系统</li> + </ul> + + <p>垂直滚动条是可调的,当前宽度设置为10。</p> @@ -3818,7 +3839,8 @@ Output: <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>欢迎来到 %1 <quote>%2</quote> 安装程序</h3> + <p>这个程序将询问您一些问题并在您的计算机上安装 %1。</p> diff --git a/lang/calamares_zh_TW.ts b/lang/calamares_zh_TW.ts index a665b7068..51f244389 100644 --- a/lang/calamares_zh_TW.ts +++ b/lang/calamares_zh_TW.ts @@ -1838,7 +1838,7 @@ The installer will quit and all changes will be lost. Office - 辦公室 + 辦公 @@ -3619,7 +3619,7 @@ Output: Open release notes website - 開啟發行手記網站 + 開啟發行記事網站 diff --git a/lang/python/de/LC_MESSAGES/python.mo b/lang/python/de/LC_MESSAGES/python.mo index 64a77a392..64f71d6aa 100644 Binary files a/lang/python/de/LC_MESSAGES/python.mo and b/lang/python/de/LC_MESSAGES/python.mo differ diff --git a/lang/python/de/LC_MESSAGES/python.po b/lang/python/de/LC_MESSAGES/python.po index 1fa3ce41e..19bd1c911 100644 --- a/lang/python/de/LC_MESSAGES/python.po +++ b/lang/python/de/LC_MESSAGES/python.po @@ -5,8 +5,8 @@ # # Translators: # Adriaan de Groot , 2019 -# Andreas Eitel , 2019 # Christian Spaan, 2020 +# Andreas Eitel , 2020 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Christian Spaan, 2020\n" +"Last-Translator: Andreas Eitel , 2020\n" "Language-Team: German (https://www.transifex.com/calamares/teams/20061/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -99,11 +99,11 @@ msgstr "rsync fehlgeschlagen mit Fehlercode {}." #: src/modules/unpackfs/main.py:302 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "" +msgstr "Bild Entpacken {}/{}, Datei {}/{}" #: src/modules/unpackfs/main.py:317 msgid "Starting to unpack {}" -msgstr "" +msgstr "Beginn des Entpackens {}" #: src/modules/unpackfs/main.py:326 src/modules/unpackfs/main.py:432 msgid "Failed to unpack image \"{}\"" @@ -134,6 +134,8 @@ msgstr "Ungültige unsquash-Konfiguration" #: src/modules/unpackfs/main.py:423 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" msgstr "" +"Das Dateisystem für \"{}\". ({}) wird von Ihrem aktuellen Kernel nicht " +"unterstützt" #: src/modules/unpackfs/main.py:427 msgid "The source filesystem \"{}\" does not exist" diff --git a/lang/python/es/LC_MESSAGES/python.mo b/lang/python/es/LC_MESSAGES/python.mo index 4746eac78..d2ab2f337 100644 Binary files a/lang/python/es/LC_MESSAGES/python.mo and b/lang/python/es/LC_MESSAGES/python.mo differ diff --git a/lang/python/es/LC_MESSAGES/python.po b/lang/python/es/LC_MESSAGES/python.po index fe61ddbd1..302238518 100644 --- a/lang/python/es/LC_MESSAGES/python.po +++ b/lang/python/es/LC_MESSAGES/python.po @@ -9,6 +9,7 @@ # Guido Grasso , 2018 # Adolfo Jayme-Barrientos, 2019 # Miguel Mayol , 2020 +# Pier Jose Gotta Perez , 2020 # #, fuzzy msgid "" @@ -17,7 +18,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Miguel Mayol , 2020\n" +"Last-Translator: Pier Jose Gotta Perez , 2020\n" "Language-Team: Spanish (https://www.transifex.com/calamares/teams/20061/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -100,11 +101,11 @@ msgstr "Falló la sincronización mediante rsync con el código de error {}." #: src/modules/unpackfs/main.py:302 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "" +msgstr "Desempaquetando la imagen {}/{}, archivo {}/{}" #: src/modules/unpackfs/main.py:317 msgid "Starting to unpack {}" -msgstr "" +msgstr "Iniciando el desempaquetado {}" #: src/modules/unpackfs/main.py:326 src/modules/unpackfs/main.py:432 msgid "Failed to unpack image \"{}\"" @@ -137,6 +138,8 @@ msgstr "Configuración de \"unsquash\" no válida" #: src/modules/unpackfs/main.py:423 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" msgstr "" +"El sistema de archivos para \"{}\" ({}) no es compatible con su kernel " +"actual" #: src/modules/unpackfs/main.py:427 msgid "The source filesystem \"{}\" does not exist" diff --git a/lang/python/fa/LC_MESSAGES/python.mo b/lang/python/fa/LC_MESSAGES/python.mo index a25fc7a02..f3e832135 100644 Binary files a/lang/python/fa/LC_MESSAGES/python.mo and b/lang/python/fa/LC_MESSAGES/python.mo differ diff --git a/lang/python/fa/LC_MESSAGES/python.po b/lang/python/fa/LC_MESSAGES/python.po index 6190c38f2..dcb1a2ebe 100644 --- a/lang/python/fa/LC_MESSAGES/python.po +++ b/lang/python/fa/LC_MESSAGES/python.po @@ -3,6 +3,9 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +# Translators: +# Danial Behzadi , 2020 +# #, fuzzy msgid "" msgstr "" @@ -10,6 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" +"Last-Translator: Danial Behzadi , 2020\n" "Language-Team: Persian (https://www.transifex.com/calamares/teams/20061/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,30 +24,30 @@ msgstr "" #: src/modules/packages/main.py:59 src/modules/packages/main.py:68 #: src/modules/packages/main.py:78 msgid "Install packages." -msgstr "" +msgstr "نصب بسته‌ها." #: src/modules/packages/main.py:66 #, python-format msgid "Processing packages (%(count)d / %(total)d)" -msgstr "" +msgstr "در حال پردازش بسته‌ها (%(count)d/%(total)d)" #: src/modules/packages/main.py:71 #, python-format msgid "Installing one package." msgid_plural "Installing %(num)d packages." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "در حال نصب یک بسته." +msgstr[1] "در حال نصب %(num)d بسته." #: src/modules/packages/main.py:74 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "در حال برداشتن یک بسته." +msgstr[1] "در حال برداشتن %(num)d بسته." #: src/modules/networkcfg/main.py:37 msgid "Saving network configuration." -msgstr "" +msgstr "در حال ذخیرهٔ پیکربندی شبکه." #: src/modules/networkcfg/main.py:48 src/modules/initcpiocfg/main.py:205 #: src/modules/initcpiocfg/main.py:209 src/modules/openrcdmcryptcfg/main.py:78 @@ -53,142 +57,146 @@ msgstr "" #: src/modules/fstab/main.py:338 src/modules/initramfscfg/main.py:94 #: src/modules/initramfscfg/main.py:98 src/modules/rawfs/main.py:171 msgid "Configuration Error" -msgstr "" +msgstr "خطای پیکربندی" #: src/modules/networkcfg/main.py:49 src/modules/initcpiocfg/main.py:210 #: src/modules/openrcdmcryptcfg/main.py:83 src/modules/localecfg/main.py:145 #: src/modules/luksopenswaphookcfg/main.py:100 src/modules/fstab/main.py:339 #: src/modules/initramfscfg/main.py:99 msgid "No root mount point is given for
{!s}
to use." -msgstr "" +msgstr "هیچ نقطهٔ اتّصال ریشه‌ای برای استفادهٔ
{!s}
داده نشده." #: src/modules/umount/main.py:40 msgid "Unmount file systems." -msgstr "" +msgstr "پیاده کردن سامانه‌های پرونده." #: src/modules/initcpiocfg/main.py:37 msgid "Configuring mkinitcpio." -msgstr "" +msgstr "پیکربندی mkinitcpio." #: src/modules/initcpiocfg/main.py:206 src/modules/openrcdmcryptcfg/main.py:79 #: src/modules/mount/main.py:146 src/modules/luksopenswaphookcfg/main.py:96 #: src/modules/fstab/main.py:333 src/modules/initramfscfg/main.py:95 #: src/modules/rawfs/main.py:172 msgid "No partitions are defined for
{!s}
to use." -msgstr "" +msgstr "هیچ افرازی برای استفادهٔ
{!s}
تعریف نشده." #: src/modules/openrcdmcryptcfg/main.py:34 msgid "Configuring OpenRC dmcrypt service." -msgstr "" +msgstr "در حال پیکربندی خدمت dmcrypt OpenRC." #: src/modules/unpackfs/main.py:44 msgid "Filling up filesystems." -msgstr "" +msgstr "در حال پر کردن سامانه‌پرونده‌ها." #: src/modules/unpackfs/main.py:257 msgid "rsync failed with error code {}." -msgstr "" +msgstr "آرسینک با رمز خطای {} شکست خورد." #: src/modules/unpackfs/main.py:302 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "" +msgstr "در حال بسته‌گشایی تصویر {}/{}، پروندهٔ {}/{}" #: src/modules/unpackfs/main.py:317 msgid "Starting to unpack {}" -msgstr "" +msgstr "در حال شروع بسته‌گشایی {}" #: src/modules/unpackfs/main.py:326 src/modules/unpackfs/main.py:432 msgid "Failed to unpack image \"{}\"" -msgstr "" +msgstr "شکست در بسته‌گشایی تصویر {}" #: src/modules/unpackfs/main.py:399 msgid "No mount point for root partition" -msgstr "" +msgstr "هیچ نقطهٔ اتّصالی برای افراز ریشه وجود ندارد" #: src/modules/unpackfs/main.py:400 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" -msgstr "" +msgstr "globalstorage کلید rootMountPoint را ندارد. کاری انجام نمی‌شود" #: src/modules/unpackfs/main.py:405 msgid "Bad mount point for root partition" -msgstr "" +msgstr "نقطهٔ اتّصال بد برای افراز ریشه" #: src/modules/unpackfs/main.py:406 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "" +msgstr "نقطهٔ اتّصال ریشه {} است که وجود ندارد. کاری انجام نمی‌شود" #: src/modules/unpackfs/main.py:422 src/modules/unpackfs/main.py:426 #: src/modules/unpackfs/main.py:446 msgid "Bad unsquash configuration" -msgstr "" +msgstr "پیکربندی بد unsquash" #: src/modules/unpackfs/main.py:423 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "" +msgstr "کرنل کنونیتان از سامانه‌پروندهٔ {} ({}) پشتیبانی نمی‌کند" #: src/modules/unpackfs/main.py:427 msgid "The source filesystem \"{}\" does not exist" -msgstr "" +msgstr "سامانهٔ پروندهٔ مبدأ {} وجود ندارد" #: src/modules/unpackfs/main.py:433 msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" -msgstr "" +msgstr "شکست در یافتن unsquashfs. مطمئن شوید بستهٔ squashfs-tools نصب است" #: src/modules/unpackfs/main.py:447 msgid "The destination \"{}\" in the target system is not a directory" -msgstr "" +msgstr "مقصد {} در سامانهٔ هدف، یک شاخه نیست" #: src/modules/services-systemd/main.py:35 msgid "Configure systemd services" -msgstr "" +msgstr "در حال پیکربندی خدمات سیستم‌دی" #: src/modules/services-systemd/main.py:68 #: src/modules/services-openrc/main.py:102 msgid "Cannot modify service" -msgstr "" +msgstr "نمی‌توان خدمت را دستکاری کرد" #: src/modules/services-systemd/main.py:69 msgid "" "systemctl {arg!s} call in chroot returned error code {num!s}." msgstr "" +"فراخوانی systemctl {arg!s} در chroot رمز خطای {num!s} را " +"برگرداند." #: src/modules/services-systemd/main.py:72 #: src/modules/services-systemd/main.py:76 msgid "Cannot enable systemd service {name!s}." -msgstr "" +msgstr "نمی‌توان خدمت سیستم‌دی {name!s} را به کار انداخت." #: src/modules/services-systemd/main.py:74 msgid "Cannot enable systemd target {name!s}." -msgstr "" +msgstr "نمی‌توان هدف سیستم‌دی {name!s} را به کار انداخت." #: src/modules/services-systemd/main.py:78 msgid "Cannot disable systemd target {name!s}." -msgstr "" +msgstr "نمی‌توان خدمت سیستم‌دی {name!s} را از کار انداخت." #: src/modules/services-systemd/main.py:80 msgid "Cannot mask systemd unit {name!s}." -msgstr "" +msgstr "نمی‌توان واحد سیستم‌دی {name!s} را پوشاند." #: src/modules/services-systemd/main.py:82 msgid "" "Unknown systemd commands {command!s} and " "{suffix!s} for unit {name!s}." msgstr "" +"دستورات ناشناختهٔ سیستم‌دی {command!s} و " +"{suffix!s} برای واحد {name!s}." #: src/modules/dummypython/main.py:44 msgid "Dummy python job." -msgstr "" +msgstr "کار پایتونی الکی." #: src/modules/dummypython/main.py:46 src/modules/dummypython/main.py:102 #: src/modules/dummypython/main.py:103 msgid "Dummy python step {}" -msgstr "" +msgstr "گام پایتونی الکی {}" #: src/modules/bootloader/main.py:51 msgid "Install bootloader." -msgstr "" +msgstr "نصب بارکنندهٔ راه‌اندازی." #: src/modules/localecfg/main.py:39 msgid "Configuring locales." @@ -196,31 +204,31 @@ msgstr "" #: src/modules/mount/main.py:38 msgid "Mounting partitions." -msgstr "" +msgstr "در حال سوار کردن افرازها." #: src/modules/plymouthcfg/main.py:36 msgid "Configure Plymouth theme" -msgstr "" +msgstr "در حال پیکربندی زمینهٔ پلی‌موث" #: src/modules/luksopenswaphookcfg/main.py:35 msgid "Configuring encrypted swap." -msgstr "" +msgstr "در حال پیکربندی مبادلهٔ رمزشده." #: src/modules/fstab/main.py:38 msgid "Writing fstab." -msgstr "" +msgstr "در حال نوشتن fstab." #: src/modules/services-openrc/main.py:38 msgid "Configure OpenRC services" -msgstr "" +msgstr "پیکربندی خدمات OpenRC" #: src/modules/services-openrc/main.py:66 msgid "Cannot add service {name!s} to run-level {level!s}." -msgstr "" +msgstr "نمی‌توان خدمت {name!s} را به سطح اجرایی {level!s} افزود." #: src/modules/services-openrc/main.py:68 msgid "Cannot remove service {name!s} from run-level {level!s}." -msgstr "" +msgstr "نمی‌توان خدمت {name!s} را از سطح اجرایی {level!s} برداشت." #: src/modules/services-openrc/main.py:70 msgid "" @@ -235,7 +243,7 @@ msgstr "" #: src/modules/services-openrc/main.py:110 msgid "Target runlevel does not exist" -msgstr "" +msgstr "سطح اجرایی هدف وجود ندارد." #: src/modules/services-openrc/main.py:111 msgid "" @@ -245,7 +253,7 @@ msgstr "" #: src/modules/services-openrc/main.py:119 msgid "Target service does not exist" -msgstr "" +msgstr "خدمت هدف وجود ندارد" #: src/modules/services-openrc/main.py:120 msgid "" @@ -255,82 +263,84 @@ msgstr "" #: src/modules/dracut/main.py:36 msgid "Creating initramfs with dracut." -msgstr "" +msgstr "در حال ایجاد initramfs با dracut." #: src/modules/dracut/main.py:58 msgid "Failed to run dracut on the target" -msgstr "" +msgstr "شکست در اجرای dracut روی هدف" #: src/modules/dracut/main.py:59 msgid "The exit code was {}" -msgstr "" +msgstr "رمز خروج {} بود" #: src/modules/grubcfg/main.py:37 msgid "Configure GRUB." -msgstr "" +msgstr "در حال پیکربندی گراب." #: src/modules/displaymanager/main.py:515 msgid "Cannot write KDM configuration file" -msgstr "" +msgstr "نمی‌توان پروندهٔ پیکربندی KDM را نوشت" #: src/modules/displaymanager/main.py:516 msgid "KDM config file {!s} does not exist" -msgstr "" +msgstr "پروندهٔ پیکربندی {!s} وجود ندارد" #: src/modules/displaymanager/main.py:577 msgid "Cannot write LXDM configuration file" -msgstr "" +msgstr "نمی‌توان پروندهٔ پیکربندی LXDM را نوشت" #: src/modules/displaymanager/main.py:578 msgid "LXDM config file {!s} does not exist" -msgstr "" +msgstr "پروندهٔ پیکربندی {!s} وجود ندارد" #: src/modules/displaymanager/main.py:661 msgid "Cannot write LightDM configuration file" -msgstr "" +msgstr "نمی‌توان پروندهٔ پیکربندی LightDM را نوشت" #: src/modules/displaymanager/main.py:662 msgid "LightDM config file {!s} does not exist" -msgstr "" +msgstr "پروندهٔ پیکربندی {!s} وجود ندارد" #: src/modules/displaymanager/main.py:736 msgid "Cannot configure LightDM" -msgstr "" +msgstr "نمی‌توان LightDM را پیکربندی کرد" #: src/modules/displaymanager/main.py:737 msgid "No LightDM greeter installed." -msgstr "" +msgstr "هیچ خوش‌آمدگوی LightDMای نصب نشده." #: src/modules/displaymanager/main.py:768 msgid "Cannot write SLIM configuration file" -msgstr "" +msgstr "نمی‌توان پروندهٔ پیکربندی LightDM را نوشت" #: src/modules/displaymanager/main.py:769 msgid "SLIM config file {!s} does not exist" -msgstr "" +msgstr "پروندهٔ پیکربندی {!s} وجود ندارد" #: src/modules/displaymanager/main.py:895 msgid "No display managers selected for the displaymanager module." -msgstr "" +msgstr "هیچ مدیر نمایشی برای پیمانهٔ displaymanager گزیده نشده." #: src/modules/displaymanager/main.py:896 msgid "" "The displaymanagers list is empty or undefined in bothglobalstorage and " "displaymanager.conf." msgstr "" +"فهرست displaymanagers خالی بوده یا در bothglobalstorage و " +"displaymanager.conf تعریف نشده." #: src/modules/displaymanager/main.py:978 msgid "Display manager configuration was incomplete" -msgstr "" +msgstr "پیکربندی مدیر نمایش کامل نبود" #: src/modules/initramfscfg/main.py:41 msgid "Configuring initramfs." -msgstr "" +msgstr "در حال پیکربندی initramfs." #: src/modules/hwclock/main.py:35 msgid "Setting hardware clock." -msgstr "" +msgstr "در حال تنظیم ساعت سخت‌افزاری." #: src/modules/rawfs/main.py:35 msgid "Installing data." -msgstr "" +msgstr "داده‌های نصب" diff --git a/lang/python/fi_FI/LC_MESSAGES/python.mo b/lang/python/fi_FI/LC_MESSAGES/python.mo index 6ed36a933..9f9791235 100644 Binary files a/lang/python/fi_FI/LC_MESSAGES/python.mo and b/lang/python/fi_FI/LC_MESSAGES/python.mo differ diff --git a/lang/python/fi_FI/LC_MESSAGES/python.po b/lang/python/fi_FI/LC_MESSAGES/python.po index 3aa0f8db2..c05931e77 100644 --- a/lang/python/fi_FI/LC_MESSAGES/python.po +++ b/lang/python/fi_FI/LC_MESSAGES/python.po @@ -24,7 +24,7 @@ msgstr "" #: src/modules/packages/main.py:59 src/modules/packages/main.py:68 #: src/modules/packages/main.py:78 msgid "Install packages." -msgstr "Asenna paketteja." +msgstr "Asenna paketit." #: src/modules/packages/main.py:66 #, python-format @@ -108,7 +108,7 @@ msgstr "Kuvan purkaminen epäonnistui \"{}\"" #: src/modules/unpackfs/main.py:399 msgid "No mount point for root partition" -msgstr "Ei liitoskohtaa juuri root-osiolle" +msgstr "Ei liitoskohtaa juuri root osiolle" #: src/modules/unpackfs/main.py:400 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" diff --git a/lang/python/id/LC_MESSAGES/python.mo b/lang/python/id/LC_MESSAGES/python.mo index b9bbbc6cb..2a6c52941 100644 Binary files a/lang/python/id/LC_MESSAGES/python.mo and b/lang/python/id/LC_MESSAGES/python.mo differ diff --git a/lang/python/id/LC_MESSAGES/python.po b/lang/python/id/LC_MESSAGES/python.po index 48acf979f..41045e74a 100644 --- a/lang/python/id/LC_MESSAGES/python.po +++ b/lang/python/id/LC_MESSAGES/python.po @@ -6,7 +6,7 @@ # Translators: # Choiril Abdul, 2018 # Harry Suryapambagya , 2018 -# Wantoyo , 2018 +# Wantoyèk , 2018 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Wantoyo , 2018\n" +"Last-Translator: Wantoyèk , 2018\n" "Language-Team: Indonesian (https://www.transifex.com/calamares/teams/20061/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/lang/python/nb/LC_MESSAGES/python.mo b/lang/python/nb/LC_MESSAGES/python.mo index c5d4d2fb1..93379d3b8 100644 Binary files a/lang/python/nb/LC_MESSAGES/python.mo and b/lang/python/nb/LC_MESSAGES/python.mo differ diff --git a/lang/python/nb/LC_MESSAGES/python.po b/lang/python/nb/LC_MESSAGES/python.po index 9358dfb59..dd88e8fad 100644 --- a/lang/python/nb/LC_MESSAGES/python.po +++ b/lang/python/nb/LC_MESSAGES/python.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Tyler Moss , 2017 +# 865ac004d9acf2568b2e4b389e0007c7_fba755c <3516cc82d94f87187da1e036e5f09e42_616112>, 2017 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Tyler Moss , 2017\n" +"Last-Translator: 865ac004d9acf2568b2e4b389e0007c7_fba755c <3516cc82d94f87187da1e036e5f09e42_616112>, 2017\n" "Language-Team: Norwegian Bokmål (https://www.transifex.com/calamares/teams/20061/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/lang/python/zh_TW/LC_MESSAGES/python.mo b/lang/python/zh_TW/LC_MESSAGES/python.mo index 23e76b0ea..3bf723b47 100644 Binary files a/lang/python/zh_TW/LC_MESSAGES/python.mo and b/lang/python/zh_TW/LC_MESSAGES/python.mo differ diff --git a/lang/python/zh_TW/LC_MESSAGES/python.po b/lang/python/zh_TW/LC_MESSAGES/python.po index 67576d410..5c76c2b20 100644 --- a/lang/python/zh_TW/LC_MESSAGES/python.po +++ b/lang/python/zh_TW/LC_MESSAGES/python.po @@ -5,6 +5,7 @@ # # Translators: # 黃柏諺 , 2020 +# Walter Cheuk , 2020 # #, fuzzy msgid "" @@ -13,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: 黃柏諺 , 2020\n" +"Last-Translator: Walter Cheuk , 2020\n" "Language-Team: Chinese (Taiwan) (https://www.transifex.com/calamares/teams/20061/zh_TW/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -126,7 +127,7 @@ msgstr "錯誤的 unsquash 設定" #: src/modules/unpackfs/main.py:423 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "\"{}\" ({}) 的檔案系統不被您目前的核心所支援" +msgstr "\"{}\" ({}) 的檔案系統不獲您目前的內核所支援" #: src/modules/unpackfs/main.py:427 msgid "The source filesystem \"{}\" does not exist" @@ -136,7 +137,7 @@ msgstr "來源檔案系統 \"{}\" 不存在" msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" -msgstr "找不到 unsquashfs,請確定您已安裝 squashfs-tools 軟體包" +msgstr "找不到 unsquashfs,請確定已安裝 squashfs-tools 軟體包" #: src/modules/unpackfs/main.py:447 msgid "The destination \"{}\" in the target system is not a directory" diff --git a/src/branding/default/branding.desc b/src/branding/default/branding.desc index 2e6a02bba..f8cc88295 100644 --- a/src/branding/default/branding.desc +++ b/src/branding/default/branding.desc @@ -141,8 +141,23 @@ images: # The slideshow is displayed during execution steps (e.g. when the # installer is actually writing to disk and doing other slow things). +# +# The slideshow can be a QML file (recommended) which can display +# arbitrary things -- text, images, animations, or even play a game -- +# during the execution step. The QML **is** abruptly stopped when the +# execution step is done, though, so maybe a game isn't a great idea. +# +# The slideshow can also be a sequence of images (not recommended unless +# you don't want QML at all in your Calamares). The images are displayed +# at a rate of 1 every 2 seconds during the execution step. +# +# To configure a QML file, list a single filename: +# slideshow: "show.qml" +# To configure images, like the filenames (here, as an inline list): +# slideshow: [ "/etc/calamares/slideshow/0.png", "/etc/logo.png" ] slideshow: "show.qml" -# There are two available APIs for the slideshow: + +# There are two available APIs for a QML slideshow: # - 1 (the default) loads the entire slideshow when the installation- # slideshow page is shown and starts the QML then. The QML # is never stopped (after installation is done, times etc. @@ -151,6 +166,8 @@ slideshow: "show.qml" # onLeave() in the root object. After the installation is done, # the show is stopped (first by calling onLeave(), then destroying # the QML components). +# +# An image slideshow does not need to have the API defined. slideshowAPI: 2 diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index 5c5a68a97..b632567b8 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -10,6 +10,20 @@ set( calamaresSources progresstree/ProgressTreeView.cpp ) +if( NOT WITH_KF5DBus ) + set( kdsagSources "" ) + foreach( _s + kdsingleapplicationguard/kdsingleapplicationguard.cpp + kdsingleapplicationguard/kdsharedmemorylocker.cpp + kdsingleapplicationguard/kdtoolsglobal.cpp + kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp + ) + list( APPEND kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/${_s} ) + endforeach() + mark_thirdparty_code( ${kdsagSources} ) + list( APPEND calamaresSources ${kdsagSources} ) +endif() + include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamares ${CMAKE_SOURCE_DIR}/src/libcalamaresui diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 5ef97a6a3..43a48881c 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -32,6 +32,9 @@ #include "utils/CalamaresUtilsSystem.h" #include "utils/Dirs.h" #include "utils/Logger.h" +#ifdef WITH_QML +#include "utils/Qml.h" +#endif #include "utils/Retranslator.h" #include "viewpages/ViewStep.h" @@ -117,34 +120,6 @@ CalamaresApplication::mainWindow() } -static QStringList -qmlDirCandidates( bool assumeBuilddir ) -{ - static const char QML[] = "qml"; - - QStringList qmlDirs; - if ( CalamaresUtils::isAppDataDirOverridden() ) - { - qmlDirs << CalamaresUtils::appDataDir().absoluteFilePath( QML ); - } - else - { - if ( assumeBuilddir ) - { - qmlDirs << QDir::current().absoluteFilePath( "src/qml" ); // In build-dir - } - if ( CalamaresUtils::haveExtraDirs() ) - for ( auto s : CalamaresUtils::extraDataDirs() ) - { - qmlDirs << ( s + QML ); - } - qmlDirs << CalamaresUtils::appDataDir().absoluteFilePath( QML ); - } - - return qmlDirs; -} - - static QStringList brandingFileCandidates( bool assumeBuilddir, const QString& brandingFilename ) { @@ -175,38 +150,12 @@ brandingFileCandidates( bool assumeBuilddir, const QString& brandingFilename ) void CalamaresApplication::initQmlPath() { - QDir importPath; // Right now, current-dir - QStringList qmlDirCandidatesByPriority = qmlDirCandidates( isDebug() ); - bool found = false; - - foreach ( const QString& path, qmlDirCandidatesByPriority ) +#ifdef WITH_QML + if ( !CalamaresUtils::initQmlModulesDir() ) { - QDir dir( path ); - if ( dir.exists() && dir.isReadable() ) - { - importPath = dir; - found = true; - break; - } - } - - if ( !found || !importPath.exists() || !importPath.isReadable() ) - { - cError() << "Cowardly refusing to continue startup without a QML directory." - << Logger::DebugList( qmlDirCandidatesByPriority ); - if ( CalamaresUtils::isAppDataDirOverridden() ) - { - cError() << "FATAL: explicitly configured application data directory is missing qml/"; - } - else - { - cError() << "FATAL: none of the expected QML paths exist."; - } ::exit( EXIT_FAILURE ); } - - cDebug() << "Using Calamares QML directory" << importPath.absolutePath(); - CalamaresUtils::setQmlModulesDir( importPath ); +#endif } diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 06a31a0e9..a3775c44e 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -22,6 +22,7 @@ #include "CalamaresWindow.h" #include "Branding.h" +#include "CalamaresConfig.h" #include "DebugWindow.h" #include "Settings.h" #include "ViewManager.h" @@ -38,8 +39,10 @@ #include #include #include +#ifdef WITH_QML #include #include +#endif #include static inline int @@ -132,18 +135,6 @@ CalamaresWindow::getWidgetSidebar( QWidget* parent, int desiredWidth ) return sideBox; } -QWidget* -CalamaresWindow::getQmlSidebar( QWidget* parent, int ) -{ - CalamaresUtils::registerCalamaresModels(); - QQuickWidget* w = new QQuickWidget( parent ); - w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - w->setResizeMode( QQuickWidget::SizeRootObjectToView ); - w->setSource( QUrl( - CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-sidebar" ) ) ) ); - return w; -} - /** @brief Get a button-sized icon. */ static inline QPixmap getButtonIcon( const QString& name ) @@ -213,10 +204,23 @@ CalamaresWindow::getWidgetNavigation( QWidget* parent ) return navigation; } +#ifdef WITH_QML +QWidget* +CalamaresWindow::getQmlSidebar( QWidget* parent, int ) +{ + CalamaresUtils::registerQmlModels(); + QQuickWidget* w = new QQuickWidget( parent ); + w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + w->setResizeMode( QQuickWidget::SizeRootObjectToView ); + w->setSource( QUrl( + CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-sidebar" ) ) ) ); + return w; +} + QWidget* CalamaresWindow::getQmlNavigation( QWidget* parent ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); QQuickWidget* w = new QQuickWidget( parent ); w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); w->setResizeMode( QQuickWidget::SizeRootObjectToView ); @@ -231,6 +235,19 @@ CalamaresWindow::getQmlNavigation( QWidget* parent ) return w; } +#else +// Bogus to keep the linker happy +QWidget * CalamaresWindow::getQmlSidebar(QWidget* , int ) +{ + return nullptr; +} +QWidget * CalamaresWindow::getQmlNavigation(QWidget* ) +{ + return nullptr; +} + + +#endif /**@brief Picks one of two methods to call * @@ -243,16 +260,21 @@ flavoredWidget( Calamares::Branding::PanelFlavor flavor, CalamaresWindow* w, QWidget* parent, widgetMaker widget, - widgetMaker qml, + widgetMaker qml, // Only if WITH_QML is on args... a ) { +#ifndef WITH_QML + Q_UNUSED( qml ) +#endif // Member-function calling syntax is (object.*member)(args) switch ( flavor ) { case Calamares::Branding::PanelFlavor::Widget: return ( w->*widget )( parent, a... ); +#ifdef WITH_QML case Calamares::Branding::PanelFlavor::Qml: return ( w->*qml )( parent, a... ); +#endif case Calamares::Branding::PanelFlavor::None: return nullptr; } diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index cd06c5d03..a29c8ce91 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -22,18 +22,22 @@ * bindings. */ -#include "modulesystem/Module.h" -#include "utils/Logger.h" -#include "utils/Yaml.h" - #include "Branding.h" +#include "CppJob.h" #include "GlobalStorage.h" #include "Job.h" #include "JobQueue.h" #include "Settings.h" #include "ViewManager.h" - +#include "modulesystem/Module.h" #include "modulesystem/ModuleManager.h" +#include "modulesystem/ViewModule.h" +#include "utils/Logger.h" +#ifdef WITH_QML +#include "utils/Qml.h" +#endif +#include "utils/Yaml.h" +#include "viewpages/ExecutionViewStep.h" #include #include @@ -42,6 +46,7 @@ #include #include #include +#include #include @@ -80,6 +85,8 @@ handle_args( QCoreApplication& a ) "src/branding/default/branding.desc" ); QCommandLineOption uiOption( QStringList() << QStringLiteral( "U" ) << QStringLiteral( "ui" ), QStringLiteral( "Enable UI" ) ); + QCommandLineOption slideshowOption( QStringList() << QStringLiteral( "s" ) << QStringLiteral( "slideshow" ), + QStringLiteral( "Run slideshow module" ) ); QCommandLineParser parser; parser.setApplicationDescription( "Calamares module tester" ); @@ -92,13 +99,14 @@ handle_args( QCoreApplication& a ) parser.addOption( langOption ); parser.addOption( brandOption ); parser.addOption( uiOption ); + parser.addOption( slideshowOption ); parser.addPositionalArgument( "module", "Path or name of module to run." ); parser.addPositionalArgument( "job.yaml", "Path of job settings document to use.", "[job.yaml]" ); parser.process( a ); const QStringList args = parser.positionalArguments(); - if ( args.isEmpty() ) + if ( args.isEmpty() && !parser.isSet( slideshowOption ) ) { cError() << "Missing path.\n"; parser.showHelp(); @@ -116,20 +124,161 @@ handle_args( QCoreApplication& a ) jobSettings = args.at( 1 ); } - return ModuleConfig { args.first(), + return ModuleConfig { parser.isSet( slideshowOption ) ? QStringLiteral( "-" ) : args.first(), jobSettings, parser.value( globalOption ), parser.value( langOption ), parser.value( brandOption ), - parser.isSet( uiOption ) }; + parser.isSet( slideshowOption ) || parser.isSet( uiOption ) }; } } +/** @brief Bogus Job for --slideshow option + * + * Generally one would use DummyCppJob for this kind of dummy + * job, but that class lives in a module so isn't available + * in this test application. + * + * This bogus job just sleeps for 3. + */ +class ExecViewJob : public Calamares::CppJob +{ +public: + explicit ExecViewJob( const QString& name, unsigned long t = 3 ) + : m_name( name ) + , m_delay( t ) + { + } + virtual ~ExecViewJob() override; + + QString prettyName() const override { return m_name; } + + Calamares::JobResult exec() override + { + QThread::sleep( m_delay ); + return Calamares::JobResult::ok(); + } + + void setConfigurationMap( const QVariantMap& ) override {} + +private: + QString m_name; + unsigned long m_delay; +}; + +ExecViewJob::~ExecViewJob() {} + +/** @brief Bogus module for --slideshow option + * + * Normally the slideshow -- displayed by ExecutionViewStep -- is not + * associated with any particular module in the Calamares configuration. + * It is added internally by the module manager. For the module-loader + * testing application, we need something that pretends to be the + * module for the ExecutionViewStep. + */ +class ExecViewModule : public Calamares::Module +{ +public: + ExecViewModule(); + ~ExecViewModule() override; + + void loadSelf() override; + + virtual Type type() const override; + virtual Interface interface() const override; + + virtual Calamares::JobList jobs() const override; + +protected: + void initFrom( const QVariantMap& ) override; +}; + +ExecViewModule::ExecViewModule() + : Calamares::Module() +{ + // Normally the module-loader gives the module an instance key + // (out of the settings file, or the descriptor of the module). + // We don't have one, so build one -- this gives us "x@x". + QVariantMap m; + m.insert( "name", "x" ); + Calamares::Module::initFrom( m, "x" ); +} + +ExecViewModule::~ExecViewModule() {} + +void +ExecViewModule::initFrom( const QVariantMap& ) +{ +} + +void +ExecViewModule::loadSelf() +{ + auto* viewStep = new Calamares::ExecutionViewStep(); + viewStep->setModuleInstanceKey( instanceKey() ); + viewStep->setConfigurationMap( m_configurationMap ); + viewStep->appendJobModuleInstanceKey( instanceKey().toString() ); + Calamares::ViewManager::instance()->addViewStep( viewStep ); + m_loaded = true; +} + +Calamares::Module::Type +ExecViewModule::type() const +{ + return Module::Type::View; +} + + +Calamares::Module::Interface +ExecViewModule::interface() const +{ + return Module::Interface::QtPlugin; +} + +Calamares::JobList +ExecViewModule::jobs() const +{ + Calamares::JobList l; + const auto* gs = Calamares::JobQueue::instance()->globalStorage(); + if ( gs && gs->contains( "jobs" ) ) + { + QVariantList joblist = gs->value( "jobs" ).toList(); + for ( const auto& jd : joblist ) + { + QVariantMap jobdescription = jd.toMap(); + if ( jobdescription.contains( "name" ) && jobdescription.contains( "delay" ) ) + { + l.append( Calamares::job_ptr( new ExecViewJob( jobdescription.value( "name" ).toString(), + jobdescription.value( "delay" ).toULongLong() ) ) ); + } + } + } + if ( l.count() > 0 ) + { + return l; + } + + l.append( Calamares::job_ptr( new ExecViewJob( QStringLiteral( "step 1" ) ) ) ); + l.append( Calamares::job_ptr( new ExecViewJob( QStringLiteral( "step two" ) ) ) ); + l.append( Calamares::job_ptr( new ExecViewJob( QStringLiteral( "locking mutexes" ), 20 ) ) ); + l.append( Calamares::job_ptr( new ExecViewJob( QStringLiteral( "unlocking mutexes" ), 1 ) ) ); + for ( const QString& s : QStringList { "Harder", "Better", "Faster", "Stronger" } ) + { + l.append( Calamares::job_ptr( new ExecViewJob( s, 0 ) ) ); + } + l.append( Calamares::job_ptr( new ExecViewJob( QStringLiteral( "cleaning up" ), 20 ) ) ); + return l; +} static Calamares::Module* load_module( const ModuleConfig& moduleConfig ) { QString moduleName = moduleConfig.moduleName(); + if ( moduleName == "-" ) + { + return new ExecViewModule; + } + QFileInfo fi; bool ok = false; @@ -188,6 +337,18 @@ load_module( const ModuleConfig& moduleConfig ) return module; } +static bool +is_ui_option( const char* s ) +{ + return !qstrcmp( s, "--ui" ) || !qstrcmp( s, "-U" ); +} + +static bool +is_slideshow_option( const char* s ) +{ + return !qstrcmp( s, "--slideshow" ) || !qstrcmp( s, "-s" ); +} + /** @brief Create the right kind of QApplication * * Does primitive parsing of argv[] to find the --ui option and returns @@ -202,7 +363,7 @@ createApplication( int& argc, char* argv[] ) { for ( int i = 1; i < argc; ++i ) { - if ( !qstrcmp( argv[ i ], "--ui" ) || !qstrcmp( argv[ i ], "-U" ) ) + if ( is_slideshow_option( argv[ i ] ) || is_ui_option( argv[ i ] ) ) { auto* aw = new QApplication( argc, argv ); aw->setQuitOnLastWindowClosed( true ); @@ -241,6 +402,10 @@ main( int argc, char* argv[] ) gs->insert( "localeConf", vm ); } +#ifdef WITH_QML + CalamaresUtils::initQmlModulesDir(); // don't care if failed +#endif + cDebug() << "Calamares module-loader testing" << module.moduleName(); Calamares::Module* m = load_module( module ); if ( !m ) @@ -252,11 +417,22 @@ main( int argc, char* argv[] ) cDebug() << " .. got" << m->name() << m->typeString() << m->interfaceString(); if ( m->type() == Calamares::Module::Type::View ) { + // If we forgot the --ui, any ViewModule will core dump as it + // tries to create the widget **which won't be used anyway**. + // + // To avoid that crash, re-create the QApplication, now with GUI + if ( !qobject_cast< QApplication* >( aw ) ) + { + auto* replace_app = new QApplication( argc, argv ); + replace_app->setQuitOnLastWindowClosed( true ); + aw = replace_app; + } mw = module.m_ui ? new QMainWindow() : nullptr; (void)new Calamares::Branding( module.m_branding ); - (void)new Calamares::ModuleManager( QStringList(), nullptr ); + auto* modulemanager = new Calamares::ModuleManager( QStringList(), nullptr ); (void)Calamares::ViewManager::instance( mw ); + modulemanager->addModule( m ); } if ( !m->isLoaded() ) diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index dd6f01fb1..b43b89289 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -1,12 +1,29 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2020 Adriaan de Groot +# +# Calamares is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Calamares is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Calamares. If not, see . +# +# SPDX-License-Identifier: GPL-3.0-or-later +# License-Filename: LICENSE +# +# # libcalamares is the non-GUI part of Calamares, which includes handling # translations, configurations, logging, utilities, global storage, and (non-GUI) jobs. -add_definitions( - ${QT_DEFINITIONS} - -DQT_SHARED - -DQT_SHAREDPOINTER_TRACK_POINTERS - -DDLLEXPORT_PRO -) +add_definitions( -DDLLEXPORT_PRO ) +include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h ) @@ -27,6 +44,7 @@ set( libSources # GeoIP services geoip/Interface.cpp + geoip/GeoIPFixed.cpp geoip/GeoIPJSON.cpp geoip/Handler.cpp @@ -65,22 +83,6 @@ set( libSources utils/Variant.cpp utils/Yaml.cpp ) -set( _kdsagSources - kdsingleapplicationguard/kdsingleapplicationguard.cpp - kdsingleapplicationguard/kdsharedmemorylocker.cpp - kdsingleapplicationguard/kdtoolsglobal.cpp - kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp -) -set( kdsagSources "" ) -foreach( _s ${_kdsagSources} ) - list( APPEND kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/${_s} ) -endforeach() -mark_thirdparty_code( ${kdsagSources} ) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} -) ### OPTIONAL Python support # @@ -156,7 +158,7 @@ endif() ### LIBRARY # # -add_library( calamares SHARED ${libSources} ${kdsagSources} ) +add_library( calamares SHARED ${libSources} ) set_target_properties( calamares PROPERTIES VERSION ${CALAMARES_VERSION_SHORT} diff --git a/src/libcalamares/CalamaresConfig.h.in b/src/libcalamares/CalamaresConfig.h.in index 55468cf15..98efa8c26 100644 --- a/src/libcalamares/CalamaresConfig.h.in +++ b/src/libcalamares/CalamaresConfig.h.in @@ -1,3 +1,24 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * + */ #ifndef CALAMARESCONFIG_H #define CALAMARESCONFIG_H @@ -11,5 +32,6 @@ //cmakedefines for CMake variables (e.g. for optdepends) go here #cmakedefine WITH_PYTHON #cmakedefine WITH_PYTHONQT +#cmakedefine WITH_QML #endif // CALAMARESCONFIG_H diff --git a/src/libcalamares/CppJob.cpp b/src/libcalamares/CppJob.cpp index b6b18b1b7..a2647463a 100644 --- a/src/libcalamares/CppJob.cpp +++ b/src/libcalamares/CppJob.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2016, Kevin Kofler + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2016 Kevin Kofler * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "CppJob.h" diff --git a/src/libcalamares/CppJob.h b/src/libcalamares/CppJob.h index e4997733e..ee093675a 100644 --- a/src/libcalamares/CppJob.h +++ b/src/libcalamares/CppJob.h @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2016, Kevin Kofler - * Copyright 2020, Adriaan de Groor + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2016 Kevin Kofler + * SPDX-FileCopyrightText: 2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_CPPJOB_H diff --git a/src/libcalamares/DllMacro.h b/src/libcalamares/DllMacro.h index 712bf5732..2eeea331e 100644 --- a/src/libcalamares/DllMacro.h +++ b/src/libcalamares/DllMacro.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,12 +15,16 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef DLLMACRO_H #define DLLMACRO_H -#include +#include /* * Mark symbols exported from Calamares non-GUI library with DLLEXPORT. diff --git a/src/libcalamares/GlobalStorage.cpp b/src/libcalamares/GlobalStorage.cpp index 428b01103..d58a3b0c6 100644 --- a/src/libcalamares/GlobalStorage.cpp +++ b/src/libcalamares/GlobalStorage.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "GlobalStorage.h" diff --git a/src/libcalamares/GlobalStorage.h b/src/libcalamares/GlobalStorage.h index 2a59009f7..e9ba1da8a 100644 --- a/src/libcalamares/GlobalStorage.h +++ b/src/libcalamares/GlobalStorage.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_GLOBALSTORAGE_H diff --git a/src/libcalamares/Job.cpp b/src/libcalamares/Job.cpp index d074a18cb..95339f349 100644 --- a/src/libcalamares/Job.cpp +++ b/src/libcalamares/Job.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Job.h" diff --git a/src/libcalamares/Job.h b/src/libcalamares/Job.h index d93e97cf7..18f11158f 100644 --- a/src/libcalamares/Job.h +++ b/src/libcalamares/Job.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ - #ifndef CALAMARES_JOB_H #define CALAMARES_JOB_H diff --git a/src/libcalamares/JobExample.cpp b/src/libcalamares/JobExample.cpp index 83da2b1e1..ba085be6e 100644 --- a/src/libcalamares/JobExample.cpp +++ b/src/libcalamares/JobExample.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ - #include "JobExample.h" namespace Calamares diff --git a/src/libcalamares/JobExample.h b/src/libcalamares/JobExample.h index 92f8f8fb6..e0307f64a 100644 --- a/src/libcalamares/JobExample.h +++ b/src/libcalamares/JobExample.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_JOB_EXAMPLE_H diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 6a2aa4cba..adff9464b 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "JobQueue.h" diff --git a/src/libcalamares/JobQueue.h b/src/libcalamares/JobQueue.h index 88a2bb0c3..ff2694d8f 100644 --- a/src/libcalamares/JobQueue.h +++ b/src/libcalamares/JobQueue.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_JOBQUEUE_H diff --git a/src/libcalamares/ProcessJob.cpp b/src/libcalamares/ProcessJob.cpp index 744f5f9bf..c6cb94359 100644 --- a/src/libcalamares/ProcessJob.cpp +++ b/src/libcalamares/ProcessJob.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "ProcessJob.h" diff --git a/src/libcalamares/ProcessJob.h b/src/libcalamares/ProcessJob.h index e826acb1d..75ef6f6e3 100644 --- a/src/libcalamares/ProcessJob.h +++ b/src/libcalamares/ProcessJob.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_PROCESSJOB_H diff --git a/src/libcalamares/PythonHelper.cpp b/src/libcalamares/PythonHelper.cpp index 0b5d77ac1..2f5418888 100644 --- a/src/libcalamares/PythonHelper.cpp +++ b/src/libcalamares/PythonHelper.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "PythonHelper.h" diff --git a/src/libcalamares/PythonHelper.h b/src/libcalamares/PythonHelper.h index 7528732a0..7acea5832 100644 --- a/src/libcalamares/PythonHelper.h +++ b/src/libcalamares/PythonHelper.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_PYTHONJOBHELPER_H diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 9069c49dc..50828e896 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2016, Teo Mrnjavac - * Copyright 2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,11 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ - #include "PythonJob.h" #include "CalamaresVersion.h" diff --git a/src/libcalamares/PythonJob.h b/src/libcalamares/PythonJob.h index eb9d8fff1..498eac44f 100644 --- a/src/libcalamares/PythonJob.h +++ b/src/libcalamares/PythonJob.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_PYTHONJOB_H diff --git a/src/libcalamares/PythonJobApi.cpp b/src/libcalamares/PythonJobApi.cpp index ecca466fe..2f8818738 100644 --- a/src/libcalamares/PythonJobApi.cpp +++ b/src/libcalamares/PythonJobApi.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2016, Teo Mrnjavac - * Copyright 2017-2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "PythonJobApi.h" diff --git a/src/libcalamares/PythonJobApi.h b/src/libcalamares/PythonJobApi.h index 6fb27cd62..6fd162912 100644 --- a/src/libcalamares/PythonJobApi.h +++ b/src/libcalamares/PythonJobApi.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2016, Teo Mrnjavac - * Copyright 2017-2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,15 +15,19 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef PYTHONJOBAPI_H #define PYTHONJOBAPI_H -#include "qglobal.h" // For qreal - #include "utils/BoostPython.h" +#include // For qreal + namespace Calamares { class PythonJob; diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index da388ea32..3c45c2e43 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -1,9 +1,9 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Dominic Hayes - * Copyright 2019, Gabriel Craciunescu - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Gabriel Craciunescu + * SPDX-FileCopyrightText: 2019 Dominic Hayes + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Settings.h" diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index 3cedd6e2b..098e010e5 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -1,9 +1,9 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Dominic Hayes - * Copyright 2019, Gabriel Craciunescu - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Gabriel Craciunescu + * SPDX-FileCopyrightText: 2019 Dominic Hayes + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef SETTINGS_H diff --git a/src/libcalamares/geoip/GeoIPFixed.cpp b/src/libcalamares/geoip/GeoIPFixed.cpp new file mode 100644 index 000000000..69d5d3a4e --- /dev/null +++ b/src/libcalamares/geoip/GeoIPFixed.cpp @@ -0,0 +1,47 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + */ + +#include "GeoIPFixed.h" + +namespace CalamaresUtils +{ +namespace GeoIP +{ + +GeoIPFixed::GeoIPFixed( const QString& attribute ) + : Interface( attribute.isEmpty() ? QStringLiteral( "Europe/Amsterdam" ) : attribute ) +{ +} + +QString +GeoIPFixed::rawReply( const QByteArray& ) +{ + return m_element; +} + +GeoIP::RegionZonePair +GeoIPFixed::processReply( const QByteArray& data ) +{ + return splitTZString( rawReply( data ) ); +} + +} // namespace GeoIP +} // namespace CalamaresUtils diff --git a/src/libcalamares/geoip/GeoIPFixed.h b/src/libcalamares/geoip/GeoIPFixed.h new file mode 100644 index 000000000..5d6fca266 --- /dev/null +++ b/src/libcalamares/geoip/GeoIPFixed.h @@ -0,0 +1,55 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + */ + +#ifndef GEOIP_GEOIPFIXED_H +#define GEOIP_GEOIPFIXED_H + +#include "Interface.h" + +namespace CalamaresUtils +{ +namespace GeoIP +{ +/** @brief GeoIP with a fixed return value + * + * The data is ignored entirely and the attribute value is returned unchanged. + * Note that you still need to provide a usable URL for a successful GeoIP + * lookup -- the URL's data is just ignored. + * + * @note This class is an implementation detail. + */ +class GeoIPFixed : public Interface +{ +public: + /** @brief Configure the value to return from rawReply() + * + * An empty string, which would not be a valid zone name, is + * translated to "Europe/Amsterdam". + */ + explicit GeoIPFixed( const QString& value = QString() ); + + virtual RegionZonePair processReply( const QByteArray& ) override; + virtual QString rawReply( const QByteArray& ) override; +}; + +} // namespace GeoIP +} // namespace CalamaresUtils +#endif diff --git a/src/libcalamares/geoip/GeoIPJSON.cpp b/src/libcalamares/geoip/GeoIPJSON.cpp index 85dc79619..6522ca085 100644 --- a/src/libcalamares/geoip/GeoIPJSON.cpp +++ b/src/libcalamares/geoip/GeoIPJSON.cpp @@ -1,7 +1,7 @@ -/* === This file is part of Calamares - === - * - * Copyright 2014-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2014-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "GeoIPJSON.h" diff --git a/src/libcalamares/geoip/GeoIPJSON.h b/src/libcalamares/geoip/GeoIPJSON.h index 3f7756dd8..246556c74 100644 --- a/src/libcalamares/geoip/GeoIPJSON.h +++ b/src/libcalamares/geoip/GeoIPJSON.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018-2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef GEOIP_GEOIPJSON_H diff --git a/src/libcalamares/geoip/GeoIPTests.cpp b/src/libcalamares/geoip/GeoIPTests.cpp index 4b1f8f8e1..9650cfe2d 100644 --- a/src/libcalamares/geoip/GeoIPTests.cpp +++ b/src/libcalamares/geoip/GeoIPTests.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,15 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "GeoIPTests.h" +#include "GeoIPFixed.h" #include "GeoIPJSON.h" #ifdef QT_XML_LIB #include "GeoIPXML.h" @@ -240,3 +245,35 @@ GeoIPTests::testGet() CHECK_GET( XML, QString(), "https://geoip.kde.org/v1/ubiquity" ) // Temporary KDE service #endif } + +void +GeoIPTests::testFixed() +{ + { + GeoIPFixed f; + auto tz = f.processReply( QByteArray() ); + QCOMPARE( tz.first, QStringLiteral( "Europe" ) ); + QCOMPARE( tz.second, QStringLiteral( "Amsterdam" ) ); + + QCOMPARE( f.processReply( xml_data_ubiquity ), tz ); + QCOMPARE( f.processReply( QByteArray( "derp" ) ), tz ); + } + { + GeoIPFixed f( QStringLiteral( "America/Vancouver" ) ); + auto tz = f.processReply( QByteArray() ); + QCOMPARE( tz.first, QStringLiteral( "America" ) ); + QCOMPARE( tz.second, QStringLiteral( "Vancouver" ) ); + + QCOMPARE( f.processReply( xml_data_ubiquity ), tz ); + QCOMPARE( f.processReply( QByteArray( "derp" ) ), tz ); + } + { + GeoIPFixed f( QStringLiteral( "America/North Dakota/Beulah" ) ); + auto tz = f.processReply( QByteArray() ); + QCOMPARE( tz.first, QStringLiteral( "America" ) ); + QCOMPARE( tz.second, QStringLiteral( "North_Dakota/Beulah" ) ); + + QCOMPARE( f.processReply( xml_data_ubiquity ), tz ); + QCOMPARE( f.processReply( QByteArray( "derp" ) ), tz ); + } +} diff --git a/src/libcalamares/geoip/GeoIPTests.h b/src/libcalamares/geoip/GeoIPTests.h index a320e3263..746a83eca 100644 --- a/src/libcalamares/geoip/GeoIPTests.h +++ b/src/libcalamares/geoip/GeoIPTests.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef GEOIPTESTS_H @@ -30,6 +34,7 @@ public: private Q_SLOTS: void initTestCase(); + void testFixed(); void testJSON(); void testJSONalt(); void testJSONbad(); diff --git a/src/libcalamares/geoip/GeoIPXML.cpp b/src/libcalamares/geoip/GeoIPXML.cpp index 2a97c5546..125614032 100644 --- a/src/libcalamares/geoip/GeoIPXML.cpp +++ b/src/libcalamares/geoip/GeoIPXML.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "GeoIPXML.h" diff --git a/src/libcalamares/geoip/GeoIPXML.h b/src/libcalamares/geoip/GeoIPXML.h index 73147ff91..d686928db 100644 --- a/src/libcalamares/geoip/GeoIPXML.h +++ b/src/libcalamares/geoip/GeoIPXML.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018-2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef GEOIP_GEOIPXML_H diff --git a/src/libcalamares/geoip/Handler.cpp b/src/libcalamares/geoip/Handler.cpp index 99e55e926..c76b86492 100644 --- a/src/libcalamares/geoip/Handler.cpp +++ b/src/libcalamares/geoip/Handler.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,15 +14,21 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Handler.h" +#include "GeoIPFixed.h" #include "GeoIPJSON.h" #if defined( QT_XML_LIB ) #include "GeoIPXML.h" #endif +#include "Settings.h" #include "network/Manager.h" #include "utils/Logger.h" #include "utils/NamedEnum.h" @@ -40,7 +46,8 @@ handlerTypes() static const NamedEnumTable names{ { QStringLiteral( "none" ), Type::None }, { QStringLiteral( "json" ), Type::JSON }, - { QStringLiteral( "xml" ), Type::XML } + { QStringLiteral( "xml" ), Type::XML }, + { QStringLiteral( "fixed" ), Type::Fixed } }; // *INDENT-ON* // clang-format on @@ -73,6 +80,10 @@ Handler::Handler( const QString& implementation, const QString& url, const QStri { cWarning() << "GeoIP style *none* does not do anything."; } + else if ( m_type == Type::Fixed && Calamares::Settings::instance() && !Calamares::Settings::instance()->debugMode() ) + { + cWarning() << "GeoIP style *fixed* is not recommended for production."; + } #if !defined( QT_XML_LIB ) else if ( m_type == Type::XML ) { @@ -99,6 +110,8 @@ create_interface( Handler::Type t, const QString& selector ) #else return nullptr; #endif + case Handler::Type::Fixed: + return std::make_unique< GeoIPFixed >( selector ); } NOTREACHED return nullptr; } diff --git a/src/libcalamares/geoip/Handler.h b/src/libcalamares/geoip/Handler.h index 518964caf..a44162576 100644 --- a/src/libcalamares/geoip/Handler.h +++ b/src/libcalamares/geoip/Handler.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef GEOIP_HANDLER_H @@ -43,9 +47,10 @@ class DLLEXPORT Handler public: enum class Type { - None, - JSON, - XML + None, // No lookup, returns empty string + JSON, // JSON-formatted data, returns extracted field + XML, // XML-formatted data, returns extracted field + Fixed // Returns selector string verbatim }; /** @brief An unconfigured handler; this always returns errors. */ diff --git a/src/libcalamares/geoip/Interface.cpp b/src/libcalamares/geoip/Interface.cpp index 2cecb63c5..82acb7950 100644 --- a/src/libcalamares/geoip/Interface.cpp +++ b/src/libcalamares/geoip/Interface.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Interface.h" diff --git a/src/libcalamares/geoip/Interface.h b/src/libcalamares/geoip/Interface.h index 1a9beaa41..1afcc911b 100644 --- a/src/libcalamares/geoip/Interface.h +++ b/src/libcalamares/geoip/Interface.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018-2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef GEOIP_INTERFACE_H @@ -98,7 +102,7 @@ public: virtual QString rawReply( const QByteArray& ) = 0; protected: - Interface( const QString& e = QString() ); + Interface( const QString& element = QString() ); QString m_element; // string for selecting from data }; diff --git a/src/libcalamares/geoip/test_geoip.cpp b/src/libcalamares/geoip/test_geoip.cpp index 32c6f4e24..a2aff929e 100644 --- a/src/libcalamares/geoip/test_geoip.cpp +++ b/src/libcalamares/geoip/test_geoip.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /** @@ -22,6 +26,7 @@ #include +#include "GeoIPFixed.h" #include "GeoIPJSON.h" #ifdef QT_XML_LIB #include "GeoIPXML.h" @@ -33,27 +38,34 @@ using namespace CalamaresUtils::GeoIP; int main( int argc, char** argv ) { - if ( argc != 2 ) + if ( ( argc != 2 ) && ( argc != 3 ) ) { - cerr << "Usage: curl url | test_geoip \n"; + cerr << "Usage: curl url | test_geoip [selector]\n"; return 1; } + QString format( argv[ 1 ] ); + QString selector = argc == 3 ? QString( argv[ 2 ] ) : QString(); + Interface* handler = nullptr; - if ( QStringLiteral( "json" ) == argv[ 1 ] ) + if ( QStringLiteral( "json" ) == format ) { - handler = new GeoIPJSON; + handler = new GeoIPJSON( selector ); } #ifdef QT_XML_LIB - else if ( QStringLiteral( "xml" ) == argv[ 1 ] ) + else if ( QStringLiteral( "xml" ) == format ) { - handler = new GeoIPXML; + handler = new GeoIPXML( selector ); } #endif + else if ( QStringLiteral( "fixed" ) == format ) + { + handler = new GeoIPFixed( selector ); + } if ( !handler ) { - cerr << "Unknown format '" << argv[ 1 ] << "'\n"; + cerr << "Unknown format '" << format.toLatin1().constData() << "'\n"; return 1; } diff --git a/src/libcalamares/locale/Label.cpp b/src/libcalamares/locale/Label.cpp index 02583df8b..0be82a380 100644 --- a/src/libcalamares/locale/Label.cpp +++ b/src/libcalamares/locale/Label.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Label.h" diff --git a/src/libcalamares/locale/Label.h b/src/libcalamares/locale/Label.h index bd596f53d..fa07e3361 100644 --- a/src/libcalamares/locale/Label.h +++ b/src/libcalamares/locale/Label.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LOCALE_LABEL_H diff --git a/src/libcalamares/locale/LabelModel.cpp b/src/libcalamares/locale/LabelModel.cpp index da4e1a9f7..a7f14bf50 100644 --- a/src/libcalamares/locale/LabelModel.cpp +++ b/src/libcalamares/locale/LabelModel.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2019-2020 Adriaan de Groot - * Copyright 2019, Camilo Higuita + * + * SPDX-FileCopyrightText: 2019 Camilo Higuita + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "LabelModel.h" diff --git a/src/libcalamares/locale/LabelModel.h b/src/libcalamares/locale/LabelModel.h index 7bd1fad67..000bf4da7 100644 --- a/src/libcalamares/locale/LabelModel.h +++ b/src/libcalamares/locale/LabelModel.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2019-2020, Adriaan de Groot - * Copyright 2019, Camilo Higuita + * + * SPDX-FileCopyrightText: 2019 Camilo Higuita + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LOCALE_LABELMODEL_H diff --git a/src/libcalamares/locale/Lookup.cpp b/src/libcalamares/locale/Lookup.cpp index baa3ce5b1..615783a87 100644 --- a/src/libcalamares/locale/Lookup.cpp +++ b/src/libcalamares/locale/Lookup.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Lookup.h" diff --git a/src/libcalamares/locale/Lookup.h b/src/libcalamares/locale/Lookup.h index abcee0ed3..daa9c2987 100644 --- a/src/libcalamares/locale/Lookup.h +++ b/src/libcalamares/locale/Lookup.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LOCALE_LOOKUP_H diff --git a/src/libcalamares/locale/Tests.cpp b/src/libcalamares/locale/Tests.cpp index 6cbe980be..6c5a508d7 100644 --- a/src/libcalamares/locale/Tests.cpp +++ b/src/libcalamares/locale/Tests.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Tests.h" diff --git a/src/libcalamares/locale/Tests.h b/src/libcalamares/locale/Tests.h index 96ee48b0b..dfe85a865 100644 --- a/src/libcalamares/locale/Tests.h +++ b/src/libcalamares/locale/Tests.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LIBCALAMARES_LOCALE_TESTS_H diff --git a/src/libcalamares/locale/TimeZone.cpp b/src/libcalamares/locale/TimeZone.cpp index e25cf2144..0c13a8c77 100644 --- a/src/libcalamares/locale/TimeZone.cpp +++ b/src/libcalamares/locale/TimeZone.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "TimeZone.h" diff --git a/src/libcalamares/locale/TimeZone.h b/src/libcalamares/locale/TimeZone.h index 5f1e19801..60900ef21 100644 --- a/src/libcalamares/locale/TimeZone.h +++ b/src/libcalamares/locale/TimeZone.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LOCALE_TIMEZONE_H diff --git a/src/libcalamares/locale/TranslatableConfiguration.cpp b/src/libcalamares/locale/TranslatableConfiguration.cpp index 83199a4cc..fb9800d64 100644 --- a/src/libcalamares/locale/TranslatableConfiguration.cpp +++ b/src/libcalamares/locale/TranslatableConfiguration.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "TranslatableConfiguration.h" diff --git a/src/libcalamares/locale/TranslatableConfiguration.h b/src/libcalamares/locale/TranslatableConfiguration.h index d845569bc..fa6016731 100644 --- a/src/libcalamares/locale/TranslatableConfiguration.h +++ b/src/libcalamares/locale/TranslatableConfiguration.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LOCALE_TRANSLATABLECONFIGURATION_H diff --git a/src/libcalamares/locale/ZoneData_p.cxxtr b/src/libcalamares/locale/ZoneData_p.cxxtr index b73d17ad3..4bfef3c0c 100644 --- a/src/libcalamares/locale/ZoneData_p.cxxtr +++ b/src/libcalamares/locale/ZoneData_p.cxxtr @@ -1,6 +1,26 @@ /* GENERATED FILE DO NOT EDIT * * === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * + * * * This file is derived from zone.tab, which has its own copyright statement: * diff --git a/src/libcalamares/locale/cldr-extractor.py b/src/libcalamares/locale/cldr-extractor.py index aae71ed1d..f69407257 100644 --- a/src/libcalamares/locale/cldr-extractor.py +++ b/src/libcalamares/locale/cldr-extractor.py @@ -1,6 +1,13 @@ #! /usr/bin/env python3 # # === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2019 Adriaan de Groot +# +# SPDX-License-Identifier: BSD-2-Clause +# License-Filename: LICENSES/BSD2 +# +# # # Python3 script to scrape some data out of ICU CLDR supplemental data. # diff --git a/src/libcalamares/locale/zone-extractor.py b/src/libcalamares/locale/zone-extractor.py index 92165d824..8ff1b5ef7 100644 --- a/src/libcalamares/locale/zone-extractor.py +++ b/src/libcalamares/locale/zone-extractor.py @@ -1,6 +1,12 @@ #! /usr/bin/env python3 # # === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2019 Adriaan de Groot +# +# SPDX-License-Identifier: BSD-2-Clause +# License-Filename: LICENSES/BSD2 +# # # Python3 script to scrape some data out of zoneinfo/zone.tab. # diff --git a/src/libcalamares/modulesystem/Actions.h b/src/libcalamares/modulesystem/Actions.h index e1be0b867..0b7133f78 100644 --- a/src/libcalamares/modulesystem/Actions.h +++ b/src/libcalamares/modulesystem/Actions.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef MODULESYSTEM_ACTIONS_H diff --git a/src/libcalamares/modulesystem/Descriptor.h b/src/libcalamares/modulesystem/Descriptor.h index 77d69caf3..b34f163ad 100644 --- a/src/libcalamares/modulesystem/Descriptor.h +++ b/src/libcalamares/modulesystem/Descriptor.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef MODULESYSTEM_DESCRIPTOR_H diff --git a/src/libcalamares/modulesystem/InstanceKey.cpp b/src/libcalamares/modulesystem/InstanceKey.cpp index cde921b40..82ccf7800 100644 --- a/src/libcalamares/modulesystem/InstanceKey.cpp +++ b/src/libcalamares/modulesystem/InstanceKey.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2018-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "InstanceKey.h" diff --git a/src/libcalamares/modulesystem/InstanceKey.h b/src/libcalamares/modulesystem/InstanceKey.h index 724827330..c81d83a75 100644 --- a/src/libcalamares/modulesystem/InstanceKey.h +++ b/src/libcalamares/modulesystem/InstanceKey.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2018-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef MODULESYSTEM_INSTANCEKEY_H #define MODULESYSTEM_INSTANCEKEY_H diff --git a/src/libcalamares/modulesystem/Module.cpp b/src/libcalamares/modulesystem/Module.cpp index 9620299ec..407a10205 100644 --- a/src/libcalamares/modulesystem/Module.cpp +++ b/src/libcalamares/modulesystem/Module.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Module.h" diff --git a/src/libcalamares/modulesystem/Module.h b/src/libcalamares/modulesystem/Module.h index ba4533fae..81737cf8f 100644 --- a/src/libcalamares/modulesystem/Module.h +++ b/src/libcalamares/modulesystem/Module.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_MODULE_H diff --git a/src/libcalamares/modulesystem/Requirement.cpp b/src/libcalamares/modulesystem/Requirement.cpp index e4525e8d6..d5ba23282 100644 --- a/src/libcalamares/modulesystem/Requirement.cpp +++ b/src/libcalamares/modulesystem/Requirement.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2017, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2017 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,5 +14,9 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Requirement.h" diff --git a/src/libcalamares/modulesystem/Requirement.h b/src/libcalamares/modulesystem/Requirement.h index da3cf29dd..eb664d2a9 100644 --- a/src/libcalamares/modulesystem/Requirement.h +++ b/src/libcalamares/modulesystem/Requirement.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2017, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2017 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_REQUIREMENT_H #define CALAMARES_REQUIREMENT_H diff --git a/src/libcalamares/modulesystem/RequirementsChecker.cpp b/src/libcalamares/modulesystem/RequirementsChecker.cpp index 92e194818..2dbaea8cf 100644 --- a/src/libcalamares/modulesystem/RequirementsChecker.cpp +++ b/src/libcalamares/modulesystem/RequirementsChecker.cpp @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "RequirementsChecker.h" @@ -41,6 +45,7 @@ RequirementsChecker::RequirementsChecker( QVector< Module* > modules, Requiremen , m_progressTimeouts( 0 ) { m_watchers.reserve( m_modules.count() ); + connect( this, &RequirementsChecker::requirementsProgress, model, &RequirementsModel::setProgressMessage ); } RequirementsChecker::~RequirementsChecker() {} @@ -83,6 +88,7 @@ RequirementsChecker::finished() } m_model->describe(); + m_model->changeRequirementsList(); QTimer::singleShot( 0, this, &RequirementsChecker::done ); } } @@ -97,8 +103,7 @@ RequirementsChecker::addCheckedRequirements( Module* m ) m_model->addRequirementsList( l ); } - requirementsProgress( - tr( "Requirements checking for module %1 is complete." ).arg( m->name() ) ); + requirementsProgress( tr( "Requirements checking for module %1 is complete." ).arg( m->name() ) ); } void diff --git a/src/libcalamares/modulesystem/RequirementsChecker.h b/src/libcalamares/modulesystem/RequirementsChecker.h index 21c86f0a6..910e34dfc 100644 --- a/src/libcalamares/modulesystem/RequirementsChecker.h +++ b/src/libcalamares/modulesystem/RequirementsChecker.h @@ -1,6 +1,6 @@ -/* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_REQUIREMENTSCHECKER_H #define CALAMARES_REQUIREMENTSCHECKER_H diff --git a/src/libcalamares/modulesystem/RequirementsModel.cpp b/src/libcalamares/modulesystem/RequirementsModel.cpp index eb2f892be..41a5616c1 100644 --- a/src/libcalamares/modulesystem/RequirementsModel.cpp +++ b/src/libcalamares/modulesystem/RequirementsModel.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2019-2020, Adriaan de Groot + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "RequirementsModel.h" @@ -92,17 +96,27 @@ RequirementsModel::roleNames() const void RequirementsModel::describe() const { + cDebug() << "Requirements model has" << m_requirements.count() << "items"; bool acceptable = true; int count = 0; for ( const auto& r : m_requirements ) { + cDebug() << Logger::SubEntry << "requirement" << count << r.name + << "satisfied?" << r.satisfied + << "mandatory?" << r.mandatory; if ( r.mandatory && !r.satisfied ) { - cDebug() << Logger::SubEntry << "requirement" << count << r.name << "is not satisfied."; acceptable = false; } ++count; } } +void +RequirementsModel::setProgressMessage( const QString& m ) +{ + m_progressMessage = m; + emit progressMessageChanged( m_progressMessage ); +} + } // namespace Calamares diff --git a/src/libcalamares/modulesystem/RequirementsModel.h b/src/libcalamares/modulesystem/RequirementsModel.h index ce9f23168..df56ccd7b 100644 --- a/src/libcalamares/modulesystem/RequirementsModel.h +++ b/src/libcalamares/modulesystem/RequirementsModel.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019-2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef CALAMARES_REQUIREMENTSMODEL_H @@ -46,6 +50,7 @@ class DLLEXPORT RequirementsModel : public QAbstractListModel Q_OBJECT Q_PROPERTY( bool satisfiedRequirements READ satisfiedRequirements NOTIFY satisfiedRequirementsChanged FINAL ) Q_PROPERTY( bool satisfiedMandatory READ satisfiedMandatory NOTIFY satisfiedMandatoryChanged FINAL ) + Q_PROPERTY( QString progressMessage READ progressMessage NOTIFY progressMessageChanged FINAL ) public: using QAbstractListModel::QAbstractListModel; @@ -65,6 +70,9 @@ public: bool satisfiedRequirements() const { return m_satisfiedRequirements; } ///@brief Are all the **mandatory** requirements satisfied? bool satisfiedMandatory() const { return m_satisfiedMandatory; } + ///@brief Message (from an ongoing check) about progress + QString progressMessage() const { return m_progressMessage; } + QVariant data( const QModelIndex& index, int role ) const override; int rowCount( const QModelIndex& ) const override; @@ -76,6 +84,7 @@ public: signals: void satisfiedRequirementsChanged( bool value ); void satisfiedMandatoryChanged( bool value ); + void progressMessageChanged( QString message ); protected: QHash< int, QByteArray > roleNames() const override; @@ -83,10 +92,14 @@ protected: ///@brief Append some requirements; resets the model void addRequirementsList( const Calamares::RequirementsList& requirements ); + ///@brief Update progress message (called by the checker) + void setProgressMessage( const QString& m ); + private: ///@brief Implementation for {set,add}RequirementsList void changeRequirementsList(); + QString m_progressMessage; QMutex m_addLock; RequirementsList m_requirements; bool m_satisfiedRequirements = false; diff --git a/src/libcalamares/modulesystem/Tests.cpp b/src/libcalamares/modulesystem/Tests.cpp index b1fab7ffc..7973cc0ad 100644 --- a/src/libcalamares/modulesystem/Tests.cpp +++ b/src/libcalamares/modulesystem/Tests.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "modulesystem/InstanceKey.h" diff --git a/src/libcalamares/network/Manager.cpp b/src/libcalamares/network/Manager.cpp index 9e76d5ff0..d70988a0a 100644 --- a/src/libcalamares/network/Manager.cpp +++ b/src/libcalamares/network/Manager.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Manager.h" diff --git a/src/libcalamares/network/Manager.h b/src/libcalamares/network/Manager.h index 0837bdc13..1ba3eb411 100644 --- a/src/libcalamares/network/Manager.h +++ b/src/libcalamares/network/Manager.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LIBCALAMARES_NETWORK_MANAGER_H diff --git a/src/libcalamares/network/Tests.cpp b/src/libcalamares/network/Tests.cpp index e21a03bab..6841a3061 100644 --- a/src/libcalamares/network/Tests.cpp +++ b/src/libcalamares/network/Tests.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Tests.h" diff --git a/src/libcalamares/network/Tests.h b/src/libcalamares/network/Tests.h index b63f7eff0..2d785672e 100644 --- a/src/libcalamares/network/Tests.h +++ b/src/libcalamares/network/Tests.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LIBCALAMARES_NETWORK_TESTS_H diff --git a/src/libcalamares/partition/FileSystem.cpp b/src/libcalamares/partition/FileSystem.cpp index fbbe48581..965a1a8af 100644 --- a/src/libcalamares/partition/FileSystem.cpp +++ b/src/libcalamares/partition/FileSystem.cpp @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015-2016, Teo Mrnjavac - * Copyright 2018-2019 Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "FileSystem.h" diff --git a/src/libcalamares/partition/FileSystem.h b/src/libcalamares/partition/FileSystem.h index 258515d3c..a683aab47 100644 --- a/src/libcalamares/partition/FileSystem.h +++ b/src/libcalamares/partition/FileSystem.h @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015-2016, Teo Mrnjavac - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /* diff --git a/src/libcalamares/partition/KPMManager.cpp b/src/libcalamares/partition/KPMManager.cpp index efc5f0003..964b87859 100644 --- a/src/libcalamares/partition/KPMManager.cpp +++ b/src/libcalamares/partition/KPMManager.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "KPMManager.h" diff --git a/src/libcalamares/partition/KPMManager.h b/src/libcalamares/partition/KPMManager.h index 5f7039221..be5ae00c0 100644 --- a/src/libcalamares/partition/KPMManager.h +++ b/src/libcalamares/partition/KPMManager.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /* diff --git a/src/libcalamares/partition/KPMTests.cpp b/src/libcalamares/partition/KPMTests.cpp index 7468d3938..0bdb29a15 100644 --- a/src/libcalamares/partition/KPMTests.cpp +++ b/src/libcalamares/partition/KPMTests.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "utils/Logger.h" diff --git a/src/libcalamares/partition/Mount.cpp b/src/libcalamares/partition/Mount.cpp index 2bb49b0cb..f9a45fafd 100644 --- a/src/libcalamares/partition/Mount.cpp +++ b/src/libcalamares/partition/Mount.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Mount.h" diff --git a/src/libcalamares/partition/Mount.h b/src/libcalamares/partition/Mount.h index 041e7e757..c08d5ac75 100644 --- a/src/libcalamares/partition/Mount.h +++ b/src/libcalamares/partition/Mount.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef PARTITION_MOUNT_H diff --git a/src/libcalamares/partition/PartitionIterator.cpp b/src/libcalamares/partition/PartitionIterator.cpp index 642752163..f4e57fbad 100644 --- a/src/libcalamares/partition/PartitionIterator.cpp +++ b/src/libcalamares/partition/PartitionIterator.cpp @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015, Teo Mrnjavac - * Copyright 2017, 2019 Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "PartitionIterator.h" diff --git a/src/libcalamares/partition/PartitionIterator.h b/src/libcalamares/partition/PartitionIterator.h index 78d930cf4..03a03faba 100644 --- a/src/libcalamares/partition/PartitionIterator.h +++ b/src/libcalamares/partition/PartitionIterator.h @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015, Teo Mrnjavac - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,13 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ + /* * NOTE: this functionality is only available when Calamares is compiled * with KPMcore support. diff --git a/src/libcalamares/partition/PartitionQuery.cpp b/src/libcalamares/partition/PartitionQuery.cpp index 6693f7e6c..0aba728b3 100644 --- a/src/libcalamares/partition/PartitionQuery.cpp +++ b/src/libcalamares/partition/PartitionQuery.cpp @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015-2016, Teo Mrnjavac - * Copyright 2018-2019 Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "PartitionQuery.h" diff --git a/src/libcalamares/partition/PartitionQuery.h b/src/libcalamares/partition/PartitionQuery.h index 18eb7edd2..595d82c0f 100644 --- a/src/libcalamares/partition/PartitionQuery.h +++ b/src/libcalamares/partition/PartitionQuery.h @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Aurélien Gâteau - * Copyright 2015-2016, Teo Mrnjavac - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2015-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /* diff --git a/src/libcalamares/partition/PartitionSize.cpp b/src/libcalamares/partition/PartitionSize.cpp index fc8d72582..d84fd81c6 100644 --- a/src/libcalamares/partition/PartitionSize.cpp +++ b/src/libcalamares/partition/PartitionSize.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Collabora Ltd - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Collabora Ltd + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,13 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ + #include "partition/PartitionSize.h" #include "utils/Logger.h" #include "utils/Units.h" diff --git a/src/libcalamares/partition/PartitionSize.h b/src/libcalamares/partition/PartitionSize.h index b22698e55..f70aa3c89 100644 --- a/src/libcalamares/partition/PartitionSize.h +++ b/src/libcalamares/partition/PartitionSize.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Collabora Ltd - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Collabora Ltd + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef PARTITION_PARTITIONSIZE_H diff --git a/src/libcalamares/partition/Sync.cpp b/src/libcalamares/partition/Sync.cpp index c71c6a172..d1f6378cd 100644 --- a/src/libcalamares/partition/Sync.cpp +++ b/src/libcalamares/partition/Sync.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019-2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Sync.h" diff --git a/src/libcalamares/partition/Sync.h b/src/libcalamares/partition/Sync.h index 510858500..a291058e7 100644 --- a/src/libcalamares/partition/Sync.h +++ b/src/libcalamares/partition/Sync.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef PARTITION_SYNC_H diff --git a/src/libcalamares/partition/Tests.cpp b/src/libcalamares/partition/Tests.cpp index 0800fa455..7719f2e84 100644 --- a/src/libcalamares/partition/Tests.cpp +++ b/src/libcalamares/partition/Tests.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Tests.h" diff --git a/src/libcalamares/partition/Tests.h b/src/libcalamares/partition/Tests.h index 799f50c04..c495fa0fd 100644 --- a/src/libcalamares/partition/Tests.h +++ b/src/libcalamares/partition/Tests.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef LIBCALAMARES_PARTITION_TESTS_H diff --git a/src/libcalamares/utils/BoostPython.h b/src/libcalamares/utils/BoostPython.h index 7bd8865da..a1986a7c2 100644 --- a/src/libcalamares/utils/BoostPython.h +++ b/src/libcalamares/utils/BoostPython.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019-2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /* diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index 327bece92..955358774 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "CalamaresUtilsSystem.h" diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.h b/src/libcalamares/utils/CalamaresUtilsSystem.h index c4db9dc00..d6adead60 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.h +++ b/src/libcalamares/utils/CalamaresUtilsSystem.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_CALAMARESUTILSSYSTEM_H #define UTILS_CALAMARESUTILSSYSTEM_H diff --git a/src/libcalamares/utils/CommandList.cpp b/src/libcalamares/utils/CommandList.cpp index 8a2f3835b..331d10e34 100644 --- a/src/libcalamares/utils/CommandList.cpp +++ b/src/libcalamares/utils/CommandList.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "CommandList.h" diff --git a/src/libcalamares/utils/CommandList.h b/src/libcalamares/utils/CommandList.h index 71a5a483c..657570563 100644 --- a/src/libcalamares/utils/CommandList.h +++ b/src/libcalamares/utils/CommandList.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_COMMANDLIST_H diff --git a/src/libcalamares/utils/Dirs.cpp b/src/libcalamares/utils/Dirs.cpp index ca569490f..290966180 100644 --- a/src/libcalamares/utils/Dirs.cpp +++ b/src/libcalamares/utils/Dirs.cpp @@ -1,12 +1,12 @@ /* === This file is part of Calamares - === - * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Originally from Tomahawk, portions: - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2010-2011, Leo Franchi - * Copyright 2010-2012, Jeff Mitchell + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2010-2011 Leo Franchi + * SPDX-FileCopyrightText: 2010-2012 Jeff Mitchell * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Dirs.h" @@ -42,7 +46,6 @@ namespace CalamaresUtils { static QDir s_appDataDir( CMAKE_INSTALL_FULL_DATADIR ); -static QDir s_qmlModulesDir( QString( CMAKE_INSTALL_FULL_DATADIR ) + "/qml" ); static bool s_isAppDataDirOverridden = false; static bool s_haveExtraDirs = false; @@ -79,13 +82,6 @@ isWritableDir( const QDir& dir ) } -QDir -qmlModulesDir() -{ - return s_qmlModulesDir; -} - - void setAppDataDir( const QDir& dir ) { @@ -200,11 +196,4 @@ appLogDir() return QDir::temp(); } - -void -setQmlModulesDir( const QDir& dir ) -{ - s_qmlModulesDir = dir; -} - } // namespace CalamaresUtils diff --git a/src/libcalamares/utils/Dirs.h b/src/libcalamares/utils/Dirs.h index a63e679da..5a3d48732 100644 --- a/src/libcalamares/utils/Dirs.h +++ b/src/libcalamares/utils/Dirs.h @@ -1,12 +1,12 @@ /* === This file is part of Calamares - === - * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Originally from Tomahawk, portions: - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2010-2011, Leo Franchi - * Copyright 2010-2012, Jeff Mitchell + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2010-2011 Leo Franchi + * SPDX-FileCopyrightText: 2010-2012 Jeff Mitchell * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_DIRS_H @@ -31,8 +35,6 @@ namespace CalamaresUtils { -DLLEXPORT QDir qmlModulesDir(); - /** * @brief appDataDir returns the directory with common application data. * Defaults to CMAKE_INSTALL_FULL_DATADIR (usually /usr/share/calamares). @@ -57,8 +59,6 @@ DLLEXPORT QDir systemLibDir(); DLLEXPORT void setAppDataDir( const QDir& dir ); DLLEXPORT bool isAppDataDirOverridden(); -DLLEXPORT void setQmlModulesDir( const QDir& dir ); - /** @brief Setup extra config and data dirs from the XDG variables. */ DLLEXPORT void setXdgDirs(); diff --git a/src/libcalamares/utils/Entropy.cpp b/src/libcalamares/utils/Entropy.cpp index ce1f6ba9d..c54b2cf3e 100644 --- a/src/libcalamares/utils/Entropy.cpp +++ b/src/libcalamares/utils/Entropy.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * - * Copyright 2019-2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Entropy.h" diff --git a/src/libcalamares/utils/Entropy.h b/src/libcalamares/utils/Entropy.h index 2ab7a609d..3489045ab 100644 --- a/src/libcalamares/utils/Entropy.h +++ b/src/libcalamares/utils/Entropy.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot * - * Copyright 2019-2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_ENTROPY_H diff --git a/src/libcalamares/utils/Logger.cpp b/src/libcalamares/utils/Logger.cpp index ceca20b7a..494b88659 100644 --- a/src/libcalamares/utils/Logger.cpp +++ b/src/libcalamares/utils/Logger.cpp @@ -1,8 +1,9 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017 Adriaan de Groot * - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -11,11 +12,15 @@ * * Calamares is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Logger.h" diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 24198e256..69674bc68 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -1,8 +1,8 @@ /* === This file is part of Calamares - === - * - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -11,11 +11,15 @@ * * Calamares is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_LOGGER_H diff --git a/src/libcalamares/utils/NamedEnum.h b/src/libcalamares/utils/NamedEnum.h index 76c8ed3bb..1242fc841 100644 --- a/src/libcalamares/utils/NamedEnum.h +++ b/src/libcalamares/utils/NamedEnum.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot - * Copyright 2019, Collabora Ltd + * + * SPDX-FileCopyrightText: 2019 Collabora Ltd + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /** @brief Support for "named" enumerations diff --git a/src/libcalamares/utils/NamedSuffix.h b/src/libcalamares/utils/NamedSuffix.h index 8ad52edea..9efc417e4 100644 --- a/src/libcalamares/utils/NamedSuffix.h +++ b/src/libcalamares/utils/NamedSuffix.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2019, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ /** @brief Support for unit-suffixed values. diff --git a/src/libcalamares/utils/PluginFactory.cpp b/src/libcalamares/utils/PluginFactory.cpp index 50b88ebfd..9f1ab5ae3 100644 --- a/src/libcalamares/utils/PluginFactory.cpp +++ b/src/libcalamares/utils/PluginFactory.cpp @@ -1,6 +1,22 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * - * Copyright 2019, Adriaan de Groot + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE * */ diff --git a/src/libcalamares/utils/PluginFactory.h b/src/libcalamares/utils/PluginFactory.h index 65ee6eee9..68b1b624f 100644 --- a/src/libcalamares/utils/PluginFactory.h +++ b/src/libcalamares/utils/PluginFactory.h @@ -1,11 +1,11 @@ /* === This file is part of Calamares - === - * - * Copyright 2015, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot - * + * + * SPDX-FileCopyrightText: 2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot + * * Based on KPluginFactory from KCoreAddons, KDE project - * Copyright 2007, Matthias Kretz - * Copyright 2007, Bernhard Loos + * SPDX-FileCopyrightText: 2007 Matthias Kretz + * SPDX-FileCopyrightText: 2007 Bernhard Loos * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_PLUGINFACTORY_H diff --git a/src/libcalamares/utils/RAII.h b/src/libcalamares/utils/RAII.h index 4d8210a25..dae85e84a 100644 --- a/src/libcalamares/utils/RAII.h +++ b/src/libcalamares/utils/RAII.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2020, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_RAII_H diff --git a/src/libcalamares/utils/Retranslator.cpp b/src/libcalamares/utils/Retranslator.cpp index 4cd618d97..03e8a6b4c 100644 --- a/src/libcalamares/utils/Retranslator.cpp +++ b/src/libcalamares/utils/Retranslator.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2014, Teo Mrnjavac + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Retranslator.h" diff --git a/src/libcalamares/utils/Retranslator.h b/src/libcalamares/utils/Retranslator.h index d62a3b751..8b3719642 100644 --- a/src/libcalamares/utils/Retranslator.h +++ b/src/libcalamares/utils/Retranslator.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === - * - * Copyright 2014-2015, Teo Mrnjavac + * + * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_RETRANSLATOR_H diff --git a/src/libcalamares/utils/String.cpp b/src/libcalamares/utils/String.cpp index e39132328..35fc692d3 100644 --- a/src/libcalamares/utils/String.cpp +++ b/src/libcalamares/utils/String.cpp @@ -1,12 +1,12 @@ /* === This file is part of Calamares - === - * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Originally from Tomahawk, portions: - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2010-2011, Leo Franchi - * Copyright 2010-2012, Jeff Mitchell + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2010-2011 Leo Franchi + * SPDX-FileCopyrightText: 2010-2012 Jeff Mitchell * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "String.h" diff --git a/src/libcalamares/utils/String.h b/src/libcalamares/utils/String.h index cdf7d0b41..d4bd33357 100644 --- a/src/libcalamares/utils/String.h +++ b/src/libcalamares/utils/String.h @@ -1,12 +1,12 @@ /* === This file is part of Calamares - === - * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Originally from Tomahawk, portions: - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2010-2011, Leo Franchi - * Copyright 2010-2012, Jeff Mitchell + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2010-2011 Leo Franchi + * SPDX-FileCopyrightText: 2010-2012 Jeff Mitchell * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_STRING_H diff --git a/src/libcalamares/utils/TestPaths.cpp b/src/libcalamares/utils/TestPaths.cpp index 382305ad5..233872324 100644 --- a/src/libcalamares/utils/TestPaths.cpp +++ b/src/libcalamares/utils/TestPaths.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018-2020 Adriaan de Groot * - * Copyright 2018, 2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "CalamaresUtilsSystem.h" diff --git a/src/libcalamares/utils/Tests.cpp b/src/libcalamares/utils/Tests.cpp index b529e7149..a1bfcd0ed 100644 --- a/src/libcalamares/utils/Tests.cpp +++ b/src/libcalamares/utils/Tests.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * - * Copyright 2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Tests.h" diff --git a/src/libcalamares/utils/Tests.h b/src/libcalamares/utils/Tests.h index 49df8ed74..2e1cba016 100644 --- a/src/libcalamares/utils/Tests.h +++ b/src/libcalamares/utils/Tests.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * - * Copyright 2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef TESTS_H diff --git a/src/libcalamares/utils/UMask.cpp b/src/libcalamares/utils/UMask.cpp index 358a52887..a97084215 100644 --- a/src/libcalamares/utils/UMask.cpp +++ b/src/libcalamares/utils/UMask.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * - * Copyright 2019, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "UMask.h" diff --git a/src/libcalamares/utils/UMask.h b/src/libcalamares/utils/UMask.h index 752c8b066..fe7d2ccb9 100644 --- a/src/libcalamares/utils/UMask.h +++ b/src/libcalamares/utils/UMask.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2019 Adriaan de Groot * - * Copyright 2019, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +15,11 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ - #ifndef UTILS_UMASK_H #define UTILS_UMASK_H diff --git a/src/libcalamares/utils/Units.h b/src/libcalamares/utils/Units.h index b869d7dde..899ceca51 100644 --- a/src/libcalamares/utils/Units.h +++ b/src/libcalamares/utils/Units.h @@ -1,7 +1,8 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2017 Adriaan de Groot + * SPDX-FileCopyrightText: 2019 Collabora Ltd * - * Copyright 2017, Adriaan de Groot - * Copyright 2019, Collabora Ltd * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_UNITS_H diff --git a/src/libcalamares/utils/Variant.cpp b/src/libcalamares/utils/Variant.cpp index c56f9301a..cf6ff91fe 100644 --- a/src/libcalamares/utils/Variant.cpp +++ b/src/libcalamares/utils/Variant.cpp @@ -1,12 +1,12 @@ /* === This file is part of Calamares - === - * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * * Originally from Tomahawk, portions: - * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2010-2011, Leo Franchi - * Copyright 2010-2012, Jeff Mitchell + * SPDX-FileCopyrightText: 2010-2011 Christian Muehlhaeuser + * SPDX-FileCopyrightText: 2010-2011 Leo Franchi + * SPDX-FileCopyrightText: 2010-2012 Jeff Mitchell * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Variant.h" diff --git a/src/libcalamares/utils/Variant.h b/src/libcalamares/utils/Variant.h index 15f791b74..a05d281c3 100644 --- a/src/libcalamares/utils/Variant.h +++ b/src/libcalamares/utils/Variant.h @@ -1,7 +1,8 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2013-2016 Teo Mrnjavac + * SPDX-FileCopyrightText: 2018 Adriaan de Groot * - * Copyright 2013-2016, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_VARIANT_H diff --git a/src/libcalamares/utils/Yaml.cpp b/src/libcalamares/utils/Yaml.cpp index b33ca3137..0c7b6787f 100644 --- a/src/libcalamares/utils/Yaml.cpp +++ b/src/libcalamares/utils/Yaml.cpp @@ -1,7 +1,8 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #include "Yaml.h" diff --git a/src/libcalamares/utils/Yaml.h b/src/libcalamares/utils/Yaml.h index a976136e1..c14639447 100644 --- a/src/libcalamares/utils/Yaml.h +++ b/src/libcalamares/utils/Yaml.h @@ -1,7 +1,8 @@ /* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2014 Teo Mrnjavac + * SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot * - * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,10 @@ * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * */ #ifndef UTILS_YAML_H diff --git a/src/libcalamares/utils/moc-warnings.h b/src/libcalamares/utils/moc-warnings.h index b773c176b..adcdeb873 100644 --- a/src/libcalamares/utils/moc-warnings.h +++ b/src/libcalamares/utils/moc-warnings.h @@ -1,3 +1,25 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2020 Adriaan de Groot + * + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + * License-Filename: LICENSE + * + */ #ifdef __clang__ #pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wredundant-parens" diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index ae8f3910f..a5909fd61 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -41,6 +41,13 @@ #include #endif +[[noreturn]] static void +bail( const QString& descriptorPath, const QString& message ) +{ + cError() << "FATAL in" << descriptorPath << Logger::Continuation << Logger::NoQuote {} << message; + ::exit( EXIT_FAILURE ); +} + namespace Calamares { @@ -153,7 +160,7 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent ) QDir componentDir( componentDirectory() ); if ( !componentDir.exists() ) { - bail( "Bad component directory path." ); + bail( m_descriptorPath, "Bad component directory path." ); } QFile file( brandingFilePath ); @@ -168,10 +175,12 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent ) m_componentName = QString::fromStdString( doc[ "componentName" ].as< std::string >() ); if ( m_componentName != componentDir.dirName() ) - bail( "The branding component name should match the name of the " + bail( m_descriptorPath, + "The branding component name should match the name of the " "component directory." ); initSimpleSettings( doc ); + initSlideshowSettings( doc ); #ifdef WITH_KOSRelease // Copy the os-release information into a QHash for use by KMacroExpander. @@ -194,17 +203,15 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent ) { QStringLiteral( "VARIANT" ), relInfo.variant() }, { QStringLiteral( "VARIANT_ID" ), relInfo.variantId() }, { QStringLiteral( "LOGO" ), relInfo.logo() } } }; - auto expand = [ & ]( const QString& s ) -> QString { + auto expand = [&]( const QString& s ) -> QString { return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '@' ) ); }; #else auto expand = []( const QString& s ) -> QString { return s; }; #endif - - // Massage the strings, images and style sections. loadStrings( m_strings, doc, "strings", expand ); - loadStrings( m_images, doc, "images", [ & ]( const QString& s ) -> QString { + loadStrings( m_images, doc, "images", [&]( const QString& s ) -> QString { // See also image() const QString imageName( expand( s ) ); QFileInfo imageFi( componentDir.absoluteFilePath( imageName ) ); @@ -214,58 +221,19 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent ) // Not found, bail out with the filename used if ( icon.isNull() ) { - bail( QString( "Image file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) ); + bail( m_descriptorPath, + QString( "Image file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) ); } return imageName; // Not turned into a path } return imageFi.absoluteFilePath(); } ); loadStrings( m_style, doc, "style", []( const QString& s ) -> QString { return s; } ); - - if ( doc[ "slideshow" ].IsSequence() ) - { - QStringList slideShowPictures; - doc[ "slideshow" ] >> slideShowPictures; - for ( int i = 0; i < slideShowPictures.count(); ++i ) - { - QString pathString = slideShowPictures[ i ]; - QFileInfo imageFi( componentDir.absoluteFilePath( pathString ) ); - if ( !imageFi.exists() ) - { - bail( QString( "Slideshow file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) ); - } - - slideShowPictures[ i ] = imageFi.absoluteFilePath(); - } - - //FIXME: implement a GenericSlideShow.qml that uses these slideShowPictures - } - else if ( doc[ "slideshow" ].IsScalar() ) - { - QString slideshowPath = QString::fromStdString( doc[ "slideshow" ].as< std::string >() ); - QFileInfo slideshowFi( componentDir.absoluteFilePath( slideshowPath ) ); - if ( !slideshowFi.exists() || !slideshowFi.fileName().toLower().endsWith( ".qml" ) ) - bail( QString( "Slideshow file %1 does not exist or is not a valid QML file." ) - .arg( slideshowFi.absoluteFilePath() ) ); - m_slideshowPath = slideshowFi.absoluteFilePath(); - } - else - { - bail( "Syntax error in slideshow sequence." ); - } - - int api = doc[ "slideshowAPI" ].IsScalar() ? doc[ "slideshowAPI" ].as< int >() : -1; - if ( ( api < 1 ) || ( api > 2 ) ) - { - cWarning() << "Invalid or missing *slideshowAPI* in branding file."; - api = 1; - } - m_slideshowAPI = api; } catch ( YAML::Exception& e ) { CalamaresUtils::explainYamlException( e, ba, file.fileName() ); - bail( e.what() ); + bail( m_descriptorPath, e.what() ); } QDir translationsDir( componentDir.filePath( "lang" ) ); @@ -423,8 +391,11 @@ flavorAndSide( const YAML::Node& doc, const char* key, Branding::PanelFlavor& fl static const NamedEnumTable< PanelFlavor > sidebarFlavorNames { { QStringLiteral( "widget" ), PanelFlavor::Widget }, { QStringLiteral( "none" ), PanelFlavor::None }, - { QStringLiteral( "hidden" ), PanelFlavor::None }, + { QStringLiteral( "hidden" ), PanelFlavor::None } +#ifdef WITH_QML + , { QStringLiteral( "qml" ), PanelFlavor::Qml } +#endif }; static const NamedEnumTable< PanelSide > panelSideNames { { QStringLiteral( "left" ), PanelSide::Left }, @@ -540,12 +511,62 @@ Branding::initSimpleSettings( const YAML::Node& doc ) } } - -[[noreturn]] void -Branding::bail( const QString& message ) +void +Branding::initSlideshowSettings( const YAML::Node& doc ) { - cError() << "FATAL in" << m_descriptorPath << Logger::Continuation << Logger::NoQuote {} << message; - ::exit( EXIT_FAILURE ); + QDir componentDir( componentDirectory() ); + + if ( doc[ "slideshow" ].IsSequence() ) + { + QStringList slideShowPictures; + doc[ "slideshow" ] >> slideShowPictures; + for ( int i = 0; i < slideShowPictures.count(); ++i ) + { + QString pathString = slideShowPictures[ i ]; + QFileInfo imageFi( componentDir.absoluteFilePath( pathString ) ); + if ( !imageFi.exists() ) + { + bail( m_descriptorPath, + QString( "Slideshow file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) ); + } + + slideShowPictures[ i ] = imageFi.absoluteFilePath(); + } + + m_slideshowFilenames = slideShowPictures; + m_slideshowAPI = -1; + } +#ifdef WITH_QML + else if ( doc[ "slideshow" ].IsScalar() ) + { + QString slideshowPath = QString::fromStdString( doc[ "slideshow" ].as< std::string >() ); + QFileInfo slideshowFi( componentDir.absoluteFilePath( slideshowPath ) ); + if ( !slideshowFi.exists() || !slideshowFi.fileName().toLower().endsWith( ".qml" ) ) + bail( m_descriptorPath, + QString( "Slideshow file %1 does not exist or is not a valid QML file." ) + .arg( slideshowFi.absoluteFilePath() ) ); + m_slideshowPath = slideshowFi.absoluteFilePath(); + + // API choice is relevant for QML slideshow + int api = doc[ "slideshowAPI" ].IsScalar() ? doc[ "slideshowAPI" ].as< int >() : -1; + if ( ( api < 1 ) || ( api > 2 ) ) + { + cWarning() << "Invalid or missing *slideshowAPI* in branding file."; + api = 1; + } + m_slideshowAPI = api; + } +#else + else if ( doc[ "slideshow" ].IsScalar() ) + { + cWarning() << "Invalid *slideshow* setting, must be list of images."; + } +#endif + else + { + bail( m_descriptorPath, "Syntax error in slideshow sequence." ); + } } + } // namespace Calamares diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index ce694a644..e84e23680 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -22,8 +22,8 @@ #ifndef BRANDING_H #define BRANDING_H +#include "CalamaresConfig.h" #include "DllMacro.h" - #include "utils/NamedSuffix.h" #include @@ -131,8 +131,11 @@ public: enum class PanelFlavor { None, - Widget, + Widget +#ifdef WITH_QML + , Qml +#endif }; Q_ENUM( PanelFlavor ) ///@brief Where to place a panel (sidebar, navigation) @@ -165,8 +168,16 @@ public: */ QString translationsDirectory() const { return m_translationsPathPrefix; } - /** @brief Path to the slideshow QML file, if any. */ + /** @brief Path to the slideshow QML file, if any. (API == 1 or 2)*/ QString slideshowPath() const { return m_slideshowPath; } + /// @brief List of pathnames of slideshow images, if any. (API == -1) + QStringList slideshowImages() const { return m_slideshowFilenames; } + /** @brief Which slideshow API to use for the slideshow? + * + * - 2 For QML-based slideshows loaded asynchronously (current) + * - 1 For QML-based slideshows, loaded when shown (legacy) + * - -1 For oldschool image-slideshows. + */ int slideshowAPI() const { return m_slideshowAPI; } QPixmap image( Branding::ImageEntry imageEntry, const QSize& size ) const; @@ -230,19 +241,29 @@ private: static const QStringList s_imageEntryStrings; static const QStringList s_styleEntryStrings; - [[noreturn]] void bail( const QString& message ); - QString m_descriptorPath; // Path to descriptor (e.g. "/etc/calamares/default/branding.desc") QString m_componentName; // Matches last part of full path to containing directory QMap< QString, QString > m_strings; QMap< QString, QString > m_images; QMap< QString, QString > m_style; + + /* The slideshow can be done in one of two ways: + * - as a sequence of images + * - as a QML file + * The slideshow: setting selects which one is used. If it is + * a list (of filenames) then it is a sequence of images, and otherwise + * it is a QML file which is run. (For QML, the slideshow API is + * important). + */ + QStringList m_slideshowFilenames; QString m_slideshowPath; int m_slideshowAPI; QString m_translationsPathPrefix; /** @brief Initialize the simple settings below */ void initSimpleSettings( const YAML::Node& doc ); + ///@brief Initialize the slideshow settings, above + void initSlideshowSettings( const YAML::Node& doc ); bool m_welcomeStyleCalamares; bool m_welcomeExpandingLogo; diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index e813b0009..32fec2cb1 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -14,15 +14,15 @@ set( calamaresui_SOURCES utils/CalamaresUtilsGui.cpp utils/ImageRegistry.cpp utils/Paste.cpp - utils/Qml.cpp viewpages/BlankViewStep.cpp viewpages/ExecutionViewStep.cpp - viewpages/QmlViewStep.cpp + viewpages/Slideshow.cpp viewpages/ViewStep.cpp widgets/ClickableLabel.cpp widgets/FixedAspectRatioLabel.cpp + widgets/PrettyRadioButton.cpp widgets/WaitingWidget.cpp ${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp @@ -44,10 +44,6 @@ if( WITH_PYTHON ) endif() if( WITH_PYTHONQT ) - include_directories(${PYTHON_INCLUDE_DIRS}) - # *_DIRS because we also use extensions - include_directories(${PYTHONQT_INCLUDE_DIRS}) - list( APPEND calamaresui_SOURCES modulesystem/PythonQtViewModule.cpp utils/PythonQtUtils.cpp @@ -56,25 +52,33 @@ if( WITH_PYTHONQT ) viewpages/PythonQtGlobalStorageWrapper.cpp viewpages/PythonQtUtilsWrapper.cpp ) - set( OPTIONAL_PYTHON_LIBRARIES - ${PYTHON_LIBRARIES} - ${PYTHONQT_LIBRARIES} +endif() + +if( WITH_QML ) + list( APPEND calamaresui_SOURCES + utils/Qml.cpp + viewpages/QmlViewStep.cpp ) endif() calamares_add_library( calamaresui SOURCES ${calamaresui_SOURCES} EXPORT_MACRO UIDLLEXPORT_PRO - LINK_PRIVATE_LIBRARIES - ${OPTIONAL_PYTHON_LIBRARIES} LINK_LIBRARIES Qt5::Svg - Qt5::QuickWidgets RESOURCES libcalamaresui.qrc EXPORT CalamaresLibraryDepends VERSION ${CALAMARES_VERSION_SHORT} ) -if ( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 ) +if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 ) target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease ) endif() +if( WITH_PYTHONQT ) + # *_DIRS because we also use extensions + target_include_directories( calamaresui PRIVATE ${PYTHON_INCLUDE_DIRS} ${PYTHONQT_INCLUDE_DIRS} ) + target_link_libraries( calamaresui PRIVATE ${PYTHON_LIBRARIES} ${PYTHONQT_LIBRARIES} ) +endif() +if( WITH_QML ) + target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets ) +endif() diff --git a/src/libcalamaresui/modulesystem/CppJobModule.cpp b/src/libcalamaresui/modulesystem/CppJobModule.cpp index 2eddeda86..632a9dcb8 100644 --- a/src/libcalamaresui/modulesystem/CppJobModule.cpp +++ b/src/libcalamaresui/modulesystem/CppJobModule.cpp @@ -52,14 +52,14 @@ CppJobModule::loadSelf() CalamaresPluginFactory* pf = qobject_cast< CalamaresPluginFactory* >( m_loader->instance() ); if ( !pf ) { - cDebug() << Q_FUNC_INFO << m_loader->errorString(); + cDebug() << "Could not load module:" << m_loader->errorString(); return; } CppJob* cppJob = pf->create< Calamares::CppJob >(); if ( !cppJob ) { - cDebug() << Q_FUNC_INFO << m_loader->errorString(); + cDebug() << "Could not load module:" << m_loader->errorString(); return; } // cDebug() << "CppJobModule loading self for instance" << instanceKey() diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index b6040371b..0b83e4d9b 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -300,22 +300,12 @@ ModuleManager::loadModules() continue; } - if ( !checkModuleDependencies( *thisModule ) ) + if ( !addModule( thisModule ) ) { // Error message is already printed failedModules.append( instanceKey.toString() ); continue; } - - // If it's a ViewModule, it also appends the ViewStep to the ViewManager. - thisModule->loadSelf(); - m_loadedModulesByInstanceKey.insert( instanceKey, thisModule ); - if ( !thisModule->isLoaded() ) - { - cError() << "Module" << instanceKey.toString() << "loading FAILED."; - failedModules.append( instanceKey.toString() ); - continue; - } } // At this point we most certainly have a pointer to a loaded module in @@ -345,6 +335,40 @@ ModuleManager::loadModules() } } +bool +ModuleManager::addModule( Module *module ) +{ + if ( !module ) + { + return false; + } + if ( !module->instanceKey().isValid() ) + { + cWarning() << "Module" << module->location() << '@' << (void*)module << "has invalid instance key."; + return false; + } + if ( !checkModuleDependencies( *module ) ) + { + return false; + } + + if ( !module->isLoaded() ) + { + module->loadSelf(); + } + + // Even if the load failed, we keep the module, so that if it tried to + // get loaded **again**, we already know. + m_loadedModulesByInstanceKey.insert( module->instanceKey(), module ); + if ( !module->isLoaded() ) + { + cError() << "Module" << module->instanceKey().toString() << "loading FAILED."; + return false; + } + + return true; +} + void ModuleManager::checkRequirements() { @@ -358,7 +382,6 @@ ModuleManager::checkRequirements() } RequirementsChecker* rq = new RequirementsChecker( modules, m_requirementsModel, this ); - connect( rq, &RequirementsChecker::requirementsProgress, this, &ModuleManager::requirementsProgress ); connect( rq, &RequirementsChecker::done, rq, &RequirementsChecker::deleteLater ); connect( rq, &RequirementsChecker::done, this, [=](){ this->requirementsComplete( m_requirementsModel->satisfiedMandatory() ); } ); @@ -415,6 +438,12 @@ ModuleManager::checkDependencies() bool ModuleManager::checkModuleDependencies( const Module& m ) { + if ( !m_availableDescriptorsByModuleName.contains( m.name() ) ) + { + cWarning() << "Module" << m.name() << "loaded externally, no dependency information."; + return true; + } + bool allRequirementsFound = true; QStringList requiredModules = m_availableDescriptorsByModuleName[ m.name() ].value( "requiredModules" ).toStringList(); diff --git a/src/libcalamaresui/modulesystem/ModuleManager.h b/src/libcalamaresui/modulesystem/ModuleManager.h index 2c2685a3a..2c51e70f7 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.h +++ b/src/libcalamaresui/modulesystem/ModuleManager.h @@ -85,6 +85,14 @@ public: */ void loadModules(); + /** + * @brief Adds a single module (loaded by some other means) + * + * Returns @c true on success (that is, the module's dependencies + * are satisfied, it wasn't already loaded, ...). + */ + bool addModule( Module* ); + /** * @brief Starts asynchronous requirements checking for each module. * When this is done, the signal requirementsComplete is emitted. @@ -100,7 +108,6 @@ signals: void modulesFailed( QStringList ); /// .. or not // Below, see RequirementsChecker documentation void requirementsComplete( bool ); - void requirementsProgress( const QString& ); private slots: void doInit(); diff --git a/src/libcalamaresui/modulesystem/ViewModule.cpp b/src/libcalamaresui/modulesystem/ViewModule.cpp index 02c771ee2..54a79ab66 100644 --- a/src/libcalamaresui/modulesystem/ViewModule.cpp +++ b/src/libcalamaresui/modulesystem/ViewModule.cpp @@ -53,14 +53,14 @@ ViewModule::loadSelf() CalamaresPluginFactory* pf = qobject_cast< CalamaresPluginFactory* >( m_loader->instance() ); if ( !pf ) { - cWarning() << Q_FUNC_INFO << "No factory:" << m_loader->errorString(); + cWarning() << "No factory:" << m_loader->errorString(); return; } m_viewStep = pf->create< Calamares::ViewStep >(); if ( !m_viewStep ) { - cWarning() << Q_FUNC_INFO << "create() failed" << m_loader->errorString(); + cWarning() << "create() failed" << m_loader->errorString(); return; } } @@ -76,7 +76,7 @@ ViewModule::loadSelf() } else { - cWarning() << Q_FUNC_INFO << "No view step was created"; + cWarning() << "No view step was created"; } } diff --git a/src/libcalamaresui/utils/CalamaresUtilsGui.cpp b/src/libcalamaresui/utils/CalamaresUtilsGui.cpp index bd15d7a68..680673a22 100644 --- a/src/libcalamaresui/utils/CalamaresUtilsGui.cpp +++ b/src/libcalamaresui/utils/CalamaresUtilsGui.cpp @@ -207,6 +207,10 @@ unmarginLayout( QLayout* layout ) int defaultFontSize() { + if ( s_defaultFontSize <= 0 ) + { + s_defaultFontSize = QFont().pointSize(); + } return s_defaultFontSize; } diff --git a/src/libcalamaresui/utils/ImageRegistry.cpp b/src/libcalamaresui/utils/ImageRegistry.cpp index 1778de745..ebe6858dd 100644 --- a/src/libcalamaresui/utils/ImageRegistry.cpp +++ b/src/libcalamaresui/utils/ImageRegistry.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * SPDX-License-Identifier: GPLv3+ + * SPDX-License-Identifier: GPL-3.0-or-later * License-Filename: LICENSES/GPLv3+-ImageRegistry * * Copyright 2019, Adriaan de Groot diff --git a/src/libcalamaresui/utils/ImageRegistry.h b/src/libcalamaresui/utils/ImageRegistry.h index f73ee36e6..5378d71e7 100644 --- a/src/libcalamaresui/utils/ImageRegistry.h +++ b/src/libcalamaresui/utils/ImageRegistry.h @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * SPDX-License-Identifier: GPLv3+ + * SPDX-License-Identifier: GPL-3.0-or-later * License-Filename: LICENSES/GPLv3+-ImageRegistry * * Copyright 2019, Adriaan de Groot diff --git a/src/libcalamaresui/utils/Qml.cpp b/src/libcalamaresui/utils/Qml.cpp index 5f3264da9..4f53aa317 100644 --- a/src/libcalamaresui/utils/Qml.cpp +++ b/src/libcalamaresui/utils/Qml.cpp @@ -21,7 +21,9 @@ #include "Branding.h" #include "GlobalStorage.h" #include "JobQueue.h" +#include "Settings.h" #include "ViewManager.h" +#include "utils/Dirs.h" #include "utils/Logger.h" #include @@ -30,11 +32,81 @@ #include #include +static QDir s_qmlModulesDir( QString( CMAKE_INSTALL_FULL_DATADIR ) + "/qml" ); + namespace CalamaresUtils { +QDir +qmlModulesDir() +{ + return s_qmlModulesDir; +} void -callQMLFunction( QQuickItem* qmlObject, const char* method ) +setQmlModulesDir( const QDir& dir ) +{ + s_qmlModulesDir = dir; +} + +static QStringList +qmlDirCandidates( bool assumeBuilddir ) +{ + static const char QML[] = "qml"; + + QStringList qmlDirs; + if ( CalamaresUtils::isAppDataDirOverridden() ) + { + qmlDirs << CalamaresUtils::appDataDir().absoluteFilePath( QML ); + } + else + { + if ( assumeBuilddir ) + { + qmlDirs << QDir::current().absoluteFilePath( "src/qml" ); // In build-dir + } + if ( CalamaresUtils::haveExtraDirs() ) + for ( auto s : CalamaresUtils::extraDataDirs() ) + { + qmlDirs << ( s + QML ); + } + qmlDirs << CalamaresUtils::appDataDir().absoluteFilePath( QML ); + } + + return qmlDirs; +} + +bool +initQmlModulesDir() +{ + QStringList qmlDirCandidatesByPriority + = qmlDirCandidates( Calamares::Settings::instance() && Calamares::Settings::instance()->debugMode() ); + + for ( const QString& path : qmlDirCandidatesByPriority ) + { + QDir dir( path ); + if ( dir.exists() && dir.isReadable() ) + { + cDebug() << "Using Calamares QML directory" << dir.absolutePath(); + CalamaresUtils::setQmlModulesDir( dir ); + return true; + } + } + + cError() << "Cowardly refusing to continue startup without a QML directory." + << Logger::DebugList( qmlDirCandidatesByPriority ); + if ( CalamaresUtils::isAppDataDirOverridden() ) + { + cError() << "FATAL: explicitly configured application data directory is missing qml/"; + } + else + { + cError() << "FATAL: none of the expected QML paths exist."; + } + return false; +} + +void +callQmlFunction( QQuickItem* qmlObject, const char* method ) { QByteArray methodSignature( method ); methodSignature.append( "()" ); @@ -71,14 +143,14 @@ addExpansions( QmlSearch method, QStringList& candidates, const QStringList& nam std::transform( names.constBegin(), names.constEnd(), std::back_inserter( candidates ), - [ & ]( const QString& s ) { return s.isEmpty() ? QString() : bPath.arg( brandDir, s ); } ); + [&]( const QString& s ) { return s.isEmpty() ? QString() : bPath.arg( brandDir, s ); } ); } if ( ( method == QmlSearch::Both ) || ( method == QmlSearch::QrcOnly ) ) { std::transform( names.constBegin(), names.constEnd(), std::back_inserter( candidates ), - [ & ]( const QString& s ) { return s.isEmpty() ? QString() : qrPath.arg( s ); } ); + [&]( const QString& s ) { return s.isEmpty() ? QString() : qrPath.arg( s ); } ); } } @@ -149,7 +221,7 @@ qmlSearchNames() } void -registerCalamaresModels() +registerQmlModels() { static bool done = false; if ( !done ) diff --git a/src/libcalamaresui/utils/Qml.h b/src/libcalamaresui/utils/Qml.h index 33b44b9ea..a3fc6d114 100644 --- a/src/libcalamaresui/utils/Qml.h +++ b/src/libcalamaresui/utils/Qml.h @@ -24,10 +24,25 @@ #include "modulesystem/InstanceKey.h" #include "utils/NamedEnum.h" +#include + class QQuickItem; namespace CalamaresUtils { +/// @brief the extra directory where Calamares searches for QML files +UIDLLEXPORT QDir qmlModulesDir(); +/// @brief sets specific directory for searching for QML files +UIDLLEXPORT void setQmlModulesDir( const QDir& dir ); + +/** @brief initialize QML search path with branding directories + * + * Picks a suitable branding directory (from the build-dir in debug mode, + * otherwise based on the branding directory) and adds it to the + * QML modules directory; returns @c false if none is found. + */ +UIDLLEXPORT bool initQmlModulesDir(); + /** @brief Sets up global Calamares models for QML * * This needs to be called at least once to make the global Calamares @@ -40,7 +55,7 @@ namespace CalamaresUtils * Additionally, modules based on QmlViewStep have a context * property `config` referring to that module's configuration (if any). */ -UIDLLEXPORT void registerCalamaresModels(); +UIDLLEXPORT void registerQmlModels(); /** @brief Calls the QML method @p method on @p qmlObject * @@ -50,7 +65,7 @@ UIDLLEXPORT void registerCalamaresModels(); * * If there is a return value from the QML method, it is logged (but not otherwise used). */ -UIDLLEXPORT void callQMLFunction( QQuickItem* qmlObject, const char* method ); +UIDLLEXPORT void callQmlFunction( QQuickItem* qmlObject, const char* method ); /** @brief Search modes for loading Qml files. * @@ -66,7 +81,7 @@ enum class QmlSearch Both }; -///@brief Names for the search terms (in config files) +/// @brief Names for the search terms (in config files) UIDLLEXPORT const NamedEnumTable< QmlSearch >& qmlSearchNames(); /** @brief Find a suitable QML file, given the search method and name hints diff --git a/src/libcalamaresui/viewpages/ExecutionViewStep.cpp b/src/libcalamaresui/viewpages/ExecutionViewStep.cpp index c9bc4b8c3..2dd4b79df 100644 --- a/src/libcalamaresui/viewpages/ExecutionViewStep.cpp +++ b/src/libcalamaresui/viewpages/ExecutionViewStep.cpp @@ -20,12 +20,14 @@ #include "ExecutionViewStep.h" +#include "Slideshow.h" + #include "Branding.h" +#include "CalamaresConfig.h" #include "Job.h" #include "JobQueue.h" #include "Settings.h" #include "ViewManager.h" - #include "modulesystem/Module.h" #include "modulesystem/ModuleManager.h" #include "utils/CalamaresUtilsGui.h" @@ -37,12 +39,28 @@ #include #include #include -#include -#include -#include -#include #include +static Calamares::Slideshow* +makeSlideshow( QWidget* parent ) +{ + const int api = Calamares::Branding::instance()->slideshowAPI(); + switch ( api ) + { + case -1: + return new Calamares::SlideshowPictures( parent ); +#ifdef WITH_QML + case 1: + FALLTHRU; + case 2: + return new Calamares::SlideshowQML( parent ); +#endif + default: + cWarning() << "Unknown Branding slideshow API" << api; + return new Calamares::SlideshowPictures( parent ); + } +} + namespace Calamares { @@ -51,20 +69,14 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent ) , m_widget( new QWidget ) , m_progressBar( new QProgressBar ) , m_label( new QLabel ) - , m_qmlShow( new QQuickWidget ) - , m_qmlComponent( nullptr ) - , m_qmlObject( nullptr ) + , m_slideshow( makeSlideshow( m_widget ) ) { QVBoxLayout* layout = new QVBoxLayout( m_widget ); QVBoxLayout* innerLayout = new QVBoxLayout; m_progressBar->setMaximum( 10000 ); - m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - m_qmlShow->setResizeMode( QQuickWidget::SizeRootObjectToView ); - m_qmlShow->engine()->addImportPath( CalamaresUtils::qmlModulesDir().absolutePath() ); - - layout->addWidget( m_qmlShow ); + layout->addWidget( m_slideshow->widget() ); CalamaresUtils::unmarginLayout( layout ); layout->addLayout( innerLayout ); @@ -72,17 +84,7 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent ) innerLayout->addWidget( m_progressBar ); innerLayout->addWidget( m_label ); - cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() ); - if ( Branding::instance()->slideshowAPI() == 2 ) - { - cDebug() << "QML load on startup, API 2."; - loadQmlV2(); - } - connect( JobQueue::instance(), &JobQueue::progress, this, &ExecutionViewStep::updateFromJobQueue ); -#if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 ) - CALAMARES_RETRANSLATE( m_qmlShow->engine()->retranslate(); ) -#endif } @@ -139,108 +141,10 @@ ExecutionViewStep::isAtEnd() const return !JobQueue::instance()->isRunning(); } -void -ExecutionViewStep::loadQmlV2() -{ - if ( !m_qmlComponent && !Calamares::Branding::instance()->slideshowPath().isEmpty() ) - { - m_qmlComponent = new QQmlComponent( m_qmlShow->engine(), - QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ), - QQmlComponent::CompilationMode::Asynchronous ); - connect( m_qmlComponent, &QQmlComponent::statusChanged, this, &ExecutionViewStep::loadQmlV2Complete ); - } -} - -/// @brief State-change of the slideshow, for changeSlideShowState() -enum class Slideshow -{ - Start, - Stop -}; - -/** @brief Tells the slideshow we activated or left the show. - * - * If @p state is @c Slideshow::Start, calls suitable activation procedures. - * If @p state is @c Slideshow::Stop, calls deactivation procedures. - * - * Applies V1 and V2 QML activation / deactivation: - * - V1 loads the QML in @p widget on activation. Sets root object property - * *activatedInCalamares* as appropriate. - * - V2 calls onActivate() or onLeave() in the QML as appropriate. Also - * sets the *activatedInCalamares* property. - */ -static void -changeSlideShowState( Slideshow state, QQuickItem* slideshow, QQuickWidget* widget ) -{ - bool activate = state == Slideshow::Start; - - if ( Branding::instance()->slideshowAPI() == 2 ) - { - // The QML was already loaded in the constructor, need to start it - CalamaresUtils::callQMLFunction( slideshow, activate ? "onActivate" : "onLeave" ); - } - else if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) - { - // API version 1 assumes onCompleted is the trigger - if ( activate ) - { - widget->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) ); - } - // needs the root object for property setting, below - slideshow = widget->rootObject(); - } - - // V1 API has picked up the root object for use, V2 passed it in. - if ( slideshow ) - { - static const char propertyName[] = "activatedInCalamares"; - auto property = slideshow->property( propertyName ); - if ( property.isValid() && ( property.type() == QVariant::Bool ) && ( property.toBool() != activate ) ) - { - slideshow->setProperty( propertyName, activate ); - } - } -} - -void -ExecutionViewStep::loadQmlV2Complete() -{ - if ( m_qmlComponent && m_qmlComponent->isReady() && !m_qmlObject ) - { - cDebug() << "QML component complete, API 2"; - // Don't do this again - disconnect( m_qmlComponent, &QQmlComponent::statusChanged, this, &ExecutionViewStep::loadQmlV2Complete ); - - QObject* o = m_qmlComponent->create(); - m_qmlObject = qobject_cast< QQuickItem* >( o ); - if ( !m_qmlObject ) - { - delete o; - } - else - { - cDebug() << Logger::SubEntry << "Loading" << Calamares::Branding::instance()->slideshowPath(); - - // setContent() is public API, but not documented publicly. - // It is marked \internal in the Qt sources, but does exactly - // what is needed: sets up visual parent by replacing the root - // item, and handling resizes. - m_qmlShow->setContent( - QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ), m_qmlComponent, m_qmlObject ); - if ( ViewManager::instance()->currentStep() == this ) - { - // We're alreay visible! Must have been slow QML loading, and we - // passed onActivate already. - changeSlideShowState( Slideshow::Start, m_qmlObject, m_qmlShow ); - } - } - } -} - void ExecutionViewStep::onActivate() { - changeSlideShowState( Slideshow::Start, m_qmlObject, m_qmlShow ); + m_slideshow->changeSlideShowState( Slideshow::Start ); JobQueue* queue = JobQueue::instance(); foreach ( const QString& instanceKey, m_jobInstanceKeys ) @@ -288,13 +192,7 @@ ExecutionViewStep::updateFromJobQueue( qreal percent, const QString& message ) void ExecutionViewStep::onLeave() { - changeSlideShowState( Slideshow::Stop, m_qmlObject, m_qmlShow ); - // API version 2 is explicitly stopped; version 1 keeps running - if ( Branding::instance()->slideshowAPI() == 2 ) - { - delete m_qmlObject; - m_qmlObject = nullptr; - } + m_slideshow->changeSlideShowState( Slideshow::Stop ); } } // namespace Calamares diff --git a/src/libcalamaresui/viewpages/ExecutionViewStep.h b/src/libcalamaresui/viewpages/ExecutionViewStep.h index e797c3cb2..48604fe93 100644 --- a/src/libcalamaresui/viewpages/ExecutionViewStep.h +++ b/src/libcalamaresui/viewpages/ExecutionViewStep.h @@ -27,13 +27,12 @@ class QLabel; class QObject; class QProgressBar; -class QQmlComponent; -class QQuickItem; -class QQuickWidget; namespace Calamares { +class Slideshow; + class ExecutionViewStep : public ViewStep { Q_OBJECT @@ -60,20 +59,14 @@ public: void appendJobModuleInstanceKey( const QString& instanceKey ); -public slots: - void loadQmlV2Complete(); - private: QWidget* m_widget; QProgressBar* m_progressBar; QLabel* m_label; - QQuickWidget* m_qmlShow; - QQmlComponent* m_qmlComponent; - QQuickItem* m_qmlObject; ///< The actual show + Slideshow* m_slideshow; QStringList m_jobInstanceKeys; - void loadQmlV2(); ///< Loads the slideshow QML (from branding) for API version 2 void updateFromJobQueue( qreal percent, const QString& message ); }; diff --git a/src/libcalamaresui/viewpages/QmlViewStep.cpp b/src/libcalamaresui/viewpages/QmlViewStep.cpp index f92ef47e7..2234c230a 100644 --- a/src/libcalamaresui/viewpages/QmlViewStep.cpp +++ b/src/libcalamaresui/viewpages/QmlViewStep.cpp @@ -58,7 +58,7 @@ changeQMLState( QMLAction action, QQuickItem* item ) static const char propertyName[] = "activatedInCalamares"; bool activate = action == QMLAction::Start; - CalamaresUtils::callQMLFunction( item, activate ? "onActivate" : "onLeave" ); + CalamaresUtils::callQmlFunction( item, activate ? "onActivate" : "onLeave" ); auto property = item->property( propertyName ); if ( property.isValid() && ( property.type() == QVariant::Bool ) && ( property.toBool() != activate ) ) @@ -76,7 +76,7 @@ QmlViewStep::QmlViewStep( QObject* parent ) , m_spinner( new WaitingWidget( tr( "Loading ..." ) ) ) , m_qmlWidget( new QQuickWidget ) { - CalamaresUtils::registerCalamaresModels(); + CalamaresUtils::registerQmlModels(); QVBoxLayout* layout = new QVBoxLayout( m_widget ); layout->addWidget( m_spinner ); diff --git a/src/libcalamaresui/viewpages/Slideshow.cpp b/src/libcalamaresui/viewpages/Slideshow.cpp new file mode 100644 index 000000000..0c75dc390 --- /dev/null +++ b/src/libcalamaresui/viewpages/Slideshow.cpp @@ -0,0 +1,285 @@ +/* === This file is part of Calamares - === + * + * Copyright 2014, Aurélien Gâteau + * Copyright 2014-2015, Teo Mrnjavac + * Copyright 2018, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +#include "Slideshow.h" + +#include "Branding.h" +#include "utils/Dirs.h" +#include "utils/Logger.h" +#ifdef WITH_QML +#include "utils/Qml.h" +#endif +#include "utils/Retranslator.h" + +#include +#include +#ifdef WITH_QML +#include +#include +#include +#include +#endif +#include + +#include + +namespace Calamares +{ + +Slideshow::~Slideshow() {} + +#ifdef WITH_QML +SlideshowQML::SlideshowQML( QWidget* parent ) + : Slideshow( parent ) + , m_qmlShow( new QQuickWidget ) + , m_qmlComponent( nullptr ) + , m_qmlObject( nullptr ) +{ + CalamaresUtils::registerQmlModels(); + + m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_qmlShow->setResizeMode( QQuickWidget::SizeRootObjectToView ); + m_qmlShow->engine()->addImportPath( CalamaresUtils::qmlModulesDir().absolutePath() ); + + cDebug() << "QML import paths:" << Logger::DebugList( m_qmlShow->engine()->importPathList() ); +#if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 ) + CALAMARES_RETRANSLATE( if ( m_qmlShow ) { m_qmlShow->engine()->retranslate(); } ) +#endif + + if ( Branding::instance()->slideshowAPI() == 2 ) + { + cDebug() << "QML load on startup, API 2."; + loadQmlV2(); + } +} + +SlideshowQML::~SlideshowQML() +{ + delete m_qmlObject; + delete m_qmlComponent; + delete m_qmlShow; +} + +QWidget* +SlideshowQML::widget() +{ + return m_qmlShow; +} + +void +SlideshowQML::loadQmlV2() +{ + QMutexLocker l( &m_mutex ); + if ( !m_qmlComponent && !Calamares::Branding::instance()->slideshowPath().isEmpty() ) + { + m_qmlComponent = new QQmlComponent( m_qmlShow->engine(), + QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ), + QQmlComponent::CompilationMode::Asynchronous ); + connect( m_qmlComponent, &QQmlComponent::statusChanged, this, &SlideshowQML::loadQmlV2Complete ); + } +} + +void +SlideshowQML::loadQmlV2Complete() +{ + QMutexLocker l( &m_mutex ); + if ( m_qmlComponent && m_qmlComponent->isReady() && !m_qmlObject ) + { + cDebug() << "QML component complete, API 2"; + // Don't do this again + disconnect( m_qmlComponent, &QQmlComponent::statusChanged, this, &SlideshowQML::loadQmlV2Complete ); + + QObject* o = m_qmlComponent->create(); + m_qmlObject = qobject_cast< QQuickItem* >( o ); + if ( !m_qmlObject ) + { + delete o; + } + else + { + cDebug() << Logger::SubEntry << "Loading" << Calamares::Branding::instance()->slideshowPath(); + + // setContent() is public API, but not documented publicly. + // It is marked \internal in the Qt sources, but does exactly + // what is needed: sets up visual parent by replacing the root + // item, and handling resizes. + m_qmlShow->setContent( + QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ), m_qmlComponent, m_qmlObject ); + if ( isActive() ) + { + // We're alreay visible! Must have been slow QML loading, and we + // passed onActivate already. changeSlideShowState() locks + // the same mutex: we could set up a workaround to call + // changeSlideShowState() later after destruction of l. + // + l.unlock(); + changeSlideShowState( Slideshow::Start ); + } + } + } + else + { + if ( m_qmlObject ) + { + cWarning() << "QML object already created"; + } + else if ( !m_qmlComponent ) + { + cWarning() << "QML component does not exist"; + } + else if ( m_qmlComponent && !m_qmlComponent->isReady() ) + { + cWarning() << "QML component not ready:" << m_qmlComponent->errors(); + } + } +} + +/* + * Applies V1 and V2 QML activation / deactivation: + * - V1 loads the QML in @p widget on activation. Sets root object property + * *activatedInCalamares* as appropriate. + * - V2 calls onActivate() or onLeave() in the QML as appropriate. Also + * sets the *activatedInCalamares* property. + */ +void +SlideshowQML::changeSlideShowState( Action state ) +{ + QMutexLocker l( &m_mutex ); + bool activate = state == Slideshow::Start; + + if ( Branding::instance()->slideshowAPI() == 2 ) + { + // The QML was already loaded in the constructor, need to start it + CalamaresUtils::callQmlFunction( m_qmlObject, activate ? "onActivate" : "onLeave" ); + } + else if ( !Calamares::Branding::instance()->slideshowPath().isEmpty() ) + { + // API version 1 assumes onCompleted is the trigger + if ( activate ) + { + m_qmlShow->setSource( QUrl::fromLocalFile( Calamares::Branding::instance()->slideshowPath() ) ); + } + // needs the root object for property setting, below + m_qmlObject = m_qmlShow->rootObject(); + } + + // V1 API has picked up the root object for use, V2 passed it in. + if ( m_qmlObject ) + { + static const char propertyName[] = "activatedInCalamares"; + auto property = m_qmlObject->property( propertyName ); + if ( property.isValid() && ( property.type() == QVariant::Bool ) && ( property.toBool() != activate ) ) + { + m_qmlObject->setProperty( propertyName, activate ); + } + } + + if ( ( Branding::instance()->slideshowAPI() == 2 ) && ( state == Slideshow::Stop ) ) + { + delete m_qmlObject; + m_qmlObject = nullptr; + } + + m_state = state; +} +#endif + +SlideshowPictures::SlideshowPictures( QWidget* parent ) + : Slideshow( parent ) + , m_label( new QLabel( parent ) ) + , m_timer( new QTimer( this ) ) + , m_imageIndex( 0 ) + , m_images( Branding::instance()->slideshowImages() ) +{ + m_label->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_label->setAlignment( Qt::AlignCenter ); + m_timer->setInterval( std::chrono::milliseconds( 2000 ) ); + connect( m_timer, &QTimer::timeout, this, &SlideshowPictures::next ); +} + +SlideshowPictures::~SlideshowPictures() +{ + delete m_timer; + delete m_label; +} + +QWidget* +SlideshowPictures::widget() +{ + return m_label; +} + +void +SlideshowPictures::changeSlideShowState( Calamares::Slideshow::Action a ) +{ + QMutexLocker l( &m_mutex ); + m_state = a; + if ( a == Slideshow::Start ) + { + m_imageIndex = -1; + if ( m_images.count() < 1 ) + { + m_label->setPixmap( QPixmap( ":/data/images/squid.svg" ) ); + } + else + { + + m_timer->start(); + QTimer::singleShot( 0, this, &SlideshowPictures::next ); + } + } + else + { + m_timer->stop(); + } +} + +void +SlideshowPictures::next() +{ + QMutexLocker l( &m_mutex ); + + if ( m_imageIndex < 0 ) + { + // Initialization, don't do the advance-by-one + m_imageIndex = 0; + } + else + { + m_imageIndex++; + if ( m_imageIndex >= m_images.count() ) + { + m_imageIndex = 0; + } + } + + if ( m_imageIndex >= m_images.count() ) + { + // Unusual case: timer is running, but we have 0 images to display. + // .. this would have been caught in changeSlideShowState(), which + // .. special-cases 0 images. + return; + } + + m_label->setPixmap( QPixmap( m_images.at( m_imageIndex ) ) ); +} + + +} // namespace Calamares diff --git a/src/libcalamaresui/viewpages/Slideshow.h b/src/libcalamaresui/viewpages/Slideshow.h new file mode 100644 index 000000000..f338d44e2 --- /dev/null +++ b/src/libcalamaresui/viewpages/Slideshow.h @@ -0,0 +1,148 @@ +/* === This file is part of Calamares - === + * + * Copyright 2014, Aurélien Gâteau + * Copyright 2014-2015, Teo Mrnjavac + * Copyright 2018, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +#ifndef LIBCALAMARESUI_SLIDESHOW_H +#define LIBCALAMARESUI_SLIDESHOW_H + +#include "CalamaresConfig.h" + +#include +#include +#include + +class QLabel; +class QTimer; +#ifdef WITH_QML +class QQmlComponent; +class QQuickItem; +class QQuickWidget; +#endif + +namespace Calamares +{ + +/** @brief API for Slideshow objects + * + * A Slideshow (subclass) object is created by the ExecutionViewStep + * and needs to manage its own configuration (e.g. from Branding). + * The slideshow is started and stopped when it becomes visible + * and when installation is over, by calling changeSlideShowState() + * as appropriate. + */ +class Slideshow : public QObject +{ + Q_OBJECT +public: + /// @brief State-change of the slideshow, for changeSlideShowState() + enum Action + { + Start, + Stop + }; + + Slideshow( QWidget* parent = nullptr ) + : QObject( parent ) + { + } + virtual ~Slideshow(); + + /// @brief Is the slideshow being shown **right now**? + bool isActive() const { return m_state == Start; } + + /** @brief The actual widget to show the user. + * + * Depending on the style of slideshow, this might be a QQuickWidget, + * or a QLabel, or something else entirely. + */ + virtual QWidget* widget() = 0; + + /** @brief Tells the slideshow we activated or left the show. + * + * If @p state is @c Slideshow::Start, calls suitable activation procedures. + * If @p state is @c Slideshow::Stop, calls deactivation procedures. + */ + virtual void changeSlideShowState( Action a ) = 0; + +protected: + QMutex m_mutex; + Action m_state = Stop; +}; + +#ifdef WITH_QML +/** @brief Slideshow using a QML file + * + * This is the "classic" slideshow in Calamares, which runs some QML + * while the installation is in progress. It is configured through + * Branding settings *slideshow* and *slideshowAPI*, showing the QML + * file from *slideshow*. The API version influences when and how the + * QML is loaded; version 1 does so only when the slideshow is activated, + * while version 2 does so asynchronously. + */ +class SlideshowQML : public Slideshow +{ + Q_OBJECT +public: + SlideshowQML( QWidget* parent ); + virtual ~SlideshowQML() override; + + QWidget* widget() override; + void changeSlideShowState( Action a ) override; + +public slots: + void loadQmlV2Complete(); + void loadQmlV2(); ///< Loads the slideshow QML (from branding) for API version 2 + +private: + QQuickWidget* m_qmlShow; + QQmlComponent* m_qmlComponent; + QQuickItem* m_qmlObject; ///< The actual show +}; +#endif + +/** @brief Slideshow using images + * + * This is an "oldschool" slideshow, but new in Calamares, which + * displays static image files one-by-one. It is for systems that + * do not use QML at all. It is configured through the Branding + * setting *slideshow*. When using this widget, the setting must + * be a list of filenames; the API is set to -1. + */ +class SlideshowPictures : public Slideshow +{ + Q_OBJECT +public: + SlideshowPictures( QWidget* parent ); + virtual ~SlideshowPictures() override; + + QWidget* widget() override; + virtual void changeSlideShowState( Action a ) override; + +public slots: + void next(); + +private: + QLabel* m_label; + QTimer* m_timer; + int m_imageIndex; + QStringList m_images; +}; + +} // namespace Calamares +#endif diff --git a/src/libcalamaresui/widgets/ClickableLabel.cpp b/src/libcalamaresui/widgets/ClickableLabel.cpp index 6e6f54459..8f2323fa4 100644 --- a/src/libcalamaresui/widgets/ClickableLabel.cpp +++ b/src/libcalamaresui/widgets/ClickableLabel.cpp @@ -18,7 +18,10 @@ #include "ClickableLabel.h" -#include +#include // for doubleClickInterval() + +namespace Calamares +{ ClickableLabel::ClickableLabel( QWidget* parent ) @@ -53,3 +56,5 @@ ClickableLabel::mouseReleaseEvent( QMouseEvent* event ) emit clicked(); } } + +} // namespace Calamares diff --git a/src/libcalamaresui/widgets/ClickableLabel.h b/src/libcalamaresui/widgets/ClickableLabel.h index fd66082c5..f60a247ca 100644 --- a/src/libcalamaresui/widgets/ClickableLabel.h +++ b/src/libcalamaresui/widgets/ClickableLabel.h @@ -17,13 +17,25 @@ * along with Calamares. If not, see . */ -#ifndef CLICKABLELABEL_H -#define CLICKABLELABEL_H +#ifndef LIBCALAMARESUI_CLICKABLELABEL_H +#define LIBCALAMARESUI_CLICKABLELABEL_H +#include #include -#include -class ClickableLabel : public QLabel +#include "DllMacro.h" + +namespace Calamares +{ + +/** @brief A Label where the whole label area is clickable + * + * When clicking anywhere on the Label (text, background, whatever) + * the signal clicked() is emitted. Use this as a buddy for radio + * buttons or other clickable things where you want mouse interaction + * with the label, to be the same as mouse interaction with the control. + */ +class UIDLLEXPORT ClickableLabel : public QLabel { Q_OBJECT public: @@ -39,7 +51,9 @@ protected: virtual void mouseReleaseEvent( QMouseEvent* event ) override; private: - QTime m_time; + QElapsedTimer m_time; }; -#endif // CLICKABLELABEL_H +} // namespace Calamares + +#endif // LIBCALAMARESUI_CLICKABLELABEL_H diff --git a/src/modules/partition/gui/PrettyRadioButton.cpp b/src/libcalamaresui/widgets/PrettyRadioButton.cpp similarity index 80% rename from src/modules/partition/gui/PrettyRadioButton.cpp rename to src/libcalamaresui/widgets/PrettyRadioButton.cpp index 18627f41c..1cf348315 100644 --- a/src/modules/partition/gui/PrettyRadioButton.cpp +++ b/src/libcalamaresui/widgets/PrettyRadioButton.cpp @@ -21,11 +21,14 @@ #include "utils/CalamaresUtilsGui.h" #include "widgets/ClickableLabel.h" +#include #include #include #include #include +namespace Calamares +{ PrettyRadioButton::PrettyRadioButton( QWidget* parent ) : QWidget( parent ) @@ -45,10 +48,8 @@ PrettyRadioButton::PrettyRadioButton( QWidget* parent ) m_mainLayout->addWidget( m_label, 0, 1 ); m_mainLayout->setContentsMargins( 0, 0, 0, 0 ); - connect( m_label, &ClickableLabel::clicked, - m_radio, &QRadioButton::click ); - connect( m_radio, &QRadioButton::toggled, - this, &PrettyRadioButton::toggleOptions ); + connect( m_label, &ClickableLabel::clicked, m_radio, &QRadioButton::click ); + connect( m_radio, &QRadioButton::toggled, this, &PrettyRadioButton::toggleOptions ); } @@ -80,17 +81,33 @@ PrettyRadioButton::iconSize() const } -QRadioButton* -PrettyRadioButton::buttonWidget() const +void +PrettyRadioButton::setChecked( bool checked ) { - return m_radio; + m_radio->setChecked( checked ); } + +bool +PrettyRadioButton::isChecked() const +{ + return m_radio->isChecked(); +} + +void +PrettyRadioButton::addToGroup( QButtonGroup* group, int id ) +{ + group->addButton( m_radio, id ); +} + + void PrettyRadioButton::addOptionsComboBox( QComboBox* box ) { if ( !box ) + { return; + } if ( !m_optionsLayout ) { @@ -105,12 +122,16 @@ PrettyRadioButton::addOptionsComboBox( QComboBox* box ) toggleOptions( m_radio->isChecked() ); } - m_optionsLayout->insertWidget( m_optionsLayout->count()-1, box ); + m_optionsLayout->insertWidget( m_optionsLayout->count() - 1, box ); } void PrettyRadioButton::toggleOptions( bool toggle ) { if ( m_optionsLayout ) + { m_optionsLayout->parentWidget()->setVisible( toggle ); + } } + +} // namespace Calamares diff --git a/src/modules/partition/gui/PrettyRadioButton.h b/src/libcalamaresui/widgets/PrettyRadioButton.h similarity index 58% rename from src/modules/partition/gui/PrettyRadioButton.h rename to src/libcalamaresui/widgets/PrettyRadioButton.h index c88c00728..9c7139526 100644 --- a/src/modules/partition/gui/PrettyRadioButton.h +++ b/src/libcalamaresui/widgets/PrettyRadioButton.h @@ -16,41 +16,59 @@ * along with Calamares. If not, see . */ -#ifndef PRETTYRADIOBUTTON_H -#define PRETTYRADIOBUTTON_H +#ifndef LIBCALAMARESUI_PRETTYRADIOBUTTON_H +#define LIBCALAMARESUI_PRETTYRADIOBUTTON_H + +#include "DllMacro.h" #include -class ClickableLabel; +class QButtonGroup; class QComboBox; class QGridLayout; class QHBoxLayout; +namespace Calamares +{ +class ClickableLabel; + /** @brief A radio button with fancy label next to it. + * + * The fancy label is used so that the text alongside the radio + * button can word-wrap, be multi-line, and support rich text. * * The radio button itself can be retrieved with buttonWidget(), * and the whole behaves a lot like a label. Extra options can be * added to the display (options are hidden when the button is * not selected) with addOptionsComboBox(). */ -class PrettyRadioButton : public QWidget +class UIDLLEXPORT PrettyRadioButton : public QWidget { Q_OBJECT public: explicit PrettyRadioButton( QWidget* parent = nullptr ); - virtual ~PrettyRadioButton() {} + virtual ~PrettyRadioButton() { } - virtual void setText( const QString& text ); + /// @brief Passes @p text on to the ClickableLabel + void setText( const QString& text ); - virtual void setIconSize( const QSize& size ); + // Icon applies to the radio-button part + void setIconSize( const QSize& size ); + QSize iconSize() const; + void setIcon( const QIcon& icon ); - virtual void setIcon( const QIcon& icon ); + // Applies to the radio-button part + void setChecked( bool checked ); + bool isChecked() const; - virtual QSize iconSize() const; + /** @brief Adds the radio-button part to the given @p group + * + * For managing the pretty-radio-button in button groups like normal + * radio buttons, call addToGroup() rather that group->addButton(). + */ + void addToGroup( QButtonGroup* group, int id = -1 ); - virtual QRadioButton* buttonWidget() const; - - /** @brief Add an options drop-down to this button. */ + /// @brief Add an options drop-down to this button. void addOptionsComboBox( QComboBox* ); protected slots: @@ -64,4 +82,5 @@ protected: QHBoxLayout* m_optionsLayout; }; -#endif // PRETTYRADIOBUTTON_H +} // namespace Calamares +#endif // LIBCALAMARESUI_PRETTYRADIOBUTTON_H diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 674484527..87288b583 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -57,7 +57,6 @@ def get_uuid(): :return: """ - root_mount_point = libcalamares.globalstorage.value("rootMountPoint") partitions = libcalamares.globalstorage.value("partitions") for partition in partitions: diff --git a/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.mo b/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.mo index 248498cd7..19f444cdd 100644 Binary files a/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.mo and b/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.mo differ diff --git a/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.po b/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.po index d4b0f1355..373a4c3e9 100644 --- a/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.po +++ b/src/modules/dummypythonqt/lang/fa/LC_MESSAGES/dummypythonqt.po @@ -3,13 +3,17 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +# Translators: +# Danial Behzadi , 2020 +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-05 11:34-0400\n" +"POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2016-12-16 12:18+0000\n" +"Last-Translator: Danial Behzadi , 2020\n" "Language-Team: Persian (https://www.transifex.com/calamares/teams/20061/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,24 +23,24 @@ msgstr "" #: src/modules/dummypythonqt/main.py:84 msgid "Click me!" -msgstr "" +msgstr "کلیکم کنید!" #: src/modules/dummypythonqt/main.py:94 msgid "A new QLabel." -msgstr "" +msgstr "یک QLabel جدید." #: src/modules/dummypythonqt/main.py:97 msgid "Dummy PythonQt ViewStep" -msgstr "" +msgstr "گام نمایش PythonQt الکی" #: src/modules/dummypythonqt/main.py:183 msgid "The Dummy PythonQt Job" -msgstr "" +msgstr "کار PythonQt الکی" #: src/modules/dummypythonqt/main.py:186 msgid "This is the Dummy PythonQt Job. The dummy job says: {}" -msgstr "" +msgstr "این کار PythonQt الکی است. کار الکی می‌گوید: {}" #: src/modules/dummypythonqt/main.py:190 msgid "A status message for Dummy PythonQt Job." -msgstr "" +msgstr "پیام وضعیتی برای کار PythonQt الکی." diff --git a/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.mo b/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.mo index 75365c3b7..faf378083 100644 Binary files a/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.mo and b/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.mo differ diff --git a/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.po b/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.po index 7bbd86a27..41a0444c0 100644 --- a/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.po +++ b/src/modules/dummypythonqt/lang/id/LC_MESSAGES/dummypythonqt.po @@ -5,16 +5,16 @@ # # Translators: # Kukuh Syafaat , 2016 -# Wantoyo , 2017 +# Wantoyèk , 2017 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-05 11:34-0400\n" +"POT-Creation-Date: 2020-04-30 23:13+0200\n" "PO-Revision-Date: 2016-12-16 12:18+0000\n" -"Last-Translator: Wantoyo , 2017\n" +"Last-Translator: Wantoyèk , 2017\n" "Language-Team: Indonesian (https://www.transifex.com/calamares/teams/20061/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/src/modules/fstab/fstab.conf b/src/modules/fstab/fstab.conf index b2f3de361..ce38a184c 100644 --- a/src/modules/fstab/fstab.conf +++ b/src/modules/fstab/fstab.conf @@ -20,12 +20,25 @@ efiMountOptions: umask=0077 # If a filesystem is on an SSD, add the following options. If a specific # filesystem is listed here, use those options, otherwise no additional # options are set (i.e. there is no *default* like in *mountOptions*). +# +# This example configuration applies the *discard* option to most +# common filesystems on an SSD. This may not be the right option +# for your distribution. If you use a systemd timer to trim the +# SSD, it may interfere with the *discard* option. Opinions vary +# as to whether *discard* is worth the effort -- it depends on +# the usage pattern of the disk as well. +# +# ssdExtraMountOptions: +# ext4: discard +# jfs: discard +# xfs: discard +# swap: discard +# btrfs: discard,compress=lzo +# +# The standard configuration applies only lzo compression to btrfs +# and does nothing for other filesystems. ssdExtraMountOptions: - ext4: discard - jfs: discard - xfs: discard - swap: discard - btrfs: discard,compress=lzo + btrfs: compress=lzo # Additional options added to each line in /etc/crypttab crypttabOptions: luks diff --git a/src/modules/grubcfg/tests/CMakeTests.txt b/src/modules/grubcfg/tests/CMakeTests.txt new file mode 100644 index 000000000..299fccf07 --- /dev/null +++ b/src/modules/grubcfg/tests/CMakeTests.txt @@ -0,0 +1,12 @@ +# Special cases for grubcfg configuration tests: +# - 2.global specifies /tmp/calamares as the rootMountPath, +# so we end up editing files there. Create the directory +# beforehand, so the test doesn't blow up. +set(_grub_root /tmp/calamares/etc/default) +set(_grub_file ${_grub_root}/bogus) + +add_test( + NAME make-grubcfg-dirs + COMMAND ${CMAKE_COMMAND} -E make_directory ${_grub_root} + ) +set_tests_properties(load-grubcfg-2 PROPERTIES DEPENDS make-grubcfg-dirs) diff --git a/src/modules/keyboard/Config.cpp b/src/modules/keyboard/Config.cpp index 8b651d05d..06f7b3e81 100644 --- a/src/modules/keyboard/Config.cpp +++ b/src/modules/keyboard/Config.cpp @@ -456,7 +456,7 @@ Config::onActivate() { "ar_YE", arabic }, { "ca_ES", "cat_ES" }, /* Catalan */ { "as_ES", "ast_ES" }, /* Asturian */ - { "en_CA", "eng_CA" }, /* Canadian English */ + { "en_CA", "us" }, /* Canadian English */ { "el_CY", "gr" }, /* Greek in Cyprus */ { "el_GR", "gr" }, /* Greek in Greeze */ { "ig_NG", "igbo_NG" }, /* Igbo in Nigeria */ diff --git a/src/modules/keyboard/KeyboardPage.cpp b/src/modules/keyboard/KeyboardPage.cpp index 21e55d5d0..43d116146 100644 --- a/src/modules/keyboard/KeyboardPage.cpp +++ b/src/modules/keyboard/KeyboardPage.cpp @@ -324,7 +324,7 @@ KeyboardPage::onActivate() { "ar_YE", arabic }, { "ca_ES", "cat_ES" }, /* Catalan */ { "as_ES", "ast_ES" }, /* Asturian */ - { "en_CA", "eng_CA" }, /* Canadian English */ + { "en_CA", "us" }, /* Canadian English */ { "el_CY", "gr" }, /* Greek in Cyprus */ { "el_GR", "gr" }, /* Greek in Greeze */ { "ig_NG", "igbo_NG" }, /* Igbo in Nigeria */ diff --git a/src/modules/keyboardq/CMakeLists.txt b/src/modules/keyboardq/CMakeLists.txt index f5fd2b64b..729748a7f 100644 --- a/src/modules/keyboardq/CMakeLists.txt +++ b/src/modules/keyboardq/CMakeLists.txt @@ -1,3 +1,8 @@ +if( NOT WITH_QML ) + calamares_skip_module( "keyboardq (QML is not supported in this build)" ) + return() +endif() + set( _keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard ) include_directories( ${_keyboard} ) diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index ea1dc5423..cde0a5e09 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -81,16 +81,16 @@ Config::setLocaleInfo( const QString& initialRegion, const QString& initialZone, auto* region = m_regionList.find< TZRegion >( initialRegion ); if ( region && region->zones().find< TZZone >( initialZone ) ) { - this->m_regionModel->setCurrentIndex( m_regionModel->indexOf( initialRegion ) ); + m_regionModel->setCurrentIndex( m_regionModel->indexOf( initialRegion ) ); m_zonesModel->setList( region->zones() ); - this->m_zonesModel->setCurrentIndex( m_zonesModel->indexOf( initialZone ) ); + m_zonesModel->setCurrentIndex( m_zonesModel->indexOf( initialZone ) ); } else { - this->m_regionModel->setCurrentIndex( m_regionModel->indexOf( "America" ) ); + m_regionModel->setCurrentIndex( m_regionModel->indexOf( "America" ) ); m_zonesModel->setList( static_cast< const TZRegion* >( m_regionModel->item( m_regionModel->currentIndex() ) )->zones() ); - this->m_zonesModel->setCurrentIndex( m_zonesModel->indexOf( "New_York" ) ); + m_zonesModel->setCurrentIndex( m_zonesModel->indexOf( "New_York" ) ); } // Some distros come with a meaningfully commented and easy to parse locale.gen, diff --git a/src/modules/locale/locale.conf b/src/modules/locale/locale.conf index 4beb4fe85..dc68a050f 100644 --- a/src/modules/locale/locale.conf +++ b/src/modules/locale/locale.conf @@ -30,14 +30,18 @@ zone: "New_York" # # GeoIP needs a working Internet connection. # This can be managed from `welcome.conf` by adding -# internet to the list of required conditions. +# internet to the list of required conditions. (The welcome +# module can also do its own GeoIP lookups, independently +# of the lookup done here. The lookup in the welcome module +# is used to establish language; this one is for timezone). # -# The configuration -# is in three parts: a *style*, which can be "json" or "xml" -# depending on the kind of data returned by the service, and -# a *url* where the data is retrieved, and an optional *selector* -# to pick the right field out of the returned data (e.g. field -# name in JSON or element name in XML). +# The configuration is in three parts: +# - a *style*, which can be "json" or "xml" depending on the +# kind of data returned by the service, and +# - a *url* where the data is retrieved, and +# - an optional *selector* +# to pick the right field out of the returned data (e.g. field +# name in JSON or element name in XML). # # The default selector (when the setting is blank) is picked to # work with existing JSON providers (which use "time_zone") and @@ -45,8 +49,8 @@ zone: "New_York" # # If the service configured via *url* uses # a different attribute name (e.g. "timezone") in JSON or a -# different element tag (e.g. "") in XML, set this -# string to the name or tag to be used. +# different element tag (e.g. "") in XML, set the +# selector to the name or tag to be used. # # In JSON: # - if the string contains "." characters, this is used as a @@ -58,7 +62,10 @@ zone: "New_York" # - all elements with the named tag (e.g. all TimeZone) elements # from the document are checked; the first one with non-empty # text value is used. -# +# Special case: +# - the *style* "fixed" is also supported. This ignores the data +# returned from the URL (but the URL must still be valid!) +# and just returns the value of the *selector*. # # An HTTP(S) request is made to *url*. The request should return # valid data in a suitable format, depending on *style*; @@ -67,9 +74,6 @@ zone: "New_York" # does not follow the conventions of "suitable data" described # below, *selector* may be used to pick different data. # -# Note that this example URL works, but the service is shutting -# down in June 2018. -# # Suitable JSON data looks like # ``` # {"time_zone":"America/New_York"} @@ -84,9 +88,6 @@ zone: "New_York" # - backslashes are removed # - spaces are replaced with _ # -# Legacy settings "geoipStyle", "geoipUrl" and "geoipSelector" -# in the top-level are still supported, but I'd advise against. -# # To disable GeoIP checking, either comment-out the entire geoip section, # or set the *style* key to an unsupported format (e.g. `none`). # Also, note the analogous feature in src/modules/welcome/welcome.conf. @@ -95,3 +96,12 @@ geoip: style: "json" url: "https://geoip.kde.org/v1/calamares" selector: "" # leave blank for the default + +# For testing purposes, you could use *fixed* style, to see how Calamares +# behaves in a particular zone: +# +# geoip: +# style: "fixed" +# url: "https://geoip.kde.org/v1/calamares" # Still needs to be valid! +# selector: "America/Vancouver" # this is the selected zone +# diff --git a/src/modules/localeq/CMakeLists.txt b/src/modules/localeq/CMakeLists.txt index 280c95c62..c9ed1cd55 100644 --- a/src/modules/localeq/CMakeLists.txt +++ b/src/modules/localeq/CMakeLists.txt @@ -1,3 +1,8 @@ +if( NOT WITH_QML ) + calamares_skip_module( "localeq (QML is not supported in this build)" ) + return() +endif() + # When debugging the timezone widget, add this debugging definition # to have a debugging-friendly timezone widget, debug logging, # and no intrusive timezone-setting while clicking around. diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index b10c5c0bf..4e16b43c3 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -52,8 +52,13 @@ def mount_partition(root_mount_point, partition, partitions): # Ensure that the created directory has the correct SELinux context on # SELinux-enabled systems. os.makedirs(mount_point, exist_ok=True) - subprocess.call(['chcon', '--reference=' + raw_mount_point, - mount_point]) + try: + subprocess.call(['chcon', '--reference=' + raw_mount_point, mount_point]) + except FileNotFoundError as e: + libcalamares.utils.warning(str(e)) + except OSError: + libcalamares.utils.error("Cannot run 'chcon' normally.") + raise fstype = partition.get("fs", "").lower() diff --git a/src/modules/netinstall/netinstall.conf b/src/modules/netinstall/netinstall.conf index 7de577877..db4d65da0 100644 --- a/src/modules/netinstall/netinstall.conf +++ b/src/modules/netinstall/netinstall.conf @@ -83,11 +83,12 @@ required: false # and existing translations. If no *title* values are provided, no string # is displayed. # -# Translations are handled through [cc] notation, much like in -# `.desktop` files. The string `key[cc]` is used for *key* when -# when the language *cc* (country-code, like *nl* or *en_GB*) is used. +# Translations are handled through `[ll]` notation, much like in +# `.desktop` files. The string associated with `key[ll]` is used for +# *key* when when the language *ll* (language-code, like *nl* or *en_GB* +# or *ja*) is used. # -# The following strings are already known to Calamares and can be +# The following strings are **already** known to Calamares and can be # listed here in *untranslated* form (e.g. as value of *sidebar*) # without bothering with the translations: they are picked up from # the regular translation framework: @@ -110,9 +111,12 @@ required: false # - "Theming" # - "Gaming" # - "Utilities" +# Other strings should follow the translations format. label: sidebar: "Package selection" # sidebar[nl]: "Pakketkeuze" + # sidebar[en_GB]: "Package choice" + # sidebar[ja]: "知りません" # "I don't know" # title: "Office Package" # title[nl]: "Kantoorsoftware" diff --git a/src/modules/notesqml/CMakeLists.txt b/src/modules/notesqml/CMakeLists.txt index 6aedab5aa..7ac808fa7 100644 --- a/src/modules/notesqml/CMakeLists.txt +++ b/src/modules/notesqml/CMakeLists.txt @@ -1,3 +1,8 @@ +if( NOT WITH_QML ) + calamares_skip_module( "notesqml (QML is not supported in this build)" ) + return() +endif() + calamares_add_plugin( notesqml TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index d01a7d983..d40bbcd1c 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -80,7 +80,6 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND gui/PartitionSizeController.cpp gui/PartitionSplitterWidget.cpp gui/PartitionViewStep.cpp - gui/PrettyRadioButton.cpp gui/ResizeVolumeGroupDialog.cpp gui/ScanningDialog.cpp gui/ReplaceWidget.cpp diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index d0de2c0d4..7f8dafb8f 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -98,11 +98,6 @@ void doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionOptions o ) { Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - QString defaultFsType = o.defaultFsType; - if ( FileSystem::typeForName( defaultFsType ) == FileSystem::Unknown ) - { - defaultFsType = "ext4"; - } bool isEfi = PartUtils::isEfiSystem(); @@ -227,12 +222,6 @@ doReplacePartition( PartitionCoreModule* core, Device* dev, Partition* partition cDebug() << "doReplacePartition for device" << partition->partitionPath(); - QString defaultFsType = o.defaultFsType; - if ( FileSystem::typeForName( defaultFsType ) == FileSystem::Unknown ) - { - defaultFsType = "ext4"; - } - PartitionRole newRoles( partition->roles() ); if ( partition->roles().has( PartitionRole::Extended ) ) { diff --git a/src/modules/partition/core/PartitionModel.cpp b/src/modules/partition/core/PartitionModel.cpp index d6f996c4f..1135f5719 100644 --- a/src/modules/partition/core/PartitionModel.cpp +++ b/src/modules/partition/core/PartitionModel.cpp @@ -241,7 +241,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const return partition->partitionPath(); case PartitionPtrRole: - return qVariantFromValue( (void*)partition ); + return QVariant::fromValue( (void*)partition ); // Osprober roles: case OsproberNameRole: diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index c69768f70..69a740d20 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -35,20 +35,19 @@ #include "PartitionBarsView.h" #include "PartitionLabelsView.h" #include "PartitionSplitterWidget.h" -#include "PrettyRadioButton.h" #include "ReplaceWidget.h" #include "ScanningDialog.h" +#include "Branding.h" #include "GlobalStorage.h" #include "JobQueue.h" #include "partition/PartitionIterator.h" #include "partition/PartitionQuery.h" +#include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" #include "utils/Retranslator.h" #include "utils/Units.h" - -#include "Branding.h" -#include "utils/CalamaresUtilsGui.h" +#include "widgets/PrettyRadioButton.h" #include #include @@ -69,6 +68,7 @@ using PartitionActions::Choices::SwapChoice; using CalamaresUtils::Partition::PartitionIterator; using CalamaresUtils::Partition::isPartitionFreeSpace; using CalamaresUtils::Partition::findPartitionByPath; +using Calamares::PrettyRadioButton; /** @brief Given a set of swap choices, return a sensible value from it. * @@ -259,14 +259,14 @@ ChoicePage::setupChoices() m_alongsideButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionAlongside, CalamaresUtils::Original, iconSize ) ); - m_grp->addButton( m_alongsideButton->buttonWidget(), Alongside ); + m_alongsideButton->addToGroup( m_grp, Alongside ); m_eraseButton = new PrettyRadioButton; m_eraseButton->setIconSize( iconSize ); m_eraseButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionEraseAuto, CalamaresUtils::Original, iconSize ) ); - m_grp->addButton( m_eraseButton->buttonWidget(), Erase ); + m_eraseButton->addToGroup( m_grp, Erase ); m_replaceButton = new PrettyRadioButton; @@ -274,7 +274,7 @@ ChoicePage::setupChoices() m_replaceButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionReplaceOs, CalamaresUtils::Original, iconSize ) ); - m_grp->addButton( m_replaceButton->buttonWidget(), Replace ); + m_replaceButton->addToGroup( m_grp, Replace ); // Fill up swap options // .. TODO: only if enabled in the config @@ -294,7 +294,7 @@ ChoicePage::setupChoices() CalamaresUtils::Original, iconSize ) ); m_itemsLayout->addWidget( m_somethingElseButton ); - m_grp->addButton( m_somethingElseButton->buttonWidget(), Manual ); + m_somethingElseButton->addToGroup( m_grp, Manual ); m_itemsLayout->addStretch(); @@ -560,7 +560,7 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current, Partition* part = modl->partitionForIndex( current ); if ( !part ) { - cDebug() << Q_FUNC_INFO << "Partition not found for index" << current; + cDebug() << "Partition not found for index" << current; return; } @@ -1193,7 +1193,7 @@ force_uncheck(QButtonGroup* grp, PrettyRadioButton* button) { button->hide(); grp->setExclusive( false ); - button->buttonWidget()->setChecked( false ); + button->setChecked( false ); grp->setExclusive( true ); } @@ -1288,8 +1288,8 @@ ChoicePage::setupActions() m_replaceButton->hide(); m_alongsideButton->hide(); m_grp->setExclusive( false ); - m_replaceButton->buttonWidget()->setChecked( false ); - m_alongsideButton->buttonWidget()->setChecked( false ); + m_replaceButton->setChecked( false ); + m_alongsideButton->setChecked( false ); m_grp->setExclusive( true ); } else if ( osproberEntriesForCurrentDevice.count() == 1 ) diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index baf575d49..1ff8f0d40 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -23,7 +23,6 @@ #include "ui_ChoicePage.h" -#include #include "core/OsproberEntry.h" #include "core/PartitionActions.h" @@ -31,17 +30,22 @@ #include #include #include +#include class QBoxLayout; class QComboBox; class QLabel; class QListView; +namespace Calamares +{ +class PrettyRadioButton; +} + class PartitionBarsView; class PartitionSplitterWidget; class PartitionLabelsView; class PartitionCoreModule; -class PrettyRadioButton; class DeviceInfoWidget; class Device; @@ -153,10 +157,10 @@ private: QComboBox* m_drivesCombo; QButtonGroup* m_grp; - PrettyRadioButton* m_alongsideButton; - PrettyRadioButton* m_eraseButton; - PrettyRadioButton* m_replaceButton; - PrettyRadioButton* m_somethingElseButton; + Calamares::PrettyRadioButton* m_alongsideButton; + Calamares::PrettyRadioButton* m_eraseButton; + Calamares::PrettyRadioButton* m_replaceButton; + Calamares::PrettyRadioButton* m_somethingElseButton; QComboBox* m_eraseSwapChoiceComboBox; // UI, see also m_eraseSwapChoice DeviceInfoWidget* m_deviceInfoWidget; @@ -182,4 +186,4 @@ private: QMutex m_coreMutex; }; -#endif // CHOICEPAGE_H +#endif // CHOICEPAGE_H diff --git a/src/modules/partition/gui/PartitionSplitterWidget.cpp b/src/modules/partition/gui/PartitionSplitterWidget.cpp index bcc80b65a..b8a8017ab 100644 --- a/src/modules/partition/gui/PartitionSplitterWidget.cpp +++ b/src/modules/partition/gui/PartitionSplitterWidget.cpp @@ -31,14 +31,16 @@ #include #include -#include #include +#include +#include #include using CalamaresUtils::Partition::PartitionIterator; -static const int VIEW_HEIGHT = qMax( CalamaresUtils::defaultFontHeight() + 8, // wins out with big fonts - int( CalamaresUtils::defaultFontHeight() * 0.6 ) + 22 ); // wins out with small fonts +static const int VIEW_HEIGHT + = qMax( CalamaresUtils::defaultFontHeight() + 8, // wins out with big fonts + int( CalamaresUtils::defaultFontHeight() * 0.6 ) + 22 ); // wins out with small fonts static const int CORNER_RADIUS = 3; static const int EXTENDED_PARTITION_MARGIN = qMax( 4, VIEW_HEIGHT / 6 ); @@ -64,35 +66,38 @@ PartitionSplitterWidget::init( Device* dev, bool drawNestedPartitions ) m_drawNestedPartitions = drawNestedPartitions; QVector< PartitionSplitterItem > allPartitionItems; PartitionSplitterItem* extendedPartitionItem = nullptr; - for ( auto it = PartitionIterator::begin( dev ); - it != PartitionIterator::end( dev ); ++it ) + for ( auto it = PartitionIterator::begin( dev ); it != PartitionIterator::end( dev ); ++it ) { - PartitionSplitterItem newItem = { - ( *it )->partitionPath(), - ColorUtils::colorForPartition( *it ), - CalamaresUtils::Partition::isPartitionFreeSpace( *it ), - ( *it )->capacity(), - PartitionSplitterItem::Normal, - {} - }; + PartitionSplitterItem newItem = { ( *it )->partitionPath(), + ColorUtils::colorForPartition( *it ), + CalamaresUtils::Partition::isPartitionFreeSpace( *it ), + ( *it )->capacity(), + PartitionSplitterItem::Normal, + {} }; // If we don't draw child partitions of a partitions as child partitions, we // need to flatten the items tree into an items list if ( drawNestedPartitions ) { if ( ( *it )->roles().has( PartitionRole::Logical ) && extendedPartitionItem ) + { extendedPartitionItem->children.append( newItem ); + } else { allPartitionItems.append( newItem ); if ( ( *it )->roles().has( PartitionRole::Extended ) ) + { extendedPartitionItem = &allPartitionItems.last(); + } } } else { if ( !( *it )->roles().has( PartitionRole::Extended ) ) + { allPartitionItems.append( newItem ); + } } } @@ -100,7 +105,7 @@ PartitionSplitterWidget::init( Device* dev, bool drawNestedPartitions ) } void -PartitionSplitterWidget::setupItems( const QVector& items ) +PartitionSplitterWidget::setupItems( const QVector< PartitionSplitterItem >& items ) { m_itemToResize = PartitionSplitterItem::null(); m_itemToResizeNext = PartitionSplitterItem::null(); @@ -110,20 +115,17 @@ PartitionSplitterWidget::setupItems( const QVector& items m_items = items; repaint(); for ( const PartitionSplitterItem& item : items ) + { cDebug() << "PSI added item" << item.itemPath << "size" << item.size; + } } void -PartitionSplitterWidget::setSplitPartition( const QString& path, - qint64 minSize, - qint64 maxSize, - qint64 preferredSize ) +PartitionSplitterWidget::setSplitPartition( const QString& path, qint64 minSize, qint64 maxSize, qint64 preferredSize ) { - cDebug() << Q_FUNC_INFO << "path:" << path - << "\nminSize:" << minSize - << "\nmaxSize:" << maxSize - << "\nprfSize:" << preferredSize; + cDebug() << "path:" << path << Logger::Continuation << "minSize:" << minSize << Logger::Continuation + << "maxSize:" << maxSize << Logger::Continuation << "prfSize:" << preferredSize; if ( m_itemToResize && m_itemToResizeNext ) { @@ -132,9 +134,8 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, // We need to remove the itemToResizeNext from wherever it is for ( int i = 0; i < m_items.count(); ++i ) { - if ( m_items[ i ].itemPath == m_itemToResize.itemPath && - m_items[ i ].status == PartitionSplitterItem::Resizing && - i + 1 < m_items.count() ) + if ( m_items[ i ].itemPath == m_itemToResize.itemPath + && m_items[ i ].status == PartitionSplitterItem::Resizing && i + 1 < m_items.count() ) { m_items[ i ].size = m_items[ i ].size + m_itemToResizeNext.size; m_items[ i ].status = PartitionSplitterItem::Normal; @@ -146,11 +147,10 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, { for ( int j = 0; j < m_items[ i ].children.count(); ++j ) { - if ( m_items[ i ].children[ j ].itemPath == m_itemToResize.itemPath && - j + 1 < m_items[ i ].children.count() ) + if ( m_items[ i ].children[ j ].itemPath == m_itemToResize.itemPath + && j + 1 < m_items[ i ].children.count() ) { - m_items[ i ].children[ j ].size = - m_items[ i ].children[ j ].size + m_itemToResizeNext.size; + m_items[ i ].children[ j ].size = m_items[ i ].children[ j ].size + m_itemToResizeNext.size; m_items[ i ].children[ j ].status = PartitionSplitterItem::Normal; m_items[ i ].children.removeAt( j + 1 ); m_itemToResizeNext = PartitionSplitterItem::null(); @@ -158,7 +158,9 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, } } if ( m_itemToResizeNext.isNull() ) + { break; + } } } @@ -166,9 +168,7 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, m_itemToResizePath.clear(); } - PartitionSplitterItem itemToResize = _findItem( m_items, - [ path ]( PartitionSplitterItem& item ) -> bool - { + PartitionSplitterItem itemToResize = _findItem( m_items, [path]( PartitionSplitterItem& item ) -> bool { if ( path == item.itemPath ) { item.status = PartitionSplitterItem::Resizing; @@ -178,20 +178,22 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, } ); if ( itemToResize.isNull() ) + { return; + } cDebug() << "itemToResize:" << itemToResize.itemPath; m_itemToResize = itemToResize; m_itemToResizePath = path; if ( preferredSize > maxSize ) + { preferredSize = maxSize; + } qint64 newSize = m_itemToResize.size - preferredSize; m_itemToResize.size = preferredSize; - int opCount = _eachItem( m_items, - [ preferredSize ]( PartitionSplitterItem& item ) -> bool - { + int opCount = _eachItem( m_items, [preferredSize]( PartitionSplitterItem& item ) -> bool { if ( item.status == PartitionSplitterItem::Resizing ) { item.size = preferredSize; @@ -208,14 +210,9 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, { if ( m_items[ i ].itemPath == itemToResize.itemPath ) { - m_items.insert( i+1, - { "", - QColor( "#c0392b" ), - false, - newSize, - PartitionSplitterItem::ResizingNext, - {} } ); - m_itemToResizeNext = m_items[ i+1 ]; + m_items.insert( i + 1, + { "", QColor( "#c0392b" ), false, newSize, PartitionSplitterItem::ResizingNext, {} } ); + m_itemToResizeNext = m_items[ i + 1 ]; break; } else if ( !m_items[ i ].children.isEmpty() ) @@ -224,29 +221,26 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, { if ( m_items[ i ].children[ j ].itemPath == itemToResize.itemPath ) { - m_items[ i ].children.insert( j+1, - { "", - QColor( "#c0392b" ), - false, - newSize, - PartitionSplitterItem::ResizingNext, - {} } ); - m_itemToResizeNext = m_items[ i ].children[ j+1 ]; + m_items[ i ].children.insert( + j + 1, { "", QColor( "#c0392b" ), false, newSize, PartitionSplitterItem::ResizingNext, {} } ); + m_itemToResizeNext = m_items[ i ].children[ j + 1 ]; break; } } if ( !m_itemToResizeNext.isNull() ) + { break; + } } } - emit partitionResized( m_itemToResize.itemPath, - m_itemToResize.size, - m_itemToResizeNext.size ); + emit partitionResized( m_itemToResize.itemPath, m_itemToResize.size, m_itemToResizeNext.size ); cDebug() << "Items updated. Status:"; foreach ( const PartitionSplitterItem& item, m_items ) + { cDebug() << "item" << item.itemPath << "size" << item.size << "status:" << item.status; + } cDebug() << "m_itemToResize: " << !m_itemToResize.isNull() << m_itemToResize.itemPath; cDebug() << "m_itemToResizeNext:" << !m_itemToResizeNext.isNull() << m_itemToResizeNext.itemPath; @@ -259,7 +253,9 @@ qint64 PartitionSplitterWidget::splitPartitionSize() const { if ( !m_itemToResize ) + { return -1; + } return m_itemToResize.size; } @@ -268,7 +264,9 @@ qint64 PartitionSplitterWidget::newPartitionSize() const { if ( !m_itemToResizeNext ) + { return -1; + } return m_itemToResizeNext.size; } @@ -303,12 +301,12 @@ PartitionSplitterWidget::paintEvent( QPaintEvent* event ) void PartitionSplitterWidget::mousePressEvent( QMouseEvent* event ) { - if ( m_itemToResize && - m_itemToResizeNext && - event->button() == Qt::LeftButton ) + if ( m_itemToResize && m_itemToResizeNext && event->button() == Qt::LeftButton ) { if ( qAbs( event->x() - m_resizeHandleX ) < HANDLE_SNAP ) + { m_resizing = true; + } } } @@ -320,16 +318,16 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event ) { qint64 start = 0; QString itemPath = m_itemToResize.itemPath; - for ( auto it = m_items.constBegin(); - it != m_items.constEnd(); ++it ) + for ( auto it = m_items.constBegin(); it != m_items.constEnd(); ++it ) { if ( it->itemPath == itemPath ) + { break; + } else if ( !it->children.isEmpty() ) { bool done = false; - for ( auto jt = it->children.constBegin(); - jt != it->children.constEnd(); ++jt ) + for ( auto jt = it->children.constBegin(); jt != it->children.constEnd(); ++jt ) { if ( jt->itemPath == itemPath ) { @@ -339,10 +337,14 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event ) start += jt->size; } if ( done ) + { break; + } } else + { start += it->size; + } } qint64 total = 0; @@ -351,15 +353,13 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event ) total += it->size; } - int ew = rect().width(); //effective width + int ew = rect().width(); //effective width qreal bpp = total / static_cast< qreal >( ew ); //bytes per pixel qreal mx = event->x() * bpp - start; // make sure we are within resize range - mx = qBound( static_cast< qreal >( m_itemMinSize ), - mx, - static_cast< qreal >( m_itemMaxSize ) ); + mx = qBound( static_cast< qreal >( m_itemMinSize ), mx, static_cast< qreal >( m_itemMaxSize ) ); qint64 span = m_itemPrefSize; qreal percent = mx / span; @@ -367,9 +367,7 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event ) m_itemToResize.size = qRound64( span * percent ); m_itemToResizeNext.size -= m_itemToResize.size - oldsize; - _eachItem( m_items, - [ this ]( PartitionSplitterItem& item ) -> bool - { + _eachItem( m_items, [this]( PartitionSplitterItem& item ) -> bool { if ( item.status == PartitionSplitterItem::Resizing ) { item.size = m_itemToResize.size; @@ -385,18 +383,20 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event ) repaint(); - emit partitionResized( itemPath, - m_itemToResize.size, - m_itemToResizeNext.size ); + emit partitionResized( itemPath, m_itemToResize.size, m_itemToResizeNext.size ); } else { if ( m_itemToResize && m_itemToResizeNext ) { if ( qAbs( event->x() - m_resizeHandleX ) < HANDLE_SNAP ) + { setCursor( Qt::SplitHCursor ); + } else if ( cursor().shape() != Qt::ArrowCursor ) + { setCursor( Qt::ArrowCursor ); + } } } } @@ -412,7 +412,10 @@ PartitionSplitterWidget::mouseReleaseEvent( QMouseEvent* event ) void -PartitionSplitterWidget::drawSection( QPainter* painter, const QRect& rect_, int x, int width, +PartitionSplitterWidget::drawSection( QPainter* painter, + const QRect& rect_, + int x, + int width, const PartitionSplitterItem& item ) { QColor color = item.color; @@ -433,7 +436,9 @@ PartitionSplitterWidget::drawSection( QPainter* painter, const QRect& rect_, int // Draw shade if ( !isFreeSpace ) + { rect.adjust( 2, 2, -2, -2 ); + } QLinearGradient gradient( 0, 0, 0, rectHeight / 2 ); @@ -449,12 +454,12 @@ PartitionSplitterWidget::drawSection( QPainter* painter, const QRect& rect_, int } void -PartitionSplitterWidget::drawResizeHandle( QPainter* painter, - const QRect& rect_, - int x ) +PartitionSplitterWidget::drawResizeHandle( QPainter* painter, const QRect& rect_, int x ) { if ( !m_itemToResize ) + { return; + } painter->setPen( Qt::NoPen ); painter->setBrush( Qt::black ); @@ -462,21 +467,15 @@ PartitionSplitterWidget::drawResizeHandle( QPainter* painter, painter->setRenderHint( QPainter::Antialiasing, true ); - qreal h = VIEW_HEIGHT; // Put the arrow in the center regardless of inner box height + qreal h = VIEW_HEIGHT; // Put the arrow in the center regardless of inner box height int scaleFactor = qRound( height() / static_cast< qreal >( VIEW_HEIGHT ) ); - QList< QPair< qreal, qreal > > arrow_offsets = { - qMakePair( 0, h / 2 - 1 ), - qMakePair( 4, h / 2 - 1 ), - qMakePair( 4, h / 2 - 3 ), - qMakePair( 8, h / 2 ), - qMakePair( 4, h / 2 + 3 ), - qMakePair( 4, h / 2 + 1 ), - qMakePair( 0, h / 2 + 1 ) - }; + QList< QPair< qreal, qreal > > arrow_offsets + = { qMakePair( 0, h / 2 - 1 ), qMakePair( 4, h / 2 - 1 ), qMakePair( 4, h / 2 - 3 ), qMakePair( 8, h / 2 ), + qMakePair( 4, h / 2 + 3 ), qMakePair( 4, h / 2 + 1 ), qMakePair( 0, h / 2 + 1 ) }; for ( int i = 0; i < arrow_offsets.count(); ++i ) { arrow_offsets[ i ] = qMakePair( arrow_offsets[ i ].first * scaleFactor, - ( arrow_offsets[ i ].second - h/2 ) * scaleFactor + h/2 ); + ( arrow_offsets[ i ].second - h / 2 ) * scaleFactor + h / 2 ); } auto p1 = arrow_offsets[ 0 ]; @@ -484,7 +483,9 @@ PartitionSplitterWidget::drawResizeHandle( QPainter* painter, { auto arrow = QPainterPath( QPointF( x + -1 * p1.first, p1.second ) ); for ( auto p : arrow_offsets ) + { arrow.lineTo( x + -1 * p.first + 1, p.second ); + } painter->drawPath( arrow ); } @@ -492,13 +493,15 @@ PartitionSplitterWidget::drawResizeHandle( QPainter* painter, { auto arrow = QPainterPath( QPointF( x + p1.first, p1.second ) ); for ( auto p : arrow_offsets ) + { arrow.lineTo( x + p.first, p.second ); + } painter->drawPath( arrow ); } painter->setRenderHint( QPainter::Antialiasing, false ); painter->setPen( Qt::black ); - painter->drawLine( x, 0, x, int(h) - 1 ); + painter->drawLine( x, 0, x, int( h ) - 1 ); } @@ -520,32 +523,30 @@ PartitionSplitterWidget::drawPartitions( QPainter* painter, const PartitionSplitterItem& item = items[ row ]; qreal width; if ( row < count - 1 ) + { width = totalWidth * ( item.size / total ); + } else - // Make sure we fill the last pixel column + // Make sure we fill the last pixel column + { width = rect.right() - x + 1; + } - drawSection( painter, rect, x, int(width), item ); + drawSection( painter, rect, x, int( width ), item ); if ( !item.children.isEmpty() ) { - QRect subRect( - x + EXTENDED_PARTITION_MARGIN, - rect.y() + EXTENDED_PARTITION_MARGIN, - int(width) - 2 * EXTENDED_PARTITION_MARGIN, - rect.height() - 2 * EXTENDED_PARTITION_MARGIN - ); + QRect subRect( x + EXTENDED_PARTITION_MARGIN, + rect.y() + EXTENDED_PARTITION_MARGIN, + int( width ) - 2 * EXTENDED_PARTITION_MARGIN, + rect.height() - 2 * EXTENDED_PARTITION_MARGIN ); drawPartitions( painter, subRect, item.children ); } // If an item to resize and the following new item both exist, // and this is not the very first partition, // and the partition preceding this one is the item to resize... - if ( m_itemToResize && - m_itemToResizeNext && - row > 0 && - !items[ row - 1 ].isFreeSpace && - !items[ row - 1 ].itemPath.isEmpty() && - items[ row - 1 ].itemPath == m_itemToResize.itemPath ) + if ( m_itemToResize && m_itemToResizeNext && row > 0 && !items[ row - 1 ].isFreeSpace + && !items[ row - 1 ].itemPath.isEmpty() && items[ row - 1 ].itemPath == m_itemToResize.itemPath ) { m_resizeHandleX = x; drawResizeHandle( painter, rect, m_resizeHandleX ); @@ -558,16 +559,20 @@ PartitionSplitterWidget::drawPartitions( QPainter* painter, PartitionSplitterItem PartitionSplitterWidget::_findItem( QVector< PartitionSplitterItem >& items, - std::function< bool ( PartitionSplitterItem& ) > condition ) const + std::function< bool( PartitionSplitterItem& ) > condition ) const { - for ( auto it = items.begin(); it != items.end(); ++it) + for ( auto it = items.begin(); it != items.end(); ++it ) { if ( condition( *it ) ) + { return *it; + } PartitionSplitterItem candidate = _findItem( it->children, condition ); if ( !candidate.isNull() ) + { return candidate; + } } return PartitionSplitterItem::null(); } @@ -575,13 +580,15 @@ PartitionSplitterWidget::_findItem( QVector< PartitionSplitterItem >& items, int PartitionSplitterWidget::_eachItem( QVector< PartitionSplitterItem >& items, - std::function< bool ( PartitionSplitterItem& ) > operation ) const + std::function< bool( PartitionSplitterItem& ) > operation ) const { int opCount = 0; - for ( auto it = items.begin(); it != items.end(); ++it) + for ( auto it = items.begin(); it != items.end(); ++it ) { if ( operation( *it ) ) + { opCount++; + } opCount += _eachItem( it->children, operation ); } @@ -607,7 +614,7 @@ PartitionSplitterWidget::computeItemsVector( const QVector< PartitionSplitterIte PartitionSplitterItem thisItem = originalItems[ row ]; QPair< QVector< PartitionSplitterItem >, qreal > pair = computeItemsVector( thisItem.children ); thisItem.children = pair.first; - thisItem.size = qint64(pair.second); + thisItem.size = qint64( pair.second ); items += thisItem; total += thisItem.size; } @@ -618,10 +625,11 @@ PartitionSplitterWidget::computeItemsVector( const QVector< PartitionSplitterIte qreal adjustedTotal = total; for ( int row = 0; row < items.count(); ++row ) { - if ( items[ row ].size < 0.01 * total ) // If this item is smaller than 1% of everything, - { // force its width to 1%. + if ( items[ row ].size < 0.01 * total ) // If this item is smaller than 1% of everything, + { + // force its width to 1%. adjustedTotal -= items[ row ].size; - items[ row ].size = qint64(0.01 * total); + items[ row ].size = qint64( 0.01 * total ); adjustedTotal += items[ row ].size; } } diff --git a/src/modules/rawfs/main.py b/src/modules/rawfs/main.py index 1898d8fea..68f3c444e 100644 --- a/src/modules/rawfs/main.py +++ b/src/modules/rawfs/main.py @@ -96,7 +96,7 @@ class RawFSItem: count = 0 libcalamares.utils.debug("Copying {} to {}".format(self.source, self.destination)) - if libcalamares.job.configuration["bogus"]: + if libcalamares.job.configuration.get("bogus", False): return srcsize, srcblksize = get_device_size(self.source) diff --git a/src/modules/rawfs/tests/CMakeTests.txt b/src/modules/rawfs/tests/CMakeTests.txt new file mode 100644 index 000000000..44a7777c8 --- /dev/null +++ b/src/modules/rawfs/tests/CMakeTests.txt @@ -0,0 +1,8 @@ +# Special cases for rawfs tests +# +# - On FreeBSD, /proc/mounts doesn't exist (/proc is only about processes, +# and is rarely used). Expect the test to fail. + +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set_tests_properties(load-rawfs-1 PROPERTIES WILL_FAIL TRUE) +endif() diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 71d6de9bb..2bf418ff1 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -32,6 +32,7 @@ Config::Config( QObject* parent ) : QObject( parent ) , m_languages( CalamaresUtils::Locale::availableTranslations() ) + , m_filtermodel( std::make_unique< QSortFilterProxyModel >() ) { initLanguages(); @@ -97,6 +98,18 @@ Config::requirementsModel() const return Calamares::ModuleManager::instance()->requirementsModel(); } +QAbstractItemModel* +Config::unsatisfiedRequirements() const +{ + if ( !m_filtermodel->sourceModel() ) + { + m_filtermodel->setFilterRole( Calamares::RequirementsModel::Roles::Satisfied ); + m_filtermodel->setFilterFixedString( QStringLiteral( "false" ) ); + m_filtermodel->setSourceModel( requirementsModel() ); + } + return m_filtermodel.get(); +} + QString Config::languageIcon() const @@ -229,14 +242,14 @@ Config::genericWelcomeMessage() const if ( Calamares::Settings::instance()->isSetupMode() ) { message = Calamares::Branding::instance()->welcomeStyleCalamares() - ? tr( "

Welcome to the Calamares setup program for %1.

" ) - : tr( "

Welcome to %1 setup.

" ); + ? tr( "

Welcome to the Calamares setup program for %1

" ) + : tr( "

Welcome to %1 setup

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

Welcome to the Calamares installer for %1.

" ) - : tr( "

Welcome to the %1 installer.

" ); + ? tr( "

Welcome to the Calamares installer for %1

" ) + : tr( "

Welcome to the %1 installer

" ); } return message; @@ -336,7 +349,7 @@ setCountry( Config* config, const QString& countryCode, CalamaresUtils::GeoIP::H } static inline void -setGeoIP( Config* c, const QVariantMap& configurationMap ) +setGeoIP( Config* config, const QVariantMap& configurationMap ) { bool ok = false; QVariantMap geoip = CalamaresUtils::getSubMap( configurationMap, "geoip", ok ); @@ -350,12 +363,12 @@ setGeoIP( Config* c, const QVariantMap& configurationMap ) if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None ) { auto* future = new FWString(); - QObject::connect( future, &FWString::finished, [config = c, f = future, h = handler]() { - QString countryResult = f->future().result(); + QObject::connect( future, &FWString::finished, [config, future, handler]() { + QString countryResult = future->future().result(); cDebug() << "GeoIP result for welcome=" << countryResult; - ::setCountry( config, countryResult, h ); - f->deleteLater(); - delete h; + ::setCountry( config, countryResult, handler ); + future->deleteLater(); + delete handler; } ); future->setFuture( handler->queryRaw() ); } diff --git a/src/modules/welcome/Config.h b/src/modules/welcome/Config.h index 7fe6fa04e..6d14097c5 100644 --- a/src/modules/welcome/Config.h +++ b/src/modules/welcome/Config.h @@ -23,13 +23,37 @@ #include "modulesystem/RequirementsModel.h" #include +#include #include +#include + class Config : public QObject { Q_OBJECT + /** @brief The languages available in Calamares. + * + * This is a list-model, with names and descriptions for the translations + * available to Calamares. + */ Q_PROPERTY( CalamaresUtils::Locale::LabelModel* languagesModel READ languagesModel CONSTANT FINAL ) + /** @brief The requirements (from modules) and their checked-status + * + * The model grows rows over time as each module is checked and its + * requirements are taken into account. The model **as a whole** + * has properties *satisfiedRequirements* and *satisfiedMandatory* + * to say if all of the requirements held in the model have been + * satisfied. See the model documentation for details. + */ Q_PROPERTY( Calamares::RequirementsModel* requirementsModel READ requirementsModel CONSTANT FINAL ) + /** @brief The requirements (from modules) that are **unsatisfied** + * + * This is the same as requirementsModel(), except filtered so + * that only those requirements that are not satisfied are exposed. + * Note that the type is different, so you should still use the + * requirementsModel() for overall status like *satisfiedMandatory*. + */ + Q_PROPERTY( QAbstractItemModel* unsatisfiedRequirements READ unsatisfiedRequirements CONSTANT FINAL ) Q_PROPERTY( QString languageIcon READ languageIcon CONSTANT FINAL ) @@ -83,6 +107,8 @@ public slots: ///@brief The **global** requirements model, from ModuleManager Calamares::RequirementsModel* requirementsModel() const; + QAbstractItemModel* unsatisfiedRequirements() const; + signals: void countryCodeChanged( QString countryCode ); void localeIndexChanged( int localeIndex ); @@ -99,7 +125,8 @@ signals: private: void initLanguages(); - CalamaresUtils::Locale::LabelModel* m_languages; + CalamaresUtils::Locale::LabelModel* m_languages = nullptr; + std::unique_ptr< QSortFilterProxyModel > m_filtermodel; QString m_languageIcon; QString m_countryCode; diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 2c6b4cc0e..0c4f44c95 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -31,6 +31,7 @@ #include "locale/LabelModel.h" #include "modulesystem/ModuleManager.h" +#include "modulesystem/RequirementsModel.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" #include "utils/NamedEnum.h" @@ -90,8 +91,8 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent ) &Calamares::ModuleManager::requirementsComplete, m_checkingWidget, &CheckerContainer::requirementsComplete ); - connect( Calamares::ModuleManager::instance(), - &Calamares::ModuleManager::requirementsProgress, + connect( Calamares::ModuleManager::instance()->requirementsModel(), + &Calamares::RequirementsModel::progressMessageChanged, m_checkingWidget, &CheckerContainer::requirementsProgress ); } diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index 0ed887fa9..cad5349a9 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -32,16 +32,14 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeViewStepFactory, registerPlugin< Wel WelcomeViewStep::WelcomeViewStep( QObject* parent ) : Calamares::ViewStep( parent ) - , m_requirementsChecker( new GeneralRequirements( this ) ) , m_conf( new Config( this ) ) + , m_widget( new WelcomePage( m_conf ) ) + , m_requirementsChecker( new GeneralRequirements( this ) ) { connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, this, &WelcomeViewStep::nextStatusChanged ); - - // the instance of the qqc2 or qwidgets page - m_widget = new WelcomePage( m_conf ); connect( m_conf, &Config::localeIndexChanged, m_widget, &WelcomePage::externallySelectedLanguage ); } diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index 3265395fc..f4874dc16 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -73,9 +73,9 @@ public: Calamares::RequirementsList checkRequirements() override; private: + Config* m_conf; WelcomePage* m_widget; GeneralRequirements* m_requirementsChecker; - Config* m_conf; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeViewStepFactory ) diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp index fc9fe5ce6..ba6ebe89f 100644 --- a/src/modules/welcome/checker/GeneralRequirements.cpp +++ b/src/modules/welcome/checker/GeneralRequirements.cpp @@ -70,16 +70,48 @@ biggestSingleScreen() return s; } +/** @brief Distinguish has-not-been-checked-at-all from false. + * + */ +struct MaybeChecked +{ + bool hasBeenChecked = false; + bool value = false; + + MaybeChecked& operator=( bool b ) + { + hasBeenChecked = true; + value = b; + return *this; + } + + operator bool() const { return value; } +}; + +QDebug& +operator<<( QDebug& s, const MaybeChecked& c ) +{ + if ( c.hasBeenChecked ) + { + s << c.value; + } + else + { + s << "unchecked"; + } + return s; +} + Calamares::RequirementsList GeneralRequirements::checkRequirements() { QSize availableSize = biggestSingleScreen(); - bool enoughStorage = false; - bool enoughRam = false; - bool hasPower = false; - bool hasInternet = false; - bool isRoot = false; + MaybeChecked enoughStorage; + MaybeChecked enoughRam; + MaybeChecked hasPower; + MaybeChecked hasInternet; + MaybeChecked isRoot; bool enoughScreen = availableSize.isValid() && ( availableSize.width() >= CalamaresUtils::windowMinimumWidth ) && ( availableSize.height() >= CalamaresUtils::windowMinimumHeight ); @@ -112,7 +144,7 @@ GeneralRequirements::checkRequirements() isRoot = checkIsRoot(); } - using TR = Logger::DebugRow< const char*, bool >; + using TR = Logger::DebugRow< const char*, MaybeChecked >; cDebug() << "GeneralRequirements output:" << TR( "enoughStorage", enoughStorage ) << TR( "enoughRam", enoughRam ) << TR( "hasPower", hasPower ) << TR( "hasInternet", hasInternet ) << TR( "isRoot", isRoot ); diff --git a/src/modules/welcome/welcome.conf b/src/modules/welcome/welcome.conf index 224bc6ded..45cb654a2 100644 --- a/src/modules/welcome/welcome.conf +++ b/src/modules/welcome/welcome.conf @@ -64,7 +64,16 @@ requirements: # # To disable GeoIP checking, either comment-out the entire geoip section, # or set the *style* key to an unsupported format (e.g. `none`). -# Also, note the analogous feature in src/modules/locale/locale.conf. +# Also, note the analogous feature in `src/modules/locale/locale.conf`, +# which is where you will find complete documentation. +# +# For testing, the *style* may be set to `fixed`, any URL that +# returns data (e.g. `http://example.com`) and then *selector* +# sets the data that is actually returned (e.g. "DE" to simulate +# the machine being in Germany). +# +# NOTE: the *selector* must pick the country code from the GeoIP +# data. Timezone, city, or other data will not be recognized. # geoip: style: "none" diff --git a/src/modules/welcomeq/CMakeLists.txt b/src/modules/welcomeq/CMakeLists.txt index 9cb89c3d9..4a040344e 100644 --- a/src/modules/welcomeq/CMakeLists.txt +++ b/src/modules/welcomeq/CMakeLists.txt @@ -1,6 +1,11 @@ # This is a re-write of the welcome module using QML view steps # instead of widgets. +if( NOT WITH_QML ) + calamares_skip_module( "welcomeq (QML is not supported in this build)" ) + return() +endif() + set( _welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome ) include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ${CMAKE_CURRENT_SOURCE_DIR}/../../libcalamares ${_welcome} ) diff --git a/src/modules/welcomeq/Recommended.qml b/src/modules/welcomeq/Recommended.qml index 373509104..5a6c1316d 100644 --- a/src/modules/welcomeq/Recommended.qml +++ b/src/modules/welcomeq/Recommended.qml @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Anke Boersma + * Copyright 2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +17,9 @@ * along with Calamares. If not, see . */ +/* THIS COMPONENT IS UNUSED -- from the default welcomeq.qml at least */ + +import io.calamares.core 1.0 import io.calamares.ui 1.0 import QtQuick 2.7 @@ -27,41 +31,70 @@ Rectangle { focus: true Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor anchors.fill: parent - anchors.topMargin: 70 + anchors.topMargin: 50 TextArea { id: recommended anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - anchors.topMargin: 20 + anchors.topMargin: 1 + horizontalAlignment: TextEdit.AlignHCenter width: 640 - font.pointSize: 12 + font.pointSize: 11 textFormat: Text.RichText antialiasing: true activeFocusOnPress: false wrapMode: Text.WordWrap - text: qsTr("

This computer does not satisfy some of the recommended requirements for setting up %1.

-

Setup can continue, but some features might be disabled.

").arg(Branding.string(Branding.VersionedName)) + text: qsTr("

This computer does not satisfy some of the recommended requirements for setting up %1.
+ Setup can continue, but some features might be disabled.

").arg(Branding.string(Branding.VersionedName)) } - TextArea { + Rectangle { + width: 640 + height: 360 anchors.horizontalCenter: parent.horizontalCenter anchors.top: recommended.bottom - anchors.topMargin: 20 - width: 640 - background: Rectangle { - implicitWidth: 640 - implicitHeight: 50 - border.color: "#ff0000" - color: "#b0e0e6" - } - font.pointSize: 12 - textFormat: Text.RichText - antialiasing: true - activeFocusOnPress: false - wrapMode: Text.WordWrap + anchors.topMargin: 5 - text: qsTr("

The system is not connected to the internet.

")//.arg(requirementsModel) + Component { + id: requirementsDelegate + + Item { + width: 640 + height: 35 + + Column { + anchors.centerIn: parent + + Rectangle { + implicitWidth: 640 + implicitHeight: 35 + border.color: satisfied ? "#228b22" : "#ffa411" + color: satisfied ? "#f0fff0" : "#ffefd5" + + Image { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.margins: 20 + source: satisfied ? "qrc:/data/images/yes.svgz" : "qrc:/data/images/information.svgz" + } + + Text { + text: satisfied ? details : negatedText + anchors.centerIn: parent + font.pointSize: 11 + } + } + } + } + } + + ListView { + anchors.fill: parent + spacing: 5 + model: config.requirementsModel + delegate: requirementsDelegate + } } } diff --git a/src/modules/welcomeq/Requirements.qml b/src/modules/welcomeq/Requirements.qml index 4f5520270..e7835d868 100644 --- a/src/modules/welcomeq/Requirements.qml +++ b/src/modules/welcomeq/Requirements.qml @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Anke Boersma + * Copyright 2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +17,7 @@ * along with Calamares. If not, see . */ +import io.calamares.core 1.0 import io.calamares.ui 1.0 import QtQuick 2.7 @@ -27,41 +29,84 @@ Rectangle { focus: true Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor anchors.fill: parent - anchors.topMargin: 70 + anchors.topMargin: 50 TextArea { id: required anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - anchors.topMargin: 20 + anchors.topMargin: 1 + horizontalAlignment: TextEdit.AlignHCenter width: 640 - font.pointSize: 12 + font.pointSize: 11 textFormat: Text.RichText antialiasing: true activeFocusOnPress: false wrapMode: Text.WordWrap - text: qsTr("

This computer does not satisfy the minimum requirements for setting up %1.

-

Setup cannot continue.

").arg(Branding.string(Branding.VersionedName)) + property var requirementsText: qsTr("

This computer does not satisfy the minimum requirements for installing %1.
+ Installation cannot continue.

").arg(Branding.string(Branding.VersionedName)) + property var recommendationsText: qsTr("

This computer does not satisfy some of the recommended requirements for setting up %1.
+ Setup can continue, but some features might be disabled.

").arg(Branding.string(Branding.VersionedName)) + + text: config.requirementsModel.satisfiedMandatory ? recommendationsText : requirementsText } - TextArea { + Rectangle { + width: 640 + height: 360 anchors.horizontalCenter: parent.horizontalCenter anchors.top: required.bottom - anchors.topMargin: 20 - width: 640 - background: Rectangle { - implicitWidth: 640 - implicitHeight: 50 - border.color: "#ff0000" - color: "#ffc0cb" - } - font.pointSize: 12 - textFormat: Text.RichText - antialiasing: true - activeFocusOnPress: false - wrapMode: Text.WordWrap + anchors.topMargin: 5 - text: qsTr("

The installer is not running with administrator rights.

")//.arg(requirementsModel) + Component { + id: requirementsDelegate + + Item { + width: 640 + height: 35 + visible: true + + Column { + anchors.centerIn: parent + + Rectangle { + implicitWidth: 640 + implicitHeight: 35 + // Colors and images based on the two satisfied-bools: + // - if satisfied, then green / ok + // - otherwise if mandatory, then red / stop + // - otherwise, then yellow / warning + border.color: satisfied ? "#228b22" : (mandatory ? "#ff0000" : "#ffa411") + color: satisfied ? "#f0fff0" : (mandatory ? "#ffc0cb" : "#ffefd5") + + Image { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.margins: 20 + source: satisfied ? "qrc:/data/images/yes.svgz" : (mandatory ? "qrc:/data/images/no.svgz" : "qrc:/data/images/information.svgz") + } + + Text { + text: satisfied ? details : negatedText + anchors.centerIn: parent + font.pointSize: 11 + } + } + } + } + } + + ListView { + id: requirementsList + anchors.fill: parent + spacing: 5 + // This uses the filtered model, so that only unsatisfied + // requirements are ever shown. You could use *requirementsModel* + // to get all of them. + model: config.unsatisfiedRequirements + delegate: requirementsDelegate + } } } + diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.cpp b/src/modules/welcomeq/WelcomeQmlViewStep.cpp index f520a9953..42944f20d 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.cpp +++ b/src/modules/welcomeq/WelcomeQmlViewStep.cpp @@ -22,9 +22,9 @@ #include "checker/GeneralRequirements.h" #include "locale/LabelModel.h" +#include "utils/Dirs.h" #include "utils/Logger.h" #include "utils/Variant.h" -#include "utils/Dirs.h" #include "Branding.h" #include "modulesystem/ModuleManager.h" @@ -33,62 +33,57 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); ) WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent ) -: Calamares::QmlViewStep(parent ) - , m_config( new Config( this ) ) // the qml singleton takes ownership and deletes it -// , m_nextEnabled( false ) + : Calamares::QmlViewStep( parent ) + , m_config( new Config( this ) ) , m_requirementsChecker( new GeneralRequirements( this ) ) - { -// connect( m_config, -// &Config::isNextEnabledChanged, -// this, -// &WelcomeQmlViewStep::nextStatusChanged ); -// emit nextStatusChanged(true); + connect( Calamares::ModuleManager::instance(), + &Calamares::ModuleManager::requirementsComplete, + this, + &WelcomeQmlViewStep::nextStatusChanged ); } QString WelcomeQmlViewStep::prettyName() const { - return tr( "Welcome" ); + return tr( "Welcome" ); } bool WelcomeQmlViewStep::isNextEnabled() const { - // TODO: should return true -// return m_config->property("isNextEnabled").toBool(); - return true; + return m_config->requirementsModel()->satisfiedMandatory(); } bool WelcomeQmlViewStep::isBackEnabled() const { - // TODO: should return true (it's weird that you are not allowed to have welcome *after* anything - return false; + // TODO: should return true (it's weird that you are not allowed to have welcome *after* anything + return false; } bool WelcomeQmlViewStep::isAtBeginning() const { - // TODO: adjust to "pages" in the QML - return true; + // TODO: adjust to "pages" in the QML + return true; } bool WelcomeQmlViewStep::isAtEnd() const { - // TODO: adjust to "pages" in the QML - return true; + // TODO: adjust to "pages" in the QML + return true; } Calamares::JobList WelcomeQmlViewStep::jobs() const { - return Calamares::JobList(); + return Calamares::JobList(); } void @@ -96,30 +91,29 @@ WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { m_config->setConfigurationMap( configurationMap ); - // TODO: figure out how the requirements (held by ModuleManager) should be accessible - // to QML as a model. //will be model as a qvariantmap containing a alert level and the message string - if ( configurationMap.contains( "requirements" ) - && configurationMap.value( "requirements" ).type() == QVariant::Map ) - { - m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); - } - else - cWarning() << "no valid requirements map found in welcome " - "module configuration."; + if ( configurationMap.contains( "requirements" ) + && configurationMap.value( "requirements" ).type() == QVariant::Map ) + { + m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); + } + else + { + cWarning() << "no valid requirements map found in welcomeq " + "module configuration."; + } - Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last + Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last setContextProperty( "Welcome", m_config ); } Calamares::RequirementsList WelcomeQmlViewStep::checkRequirements() { - return m_requirementsChecker->checkRequirements(); + return m_requirementsChecker->checkRequirements(); } QObject* WelcomeQmlViewStep::getConfig() { - return m_config; + return m_config; } - diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.h b/src/modules/welcomeq/WelcomeQmlViewStep.h index 8e163083d..78999986c 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.h +++ b/src/modules/welcomeq/WelcomeQmlViewStep.h @@ -47,7 +47,6 @@ class PLUGINDLLEXPORT WelcomeQmlViewStep : public Calamares::QmlViewStep Q_OBJECT public: - explicit WelcomeQmlViewStep( QObject* parent = nullptr ); QString prettyName() const override; @@ -74,8 +73,7 @@ public: QObject* getConfig() override; private: - // TODO: a generic QML viewstep should return a config object from a method - Config *m_config; + Config* m_config; GeneralRequirements* m_requirementsChecker; }; diff --git a/src/modules/welcomeq/welcomeq.conf b/src/modules/welcomeq/welcomeq.conf index a5ab97f50..6c131742e 100644 --- a/src/modules/welcomeq/welcomeq.conf +++ b/src/modules/welcomeq/welcomeq.conf @@ -1,27 +1,34 @@ -# Configuration for the welcome module. The welcome page -# displays some information from the branding file. -# Which parts it displays can be configured through -# the show* variables. +# Configuration for the welcomeq module. # -# In addition to displaying the welcome page, this module -# can check requirements for installation. +# The configuration for welcomeq is exactly the same +# as the welcome module, with the one exception of +# *qmlSearch* which governs QML loading. +# +# No documentation is given here: look in the welcome module. --- -# Setting for QML loading +# Setting for QML loading: use QRC, branding, or both sources of files qmlSearch: both -# Display settings for various buttons on the welcome page. -# The URLs themselves come from branding.desc is the setting -# here is "true". If the setting is false, the button is hidden. -# The setting can also be a full URL which will then be used -# instead of the one from the branding file, or empty or not-set -# which will hide the button. + +# Everythin below here is documented in `welcome.conf` showSupportUrl: true showKnownIssuesUrl: true showReleaseNotesUrl: true -# If this Url is set to something non-empty, a "donate" -# button is added to the welcome page alongside the -# others (see settings, above). Clicking the button opens -# the corresponding link. (This button has no corresponding -# branding.desc string) -# -# showDonateUrl: https://kde.org/community/donations/ +requirements: + requiredStorage: 5.5 + requiredRam: 1.0 + internetCheckUrl: http://google.com + check: + - storage + - ram + - power + - internet + - root + - screen + required: + - ram + +geoip: + style: "none" + url: "https://geoip.kde.org/v1/ubiquity" # extended XML format + selector: "CountryCode" # blank uses default, which is wrong diff --git a/src/modules/welcomeq/welcomeq.qml b/src/modules/welcomeq/welcomeq.qml index 910274fe2..ffa480f4a 100644 --- a/src/modules/welcomeq/welcomeq.qml +++ b/src/modules/welcomeq/welcomeq.qml @@ -56,18 +56,8 @@ Page fillMode: Image.PreserveAspectFit } - Recommended { - property var required: "yes" //requirementsModel - property var satisfied: "yes" //satisfiedRequirements - property var requiredMet: (required != satisfied) ? true : false - visible: requiredMet - } - Requirements { - property var required: "yes" //requirementsModel - property var mandatory: "yes" //satisfiedMandatory - property var mandatoryMet: (required != mandatory) ? true : false - visible: mandatoryMet + visible: !config.requirementsModel.satisfiedRequirements } RowLayout { diff --git a/src/qml/calamares/slideshow/Presentation.qml b/src/qml/calamares/slideshow/Presentation.qml index 1d2fd9c85..405055b56 100644 --- a/src/qml/calamares/slideshow/Presentation.qml +++ b/src/qml/calamares/slideshow/Presentation.qml @@ -12,7 +12,7 @@ * - Support "V2" loading * - Disable shortcuts until the content is visible in Calamares * - * SPDX-License-Identifier: LGPL-2.1 + * SPDX-License-Identifier: LGPL-2.1-only * License-Filename: LICENSES/LGPLv2.1-Presentation */ diff --git a/src/qml/calamares/slideshow/Slide.qml b/src/qml/calamares/slideshow/Slide.qml index 6b32ddfbf..dc3e24480 100644 --- a/src/qml/calamares/slideshow/Slide.qml +++ b/src/qml/calamares/slideshow/Slide.qml @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * SPDX-License-Identifier: LGPL-2.1 + * SPDX-License-Identifier: LGPL-2.1-only * License-Filename: LICENSES/LGPLv2.1-Presentation */