disable username registration field when needed

when the register your username checkbox is not ticked, disable the text
entry field.

Also clear some redundant labels and fix migration string asking for
password.

Change-Id: I30de073eb90da47ced1b54cbfebe2f7a10e8ebb5
Reviewed-by: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
diff --git a/wizarddialog.cpp b/wizarddialog.cpp
index 467bac7..9200d2d 100644
--- a/wizarddialog.cpp
+++ b/wizarddialog.cpp
@@ -66,7 +66,7 @@
         ui->previousButton->hide();
         ui->photoBooth->hide();
         ui->pinEdit->hide();
-        ui->usernameLabel->setText(tr("Your account needs to be migrated. Choose a password."));
+        ui->infoLabel->setText(tr("Your account needs to be migrated. Enter your password."));
     } else
         ui->navBarWidget->hide();
 
@@ -228,7 +228,7 @@
     }
     ui->navBarWidget->show();
     ui->avatarLabel->setHidden(true);
-    ui->usernameLabel->setHidden(existingAccount);
+    ui->infoLabel->setHidden(existingAccount);
     ui->usernameEdit->setHidden(existingAccount);
     ui->signUpCheckbox->setHidden(existingAccount);
     ui->signUpCheckbox->setChecked(!existingAccount);
@@ -350,3 +350,13 @@
     account_->performAction(Account::EditAction::RELOAD);
     QDialog::accept();
 }
+
+void WizardDialog::on_signUpCheckbox_toggled(bool checked)
+{
+    if (checked) {
+        ui->usernameEdit->setEnabled(true);
+    } else {
+        ui->usernameEdit->setEnabled(false);
+        ui->usernameEdit->clear();
+    }
+}