QTfrontend/hwform.cpp
changeset 8295 6ef114ea2298
parent 8294 0e5782b0dd54
child 8296 455da122c0ad
equal deleted inserted replaced
8294:0e5782b0dd54 8295:6ef114ea2298
  1055     else { //Send the hash
  1055     else { //Send the hash
  1056         hwnet->SendPasswordHash(temphash);
  1056         hwnet->SendPasswordHash(temphash);
  1057     }
  1057     }
  1058 
  1058 
  1059     //Remove temporary hash from config
  1059     //Remove temporary hash from config
  1060     config->clearPasswordHash();
  1060     config->clearTempHash();
  1061 }
  1061 }
  1062 
  1062 
  1063 void HWForm::NetNickRegistered(const QString & nick)
  1063 void HWForm::NetNickRegistered(const QString & nick)
  1064 {
  1064 {
  1065     //Get hashes
  1065     //Get hashes
  1066     QString hash =  config->passwordHash();
  1066     QString hash =  config->passwordHash();
  1067     QString temphash =  config->tempHash();
  1067     QString temphash =  config->tempHash();
  1068     qDebug("NETNICKREGISTERED");
  1068 
  1069     if (hash.isEmpty()) {
  1069     if (hash.isEmpty()) {
  1070         qDebug("NNR - HASH EMPTY");
       
  1071         if (temphash.isEmpty()) { //If the user enters a registered nick with no password
  1070         if (temphash.isEmpty()) { //If the user enters a registered nick with no password
  1072             qDebug("NNR - TEMPHASH EMTPY");
       
  1073             QString suppliedpass;
  1071             QString suppliedpass;
  1074             while (suppliedpass.isEmpty()) {
  1072             while (suppliedpass.isEmpty()) {
  1075                 QInputDialog nickRegedDialog(this);
  1073                 QInputDialog nickRegedDialog(this);
  1076                 nickRegedDialog.setWindowModality(Qt::WindowModal);
  1074                 nickRegedDialog.setWindowModality(Qt::WindowModal);
  1077                 nickRegedDialog.setInputMode(QInputDialog::TextInput);
  1075                 nickRegedDialog.setInputMode(QInputDialog::TextInput);
  1383             bool save = pwDialog->cbSave->isChecked();
  1381             bool save = pwDialog->cbSave->isChecked();
  1384             config->setValue("net/savepassword", save);
  1382             config->setValue("net/savepassword", save);
  1385             if (save) // user wants to save password
  1383             if (save) // user wants to save password
  1386             {
  1384             {
  1387                 config->setPasswordHash(temphash);
  1385                 config->setPasswordHash(temphash);
  1388                 config->setNetPasswordLength(password.size());
       
  1389             }
  1386             }
  1390         }
  1387         }
  1391         else {
  1388         else {
  1392             delete pwDialog;
  1389             delete pwDialog;
  1393             config->setValue("net/nick", nickname);
  1390             config->setValue("net/nick", nickname);