diff --git a/CHANGES b/CHANGES index 0f8963ae1..bd7dbfc7c 100644 --- a/CHANGES +++ b/CHANGES @@ -8,7 +8,9 @@ website will have to do for older versions. This release contains contributions from (alphabetically by first name): - Alf Gaida - aliveafter1000 + - Arnaud Ferraris - Caio Carvalho + - Collabora LTD - Kevin Kofler - Philip Mueller - Scott Harvey @@ -32,10 +34,15 @@ This release contains contributions from (alphabetically by first name): and Calamares no longer reserves 2GiB of space in calculations for internal use (this means that it no longer mysteriously drops swap when the disk size is close to the required installation size). + * The name of the type of default filesystem (e.g. ext4 or btrfs) is now handled + case- and localization-insensitively. This means that *btrfs* is now always + an acceptable spelling. + * The currently-selected disk device is remembered between manual partitioning + and the partitioning-overview pages. (Thanks to Arnaud) * The *keyboard* module now handles the (bogus) Austrian keymap for - the system console properly. + the system console properly. (Thanks to Kevin) * The *preservefiles* module now has a mechanism for setting the permissions - (and ownership) of preserved files. + (and ownership) of preserved files. (Thanks to Scott) * New module *fsresizer* can be used to resize filesystems. It is intended for use in OEM installs where an image of fixed size is created, and then sized to the actual SD card the user has used. diff --git a/lang/calamares_eu.ts b/lang/calamares_eu.ts index c93ffb6b1..8b888a599 100644 --- a/lang/calamares_eu.ts +++ b/lang/calamares_eu.ts @@ -366,7 +366,7 @@ Instalatzailea irten egingo da eta aldaketa guztiak galduko dira. %1 will be shrunk to %2MB and a new %3MB partition will be created for %4. - + %1 %2MB-ra txikituko da, eta %3MB-tako partizio berri bat sortuko da %4-(e)rako. @@ -389,7 +389,7 @@ Instalatzailea irten egingo da eta aldaketa guztiak galduko dira. <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> - + <strong>Aukeratu partizioa txikitzeko eta gero arrastatu azpiko-barra tamaina aldatzeko</strong> @@ -427,7 +427,7 @@ Instalatzailea irten egingo da eta aldaketa guztiak galduko dira. This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + Biltegiratze-gailuak %1 dauka. Zer egin nahiko zenuke? <br/>Zure aukerak berrikusteko eta berresteko aukera izango duzu aldaketak gauzatu aurretik biltegiratze-gailuan @@ -435,7 +435,7 @@ Instalatzailea irten egingo da eta aldaketa guztiak galduko dira. <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. - + <strong>Instalatu alboan</strong><br/>Instalatzaileak partizioa txikituko du lekua egiteko %1-(r)i. @@ -443,7 +443,7 @@ Instalatzailea irten egingo da eta aldaketa guztiak galduko dira. <strong>Replace a partition</strong><br/>Replaces a partition with %1. - + <strong>Ordeztu partizioa</strong><br/>ordezkatu partizioa %1-(e)kin. diff --git a/lang/python/ast/LC_MESSAGES/python.mo b/lang/python/ast/LC_MESSAGES/python.mo index 213918efd..666f07af3 100644 Binary files a/lang/python/ast/LC_MESSAGES/python.mo and b/lang/python/ast/LC_MESSAGES/python.mo differ diff --git a/lang/python/ast/LC_MESSAGES/python.po b/lang/python/ast/LC_MESSAGES/python.po index 815095319..786839323 100644 --- a/lang/python/ast/LC_MESSAGES/python.po +++ b/lang/python/ast/LC_MESSAGES/python.po @@ -3,9 +3,6 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -# Translators: -# enolp , 2017 -# #, fuzzy msgid "" msgstr "" @@ -13,7 +10,6 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-05 11:34-0400\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: enolp , 2017\n" "Language-Team: Asturian (https://www.transifex.com/calamares/teams/20061/ast/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -86,15 +82,15 @@ msgstr "" #: src/modules/dummypython/main.py:44 msgid "Dummy python job." -msgstr "Trabayu maniquín de python." +msgstr "" #: src/modules/dummypython/main.py:97 msgid "Dummy python step {}" -msgstr "Pasu maniquín de python {}" +msgstr "" #: src/modules/machineid/main.py:35 msgid "Generate machine-id." -msgstr "Xenerar machine-id." +msgstr "" #: src/modules/packages/main.py:62 #, python-format diff --git a/lang/python/de/LC_MESSAGES/python.mo b/lang/python/de/LC_MESSAGES/python.mo index 9d613105a..62936843d 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 8b6cf8b24..7328d957c 100644 --- a/lang/python/de/LC_MESSAGES/python.po +++ b/lang/python/de/LC_MESSAGES/python.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Dirk Hein , 2017 +# Adriaan de Groot , 2017 # Christian Spaan, 2018 # Andreas Eitel, 2018 # @@ -115,11 +115,11 @@ msgstr "Pakete installieren " msgid "Installing one package." msgid_plural "Installing %(num)d packages." msgstr[0] "Installiere ein Paket" -msgstr[1] "Installiere %(num)dPakete." +msgstr[1] "Installiere %(num)d Pakete." #: src/modules/packages/main.py:70 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." msgstr[0] "Entferne ein Paket" -msgstr[1] "Entferne %(num)dPakete." +msgstr[1] "Entferne %(num)d Pakete." diff --git a/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.mo b/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.mo index 35ad2c9ea..da5256c9f 100644 Binary files a/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.mo and b/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.mo differ diff --git a/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.po b/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.po index 0fc16c2b9..6721edaea 100644 --- a/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.po +++ b/src/modules/dummypythonqt/lang/ast/LC_MESSAGES/dummypythonqt.po @@ -4,7 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# enolp , 2017 +# enolp , 2019 # #, fuzzy msgid "" @@ -13,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-05 11:34-0400\n" "PO-Revision-Date: 2016-12-16 12:18+0000\n" -"Last-Translator: enolp , 2017\n" +"Last-Translator: enolp , 2019\n" "Language-Team: Asturian (https://www.transifex.com/calamares/teams/20061/ast/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,7 +23,7 @@ msgstr "" #: src/modules/dummypythonqt/main.py:84 msgid "Click me!" -msgstr "¡Prímime!" +msgstr "¡Fai clic en min!" #: src/modules/dummypythonqt/main.py:94 msgid "A new QLabel." @@ -31,7 +31,7 @@ msgstr "Una QLabel nueva." #: src/modules/dummypythonqt/main.py:97 msgid "Dummy PythonQt ViewStep" -msgstr "" +msgstr "ViewStep maniquín de PythonQT" #: src/modules/dummypythonqt/main.py:183 msgid "The Dummy PythonQt Job" diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index ba49bd95d..3aeb4d258 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -2,6 +2,7 @@ * * Copyright 2014-2017, Teo Mrnjavac * Copyright 2017-2018, 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 @@ -1523,3 +1524,16 @@ ChoicePage::updateSwapChoicesTr(QComboBox* box) } } } + +int +ChoicePage::lastSelectedDeviceIndex() +{ + return m_lastSelectedDeviceIndex; +} + +void +ChoicePage::setLastSelectedDeviceIndex( int index ) +{ + m_lastSelectedDeviceIndex = index; + m_drivesCombo->setCurrentIndex( m_lastSelectedDeviceIndex ); +} diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index 07d052c2d..a53f3fff1 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -2,6 +2,7 @@ * * Copyright 2014-2016, Teo Mrnjavac * Copyright 2018, 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 @@ -97,6 +98,9 @@ public: */ void applyActionChoice( ChoicePage::InstallChoice choice ); + int lastSelectedDeviceIndex(); + void setLastSelectedDeviceIndex( int index ); + signals: void nextStatusChanged( bool ); void actionChosen(); diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index 9d972c8fd..86de992e6 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -5,6 +5,7 @@ * Copyright 2018, Adriaan de Groot * Copyright 2018, Andrius Štikonas * Copyright 2018, Caio Jordão Carvalho + * 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 @@ -609,3 +610,15 @@ PartitionPage::getCurrentUsedMountpoints() return mountPoints; } + +int +PartitionPage::selectedDeviceIndex() +{ + return m_ui->deviceComboBox->currentIndex(); +} + +void +PartitionPage::selectDeviceByIndex ( int index ) +{ + m_ui->deviceComboBox->setCurrentIndex( index ); +} diff --git a/src/modules/partition/gui/PartitionPage.h b/src/modules/partition/gui/PartitionPage.h index 70d8ccdfb..8289f2cdd 100644 --- a/src/modules/partition/gui/PartitionPage.h +++ b/src/modules/partition/gui/PartitionPage.h @@ -2,6 +2,7 @@ * * Copyright 2014, Aurélien Gâteau * Copyright 2018, 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 @@ -46,6 +47,9 @@ public: void onRevertClicked(); + int selectedDeviceIndex(); + void selectDeviceByIndex( int index ); + private: QScopedPointer< Ui_PartitionPage > m_ui; PartitionCoreModule* m_core; diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 0152f8bec..c303cff91 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -3,6 +3,7 @@ * Copyright 2014, Aurélien Gâteau * Copyright 2014-2017, Teo Mrnjavac * Copyright 2018, 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 @@ -286,6 +287,7 @@ PartitionViewStep::next() if ( m_choicePage->currentChoice() == ChoicePage::Manual ) { m_widget->setCurrentWidget( m_manualPartitionPage ); + m_manualPartitionPage->selectDeviceByIndex( m_choicePage->lastSelectedDeviceIndex() ); if ( m_core->isDirty() ) m_manualPartitionPage->onRevertClicked(); } @@ -315,7 +317,10 @@ void PartitionViewStep::back() { if ( m_widget->currentWidget() != m_choicePage ) + { m_widget->setCurrentWidget( m_choicePage ); + m_choicePage->setLastSelectedDeviceIndex( m_manualPartitionPage->selectedDeviceIndex() ); + } } @@ -495,6 +500,61 @@ nameToChoice( QString name, bool& ok ) return SwapChoice::NoSwap; } +/** @brief translate @p defaultFS into a recognized name + * + * Makes several attempts to translate the string into a + * name that KPMCore will recognize. + */ +static QString +findFS( QString defaultFS ) +{ + QStringList fsLanguage { QLatin1Literal( "C" ) }; // Required language list to turn off localization + if ( defaultFS.isEmpty() ) + defaultFS = QStringLiteral( "ext4" ); + if ( FileSystem::typeForName( defaultFS, fsLanguage ) != FileSystem::Unknown ) + { + cDebug() << "Partition-module setting *defaultFileSystemType*" << defaultFS; + return defaultFS; + } + + // First pass: try the default language instead of C locale + auto fsType = FileSystem::typeForName( defaultFS ); + if ( fsType != FileSystem::Unknown ) + { + defaultFS = FileSystem::nameForType( fsType, fsLanguage ); + cWarning() << "Partition-module setting *defaultFileSystemType* changed" << defaultFS; + return defaultFS; + } + + // Second pass: try case-insensitive, both unlocalized and localized + const auto fstypes = FileSystem::types(); + for ( FileSystem::Type t : fstypes ) + { + if ( ( 0 == QString::compare( defaultFS, FileSystem::nameForType( t, fsLanguage ), Qt::CaseInsensitive ) ) || + ( 0 == QString::compare( defaultFS, FileSystem::nameForType( t ), Qt::CaseInsensitive ) ) ) + { + defaultFS = FileSystem::nameForType( fsType, fsLanguage ); + cWarning() << "Partition-module setting *defaultFileSystemType* changed" << defaultFS; + return defaultFS; + } + } + + cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << defaultFS << ") using ext4."; + defaultFS = QStringLiteral( "ext4" ); +#ifdef DEBUG_FILESYSTEMS + // This bit is for distro's debugging their settings, and shows + // all the strings that KPMCore is matching against for FS type. + { + Logger::CLog d( Logger::LOGDEBUG ); + using TR = Logger::DebugRow< int, QString >; + const auto fstypes = FileSystem::types(); + d << "Available types (" << fstypes.count() << ')'; + for ( FileSystem::Type t : fstypes ) + d << TR( static_cast( t ), FileSystem::nameForType( t, fsLanguage ) ); + } +#endif + return defaultFS; +} void PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) @@ -570,30 +630,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) gs->insert( "drawNestedPartitions", CalamaresUtils::getBool( configurationMap, "drawNestedPartitions", false ) ); gs->insert( "alwaysShowPartitionLabels", CalamaresUtils::getBool( configurationMap, "alwaysShowPartitionLabels", true ) ); gs->insert( "enableLuksAutomatedPartitioning", CalamaresUtils::getBool( configurationMap, "enableLuksAutomatedPartitioning", true ) ); - - QString defaultFS = CalamaresUtils::getString( configurationMap, "defaultFileSystemType" ); - if ( defaultFS.isEmpty() ) - defaultFS = QStringLiteral( "ext4" ); - else - cDebug() << "Partition-module setting *defaultFileSystemType*" << defaultFS; - if ( FileSystem::typeForName( defaultFS ) == FileSystem::Unknown ) - { - cWarning() << "Partition-module setting *defaultFileSystemType* is bad (" << defaultFS << ") using ext4."; - defaultFS = QStringLiteral( "ext4" ); -#ifdef DEBUG_FILESYSTEMS - // This bit is for distro's debugging their settings, and shows - // all the strings that KPMCore is matching against for FS type. - { - Logger::CLog d( Logger::LOGDEBUG ); - using TR = Logger::DebugRow< int, QString >; - const auto fstypes = FileSystem::types(); - d << "Available types (" << fstypes.count() << ')'; - for ( FileSystem::Type t : fstypes ) - d << TR( static_cast( t ), FileSystem::nameForType( t ) ); - } -#endif - } - gs->insert( "defaultFileSystemType", defaultFS ); + gs->insert( "defaultFileSystemType", findFS( CalamaresUtils::getString( configurationMap, "defaultFileSystemType" ) ) ); // Now that we have the config, we load the PartitionCoreModule in the background