diff options
Diffstat (limited to 'raveos-calamares-module/raveusers/RaveUsersViewStep.cpp')
| -rw-r--r-- | raveos-calamares-module/raveusers/RaveUsersViewStep.cpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp b/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp index 4014429..fbcd765 100644 --- a/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp +++ b/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp @@ -52,6 +52,44 @@ RaveUsersViewStep::prettyName() const return tr( "User" ); } +QString +RaveUsersViewStep::prettyStatus() const +{ + if ( !m_backend || m_backend->username().isEmpty() ) + { + return QString(); + } + const QString locale = getLocale(); + QString userLabel = QStringLiteral( "User" ); + QString hostLabel = QStringLiteral( "Computer name" ); + QString autoLabel = QStringLiteral( "Automatic login" ); + QString yes = QStringLiteral( "yes" ); + QString no = QStringLiteral( "no" ); + if ( locale.startsWith( QLatin1String( "hu" ) ) ) + { + userLabel = QStringLiteral( "Felhasználó" ); + hostLabel = QStringLiteral( "Gép neve" ); + autoLabel = QStringLiteral( "Automatikus bejelentkezés" ); + yes = QStringLiteral( "igen" ); + no = QStringLiteral( "nem" ); + } + else if ( locale.startsWith( QLatin1String( "de" ) ) ) + { + userLabel = QStringLiteral( "Benutzer" ); + hostLabel = QStringLiteral( "Computername" ); + autoLabel = QStringLiteral( "Automatische Anmeldung" ); + yes = QStringLiteral( "ja" ); + no = QStringLiteral( "nein" ); + } + return QStringLiteral( "%1: <b>%2</b><br/>%3: <b>%4</b><br/>%5: <b>%6</b>" ) + .arg( userLabel, + m_backend->username().toHtmlEscaped(), + hostLabel, + m_backend->hostname().toHtmlEscaped(), + autoLabel, + m_backend->autoLogin() ? yes : no ); +} + void RaveUsersViewStep::buildWidget() { @@ -62,7 +100,7 @@ RaveUsersViewStep::buildWidget() m_quickWidget = new QQuickWidget(); m_quickWidget->setResizeMode( QQuickWidget::SizeRootObjectToView ); - m_quickWidget->setClearColor( QColor( 0x40, 0x40, 0x40 ) ); + m_quickWidget->setClearColor( QColor( 0x1a, 0x1b, 0x1d ) ); QString modulePath = QStringLiteral( "/usr/lib/calamares/modules/raveusers/ui" ); if ( !QDir( modulePath ).exists() ) @@ -189,6 +227,14 @@ RaveUsersViewStep::onLeave() gs->insert( "password", Calamares::String::obscure( m_backend->userPassword() ) ); gs->insert( "setRootPassword", m_backend->rootReuseVisible() ); gs->insert( "reuseRootPassword", m_backend->reuseRootPassword() ); + if ( m_backend->autoLogin() ) + { + gs->insert( "autoLoginUser", username ); + } + else + { + gs->remove( "autoLoginUser" ); + } } void |