From 1aee8401db89306d64749a20303d2dc2b10c5228 Mon Sep 17 00:00:00 2001 From: Victor Fuentes Date: Sat, 23 Apr 2022 13:51:02 -0400 Subject: [PATCH 1/5] [packagechooserq]: allow changing step name --- src/modules/packagechooser/Config.cpp | 16 ++++++++++++++++ src/modules/packagechooser/Config.h | 2 ++ .../packagechooser/PackageChooserViewStep.cpp | 14 +------------- .../packagechooser/PackageChooserViewStep.h | 1 - .../PackageChooserQmlViewStep.cpp | 2 +- src/modules/packagechooserq/packagechooserq.conf | 13 +++++++++++++ 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/modules/packagechooser/Config.cpp b/src/modules/packagechooser/Config.cpp index 491fe5c25..667621597 100644 --- a/src/modules/packagechooser/Config.cpp +++ b/src/modules/packagechooser/Config.cpp @@ -237,6 +237,12 @@ Config::setPackageChoice( const QString& packageChoice ) emit packageChoiceChanged( m_packageChoice.value_or( QString() ) ); } +QString +Config::prettyName() const +{ + return m_stepName ? m_stepName->get() : tr( "Packages" ); +} + QString Config::prettyStatus() const { @@ -343,4 +349,14 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) cWarning() << "Single-selection QML module must use 'Legacy' method."; } } + + bool labels_ok = false; + auto labels = CalamaresUtils::getSubMap( configurationMap, "labels", labels_ok ); + if ( labels_ok ) + { + if ( labels.contains( "step" ) ) + { + m_stepName = new CalamaresUtils::Locale::TranslatedString( labels, "step" ); + } + } } diff --git a/src/modules/packagechooser/Config.h b/src/modules/packagechooser/Config.h index b04b1c30b..d1b783a8d 100644 --- a/src/modules/packagechooser/Config.h +++ b/src/modules/packagechooser/Config.h @@ -98,6 +98,7 @@ public: QString packageChoice() const { return m_packageChoice.value_or( QString() ); } void setPackageChoice( const QString& packageChoice ); + QString prettyName() const; QString prettyStatus() const; signals: @@ -120,6 +121,7 @@ private: * Reading the property will return an empty QString. */ std::optional< QString > m_packageChoice; + CalamaresUtils::Locale::TranslatedString* m_stepName; // As it appears in the sidebar }; diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp index 9057004de..c3f2ce6e2 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.cpp +++ b/src/modules/packagechooser/PackageChooserViewStep.cpp @@ -29,7 +29,6 @@ PackageChooserViewStep::PackageChooserViewStep( QObject* parent ) : Calamares::ViewStep( parent ) , m_config( new Config( this ) ) , m_widget( nullptr ) - , m_stepName( nullptr ) { emit nextStatusChanged( false ); } @@ -41,14 +40,13 @@ PackageChooserViewStep::~PackageChooserViewStep() { m_widget->deleteLater(); } - delete m_stepName; } QString PackageChooserViewStep::prettyName() const { - return m_stepName ? m_stepName->get() : tr( "Packages" ); + return m_config->prettyName(); } @@ -139,16 +137,6 @@ PackageChooserViewStep::setConfigurationMap( const QVariantMap& configurationMap m_config->setDefaultId( moduleInstanceKey() ); m_config->setConfigurationMap( configurationMap ); - bool labels_ok = false; - auto labels = CalamaresUtils::getSubMap( configurationMap, "labels", labels_ok ); - if ( labels_ok ) - { - if ( labels.contains( "step" ) ) - { - m_stepName = new CalamaresUtils::Locale::TranslatedString( labels, "step" ); - } - } - if ( m_widget ) { hookupModel(); diff --git a/src/modules/packagechooser/PackageChooserViewStep.h b/src/modules/packagechooser/PackageChooserViewStep.h index 7561f2bd7..76b35aed8 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.h +++ b/src/modules/packagechooser/PackageChooserViewStep.h @@ -50,7 +50,6 @@ private: Config* m_config; PackageChooserPage* m_widget; - CalamaresUtils::Locale::TranslatedString* m_stepName; // As it appears in the sidebar }; CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserViewStepFactory ) diff --git a/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp index 543c9771d..ae4aa3c48 100644 --- a/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp +++ b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp @@ -29,7 +29,7 @@ PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent ) QString PackageChooserQmlViewStep::prettyName() const { - return tr( "Packages" ); + return m_config->prettyName(); } QString diff --git a/src/modules/packagechooserq/packagechooserq.conf b/src/modules/packagechooserq/packagechooserq.conf index 803c6f670..9c1878f34 100644 --- a/src/modules/packagechooserq/packagechooserq.conf +++ b/src/modules/packagechooserq/packagechooserq.conf @@ -42,6 +42,19 @@ # method: legacy +# Human-visible strings in this module. These are all optional. +# The following translated keys are used: +# - *step*, used in the overall progress view (left-hand pane) +# +# Each key can have a [locale] added to it, which is used as +# the translated string for that locale. For the strings +# associated with the "no-selection" item, see *items*, below +# with the explicit item-*id* "". +# +labels: + step: "Packages" + step[nl]: "Pakketten" + # The *packageChoice* value is used for setting the default selection # in the QML view; this should match one of the keys used in the QML # module for package names. From 78067110c909281c0dcc3a05f436257cb05c0852 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 16 Apr 2022 12:42:29 +0200 Subject: [PATCH 2/5] Git: add a blame-ignore file for large-scale reformatting --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..cbf236645 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +18fef8dfe5d926ec0bc979562553adf4db8db2e9 From cab4be1bd0d934e6f8a3086c76b3343abb787d18 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 23 Apr 2022 21:29:00 +0200 Subject: [PATCH 3/5] Changes: credits for packagechooser-naming --- CHANGES-3.2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES-3.2 b/CHANGES-3.2 index 5efd645bb..c590fe13f 100644 --- a/CHANGES-3.2 +++ b/CHANGES-3.2 @@ -12,6 +12,7 @@ website will have to do for older versions. This release contains contributions from (alphabetically by first name): - Arjen Balfoort (new contributor! Welcome!) + - Victor Fuentes ## Core ## - No core changes yet @@ -19,6 +20,8 @@ This release contains contributions from (alphabetically by first name): ## Modules ## - *fstab* and *luksbootkeyfile* have better support for an **un**encrypted `/boot` partition. #1931 (thanks Arjen) + - *packagechooser* and *packagechooserq* can now be given a custom name + in the side-panel. #1932 (thanks Victor) # 3.2.56 (2022-04-22) # From c48209a9dd9b541e146f71fd671e6c1eed290f41 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 25 Apr 2022 15:28:35 +0200 Subject: [PATCH 4/5] CI: make CI scripts more consistent --- .github/workflows/nightly-debian.yml | 6 +++-- .github/workflows/nightly-neon.yml | 32 ++++++++++++++------------ .github/workflows/nightly-opensuse.yml | 5 ++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/nightly-debian.yml b/.github/workflows/nightly-debian.yml index 433df748b..9d3fc4d4d 100644 --- a/.github/workflows/nightly-debian.yml +++ b/.github/workflows/nightly-debian.yml @@ -34,11 +34,13 @@ jobs: with: token: ${{ secrets.MATRIX_TOKEN }} room: ${{ secrets.MATRIX_ROOM }} - message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" + message: | + OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} - name: "notify: fail" if: ${{ failure() && github.repository == 'calamares/calamares' }} uses: calamares/actions/matrix-notify@v4 with: token: ${{ secrets.MATRIX_TOKEN }} room: ${{ secrets.MATRIX_ROOM }} - message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" + message: | + FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} diff --git a/.github/workflows/nightly-neon.yml b/.github/workflows/nightly-neon.yml index d2930fa36..b0c576721 100644 --- a/.github/workflows/nightly-neon.yml +++ b/.github/workflows/nightly-neon.yml @@ -28,6 +28,22 @@ jobs: - name: "build" id: build uses: calamares/actions/generic-build@v4 + - name: "notify: ok" + if: ${{ success() && github.repository == 'calamares/calamares' }} + uses: calamares/actions/matrix-notify@v4 + with: + token: ${{ secrets.MATRIX_TOKEN }} + room: ${{ secrets.MATRIX_ROOM }} + message: | + OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} + - name: "notify: fail" + if: ${{ failure() && github.repository == 'calamares/calamares' }} + uses: calamares/actions/matrix-notify@v4 + with: + token: ${{ secrets.MATRIX_TOKEN }} + room: ${{ secrets.MATRIX_ROOM }} + message: | + FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} - name: "Calamares: archive" working-directory: ${{ env.BUILDDIR }} run: | @@ -39,18 +55,4 @@ jobs: name: calamares-tarball path: ${{ env.BUILDDIR }}/calamares.tar.gz if-no-files-found: error - retention-days: 3 - - name: "notify: ok" - if: ${{ success() && github.repository == 'calamares/calamares' }} - uses: calamares/actions/matrix-notify@v4 - with: - token: ${{ secrets.MATRIX_TOKEN }} - room: ${{ secrets.MATRIX_ROOM }} - message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" - - name: "notify: fail" - if: ${{ failure() && github.repository == 'calamares/calamares' }} - uses: calamares/actions/matrix-notify@v4 - with: - token: ${{ secrets.MATRIX_TOKEN }} - room: ${{ secrets.MATRIX_ROOM }} - message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" + retention-days: 7 diff --git a/.github/workflows/nightly-opensuse.yml b/.github/workflows/nightly-opensuse.yml index 2979c56b6..717cabe66 100644 --- a/.github/workflows/nightly-opensuse.yml +++ b/.github/workflows/nightly-opensuse.yml @@ -35,11 +35,12 @@ jobs: token: ${{ secrets.MATRIX_TOKEN }} room: ${{ secrets.MATRIX_ROOM }} message: | - OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" + OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} - name: "notify: fail" if: ${{ failure() && github.repository == 'calamares/calamares' }} uses: calamares/actions/matrix-notify@v4 with: token: ${{ secrets.MATRIX_TOKEN }} room: ${{ secrets.MATRIX_ROOM }} - message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }}" + message: | + FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.build.outputs.git-summary }} From 5bff26e1e0a9cb732464498f6707931c6c857e5f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 25 Apr 2022 16:06:24 +0200 Subject: [PATCH 5/5] [partition] Display partition label and path if set Setting labels (e.g. in manual partitioning) landed some time ago, but the progress display still shows a raw device path. Make it more expressive. FIXES #449 FIXES #540 --- src/modules/partition/jobs/FormatPartitionJob.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/partition/jobs/FormatPartitionJob.cpp b/src/modules/partition/jobs/FormatPartitionJob.cpp index 63d233426..599e29769 100644 --- a/src/modules/partition/jobs/FormatPartitionJob.cpp +++ b/src/modules/partition/jobs/FormatPartitionJob.cpp @@ -58,10 +58,13 @@ FormatPartitionJob::prettyDescription() const QString FormatPartitionJob::prettyStatusMessage() const { + QString partitionLabel = m_partition->label().isEmpty() + ? m_partition->partitionPath() + : tr( "%1 (%2)", "partition label %1 (device path %2)" ) + .arg( m_partition->label(), m_partition->partitionPath() ); return tr( "Formatting partition %1 with " "file system %2." ) - .arg( m_partition->partitionPath() ) - .arg( userVisibleFS( m_partition->fileSystem() ) ); + .arg( partitionLabel, userVisibleFS( m_partition->fileSystem() ) ); }