ContactsDialog::ContactsDialog(QWidget *parent) :
    QDialog(parent)
{
    QHBoxLayout* l = new QHBoxLayout;
    m_listWidget = new QListWidget(this);
    l->addWidget(m_listWidget);

    QVBoxLayout* lv = new QVBoxLayout;

    QPushButton* backBtn = new QPushButton("Back",this);
    QObject::connect(backBtn, SIGNAL(pressed()), this, SLOT(close()));
    backBtn->setFixedWidth(100);
    lv->addWidget(backBtn);
    lv->setAlignment(backBtn,Qt::AlignTop);

    QPushButton* okBtn = new QPushButton("Ok",this);
    QObject::connect(okBtn, SIGNAL(pressed()), this, SLOT(selectContact()));
    okBtn->setFixedWidth(100);
    lv->addWidget(okBtn);
    lv->setAlignment(okBtn,Qt::AlignBottom);

    l->addLayout(lv);

    setLayout(l);

    // Remove context menu from the all widgets
#ifdef Q_OS_SYMBIAN
    QWidgetList widgets = QApplication::allWidgets();
    QWidget* w = 0;
    foreach (w,widgets)
        {
            w->setContextMenuPolicy(Qt::NoContextMenu);
        }
Exemplo n.º 2
0
void                UserWin::manageWin()
{
    this->_serverText = "Serveur: ";
    this->_serverText.append(this->getServer());
    this->_portText = " | Port: ";
    this->_portText.append(QString::number(this->getTcpPort()));
    this->_idText = "Identifiant: ";
    this->_idText.append(this->getClientId());
    this->_call.setText("Appeler");
    this->_mContact->addAction(this->_aAddContact);
    this->_mContact->addAction(this->_aDelContact);
    this->_mContact->addAction(this->_aSearchContact);
    this->_mContact->addAction(this->_aDisconnect);
    this->_mContact->addAction(this->_aQuit);
    this->_mAccount->addAction(this->_aProfile);
    this->_mHelp->addAction(this->_aHelp);
    this->_online.setText("Contacts en ligne");
    this->_offline.setText("Contacts hors ligne");
    this->_idLabel.setText(this->_idText);
    this->_infoLabel.setText(this->_serverText.append(this->_portText));
    this->_call.setFont(QFont("Default", 14));
    this->_call.setCursor(Qt::PointingHandCursor);
    this->_call.setIcon(QIcon(QCoreApplication::applicationDirPath() + "/ressources/Logo.png"));
    this->_modelOn.setStringList(this->getContactOn());
    this->_modelOff.setStringList(this->getContactOff());
    this->_viewOn.setModel(&this->_modelOn);
    this->_viewOn.setEditTriggers(QAbstractItemView::NoEditTriggers);
    this->_viewOff.setModel(&this->_modelOff);
    this->_viewOff.setEditTriggers(QAbstractItemView::NoEditTriggers);
    this->_viewOff.setSelectionMode(QAbstractItemView::NoSelection);
    this->_layout.addWidget(&this->_infoLabel);
    this->_layout.addWidget(&this->_idLabel);
    this->_layout.addWidget(&this->_online, Qt::AlignCenter);
    this->_layout.addWidget(&this->_viewOn);
    this->_layout.addWidget(&this->_offline, Qt::AlignCenter);
    this->_layout.addWidget(&this->_viewOff);
    this->_layout.addWidget(&this->_call);
    this->_core.setLayout(&this->_layout);
    this->getUdpSocket()->bind(this->getUdpPort());
    this->setCentralWidget(&this->_core);
    this->setWindowIcon(QIcon(QCoreApplication::applicationDirPath() + "/ressources/babybel.png"));
    connect(&this->_call, SIGNAL(clicked()), this, SLOT(selectContact()));
    connect(this->_aQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(this->_aAddContact, SIGNAL(triggered()), this, SLOT(addContact()));
    connect(this->_aDelContact, SIGNAL(triggered()), this, SLOT(delContact()));
    connect(this->_aSearchContact, SIGNAL(triggered()), this, SLOT(searchContact()));
    connect(this->_aDisconnect, SIGNAL(triggered()), this, SLOT(aDisconnect()));
    connect(this->_aHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
    connect(this->_aProfile, SIGNAL(triggered()), this, SLOT(showProfile()));
    connect(this->getTcpSocket(), SIGNAL(readyRead()), this, SLOT(receivedTcpData()));
    connect(this->getUdpSocket(), SIGNAL(readyRead()), this, SLOT(receivedUdpData()));
}
Exemplo n.º 3
0
//---------------------------------------------------------------------------
void TQSOEditDlg::selectCatchup( BaseContestLog * c )
{
    // Kick off Post Entry/Uri/catchup
    // We need to create a new contact, and set the "post entry" flag
    // and then trigger the qso edit dialog on it

    // Also note that we don't get a dups display doing it this way
    // Not sure if that matters...

    // OR can we build a match window into the edit dialog?

    catchup = true;
    LoggerContestLog *ct = dynamic_cast<LoggerContestLog *>( c );

    int ctmax = ct->maxSerial + 1;

    DisplayContestContact *lct = ct->addContact( ctmax, 0, false, catchup );
    selectContact(c, lct);
    GJVQSOEditFrame->FirstUnfilledButton->Enabled = false;
}
Exemplo n.º 4
0
ContactsDialog::ContactsDialog(QContactManager* manager, QWidget *parent) :
    QDialog(parent)
{
    m_contactManager = manager;
    
    QVBoxLayout* vbox = new QVBoxLayout;
    QHBoxLayout* hbox = new QHBoxLayout;

    QLabel* label = new QLabel("Send MMS to",this);
    label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
    vbox->addWidget(label, Qt::AlignHCenter | Qt::AlignVCenter);

    // List
    m_listWidget = new QListWidget(this);
    m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    m_listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    vbox->addWidget(m_listWidget);


    // Buttons
    m_ok = new QPushButton("Select", this);
    m_ok->setContextMenuPolicy(Qt::NoContextMenu);
    QObject::connect(m_ok, SIGNAL(clicked()), this, SLOT(selectContact()));
    hbox->addWidget(m_ok, Qt::AlignTop | Qt::AlignVCenter);

    m_exit = new QPushButton("Cancel", this);
    m_exit->setContextMenuPolicy(Qt::NoContextMenu);
    QObject::connect(m_exit, SIGNAL(clicked()), this, SLOT(close()));
    hbox->addWidget(m_exit, Qt::AlignTop | Qt::AlignVCenter);

    vbox->addLayout(hbox);


    // Remove context menu from the all widgets
#ifdef Q_OS_SYMBIAN
    QWidgetList widgets = QApplication::allWidgets();
    QWidget* w = 0;
    foreach(w,widgets)
        {
            w->setContextMenuPolicy(Qt::NoContextMenu);
        }