Example #1
0
int main() {

	PhoneBook phoneBook;
	Contacts contact;

	bool ProgramOn = true;
	int option;

	while (ProgramOn) {
		Intro();
		cin >> option;
		cout << endl;
		switch (option)
		{
		case 1:
			cout << "Insert contact data : \n ";
			contact.getData(phoneBook);
			phoneBook.contacts.push_back(contact);
			break;
		case 2: {
			string contactName;
			cout << "Insert contact name : ";
			cin >> contactName;

			if (checkIfExist(phoneBook, contactName) != -1) {
				phoneBook.contacts[checkIfExist(phoneBook, contactName)].showContact();
			}
			else {
				cout << "Contact " << contactName << " doesn't exist !\n";
			}
		}
			break;
		case 3: {
			string contactName;
			cout << "\n Contacts in phoneBook : "<< phoneBook.getContactNumbers() <<"\n";
			for (int i = 0; i < phoneBook.contacts.size(); i++)
			{
				cout << phoneBook.contacts[i].getContactName();
				cout << "\n\n";
			}
		}
			break;
		case 4:
			ProgramOn = false;
			break;
		default:
			cout << "Wrong option ! ";
			break;
		}
	}

	system("PAUSE");
}
Example #2
0
void QtVoxWindowManager::showContactManagerWindow(QString  contactId, QtContactProfileWidget::ActionId actionId )
{
	if(!checkIfExist(QtEnumWindowType::ContactManagerWindow))
	{
		//We don't want to open CM if we are deleting.
		if ( actionId != QtContactProfileWidget::Action_Delete )	//VOXOX - JRT - 2009.09.19 
		{
			QtContactProfileWidget *dlg = new QtContactProfileWidget(&_qtWengoPhone.getCWengoPhone(), contactId, actionId, getDefaultParent() );		

			SAFE_CONNECT(dlg, SIGNAL(windowClose(QString )), SLOT(closeWindow(QString )));
			dlg->showWindow();	

			_activeWindowList[dlg->getKey()] = dlg;
		}
	}
	else
	{
		QString id = QtEnumWindowType::toString(QtEnumWindowType::ContactManagerWindow);
		QtVoxWindowInfo * info = getWindow(id);
		if(info!=NULL)
		{
			info->showWindow();

			((QtContactProfileWidget*)info)->setAction( actionId, contactId );		//VOXOX - JRT - 2009.09.19 
		}
	}
}
Example #3
0
void QtVoxWindowManager::showWizardWindow(){
	if(!checkIfExist(QtEnumWindowType::WizardWindow)){
		QtWizardDialog * wizard = new QtWizardDialog(getDefaultParent(), _qtWengoPhone.getCWengoPhone());
		SAFE_CONNECT(wizard, SIGNAL(windowClose(QString )), SLOT(closeWindow(QString )));
		wizard->showWindow();	
		_activeWindowList[wizard->getKey()] = wizard;
	}else{
		QString id = QtEnumWindowType::toString(QtEnumWindowType::WizardWindow);
		QtVoxWindowInfo * info = getWindow(id);
		if(info!=NULL){
			info->showWindow();
		}
	}
}
Example #4
0
//VOXOX - JRT - 2009.09.23 - I hate this hack, but since ContactManager has grown to much more than the original window,
//							 I need to do this for now.
void QtVoxWindowManager::notifyContactManagerContactAdded( const std::string& contactId, int qtId )	//VOXOX - JRT - 2009.09.23 
{
	//We only do this if CM is open.
	if ( checkIfExist( QtEnumWindowType::ContactManagerWindow))
	{
		QString id = QtEnumWindowType::toString(QtEnumWindowType::ContactManagerWindow);
		QtVoxWindowInfo * info = getWindow(id);

		if ( info )
		{
			info->showWindow();

			((QtContactProfileWidget*)info)->setJsonId( 0, qtId );
		}
	}
}
Example #5
0
void QtVoxWindowManager::showProfileWindow(){
	if(!checkIfExist(QtEnumWindowType::ProfileWindow)){
		if (_qtWengoPhone.getCWengoPhone().getCUserProfileHandler().getCUserProfile()){
			QtProfileDetails * qtProfileDetails   = new QtProfileDetails(*_qtWengoPhone.getCWengoPhone().getCUserProfileHandler().getCUserProfile(),
				_qtWengoPhone.getCWengoPhone().getCUserProfileHandler().getCUserProfile()->getUserProfile(),
				getDefaultParent(), tr("Edit My Profile"));

			SAFE_CONNECT(qtProfileDetails, SIGNAL(windowClose(QString )), SLOT(closeWindow(QString )));
			qtProfileDetails->showWindow();	
			_activeWindowList[qtProfileDetails->getKey()] = qtProfileDetails;
		}
	}else{
		QString id = QtEnumWindowType::toString(QtEnumWindowType::ProfileWindow);
		QtVoxWindowInfo * info = getWindow(id);
		if(info!=NULL){
			info->showWindow();
		}
	}
}
Example #6
0
void QtVoxWindowManager::showConfigWindow(QString pageName){
	if(!checkIfExist(QtEnumWindowType::ConfigWindow)){
		QtWengoConfigDialog * settings = new QtWengoConfigDialog(getDefaultParent(), _qtWengoPhone.getCWengoPhone());
		SAFE_CONNECT(settings, SIGNAL(windowClose(QString )), SLOT(closeWindow(QString )));
		if(pageName!=""){
			settings->setCurrentTab(pageName);
		}
		settings->showWindow();	
		_activeWindowList[settings->getKey()] = settings;
	}else{
		QString id = QtEnumWindowType::toString(QtEnumWindowType::ConfigWindow);
		QtVoxWindowInfo * info = getWindow(id);
		if(info!=NULL){
			info->setCurrentTab(pageName);
			info->showWindow();
		}

	}
}