Example #1
0
void JContact::setName(const QString &name)
{
    Q_D(JContact);
    if (d->name == name)
        return;
    setContactName(name);
    d->account->roster()->setName(this,name);
}
Example #2
0
ContactInfoWindow::ContactInfoWindow(Contact *contact, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::ContactInfoWindow)
{
    this->contact = contact;

    ui->setupUi(this);

    ui->phoneNumberLabel->setText(contact->phone);

    setContactPhoto();
    setContactName();
    setContactStatus();

    connect(ui->contactPhotoButton,SIGNAL(clicked()),
            this,SLOT(showPhoto()));

    connect(ui->copyButton,SIGNAL(clicked()),
            this,SLOT(copyPhoneToClipboard()));

    connect(ui->dialButton,SIGNAL(clicked()),
            this,SLOT(dialPhone()));

    QDir home = QDir::home();
    QString fileName = home.path() + CACHE_DIR"/"PHOTOS_DIR"/" + contact->jid
            + "/" + contact->photoId + ".png";
    QFile file(fileName);
    photoDownloaded = (file.exists());
    isDownloading = false;

    connect(Client::mainWin,SIGNAL(previewPhotoReceived(QString)),
            this,SLOT(previewPhotoReceived(QString)));

    connect(Client::mainWin,SIGNAL(largePhotoReceived(QString,QImage,QString)),
            this,SLOT(photoReceived(QString,QImage,QString)));

    connect(Client::mainWin,SIGNAL(onlineStatusChanged(QString)),
            this,SLOT(onlineStatusChanged(QString)));

    connect(Client::mainWin,SIGNAL(userStatusUpdated(QString)),
            this,SLOT(userStatusUpdated(QString)));

    connect(this,SIGNAL(photoUpdate(QString,QString,bool)),
            Client::mainWin,SLOT(requestPhotoUpdate(QString,QString,bool)));
}
Example #3
0
void ContactInfoWindow::onlineStatusChanged(QString jid)
{
    if (contact->jid == jid)
        setContactName();
}