[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 "Settings.h"
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
@ -73,16 +72,30 @@ Config::Config( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_thisViewStep( static_cast< SummaryQmlViewStep* >( parent ) )
|
||||
, m_summary( new SummaryModel( this ) )
|
||||
|
||||
{
|
||||
CALAMARES_RETRANSLATE_SLOT( &Config::retranslate );
|
||||
retranslate();
|
||||
}
|
||||
|
||||
void
|
||||
Config::retranslate()
|
||||
{
|
||||
m_title = m_thisViewStep->prettyName();
|
||||
|
||||
if ( Calamares::Settings::instance()->isSetupMode() )
|
||||
{
|
||||
m_message = ( tr( "This is an overview of what will happen once you start "
|
||||
"the setup procedure." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_message = ( tr( "This is an overview of what will happen once you start "
|
||||
"the install procedure." ) );
|
||||
}
|
||||
Q_EMIT titleChanged();
|
||||
Q_EMIT messageChanged();
|
||||
}
|
||||
|
||||
void
|
||||
Config::componentComplete()
|
||||
|
@ -52,8 +52,12 @@ private:
|
||||
class Config : public QObject, public QQmlParserStatus
|
||||
{
|
||||
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 )
|
||||
|
||||
public:
|
||||
@ -68,6 +72,8 @@ public:
|
||||
|
||||
private:
|
||||
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
||||
void retranslate();
|
||||
|
||||
const SummaryQmlViewStep* m_thisViewStep;
|
||||
SummaryModel* m_summary;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user