void QtAddVoxOxAccount::loginClicked() { std::string login = _ui->usernameComboBox->currentText().toStdString(); std::string password = _ui->passwordLineEdit->text().toStdString(); if (!login.empty() && !password.empty()) { WengoAccount wengoAccount(login, password, _ui->rememberPasswordCheckBox->isChecked()); wengoAccount.setVisibleName(login); wengoAccount.setRememberPassword(_ui->rememberPasswordCheckBox->isChecked());//VOXOX CHANGE by Rolando 04-06-09 wengoAccount.setRememberUsername(_ui->rememberPasswordCheckBox->isChecked());//VOXOX CHANGE by Rolando 04-06-09 wengoAccount.setAutoLoginVoxOx(_ui->automaticallyLoginCheckBox->isChecked());//VOXOX CHANGE by Rolando 04-06-09 //_currentUsername = login; // Looking for the selected profile if (!_cUserProfileHandler.userProfileExists(login)) { // The selected profile does not exist. Creating a new one. UserProfile userProfile; userProfile.setSipAccount(wengoAccount, false /* needInitialization */); UserProfileFileStorage userProfileStorage(userProfile); userProfileStorage.save(login); } _cUserProfileHandler.setCurrentUserProfile(login, wengoAccount); _loginDialog->accept(); } }
void UserProfileHandler::saveUserProfile(UserProfile & userProfile) { if (_autoSave && &userProfile && !userProfile.isDestroying() ) //VOXOX - JRT - 2009.09.22 { UserProfileFileStorage userProfileStorage(userProfile); userProfileStorage.save(userProfile.getName()); } }
bool UserProfileHandler::LoadUserProfileFromName(UserProfile * userprofile, const std::string & name) { UserProfileFileStorage userProfileStorage(*userprofile); if (userProfileStorage.load(name)) { return true; } return false; }
UserProfile * UserProfileHandler::getUserProfile(const std::string & name) { UserProfile * result = new UserProfile(); UserProfileFileStorage userProfileStorage(*result); userProfileStorage.profileLoadedFromBackupsEvent += profileLoadedFromBackupsEvent; userProfileStorage.profileCannotBeLoadedEvent += profileCannotBeLoadedEvent; if (!userProfileStorage.load(name)) { OWSAFE_DELETE(result); } return result; }
void QtAddWengoAccount::loginClicked() { std::string login = _ui->email->text().toStdString(); // check if login is an email address //VOXOX CHANGE //CJC //We dont need any @ /*if (login.find("@", 0) == login.npos) { QMessageBox::warning(this, tr("@product@ - Connexion"), tr("Please enter an email address."), QMessageBox::Ok, QMessageBox::NoButton); return; }*/ //// std::string password = _ui->password->text().toStdString(); if (!login.empty() && !password.empty()) { WengoAccount wengoAccount(login, password, true/*_ui->rememberPassword->isChecked()*/); wengoAccount.setVisibleName(login); // Looking for the selected profile if (!_cUserProfileHandler.userProfileExists(login)) { // The selected profile does not exist. Create it. UserProfile userProfile; //VOXOX CHANGE by Rolando 01-20-09 eliminated add test calls /*Config & config = ConfigManager::getInstance().getCurrentConfig(); QtAddAccountUtils::addTestContacts(&userProfile, config.getWengoAudioTestCall(), config.getWengoVideoTestCall() );*/ userProfile.setSipAccount(wengoAccount, false /* needInitialization */); UserProfileFileStorage userProfileStorage(userProfile); userProfileStorage.save(login); } _cUserProfileHandler.setCurrentUserProfile(login, wengoAccount); _loginDialog->accept(); } }