Merge branch 'ui-tweaks'

This commit is contained in:
Adriaan de Groot 2017-07-04 08:53:21 -04:00
commit 57031a4c15
16 changed files with 138 additions and 123 deletions

View File

@ -8,6 +8,10 @@ componentName: default
# same distribution.
welcomeStyleCalamares: false
# Should the welcome image (productWelcome, below) be scaled
# up beyond its natural size?
welcomeExpandingLogo: true
strings:
productName: Generic GNU/Linux
shortProductName: Generic

View File

@ -43,8 +43,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
CALAMARES_RETRANSLATE(
setWindowTitle( tr( "%1 Installer" )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) ) );
.arg( *Calamares::Branding::ProductName ) );
)
using CalamaresUtils::windowMinimumHeight;

View File

@ -110,6 +110,7 @@ Branding::Branding( const QString& brandingFilePath,
bail( "Syntax error in strings map." );
m_welcomeStyleCalamares = doc[ "welcomeStyleCalamares" ].as< bool >( false );
m_welcomeExpandingLogo = doc[ "welcomeExpandingLogo" ].as< bool >( true );
QVariantMap strings =
CalamaresUtils::yamlMapToVariant( doc[ "strings" ] ).toMap();
@ -276,12 +277,6 @@ Branding::slideshowPath() const
return m_slideshowPath;
}
bool
Branding::welcomeStyleCalamares() const
{
return m_welcomeStyleCalamares;
}
void
Branding::setGlobals( GlobalStorage* globalStorage ) const
{

View File

@ -37,6 +37,11 @@ class UIDLLEXPORT Branding : public QObject
{
Q_OBJECT
public:
/**
* Descriptive strings in the configuration file. use
* e.g. *Branding::ProductName to get the string value for
* the product name.
*/
enum StringEntry : short
{
ProductName,
@ -83,7 +88,8 @@ public:
QPixmap image( Branding::ImageEntry imageEntry, const QSize& size ) const;
QString slideshowPath() const;
bool welcomeStyleCalamares() const;
bool welcomeStyleCalamares() const { return m_welcomeStyleCalamares; }
bool welcomeExpandingLogo() const { return m_welcomeExpandingLogo; }
/**
* Creates a map called "branding" in the global storage, and inserts an
@ -110,8 +116,11 @@ private:
QString m_translationsPathPrefix;
bool m_welcomeStyleCalamares;
bool m_welcomeExpandingLogo;
};
template<typename U> inline QString operator*(U e) { return Branding::instance()->string( e ); }
}
#endif // BRANDING_H

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -177,22 +178,23 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
cLog() << "- message:" << message;
cLog() << "- details:" << details;
QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Critical );
msgBox.setWindowTitle( tr("Error") );
msgBox.setText( "<strong>" + tr( "Installation Failed" ) + "</strong>" );
msgBox.setStandardButtons( QMessageBox::Close );
QMessageBox* msgBox = new QMessageBox();
msgBox->setIcon( QMessageBox::Critical );
msgBox->setWindowTitle( tr("Error") );
msgBox->setText( "<strong>" + tr( "Installation Failed" ) + "</strong>" );
msgBox->setStandardButtons( QMessageBox::Close );
msgBox->button( QMessageBox::Close )->setText( tr( "&Close" ) );
QString text = "<p>" + message + "</p>";
if ( !details.isEmpty() )
{
text += "<p>" + details + "</p>";
}
msgBox.setInformativeText( text );
msgBox->setInformativeText( text );
msgBox.exec();
cLog() << "Calamares will now quit.";
qApp->quit();
connect(msgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit);
cLog() << "Calamares will quit when the dialog closes.";
msgBox->show();
}
@ -237,10 +239,8 @@ ViewManager::next()
tr( "The %1 installer is about to make changes to your "
"disk in order to install %2.<br/><strong>You will not be able "
"to undo these changes.</strong>" )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortProductName ) )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortVersionedName ) ),
.arg( *Calamares::Branding::ShortProductName )
.arg( *Calamares::Branding::ShortVersionedName ),
tr( "&Install now" ),
tr( "Go &back" ),
QString(),

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,7 +31,7 @@ public:
virtual ~FixedAspectRatioLabel();
public slots:
virtual void setPixmap( const QPixmap &pixmap );
void setPixmap( const QPixmap &pixmap );
void resizeEvent( QResizeEvent* event ) override;
private:

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -39,6 +40,7 @@ FinishedPage::FinishedPage( QWidget* parent )
, ui( new Ui::FinishedPage )
, m_restartSetUp( false )
{
cDebug() << "FinishedPage()";
ui->setupUi( this );
ui->mainText->setAlignment( Qt::AlignCenter );
@ -51,10 +53,8 @@ FinishedPage::FinishedPage( QWidget* parent )
"%1 has been installed on your computer.<br/>"
"You may now restart into your new system, or continue "
"using the %2 Live environment." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) ) );
.arg( *Calamares::Branding::VersionedName )
.arg( *Calamares::Branding::ProductName ) );
)
}
@ -83,6 +83,7 @@ FinishedPage::setRestartNowCommand( const QString& command )
void
FinishedPage::setUpRestart()
{
cDebug() << "FinishedPage::setUpRestart()";
if ( !m_restartSetUp )
{
connect( qApp, &QApplication::aboutToQuit,
@ -102,3 +103,14 @@ FinishedPage::focusInEvent( QFocusEvent* e )
e->accept();
}
void
FinishedPage::onInstallationFailed( const QString& message, const QString& details )
{
Q_UNUSED( details );
ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>"
"%1 has not been installed on your computer.<br/>"
"The error message was: %2." )
.arg( *Calamares::Branding::VersionedName )
.arg( message ) );
setRestartNowEnabled( false );
}

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +39,9 @@ public:
void setUpRestart();
public slots:
void onInstallationFailed( const QString& message, const QString& details );
protected:
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,8 +18,10 @@
*/
#include "FinishedViewStep.h"
#include "FinishedPage.h"
#include "JobQueue.h"
#include "utils/Logger.h"
#include <QVariantMap>
@ -26,6 +29,11 @@ FinishedViewStep::FinishedViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new FinishedPage() )
{
cDebug() << "FinishedViewStep()";
connect( Calamares::JobQueue::instance(), &Calamares::JobQueue::failed,
m_widget, &FinishedPage::onInstallationFailed );
emit nextStatusChanged( true );
}
@ -47,6 +55,7 @@ FinishedViewStep::prettyName() const
QWidget*
FinishedViewStep::widget()
{
cDebug() << "FinishedViewStep::widget()";
return m_widget;
}
@ -94,6 +103,7 @@ FinishedViewStep::isAtEnd() const
void
FinishedViewStep::onActivate()
{
cDebug() << "FinishedViewStep::onActivate()";
m_widget->setUpRestart();
}
@ -101,6 +111,7 @@ FinishedViewStep::onActivate()
QList< Calamares::job_ptr >
FinishedViewStep::jobs() const
{
cDebug() << "FinishedViewStep::jobs";
return QList< Calamares::job_ptr >();
}

View File

@ -153,19 +153,27 @@ PartitionCoreModule::doInit()
{
FileSystemFactory::init();
using DeviceList = QList< Device* >;
CoreBackend* backend = CoreBackendManager::self()->backend();
QList< Device* > devices = backend->scanDevices( true );
DeviceList devices = backend->scanDevices( true );
cDebug() << "Winnowing" << devices.count() << "devices.";
// Remove the device which contains / from the list
for ( QList< Device* >::iterator it = devices.begin(); it != devices.end(); )
for ( DeviceList::iterator it = devices.begin(); it != devices.end(); )
if ( ! (*it) || hasRootPartition( *it ) ||
(*it)->deviceNode().startsWith( "/dev/zram") ||
isIso9660( *it ) )
{
cDebug() << " .. Winnowing" << ( (*it) ? (*it)->deviceNode() : QString( "<null device>" ) );
it = devices.erase( it );
}
else
++it;
cDebug() << "LIST OF DETECTED DEVICES:\nnode\tcapacity\tname\tprettyName";
cDebug() << "LIST OF DETECTED DEVICES:";
cDebug() << "node\tcapacity\tname\tprettyName";
for ( auto device : devices )
{
auto deviceInfo = new DeviceInfo( device );

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -474,8 +475,7 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current,
qRound64( part->used() * 1.1 ),
part->capacity() - requiredStorageB,
part->capacity() / 2,
Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) );
*Calamares::Branding::ProductName );
if ( m_isEfi )
setupEfiSystemPartitionSelector();
@ -775,8 +775,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
if ( !homePartitionPath->isEmpty() )
m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." )
.arg( *homePartitionPath )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
delete homePartitionPath;
if ( m_isEfi )
@ -919,8 +918,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
.arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() )
.arg( size / ( 1024 * 1024 ) )
.arg( sizeNext / ( 1024 * 1024 ) )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
} );
m_previewAfterFrame->show();
@ -948,8 +946,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
m_afterPartitionBarsView->setNestedPartitionsMode( mode );
m_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame );
m_afterPartitionLabelsView->setExtendedPartitionHidden( mode == PartitionBarsView::NoNestedPartitions );
m_afterPartitionLabelsView->setCustomNewRootLabel( Calamares::Branding::instance()->
string( Calamares::Branding::BootloaderEntryName ) );
m_afterPartitionLabelsView->setCustomNewRootLabel( *Calamares::Branding::BootloaderEntryName );
PartitionModel* model = m_core->partitionModelForDevice( selectedDevice() );
@ -1073,8 +1070,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "An EFI system partition cannot be found anywhere "
"on this system. Please go back and use manual "
"partitioning to set up %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
updateNextEnabled();
}
else if ( efiSystemPartitions.count() == 1 ) //probably most usual situation
@ -1083,8 +1079,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "The EFI system partition at %1 will be used for "
"starting %2." )
.arg( efiSystemPartitions.first()->partitionPath() )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
}
else
{
@ -1185,13 +1180,11 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
m_replaceButton->hide();
@ -1216,8 +1209,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data "
@ -1226,8 +1218,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
}
else
@ -1240,8 +1231,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data "
@ -1249,8 +1239,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
}
@ -1278,8 +1267,7 @@ ChoicePage::setupActions()
m_alongsideButton->setText( tr( "<strong>Install alongside</strong><br/>"
"The installer will shrink a partition to make room for %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
m_eraseButton->setText( tr( "<strong>Erase disk</strong><br/>"
"This will <font color=\"red\">delete</font> all data "
@ -1287,8 +1275,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
m_replaceButton->show();

View File

@ -156,18 +156,15 @@ PartitionViewStep::createSummaryWidget() const
{
case ChoicePage::Alongside:
modeText = tr( "Install %1 <strong>alongside</strong> another operating system." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) );
.arg( *Calamares::Branding::ShortVersionedName );
break;
case ChoicePage::Erase:
modeText = tr( "<strong>Erase</strong> disk and install %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) );
.arg( *Calamares::Branding::ShortVersionedName );
break;
case ChoicePage::Replace:
modeText = tr( "<strong>Replace</strong> a partition with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) );
.arg( *Calamares::Branding::ShortVersionedName );
break;
case ChoicePage::NoChoice:
case ChoicePage::Manual:
@ -185,22 +182,19 @@ PartitionViewStep::createSummaryWidget() const
{
case ChoicePage::Alongside:
modeText = tr( "Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3)." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) )
.arg( *Calamares::Branding::ShortVersionedName )
.arg( info.deviceNode )
.arg( info.deviceName );
break;
case ChoicePage::Erase:
modeText = tr( "<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) )
.arg( *Calamares::Branding::ShortVersionedName )
.arg( info.deviceNode )
.arg( info.deviceName );
break;
case ChoicePage::Replace:
modeText = tr( "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) )
.arg( *Calamares::Branding::ShortVersionedName )
.arg( info.deviceNode )
.arg( info.deviceName );
break;
@ -252,8 +246,7 @@ PartitionViewStep::createSummaryWidget() const
previewLabels->setModel( info.partitionModelAfter );
preview->setSelectionMode( QAbstractItemView::NoSelection );
previewLabels->setSelectionMode( QAbstractItemView::NoSelection );
previewLabels->setCustomNewRootLabel( Calamares::Branding::instance()->
string( Calamares::Branding::BootloaderEntryName ) );
previewLabels->setCustomNewRootLabel( *Calamares::Branding::BootloaderEntryName );
info.partitionModelAfter->setParent( widget );
field = new QVBoxLayout;
CalamaresUtils::unmarginLayout( field );
@ -412,8 +405,7 @@ PartitionViewStep::onLeave()
"<strong>%2</strong>.<br/><br/>"
"You can continue without setting up an EFI system "
"partition but your system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( *Calamares::Branding::ShortProductName )
.arg( espMountPoint );
}
else if ( esp && !esp->activeFlags().testFlag( PartitionTable::FlagEsp ) )
@ -428,8 +420,7 @@ PartitionViewStep::onLeave()
"<br/><br/>"
"You can continue without setting the flag but your "
"system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( *Calamares::Branding::ShortProductName )
.arg( espMountPoint );
}

View File

@ -134,8 +134,7 @@ ReplaceWidget::onPartitionSelected()
tr( "Select where to install %1.<br/>"
"<font color=\"red\">Warning: </font>this will delete all files "
"on the selected partition." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
.arg( *Calamares::Branding::VersionedName ) );
setNextEnabled( false );
return;
}
@ -168,8 +167,7 @@ ReplaceWidget::onPartitionSelected()
updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on empty space. Please select an "
"existing partition." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
.arg( *Calamares::Branding::VersionedName ) );
setNextEnabled( false );
return;
}
@ -179,8 +177,7 @@ ReplaceWidget::onPartitionSelected()
updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on an extended partition. Please select an "
"existing primary or logical partition." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
.arg( *Calamares::Branding::VersionedName ) );
setNextEnabled( false );
return;
}
@ -189,8 +186,7 @@ ReplaceWidget::onPartitionSelected()
{
updateStatus( CalamaresUtils::Fail,
tr( "%1 cannot be installed on this partition." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
.arg( *Calamares::Branding::VersionedName ) );
setNextEnabled( false );
return;
}
@ -232,8 +228,7 @@ ReplaceWidget::onPartitionSelected()
"The partition %1 is too small for %2. Please select a partition "
"with capacity at least %3 GiB." )
.arg( partition->partitionPath() )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) )
.arg( *Calamares::Branding::VersionedName )
.arg( requiredSpaceB / ( 1024. * 1024. * 1024. ),
0, 'f', 1 )
.arg( prettyName ) );
@ -256,8 +251,7 @@ ReplaceWidget::onPartitionSelected()
"An EFI system partition cannot be found anywhere "
"on this system. Please go back and use manual "
"partitioning to set up %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( *Calamares::Branding::ShortProductName )
.arg( prettyName ) );
setNextEnabled( false );
}
@ -268,16 +262,14 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.")
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) )
.arg( *Calamares::Branding::VersionedName )
.arg( partition->partitionPath() )
.arg( prettyName ) );
m_ui->bootStatusLabel->show();
m_ui->bootStatusLabel->setText(
tr( "The EFI system partition at %1 will be used for starting %2." )
.arg( efiSystemPartitions.first()->partitionPath() )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
setNextEnabled( true );
}
else
@ -287,8 +279,7 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.")
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) )
.arg( *Calamares::Branding::VersionedName )
.arg( partition->partitionPath() )
.arg( prettyName ) );
m_ui->bootStatusLabel->show();
@ -312,8 +303,7 @@ ReplaceWidget::onPartitionSelected()
"%1 will be installed on %2.<br/>"
"<font color=\"red\">Warning: </font>all data on partition "
"%2 will be lost.")
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) )
.arg( *Calamares::Branding::VersionedName )
.arg( partition->partitionPath() )
.arg( prettyName ) );
setNextEnabled( true );

