From 390acd41b2972df918f73ea1dc81e7dec5eadbe9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 4 Aug 2021 01:42:00 +0200 Subject: [PATCH] [partition] Factor out manual partitioning translation - needs to be called when the button is created, too --- src/modules/partition/gui/ChoicePage.cpp | 18 +++++++++++++----- src/modules/partition/gui/ChoicePage.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index ebff428de..d6a9a5250 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -140,12 +140,8 @@ ChoicePage::retranslate() m_previewBeforeLabel->setText( tr( "Current:" ) ); m_previewAfterLabel->setText( tr( "After:" ) ); - if ( m_somethingElseButton ) - { - m_somethingElseButton->setText( tr( "Manual partitioning
" - "You can create or resize partitions yourself." ) ); - } updateSwapChoicesTr( m_eraseSwapChoiceComboBox ); + updateChoiceButtonsTr(); } @@ -342,6 +338,8 @@ ChoicePage::setupChoices() this, &ChoicePage::onEraseSwapChoiceChanged ); } + + updateChoiceButtonsTr(); } @@ -1664,6 +1662,16 @@ ChoicePage::updateSwapChoicesTr( QComboBox* box ) } } +void +ChoicePage::updateChoiceButtonsTr() +{ + if ( m_somethingElseButton ) + { + m_somethingElseButton->setText( tr( "Manual partitioning
" + "You can create or resize partitions yourself." ) ); + } +} + int ChoicePage::lastSelectedDeviceIndex() { diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index c340bfe4a..ce1c95326 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -125,6 +125,7 @@ private: // Translations support void updateSwapChoicesTr( QComboBox* box ); + void updateChoiceButtonsTr(); Config* m_config; bool m_nextEnabled;