示例#1
0
void ContactDetails::init( const QContact &entry )
{
    // If we redisplay the same entry, don't shift our view around too much
    bool sameEntry = (entry.uid() == ent.uid());

    ent = entry;
    mLink.clear();

    /* Create our members, if we haven't */
    if ( !mModel ) {
        mModel = new QContactModel(this);
        connect(mModel, SIGNAL(modelReset()), this, SLOT(modelChanged()));

        mTabs = new QTabWidget();

        mQuickTab = new ContactOverview(0);
        mDetailsTab = new ContactBrowser(0);
#if defined(QTOPIA_TELEPHONY)
        mCallHistoryTab = new ContactCallHistoryList(0);
#endif
        mMessageHistoryTab = new ContactMessageHistoryList(0);

        mTabs->addTab(mQuickTab, QIcon(":icon/contactdetails"), tr("Overview"));
        mTabs->addTab(mDetailsTab, QIcon(":icon/details"), tr("Details"));
#if defined(QTOPIA_TELEPHONY)
        mTabs->addTab(mCallHistoryTab, QIcon(":icon/phone/calls"), tr("Calls"));
#endif
        mTabs->addTab(mMessageHistoryTab, QIcon(":icon/email"), tr("Messages"));

        connect(mQuickTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mQuickTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
        connect(mDetailsTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mDetailsTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
#if defined(QTOPIA_TELEPHONY)
        connect(mCallHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mCallHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));
#endif
        connect(mMessageHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mMessageHistoryTab, SIGNAL(backClicked()), this, SIGNAL(backClicked()));

        connect(mQuickTab, SIGNAL(callContact()), this, SIGNAL(callContact()));
        connect(mQuickTab, SIGNAL(textContact()), this, SIGNAL(textContact()));
        connect(mQuickTab, SIGNAL(emailContact()), this, SIGNAL(emailContact()));
        connect(mQuickTab, SIGNAL(editContact()), this, SIGNAL(editContact()));

        connect(mDetailsTab, SIGNAL(highlighted(QString)), this, SIGNAL(highlighted(QString)));

        QVBoxLayout *v = new QVBoxLayout();
        v->addWidget(mTabs);
        v->setMargin(0);
        setLayout(v);
    }

    modelChanged();

    if (!sameEntry)
        mTabs->setCurrentIndex(0);
    mTabs->currentWidget()->setFocus();
}
示例#2
0
文件: Home.cpp 项目: ekersale/Babel
void    Home::load()
{
	ui->setupUi(this);
	ui->_line_addContact->hide();


	_video = new OpenCV();

	timer = new QTimer(this);

	QLabel::connect(_video, SIGNAL(processedImage(QImage, int)), this, SLOT(updatePlayerUI(QImage, int)));
	
	
	//QLabel::connect(_video, SIGNAL(sendFrame(std::vector<unsigned char*> *)),
	//this, SLOT(sendFrameTo(std::vector<unsigned char *> *)));
	
	//QLabel::connect(_video, SIGNAL(sendFrame(std::vector<unsigned char*> *)), this,
	  //SLOT(sendFrameTo(std::vector<unsigned char *> *)));


	QLabel::connect(_video, SIGNAL(sendFrame(std::vector<unsigned char*> *)), this, SLOT(sendFrameTo(std::vector<unsigned char *> *)));

	QObject::connect(ui->_btnClose, SIGNAL(clicked()), this, SLOT(close()));
	QObject::connect(ui->_btn_Online, SIGNAL(clicked()), this, SLOT(changeOnline()));
	QObject::connect(ui->_btn_Away, SIGNAL(clicked()), this, SLOT(changeAway()));
	QObject::connect(ui->_btn_Busy, SIGNAL(clicked()), this, SLOT(changeBusy()));
	QObject::connect(ui->_btnAddContact, SIGNAL(clicked()), this, SLOT(showNewField()));
	// QObject::connect(ui->_btnInviteContact, SIGNAL(clicked()), this, SLOT(invitContact()));
	QObject::connect(ui->_btnMicro, SIGNAL(clicked()), this, SLOT(callContact()));
	QObject::connect(ui->_btnCam, SIGNAL(clicked()), this, SLOT(videoCallContact()));
	QObject::connect(ui->_btnHangUp, SIGNAL(clicked()), this, SLOT(hangHup()));
	QObject::connect(ui->_line_addContact, SIGNAL(returnPressed()), this, SLOT(sendAddContact()));
	QObject::connect(ui->_lineContactName, SIGNAL(returnPressed()), this, SLOT(sendNewName()));
	QObject::connect(ui->_lineSurnameEdit, SIGNAL(returnPressed()), this, SLOT(sendNewSurname()));
	QObject::connect(ui->_lineBirthday, SIGNAL(returnPressed()), this, SLOT(sendNewBirthday()));
	QObject::connect(ui->_lineLocalisation, SIGNAL(returnPressed()), this, SLOT(sendNewLocalisation()));
	QObject::connect(ui->_linePhoneNumber, SIGNAL(returnPressed()), this, SLOT(sendNewPhone()));
	defineStatus(this->_status);
}
HbServiceClientView::HbServiceClientView(QGraphicsItem *parent)
    : HbView(parent)
{
    XQSERVICE_DEBUG_PRINT("HbServiceClientView::HbServiceClientView");
    setTitle(tr("HB Service client view"));

    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical,this);

    layout->addItem(new HbLabel("Call service",this));
    mNumberEdit = new HbLineEdit(this);
    mNumberEdit->setText("+35850123456789");
    layout->addItem(mNumberEdit);

    mServiceEdit = new HbLineEdit(this);
    mServiceEdit->setText("com.nokia.services.hbserviceprovider.Dialer");
    layout->addItem(mServiceEdit);

    /*
    mServiceEmbedded = HbCheckBox("Embedded",this)
    mServiceEmbedded->setTristate(true);
    layout->addItem(mServiceEmbedded);
    */
    
    mRetValue = new HbLineEdit(this);
    mRetValue->setText("*****");
    layout->addItem(mRetValue);

    layout->addItem(new HbLabel("Map service",this));
    mAddressEdit = new HbLineEdit(this);
    mAddressEdit->setText("Karakaari 13");
    layout->addItem(mAddressEdit);

    mCityEdit = new HbLineEdit(this);
    mCityEdit->setText("Espoo");
    layout->addItem(mCityEdit);

    mCountryEdit = new HbLineEdit(this);
    mCountryEdit->setText("Finland");
    layout->addItem(mCountryEdit);

    mServiceMapEdit = new HbLineEdit(this);
    mServiceMapEdit->setText("com.nokia.services.hbserviceprovider.Map");
    layout->addItem(mServiceMapEdit);

    mRetMapValue = new HbLineEdit(this);
    mRetMapValue->setText("*****");
    layout->addItem(mRetMapValue);
    
    setLayout(layout);

    HbToolBar* toolBar = this->toolBar();
    
    HbAction* callAction = new HbAction("Call"); 
    connect(callAction, SIGNAL(triggered()), this, SLOT(callContact()));

    HbAction* callEmbeddedAction = new HbAction("Call Embedded"); 
    connect(callEmbeddedAction, SIGNAL(triggered()), this, SLOT(callContactEmbedded()));

    HbAction* showAddressesAction = new HbAction("Select contacts"); 
    connect(showAddressesAction, SIGNAL(triggered()), this, SLOT(launchContactSelecting()));
    
    toolBar->addAction(callAction);
    toolBar->addAction(callEmbeddedAction);
    toolBar->addAction(showAddressesAction);
    sndAsync = NULL;
}
示例#4
0
    ContactWidget::ContactWidget(QWidget* _parent, std::shared_ptr<Logic::contact_profile> _profile, const std::map<QString, QString>& _countries)
        :QWidget(_parent),
        profile_(_profile),
        name_(new TextEmojiWidget(this, Fonts::appFontScaled(18), CommonStyle::getColor(CommonStyle::Color::TEXT_PRIMARY))),
        info_(new TextEmojiWidget(this, Fonts::appFontScaled(14), CommonStyle::getColor(CommonStyle::Color::TEXT_SECONDARY))),
        addButton_(new QPushButton(this)),
        callButton_(new QPushButton(this)),
        msgButton_(new QPushButton(this))
    {
        Utils::grabTouchWidget(this);

        setFixedSize(Utils::scale_value(widget_width), Utils::scale_value(widget_height));

        QHBoxLayout* rootLayout = Utils::emptyHLayout();
        rootLayout->setAlignment(Qt::AlignLeft);

        const QString displayName = _profile->get_contact_name();

        auto avatarWidget = new ContactAvatarWidget(
            this,
            _profile->get_aimid(),
            displayName,
            Utils::scale_value(widget_height),
            false);

        avatarWidget->setCursor(QCursor(Qt::PointingHandCursor));

        rootLayout->addWidget(avatarWidget);

        Utils::grabTouchWidget(avatarWidget);

        QVBoxLayout* infoLayout = Utils::emptyVLayout();
        infoLayout->setContentsMargins(Utils::scale_value(12), 0, 0, 0);
        infoLayout->setAlignment(Qt::AlignTop);

        name_->setObjectName(qsl("contact_name"));
        name_->setFading(true);
        name_->setText(_profile->get_contact_name());
        infoLayout->addWidget(name_);
        Utils::grabTouchWidget(name_);

        info_->setObjectName(qsl("contact_info"));
        info_->setText(getContactInfo(_profile, _countries));
        infoLayout->addWidget(info_);
        Utils::grabTouchWidget(info_);

        QHBoxLayout* buttonsLayout = new QHBoxLayout();
        buttonsLayout->setSpacing(Utils::scale_value(12));
        buttonsLayout->setAlignment(Qt::AlignLeft);

        Logic::ContactItem* contactItem = Logic::getContactListModel()->getContactItem(profile_->get_aimid());

        addButton_->setObjectName(qsl("add_contact_button"));
        addButton_->setVisible(!contactItem);
        addButton_->setCursor(QCursor(Qt::PointingHandCursor));
        buttonsLayout->addWidget(addButton_);
        Utils::grabTouchWidget(addButton_);

        msgButton_->setVisible(!!contactItem);
        msgButton_->setObjectName(qsl("msg_contact_button"));
        msgButton_->setCursor(QCursor(Qt::PointingHandCursor));
        buttonsLayout->addWidget(msgButton_);
        Utils::grabTouchWidget(msgButton_);

        callButton_->setVisible(!!contactItem);
        callButton_->setObjectName("call_contact_button");
        callButton_->setCursor(QCursor(Qt::PointingHandCursor));
        buttonsLayout->addWidget(callButton_);
        Utils::grabTouchWidget(callButton_);

        infoLayout->addLayout(buttonsLayout);

        rootLayout->addLayout(infoLayout);

        setLayout(rootLayout);

        connect(addButton_, &QPushButton::clicked, [this]()
        {
            emit addContact(profile_->get_aimid());
        });

        connect(msgButton_, &QPushButton::clicked, [this]()
        {
            emit msgContact(profile_->get_aimid());
        });

        connect(callButton_, &QPushButton::clicked, [this]()
        {
            emit callContact(profile_->get_aimid());
        });

        connect(avatarWidget, &ContactAvatarWidget::clickedInternal, [this]()
        {
            emit contactInfo(profile_->get_aimid());
        });
    }
