mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
Add support to set the hostname
This commit is contained in:
parent
89fe455163
commit
b587a0ff00
4 changed files with 113 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue