Example #1
0
ChatDialog::ChatDialog(QWidget *parent, QString username, QString peername, QString peeraddr, ChatConnection *connection) :
    QDialog(parent)
{
    this->userName = username;
    this->chatSession = connection;

    if(DEBUG)
        qDebug() << "Peer addr string is: " << peeraddr;

    //this->iconLabel = new QLabel(QObject::tr("XXXXX\nXXXXX\nXXXXX"), this);
    //this->iconLabel->setAlignment(Qt::AlignCenter);
    this->peerName = new QLabel(this);
    this->peerAddress = new QLabel(this);
    this->logChat = new QTextEdit();
    this->msgSend = new QLineEdit();
    this->sendButton = new QPushButton(QObject::tr("Send"), this);
    this->msgSend->setFocusPolicy(Qt::StrongFocus);
    this->logChat->setFocusPolicy(Qt::NoFocus);
    this->logChat->setReadOnly(true);

    this->peerName->setText("Username: "******"Address: " + peeraddr);
    this->setWindowTitle(peername + "@" + peeraddr);
    this->initLayout();
    this->resize(QSize(480, 360));

    connect(sendButton, SIGNAL(clicked()), this, SLOT(handleToSendMessage()));
    connect(msgSend, SIGNAL(returnPressed()), this, SLOT(handleToSendMessage()));

    connect(chatSession, SIGNAL(newMessage(QString, QString)), this, SLOT(handleReceivedMssage(QString, QString)));
    connect(chatSession, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(handleConnectionError(QAbstractSocket::SocketError)));
    connect(this, SIGNAL(rejected()), this, SLOT(handleRejected()));
}
// ----------------------------------------------------------------------------
// SifUiDialogSelectLanguage::SifUiDialogSelectLanguage()
// ----------------------------------------------------------------------------
//
SifUiDialogSelectLanguage::SifUiDialogSelectLanguage(const QVariant &languages,
        QGraphicsItem *parent) : HbDialog(parent), mRadioButtonList(0), mOkAction(0)
{
    setTimeout(HbPopup::NoTimeout);
    setDismissPolicy(HbPopup::NoDismiss);
    setModal(true);

    HbLabel *title = new HbLabel(hbTrId("txt_installer_title_select_language"));
    setHeadingWidget(title);

    Q_ASSERT( mRadioButtonList == 0 );
    mRadioButtonList = new HbRadioButtonList(this);
    mRadioButtonList->setItems(languageNames(languages));
    setContentWidget(mRadioButtonList);

    HbAction *okAction = new HbAction(QString(hbTrId("txt_common_button_ok")), this);
    disconnect(okAction, SIGNAL(triggered()), this, SLOT(close()));
    connect(okAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
    addAction(okAction);

    HbAction *cancelAction = new HbAction(QString(hbTrId("txt_common_button_cancel")), this);
    disconnect(cancelAction, SIGNAL(triggered()), this, SLOT(close()));
    connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleRejected()));
    addAction(cancelAction);
}
PasswordInputWindow::PasswordInputWindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PasswordInputWindow)
{
    ui->setupUi(this);

    bool success;
    success = connect(this, SIGNAL(accepted()), this, SLOT(handleAccepted()));
    Q_ASSERT(success);
    success = connect(this, SIGNAL(rejected()), this, SLOT(handleRejected()));
    Q_ASSERT(success);
}
AdminWindow::AdminWindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AdminWindow),
    m_got_users(false)
{
    ui->setupUi(this);

    bool success;
    success = connect(this, SIGNAL(accepted()), this, SLOT(handleAccepted()));
    Q_ASSERT(success);
    success = connect(this, SIGNAL(rejected()), this, SLOT(handleRejected()));
    Q_ASSERT(success);

    enableCorrectControls();
}
Example #5
0
			ImportWizard::ImportWizard (QWidget *parent)
			: QWizard (parent)
			{
				Ui_.setupUi (this);

				Importers_ << new AkregatorImporter (this);
				Importers_ << new LifereaImporter (this);
				Importers_ << new KTorrentImporter (this);
				Importers_ << new FirefoxImporter (this);

				connect (this,
						SIGNAL (accepted ()),
						this,
						SLOT (handleAccepted ()),
						Qt::QueuedConnection);
				connect (this,
						SIGNAL (accepted ()),
						this,
						SLOT (handleRejected ()),
						Qt::QueuedConnection);

				SetupImporters ();
			}