示例#5
0
void ContactDetails::init( const QContact &entry )
{
    // If we redisplay the same entry, don't shift our view around too much
    bool sameEntry = (entry.uid() == ent.uid());

    ent = entry;
    mLink.clear();


    // We create tabs for each addressbook detail view plugin
    // We ask them if they want to be shown for this contact (or they can
    // just hide themselves in the init function)
    // they need to provide certain actions
    // and signals
    // maybe a view factory plugin
    // returns view plugins for list, details?
    // maybe string, maybe enum


    /* Create our members, if we haven't */
    if ( !mModel ) {
        mModel = new QContactModel(this);
        connect(mModel, SIGNAL(modelReset()), this, SLOT(modelChanged()));

        mTabs = new QTabWidget();

        mQuickTab = new ContactOverview(0);
        mDetailsTab = new ContactBrowser(0);
#if defined(QTOPIA_TELEPHONY)
        mCallHistoryTab = new ContactCallHistoryList(0);
#endif
        mMessageHistoryTab = new ContactMessageHistoryList(0);

        mTabs->addTab(mQuickTab, QIcon(":icon/contactdetails"), tr("Overview"));
        mTabs->addTab(mDetailsTab, QIcon(":icon/details"), tr("Details"));
#if defined(QTOPIA_TELEPHONY)
        mTabs->addTab(mCallHistoryTab, QIcon(":icon/phone/calls"), tr("Calls"));
#endif
        mTabs->addTab(mMessageHistoryTab, QIcon(":icon/email"), tr("Messages"));

        connect(mQuickTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mQuickTab, SIGNAL(closeView()), this, SIGNAL(closeView()));
        connect(mDetailsTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mDetailsTab, SIGNAL(closeView()), this, SIGNAL(closeView()));
#if defined(QTOPIA_TELEPHONY)
        connect(mCallHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mCallHistoryTab, SIGNAL(closeView()), this, SIGNAL(closeView()));
#endif
        connect(mMessageHistoryTab, SIGNAL(externalLinkActivated()), this, SIGNAL(externalLinkActivated()));
        connect(mMessageHistoryTab, SIGNAL(closeView()), this, SIGNAL(closeView()));

        connect(mQuickTab, SIGNAL(callContact()), this, SIGNAL(callContact()));
        connect(mQuickTab, SIGNAL(textContact()), this, SIGNAL(textContact()));
        connect(mQuickTab, SIGNAL(emailContact()), this, SIGNAL(emailContact()));
        connect(mQuickTab, SIGNAL(editContact()), this, SIGNAL(editContact()));

        connect(mDetailsTab, SIGNAL(highlighted(QString)), this, SIGNAL(highlighted(QString)));

        QVBoxLayout *v = new QVBoxLayout();
        v->addWidget(mTabs);
        v->setMargin(0);
        setLayout(v);
    }

    modelChanged();

    if (!sameEntry)
        mTabs->setCurrentIndex(0);
    mTabs->currentWidget()->setFocus();
}