Use Branding in partition viewmodule.

main
Teo Mrnjavac 10 years ago
parent 4c51d320f6
commit 2e2bd78deb

@ -32,6 +32,7 @@
#include "GlobalStorage.h" #include "GlobalStorage.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/CalamaresUtilsGui.h" #include "utils/CalamaresUtilsGui.h"
#include "Branding.h"
#include <QBoxLayout> #include <QBoxLayout>
#include <QComboBox> #include <QComboBox>
@ -137,7 +138,8 @@ AlongsidePage::init( PartitionCoreModule* core , const OsproberEntryList& osprob
candidate->used() * 1.1, candidate->used() * 1.1,
candidate->capacity() - requiredStorageB, candidate->capacity() - requiredStorageB,
candidate->capacity() / 2, candidate->capacity() / 2,
tr( "$RELEASE" ) ); Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) );
m_splitterWidget->setFixedHeight( qMax< int >( CalamaresUtils::defaultFontHeight() * 1.5, 30 ) ); m_splitterWidget->setFixedHeight( qMax< int >( CalamaresUtils::defaultFontHeight() * 1.5, 30 ) );
if ( ok ) if ( ok )
@ -158,12 +160,13 @@ AlongsidePage::init( PartitionCoreModule* core , const OsproberEntryList& osprob
{ {
m_sizeLabel->setText( tr( "With this operation, the partition <b>%1</b> which contains " m_sizeLabel->setText( tr( "With this operation, the partition <b>%1</b> which contains "
"%4 will be shrunk " "%4 will be shrunk "
"to %2MB and a new %3MB partition will be created for " "to %2MB and a new %3MB partition will be created for %5." )
"$RELEASE." )
.arg( path ) .arg( path )
.arg( size / ( 1024 * 1024 ) ) .arg( size / ( 1024 * 1024 ) )
.arg( sizeNext / ( 1024 * 1024 ) ) .arg( sizeNext / ( 1024 * 1024 ) )
.arg( m_partitionsComboBox->currentText() ) ); .arg( m_partitionsComboBox->currentText() )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) ) );
} ); } );
foreach ( const OsproberEntry& e, osproberEntries ) foreach ( const OsproberEntry& e, osproberEntries )

@ -27,6 +27,7 @@
#include "utils/CalamaresUtilsGui.h" #include "utils/CalamaresUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "Branding.h"
#include <QBoxLayout> #include <QBoxLayout>
#include <QButtonGroup> #include <QButtonGroup>
@ -107,7 +108,8 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn
eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>" eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>"
"<font color=\"red\">Warning: </font>This will delete all of your programs, " "<font color=\"red\">Warning: </font>This will delete all of your programs, "
"documents, photos, music, and any other files." ) "documents, photos, music, and any other files." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
alongsideButton->hide(); alongsideButton->hide();
} }
@ -126,14 +128,16 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn
"You can choose which operating system you want each time the " "You can choose which operating system you want each time the "
"computer starts up." ) "computer starts up." )
.arg( osName ) .arg( osName )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
eraseButton->setText( tr( "<b>Replace %1 with %2</b><br/>" eraseButton->setText( tr( "<b>Replace %1 with %2</b><br/>"
"<font color=\"red\">Warning: </font>This will erase the whole disk and " "<font color=\"red\">Warning: </font>This will erase the whole disk and "
"delete all of your %1 programs, " "delete all of your %1 programs, "
"documents, photos, music, and any other files." ) "documents, photos, music, and any other files." )
.arg( osName ) .arg( osName )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
} }
else else
{ {
@ -144,12 +148,14 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn
"Documents, music and other personal files will be kept. " "Documents, music and other personal files will be kept. "
"You can choose which operating system you want each time the " "You can choose which operating system you want each time the "
"computer starts up." ) "computer starts up." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>" eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>"
"<font color=\"red\">Warning: </font>This will delete all of your Windows 7 programs, " "<font color=\"red\">Warning: </font>This will delete all of your Windows 7 programs, "
"documents, photos, music, and any other files." ) "documents, photos, music, and any other files." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
} }
if ( !osproberEntries.first().canBeResized ) if ( !osproberEntries.first().canBeResized )
alongsideButton->hide(); alongsideButton->hide();
@ -176,12 +182,14 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn
"Documents, music and other personal files will be kept. " "Documents, music and other personal files will be kept. "
"You can choose which operating system you want each time the " "You can choose which operating system you want each time the "
"computer starts up." ) "computer starts up." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>" eraseButton->setText( tr( "<b>Erase disk and install %1</b><br/>"
"<font color=\"red\">Warning: </font>This will delete all of your Windows 7 programs, " "<font color=\"red\">Warning: </font>This will delete all of your Windows 7 programs, "
"documents, photos, music, and any other files." ) "documents, photos, music, and any other files." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
if ( !atLeastOneCanBeResized ) if ( !atLeastOneCanBeResized )
alongsideButton->hide(); alongsideButton->hide();
@ -195,7 +203,8 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn
somethingElseButton->setText( tr( "<b>Something else</b><br/>" somethingElseButton->setText( tr( "<b>Something else</b><br/>"
"You can create or resize partitions yourself, or choose " "You can create or resize partitions yourself, or choose "
"multiple partitions for %1." ) "multiple partitions for %1." )
.arg( "$RELEASE" ) ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
somethingElseButton->setIconSize( iconSize ); somethingElseButton->setIconSize( iconSize );
somethingElseButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Partitions, somethingElseButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Partitions,
CalamaresUtils::Original, CalamaresUtils::Original,

Loading…
Cancel
Save