From 0f9496babe3435ca3e867b9121e4cad2a44fb259 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 13 Nov 2014 16:51:23 +0100 Subject: [PATCH] Finish up retranslation in PreparePage. --- src/modules/prepare/PreparePage.cpp | 2 +- src/modules/prepare/PrepareViewStep.cpp | 12 ++++++------ src/modules/prepare/PrepareViewStep.h | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/modules/prepare/PreparePage.cpp b/src/modules/prepare/PreparePage.cpp index 028044c0a..00a5ccab9 100644 --- a/src/modules/prepare/PreparePage.cpp +++ b/src/modules/prepare/PreparePage.cpp @@ -60,7 +60,7 @@ PreparePage::init( const QList< PrepareEntry >& checkEntries ) for ( const PrepareEntry& entry : checkEntries ) { PrepareCheckWidget* pcw = new PrepareCheckWidget( entry.checked ); - pcw->setText( entry.text ); + CALAMARES_RETRANSLATE( pcw->setText( entry.text() ); ) m_entriesLayout->addWidget( pcw ); pcw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); diff --git a/src/modules/prepare/PrepareViewStep.cpp b/src/modules/prepare/PrepareViewStep.cpp index 4f230ed49..ef6c24a65 100644 --- a/src/modules/prepare/PrepareViewStep.cpp +++ b/src/modules/prepare/PrepareViewStep.cpp @@ -87,30 +87,30 @@ PrepareViewStep::PrepareViewStep( QObject* parent ) if ( entry == "storage" ) checkEntries.append( { entry, - tr( "has at least %1 GB available drive space" ) - .arg( m_requiredStorageGB ), + [this]{ return tr( "has at least %1 GB available drive space" ) + .arg( m_requiredStorageGB ); }, enoughStorage, m_entriesToRequire.contains( entry ) } ); else if ( entry == "ram" ) checkEntries.append( { entry, - tr( "has at least %1 GB working memory" ) - .arg( m_requiredRamGB ), + [this]{ return tr( "has at least %1 GB working memory" ) + .arg( m_requiredRamGB ); }, enoughRam, m_entriesToRequire.contains( entry ) } ); else if ( entry == "power" ) checkEntries.append( { entry, - tr( "is plugged in to a power source" ), + [this]{ return tr( "is plugged in to a power source" ); }, hasPower, m_entriesToRequire.contains( entry ) } ); else if ( entry == "internet" ) checkEntries.append( { entry, - tr( "is connected to the Internet" ), + [this]{ return tr( "is connected to the Internet" ); }, hasInternet, m_entriesToRequire.contains( entry ) } ); diff --git a/src/modules/prepare/PrepareViewStep.h b/src/modules/prepare/PrepareViewStep.h index 3dbfbf2dc..3b9ada8f2 100644 --- a/src/modules/prepare/PrepareViewStep.h +++ b/src/modules/prepare/PrepareViewStep.h @@ -19,18 +19,20 @@ #ifndef PREPAREPAGEPLUGIN_H #define PREPAREPAGEPLUGIN_H +#include "viewpages/ViewStep.h" +#include "PluginDllMacro.h" + #include #include -#include "viewpages/ViewStep.h" -#include "PluginDllMacro.h" +#include class PreparePage; struct PrepareEntry { QString name; - QString text; + std::function< QString() > text; bool checked; bool required; };