From f0eb7ffbda5f6844c864ee0d5269a54445bbab6e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 8 Dec 2021 00:59:20 +0100 Subject: [PATCH] [partition Untangle, Warnings-- The translations apply to labels and a tooltip, which depends on the partition-table type. Move the strings together and make the whole range of the switch explicitly. --- .../partition/gui/DeviceInfoWidget.cpp | 83 ++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/src/modules/partition/gui/DeviceInfoWidget.cpp b/src/modules/partition/gui/DeviceInfoWidget.cpp index bbc8ce74c..05a8c4b63 100644 --- a/src/modules/partition/gui/DeviceInfoWidget.cpp +++ b/src/modules/partition/gui/DeviceInfoWidget.cpp @@ -68,7 +68,8 @@ DeviceInfoWidget::setPartitionTableType( PartitionTable::TableType type ) void DeviceInfoWidget::retranslateUi() { - QString typeString = PartitionTable::tableTypeToName( m_tableType ).toUpper(); + QString typeString; + QString toolTipString; // fix up if the name shouldn't be uppercase: switch ( m_tableType ) @@ -76,38 +77,32 @@ DeviceInfoWidget::retranslateUi() case PartitionTable::msdos: case PartitionTable::msdos_sectorbased: typeString = "MBR"; + toolTipString += tr( "

This partition table type is only advisable on older " + "systems which start from a BIOS boot " + "environment. GPT is recommended in most other cases.

" + "Warning: the MBR partition table " + "is an obsolete MS-DOS era standard.
" + "Only 4 primary partitions may be created, and of " + "those 4, one can be an extended partition, which " + "may in turn contain many logical partitions." ); + break; + case PartitionTable::gpt: + // TypeString is ok + toolTipString += tr( "

This is the recommended partition table type for modern " + "systems which start from an EFI boot " + "environment." ); break; case PartitionTable::loop: typeString = "loop"; - break; - case PartitionTable::mac: - typeString = "Mac"; - break; - case PartitionTable::amiga: - typeString = "Amiga"; - break; - case PartitionTable::sun: - typeString = "Sun"; - break; - case PartitionTable::unknownTableType: - typeString = " ? "; - } - - - QString toolTipString = tr( "This device has a %1 partition " - "table." ) - .arg( typeString ); - - switch ( m_tableType ) - { - case PartitionTable::loop: toolTipString = tr( "This is a loop " "device.

" "It is a pseudo-device with no partition table " "that makes a file accessible as a block device. " "This kind of setup usually only contains a single filesystem." ); break; + case PartitionTable::none: case PartitionTable::unknownTableType: + typeString = " ? "; toolTipString = tr( "This installer cannot detect a partition table on the " "selected storage device.

" "The device either has no partition " @@ -117,21 +112,35 @@ DeviceInfoWidget::retranslateUi() "either automatically, or through the manual partitioning " "page." ); break; - case PartitionTable::gpt: - toolTipString += tr( "

This is the recommended partition table type for modern " - "systems which start from an EFI boot " - "environment." ); + // The next ones need to have the name adjusted, but the default tooltip is OK + case PartitionTable::mac: + typeString = "Mac"; break; - case PartitionTable::msdos: - case PartitionTable::msdos_sectorbased: - toolTipString += tr( "

This partition table type is only advisable on older " - "systems which start from a BIOS boot " - "environment. GPT is recommended in most other cases.

" - "Warning: the MBR partition table " - "is an obsolete MS-DOS era standard.
" - "Only 4 primary partitions may be created, and of " - "those 4, one can be an extended partition, which " - "may in turn contain many logical partitions." ); + case PartitionTable::amiga: + typeString = "Amiga"; + break; + case PartitionTable::sun: + typeString = "Sun"; + break; + // Peculiar tables, do nothing and use default type and tooltip strings + case PartitionTable::aix: + case PartitionTable::bsd: + case PartitionTable::dasd: + case PartitionTable::dvh: + case PartitionTable::pc98: + case PartitionTable::vmd: + break; + } + + if ( typeString.isEmpty() ) + { + typeString = PartitionTable::tableTypeToName( m_tableType ).toUpper(); + } + if ( toolTipString.isEmpty() ) + { + toolTipString = tr( "This device has a %1 partition " + "table." ) + .arg( typeString ); } m_ptLabel->setText( typeString );