示例#1
0
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();
		
	}

}
示例#2
0
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();
	}
}