Ejemplo n.º 1
0
QtHistory::QtHistory(CHistory & cHistory)
	: QAbstractTableModel(NULL),
	_cHistory(cHistory) {

	_chatLogViewer = NULL;
	_mutex = new QMutex(QMutex::Recursive);

	_stateFilter = HistoryMemento::Any;

	QtWengoPhone * qtWengoPhone = (QtWengoPhone *) _cHistory.getCWengoPhone().getPresentation();
	_historyWidget = new QtHistoryWidget(qtWengoPhone->getWidget(), this);
	SAFE_CONNECT(_historyWidget,
		SIGNAL(replayItemRequested(int)),
		SLOT(replayItem(int))
	);
	SAFE_CONNECT(_historyWidget,
		SIGNAL(showChatLogRequested(int)),
		SLOT(showChatLog(int))
	);
	SAFE_CONNECT(_historyWidget,
		SIGNAL(removeItemRequested(int)),
		SLOT(removeItem(int))
	);
	SAFE_CONNECT(_historyWidget,
		SIGNAL(missedCallsSeen()),
		SLOT(resetUnseenMissedCalls())
	);

	SAFE_CONNECT(_historyWidget,
		SIGNAL(showOnlyItemOfType(int)),
		SLOT(showOnlyItemOfTypeSlot(int))
	);
	qtWengoPhone->setQtHistoryWidget(_historyWidget);
	
	// define user use a Wengo or a SIP account
	UserProfile * userProfile = _cHistory.getCWengoPhone().getCUserProfileHandler().getUserProfileHandler().getCurrentUserProfile();
	if (userProfile) {
		_isWengoAccountConnected = userProfile->hasWengoAccount();
	} else {
		_isWengoAccountConnected = false;
	}
	////

	updatePresentation();
}
Ejemplo n.º 2
0
void QtAddWengoAccount::load(std::string sipAccountName) {
	//load userprofile
	UserProfile * userProfile = _cUserProfileHandler.getUserProfileHandler().getUserProfile(sipAccountName);
	if (userProfile && userProfile->hasSipAccount()) {
		//tests account type
		if (userProfile->hasWengoAccount()) {
			//loads the wengo acccount
			WengoAccount * wengoAccount = userProfile->getWengoAccount();
			_ui->email->setText(QString::fromStdString(wengoAccount->getWengoLogin()));
			_ui->password->setText(QString::fromStdString(wengoAccount->getWengoPassword()));
			setInfoMessage();
		} else {
			//should be loaded as a sip account
			//_loginDialog->changePage(QtLoginDialog::AddSIPAccount, sipAccountName);//VOXOX CHANGE by Rolando 02-25-09
			_loginDialog->changePage(QtLoginDialog::AddVoxOxAccount, sipAccountName);//VOXOX CHANGE by Rolando 02-25-09

		}
	} else {
		//_loginDialog->changePage(QtLoginDialog::AddAccount);//VOXOX CHANGE by Rolando 02-25-09
		_loginDialog->changePage(QtLoginDialog::AddVoxOxAccount, sipAccountName);//VOXOX CHANGE by Rolando 02-25-09

	}
	OWSAFE_DELETE(userProfile);
}