Exemplo n.º 1
0
void insertNewContact(struct contact *headContact, struct contact *tailContact)
{
	int x = 40, y = 4;
	struct contact *newContact;

	newContact = (struct contact *)malloc(sizeof(struct contact));

		// read all variables
		setCursorPosition(x,++y); printColouredText("First Name:", 2);
		fflush(stdin);
		gets_s(newContact->firstName ,MAXSTRLENGTH);

		setCursorPosition(x,++y); printColouredText("Last Name:", 2);
		fflush(stdin);
		gets_s(newContact->lastName ,MAXSTRLENGTH);

		setCursorPosition(x,++y); printColouredText("PhoneNumber:", 2);
		fflush(stdin);
		gets_s(newContact->phoneNumber ,MAXSTRLENGTH);

		setCursorPosition(x,++y); printColouredText("Email:", 2);
		fflush(stdin);
		gets_s(newContact->email ,MAXSTRLENGTH);

		setCursorPosition(x,++y); printColouredText("Company:", 2);
		fflush(stdin);
		gets_s(newContact->company ,MAXSTRLENGTH);

		addNewContact(headContact, tailContact, newContact);
}
Exemplo n.º 2
0
BabelWindow::BabelWindow(Client *client, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::BabelWindow)
{
    _client = client;
    ui->setupUi(this);
    connect(_client, SIGNAL(messageReceived()), SLOT(onMessageReceived()));
	
	addNewContact("Galdan");
    addNewContact("Khaled");

	ui->_messagesList->clear();
	_mapMessages.insert("Khaled", new MessagesList());
	MessagesList *list = _mapMessages.value("Khaled");
	*list << "Salut";

	*list << "Ca va ?";

	_mapMessages.insert("Galdan", new MessagesList());
	list = _mapMessages.value("Galdan");
	*list << "Wesh";
	*list << "Trkl ?";
}
Exemplo n.º 3
0
void PeopleApplication::createPeoplePage()
{

    //m_AccountManager = AccountManger::getInstance();
    m_mainPage = new MApplicationPage;
    m_mainPage->setTitle(QObject::tr("People","Title of the application"));

    QGraphicsLinearLayout *linear = new QGraphicsLinearLayout(Qt::Vertical);
    linear->setContentsMargins(0, 0, 0, 0);
    linear->setSpacing(0);
    m_mainPage->centralWidget()->setLayout(linear);

    m_topSpacer = new QGraphicsWidget;
    m_topSpacer->setPreferredHeight(0);
    linear->addItem(m_topSpacer);

    m_people = new SeasidePeople;
    linear->addItem(m_people);

    m_bottomSpacer = new QGraphicsWidget;
    m_bottomSpacer->setPreferredHeight(0);
    linear->addItem(m_bottomSpacer); 

    m_actionSearch = new MAction(QObject::tr("Search","Menu action to bring up search for contact list"), this);
    m_actionSearch->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionSearch);
    connect(m_actionSearch, SIGNAL(triggered()), this, SLOT(searchClicked()));

    m_actionAdd = new MAction(QObject::tr("Add Contact","Menu action to add contact"), this);
    m_actionAdd->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionAdd);
    connect(m_actionAdd, SIGNAL(triggered()), this, SLOT(addNewContact()));

    m_actionAll = new MAction(QObject::tr("<b>Show All</b>","Menu filter to show all contacts"), this);  
    m_actionAll->setLocation(MAction::ApplicationMenuLocation);
    m_actionAll->setObjectName("ShowAllFilter");
    m_actionAll->setCheckable(true);
    connect(m_actionAll, SIGNAL(triggered()), m_people, SLOT(filterAll()));

    m_actionFav = new MAction(QObject::tr("Show Favorites", "Menu filter to show all contacts marked as favorites"), this);
    m_actionFav->setLocation(MAction::ApplicationMenuLocation);
    m_actionFav->setObjectName("ShowFavoritesFilter");
    m_actionFav->setCheckable(true);
    connect(m_actionFav, SIGNAL(triggered()), m_people, SLOT(filterFavorites()));

    m_actionRecent = new MAction(QObject::tr("Show Recent","Menu filter to show all contacts with recent communications"), this);
    m_actionRecent->setLocation(MAction::ApplicationMenuLocation);
    m_actionRecent->setCheckable(true);
    m_actionRecent->setObjectName("ShowRecentFilter");
    connect(m_actionRecent, SIGNAL(triggered()), m_people, SLOT(filterRecent()));

    m_actionFilters = new QActionGroup(this);
    m_actionFilters->addAction(m_actionAll);
    m_actionFilters->addAction(m_actionRecent);
    m_actionFilters->addAction(m_actionFav);
    m_actionFilters->setExclusive(true);
    m_mainPage->addActions(m_actionFilters->actions());
    connect(m_actionFilters, SIGNAL(triggered(QAction*)), this, SLOT(menuFilterSelected(QAction*)));

    connect(m_people, SIGNAL(itemClicked(QModelIndex)),
            this, SLOT(createDetailPage(QModelIndex)));
    connect(m_people, SIGNAL(editRequest(QModelIndex)),
            this, SLOT(createEditPage(QModelIndex)));

    connect(m_people, SIGNAL(callNumber(const QString&)),
            this, SLOT(callNumber(const QString&)));
    connect(m_people, SIGNAL(composeSMS(const QString&)),
            this, SLOT(composeSMS(const QString&)));
    connect(m_people, SIGNAL(composeIM(const QString&)),
            this, SLOT(composeIM(const QString&)));
    connect(m_people, SIGNAL(composeEmail(const QString&)),
            this, SLOT(composeEmail(const QString&)));

    m_mainPage->appear();

    initSlider();
    initSearch();
    repositionOverlays();
}