Add support to set the hostname

This commit is contained in:
Rohan Garg 2014-10-21 18:59:02 +02:00
parent 89fe455163
commit b587a0ff00
4 changed files with 113 additions and 2 deletions

View file

@ -24,6 +24,7 @@
#include "ui_page_usersetup.h"
#include "CreateUserJob.h"
#include "SetPasswordJob.h"
#include "SetHostNameJob.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "utils/Logger.h"
@ -109,6 +110,9 @@ UsersPage::createJobs( const QString& defaultUserGroup, const QStringList& defau
ui->textBoxRootPassword->text() );
list.append( Calamares::job_ptr( j ) );
j = new SetHostNameJob( ui->textBoxHostname->text() );
list.append( Calamares::job_ptr( j ) );
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
gs->insert( "hostname", ui->textBoxHostname->text() );
if ( ui->checkBoxLoginAuto->isChecked() )
@ -270,11 +274,11 @@ UsersPage::validateHostnameText( const QString& textRef )
if ( pos >= 0 && pos < text.size() )
ui->labelHostnameError->setText(
tr( "Your username contains an invalid character '%1'" )
tr( "Your hostname contains an invalid character '%1'" )
.arg( text.at( pos ) ) );
else
ui->labelHostnameError->setText(
tr( "Your username contains invalid characters!" ) );
tr( "Your hostname contains invalid characters!" ) );
m_readyHostname = false;
}