[summaryq] Repair translatable properties
- doesn't make sense to have NOTIFY and CONSTANT - connect to translation signals - document the properties
This commit is contained in:
parent
3b7c2b2221
commit
a316f1b40d
@ -14,7 +14,6 @@
|
|||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
@ -73,15 +72,29 @@ Config::Config( QObject* parent )
|
|||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, m_thisViewStep( static_cast< SummaryQmlViewStep* >( parent ) )
|
, m_thisViewStep( static_cast< SummaryQmlViewStep* >( parent ) )
|
||||||
, m_summary( new SummaryModel( this ) )
|
, m_summary( new SummaryModel( this ) )
|
||||||
|
|
||||||
|
{
|
||||||
|
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate );
|
||||||
|
retranslate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::retranslate()
|
||||||
{
|
{
|
||||||
m_title = m_thisViewStep->prettyName();
|
m_title = m_thisViewStep->prettyName();
|
||||||
|
|
||||||
if ( Calamares::Settings::instance()->isSetupMode() )
|
if ( Calamares::Settings::instance()->isSetupMode() )
|
||||||
|
{
|
||||||
m_message = ( tr( "This is an overview of what will happen once you start "
|
m_message = ( tr( "This is an overview of what will happen once you start "
|
||||||
"the setup procedure." ) );
|
"the setup procedure." ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_message = ( tr( "This is an overview of what will happen once you start "
|
m_message = ( tr( "This is an overview of what will happen once you start "
|
||||||
"the install procedure." ) );
|
"the install procedure." ) );
|
||||||
|
}
|
||||||
|
Q_EMIT titleChanged();
|
||||||
|
Q_EMIT messageChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -52,8 +52,12 @@ private:
|
|||||||
class Config : public QObject, public QQmlParserStatus
|
class Config : public QObject, public QQmlParserStatus
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY( QString message MEMBER m_message NOTIFY messageChanged CONSTANT )
|
|
||||||
Q_PROPERTY( QString title MEMBER m_title NOTIFY titleChanged CONSTANT )
|
///@brief Name of this summary (generally, "Summary")
|
||||||
|
Q_PROPERTY( QString title MEMBER m_title NOTIFY titleChanged )
|
||||||
|
///@brief Description of what the summary means
|
||||||
|
Q_PROPERTY( QString message MEMBER m_message NOTIFY messageChanged )
|
||||||
|
|
||||||
Q_PROPERTY( SummaryModel* summaryModel READ summaryModel CONSTANT FINAL )
|
Q_PROPERTY( SummaryModel* summaryModel READ summaryModel CONSTANT FINAL )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -68,6 +72,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
||||||
|
void retranslate();
|
||||||
|
|
||||||
const SummaryQmlViewStep* m_thisViewStep;
|
const SummaryQmlViewStep* m_thisViewStep;
|
||||||
SummaryModel* m_summary;
|
SummaryModel* m_summary;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user