Exemple #1
0
void ProfileWindow::verifyUserName()
{
    QString userName = Utilities::htmlToWAText(ui->textEdit->toHtml());

    if (userName.isEmpty())
    {
        QMaemo5InformationBox::information(this,"Name can't be empty",
                                           QMaemo5InformationBox::NoTimeout);
    }
    else if (userName.length() > 25)
    {
        QMaemo5InformationBox::information(this,"Name can't be longer than 25 characters",
                                           QMaemo5InformationBox::NoTimeout);
    }
    else
    {
        // Save the alias/username
        Contact &c = Client::roster->getContact(Client::myJid);
        c.alias = userName;
        Client::roster->updateAlias(&c);

        emit changeUserName(userName);
        close();
    }
}
void FtpClientWindow::ftpConnect()
{
	changeServerName();
	changeServerPort();
	changeUserName();
	changePWD();
	ftpClient-> ftpConnect();
}
void KaduExtInfo::userDataChanged(const UserListElement* const oldData, const UserListElement* const newData,bool)
{
    kdebugf();
#ifdef KADU_0_4_x
    if (!oldData || !newData)
        return;
    changeUserName(oldData->altNick(),newData->altNick());
#endif
    kdebugf2();
}
void KaduExtInfo::userDataChanged(UserListElement elem, QString name, QVariant oldValue,QVariant currentValue, bool massively, bool last)
{
    kdebugf();
#ifdef KADU_0_5_0
    if (name != QString("AltNick"))
        return;
    changeUserName(oldValue.toString(), currentValue.toString());
#endif
    kdebugf2();
}
VisItPasswordWindow::VisItPasswordWindow(QWidget *parent) : QDialog(parent)
{
    setModal(true);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(10);

    QHBoxLayout *l2 = new QHBoxLayout;
    layout->addLayout(l2);
    l2->setSpacing(5);
    label = new QLabel(tr("Password for localhost: "), this);
    l2->addWidget(label);

    passedit = new QLineEdit(this);
    passedit->setEchoMode(QLineEdit::Password);
    l2->addWidget(passedit);
    connect(passedit, SIGNAL(returnPressed()), this, SLOT(accept()));
    layout->addSpacing(20);

    QHBoxLayout *l3 = new QHBoxLayout;
    layout->addLayout(l3);
    QPushButton *okay = new QPushButton(tr("OK"), this);
    connect(okay, SIGNAL(clicked()), this, SLOT(accept()));
    l3->addWidget(okay);
    l3->addStretch(10);

    QPushButton *cub = new QPushButton(tr("Change username"), this);
    connect(cub, SIGNAL(clicked()), this, SLOT(changeUserName()));
    l3->addWidget(cub);
    l3->addStretch(10);

    QPushButton *cancel = new QPushButton(tr("Cancel"), this);
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
    l3->addWidget(cancel);

    setWindowTitle(tr("Enter password"));

    this->changedUserName = false;
}