View File

@ -145,8 +145,7 @@ FillGlobalStorageJob::prettyDescription() const
{
if ( mountPoint == "/" )
lines.append( tr( "Install %1 on <strong>new</strong> %2 system partition." )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortProductName ) )
.arg( *Calamares::Branding::ShortProductName )
.arg( fsType ) );
else
lines.append( tr( "Set up <strong>new</strong> %2 partition with mount point "
@ -159,8 +158,7 @@ FillGlobalStorageJob::prettyDescription() const
if ( mountPoint == "/" )
lines.append( tr( "Install %2 on %3 system partition <strong>%1</strong>." )
.arg( path )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortProductName ) )
.arg( *Calamares::Branding::ShortProductName )
.arg( fsType ) );
else
lines.append( tr( "Set up %3 partition <strong>%1</strong> with mount point "

View File

@ -54,12 +54,11 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par
ui->mainText->setOpenExternalLinks( true );
cDebug() << "Welcome string" << Calamares::Branding::instance()->welcomeStyleCalamares()
<< Calamares::Branding::instance()->string( Calamares::Branding::VersionedName );
<< *Calamares::Branding::VersionedName;
CALAMARES_RETRANSLATE(
ui->mainText->setText( (Calamares::Branding::instance()->welcomeStyleCalamares() ? tr( "<h1>Welcome to the Calamares installer for %1.</h1>" ) : tr( "<h1>Welcome to the %1 installer.</h1>" ))
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::VersionedName ) ) );
.arg( *Calamares::Branding::VersionedName ) );
ui->retranslateUi( this );
)
@ -78,6 +77,7 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par
"<strong>%2<br/>"
"for %3</strong><br/><br/>"
"Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>"
"Copyright 2017 Adriaan de Groot &lt;groot@kde.org&gt;<br/>"
"Thanks to: Anke Boersma, Aurélien Gâteau, Kevin Kofler, Lisa Vitolo,"
" Philip Müller, Pier Luigi Fiorini, Rohan Garg and the <a "
"href=\"https://www.transifex.com/calamares/calamares/\">Calamares "
@ -89,8 +89,7 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par
)
.arg( CALAMARES_APPLICATION_NAME )
.arg( CALAMARES_VERSION )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::VersionedName ) ),
.arg( *Calamares::Branding::VersionedName ),
QMessageBox::Ok,
this );
mb.setIconPixmap( CalamaresUtils::defaultPixmap( CalamaresUtils::Squid,
@ -193,12 +192,11 @@ WelcomePage::setUpLinks( bool showSupportUrl,
bool showReleaseNotesUrl )
{
using namespace Calamares;
Branding* b = Branding::instance();
if ( showSupportUrl && !b->string( Branding::SupportUrl ).isEmpty() )
if ( showSupportUrl && !( *Branding::SupportUrl ).isEmpty() )
{
CALAMARES_RETRANSLATE(
ui->supportButton->setText( tr( "%1 support" )
.arg( b->string( Branding::ShortProductName ) ) );
.arg( *Branding::ShortProductName ) );
)
ui->supportButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Help,
CalamaresUtils::Original,
@ -206,7 +204,7 @@ WelcomePage::setUpLinks( bool showSupportUrl,
CalamaresUtils::defaultFontHeight() ) ) );
connect( ui->supportButton, &QPushButton::clicked, []
{
QDesktopServices::openUrl( Branding::instance()->string( Branding::SupportUrl ) );
QDesktopServices::openUrl( *Branding::SupportUrl );
} );
}
else
@ -214,7 +212,7 @@ WelcomePage::setUpLinks( bool showSupportUrl,
ui->supportButton->hide();
}
if ( showKnownIssuesUrl && !b->string( Branding::KnownIssuesUrl ).isEmpty() )
if ( showKnownIssuesUrl && !( *Branding::KnownIssuesUrl ).isEmpty() )
{
ui->knownIssuesButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Bugs,
CalamaresUtils::Original,
@ -222,7 +220,7 @@ WelcomePage::setUpLinks( bool showSupportUrl,
CalamaresUtils::defaultFontHeight() ) ) );
connect( ui->knownIssuesButton, &QPushButton::clicked, []
{
QDesktopServices::openUrl( Branding::instance()->string( Branding::KnownIssuesUrl ) );
QDesktopServices::openUrl( *Branding::KnownIssuesUrl );
} );
}
else
@ -230,7 +228,7 @@ WelcomePage::setUpLinks( bool showSupportUrl,
ui->knownIssuesButton->hide();
}
if ( showReleaseNotesUrl && !b->string( Branding::ReleaseNotesUrl ).isEmpty() )
if ( showReleaseNotesUrl && !( *Branding::ReleaseNotesUrl ).isEmpty() )
{
ui->releaseNotesButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Release,
CalamaresUtils::Original,
@ -238,7 +236,7 @@ WelcomePage::setUpLinks( bool showSupportUrl,
CalamaresUtils::defaultFontHeight() ) ) );
connect( ui->releaseNotesButton, &QPushButton::clicked, []
{
QDesktopServices::openUrl( Branding::instance()->string( Branding::ReleaseNotesUrl ) );
QDesktopServices::openUrl( *Branding::ReleaseNotesUrl );
} );
}
else

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -96,8 +97,7 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
"requirements for installing %1.<br/>"
"Installation cannot continue. "
"<a href=\"#details\">Details...</a>" )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
textLabel->setOpenExternalLinks( false );
connect( textLabel, &QLabel::linkActivated,
@ -114,8 +114,7 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
"recommended requirements for installing %1.<br/>"
"Installation can continue, but some features "
"might be disabled." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortVersionedName ) ) );
.arg( *Calamares::Branding::ShortVersionedName ) );
)
}
}
@ -129,20 +128,29 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
imagePath( Calamares::Branding::ProductWelcome ) );
if ( !theImage.isNull() )
{
FixedAspectRatioLabel* imageLabel = new FixedAspectRatioLabel;
QLabel* imageLabel;
if ( Calamares::Branding::instance()->welcomeExpandingLogo() )
{
FixedAspectRatioLabel *p = new FixedAspectRatioLabel;
p->setPixmap( theImage );
imageLabel = p;
}
else
{
imageLabel = new QLabel;
imageLabel->setPixmap( theImage );
}
imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight() * 3 / 4, 4, 4 );
m_mainLayout->addWidget( imageLabel );
imageLabel->setAlignment( Qt::AlignCenter );
imageLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
imageLabel->setPixmap( theImage );
}
}
CALAMARES_RETRANSLATE(
textLabel->setText( tr( "This program will ask you some questions and "
"set up %2 on your computer." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) ) );
.arg( *Calamares::Branding::ProductName ) );
textLabel->setAlignment( Qt::AlignCenter );
)
}