forked from blue/squawk
deprecation fix about qxmpp, beginning of adding email addresses in VCards
This commit is contained in:
parent
c067835b00
commit
9d491e9e93
17 changed files with 610 additions and 227 deletions
21
ui/widgets/vcard/CMakeLists.txt
Normal file
21
ui/widgets/vcard/CMakeLists.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(vCardUI)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to create code from Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||
|
||||
set(vCardUI_SRC
|
||||
vcard.cpp
|
||||
emailsmodel.cpp
|
||||
)
|
||||
|
||||
# Tell CMake to create the helloworld executable
|
||||
add_library(vCardUI ${vCardUI_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(vCardUI Qt5::Widgets)
|
145
ui/widgets/vcard/emailsmodel.cpp
Normal file
145
ui/widgets/vcard/emailsmodel.cpp
Normal file
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* Squawk messenger.
|
||||
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "emailsmodel.h"
|
||||
|
||||
UI::VCard::EMailsModel::EMailsModel(bool p_edit, QObject* parent):
|
||||
QAbstractTableModel(parent),
|
||||
edit(p_edit),
|
||||
deque()
|
||||
{
|
||||
}
|
||||
|
||||
int UI::VCard::EMailsModel::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
int UI::VCard::EMailsModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
return deque.size();
|
||||
}
|
||||
|
||||
QVariant UI::VCard::EMailsModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if (index.isValid()) {
|
||||
int col = index.column();
|
||||
switch (col) {
|
||||
case 0:
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return deque[index.row()].address;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return tr(Shared::VCard::Email::roleNames[deque[index.row()].role].toStdString().c_str());
|
||||
case Qt::EditRole:
|
||||
return deque[index.row()].role;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return QVariant();
|
||||
case Qt::DecorationRole:
|
||||
if (deque[index.row()].prefered) {
|
||||
return Shared::icon("favorite", false);
|
||||
}
|
||||
return QVariant();
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Qt::ItemFlags UI::VCard::EMailsModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
Qt::ItemFlags f = QAbstractTableModel::flags(index);
|
||||
if (edit && index.column() != 2) {
|
||||
f = Qt::ItemIsEditable | f;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
bool UI::VCard::EMailsModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||
{
|
||||
if (role == Qt::EditRole && checkIndex(index)) {
|
||||
Shared::VCard::Email& item = deque[index.row()];
|
||||
switch (index.column()) {
|
||||
case 0:
|
||||
item.address = value.toString();
|
||||
return true;
|
||||
case 1: {
|
||||
quint8 newRole = value.toUInt();
|
||||
if (newRole > Shared::VCard::Email::work) {
|
||||
return false;
|
||||
}
|
||||
item.role = static_cast<Shared::VCard::Email::Role>(newRole);
|
||||
return true;
|
||||
}
|
||||
case 2: {
|
||||
bool newDef = value.toBool();
|
||||
if (newDef != item.prefered) {
|
||||
if (newDef) {
|
||||
dropPrefered();
|
||||
}
|
||||
item.prefered = newDef;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool UI::VCard::EMailsModel::dropPrefered()
|
||||
{
|
||||
bool dropped = false;
|
||||
int i = 0;
|
||||
for (Shared::VCard::Email& email : deque) {
|
||||
if (email.prefered) {
|
||||
email.prefered = false;
|
||||
QModelIndex ci = createIndex(i, 2, &email);
|
||||
emit dataChanged(ci, ci);
|
||||
dropped = true;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return dropped;
|
||||
}
|
||||
|
||||
QModelIndex UI::VCard::EMailsModel::addNewEmptyLine()
|
||||
{
|
||||
beginInsertRows(QModelIndex(), deque.size(), deque.size());
|
||||
deque.emplace_back("");
|
||||
endInsertRows();
|
||||
return createIndex(deque.size() - 1, 0, &(deque.back()));
|
||||
}
|
57
ui/widgets/vcard/emailsmodel.h
Normal file
57
ui/widgets/vcard/emailsmodel.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* Squawk messenger.
|
||||
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef UI_VCARD_EMAILSMODEL_H
|
||||
#define UI_VCARD_EMAILSMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QIcon>
|
||||
|
||||
#include <deque>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
namespace UI {
|
||||
namespace VCard {
|
||||
|
||||
class EMailsModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EMailsModel(bool edit = false, QObject *parent = nullptr);
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
public slots:
|
||||
QModelIndex addNewEmptyLine();
|
||||
|
||||
private:
|
||||
bool edit;
|
||||
std::deque<Shared::VCard::Email> deque;
|
||||
|
||||
private:
|
||||
bool dropPrefered();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // UI_VCARD_EMAILSMODEL_H
|
312
ui/widgets/vcard/vcard.cpp
Normal file
312
ui/widgets/vcard/vcard.cpp
Normal file
|
@ -0,0 +1,312 @@
|
|||
/*
|
||||
* Squawk messenger.
|
||||
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "vcard.h"
|
||||
#include "ui_vcard.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
const std::set<QString> VCard::supportedTypes = {"image/jpeg", "image/png"};
|
||||
|
||||
VCard::VCard(const QString& jid, bool edit, QWidget* parent):
|
||||
QWidget(parent),
|
||||
m_ui(new Ui::VCard()),
|
||||
avatarButtonMargins(),
|
||||
avatarMenu(nullptr),
|
||||
editable(edit),
|
||||
currentAvatarType(Shared::Avatar::empty),
|
||||
currentAvatarPath(""),
|
||||
progress(new Progress(100)),
|
||||
progressLabel(new QLabel()),
|
||||
overlay(new QWidget()),
|
||||
contextMenu(new QMenu()),
|
||||
emails(edit),
|
||||
roleDelegate(new ComboboxDelegate())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->jabberID->setText(jid);
|
||||
m_ui->jabberID->setReadOnly(true);
|
||||
|
||||
QAction* setAvatar = m_ui->actionSetAvatar;
|
||||
QAction* clearAvatar = m_ui->actionClearAvatar;
|
||||
|
||||
connect(setAvatar, &QAction::triggered, this, &VCard::onSetAvatar);
|
||||
connect(clearAvatar, &QAction::triggered, this, &VCard::onClearAvatar);
|
||||
|
||||
setAvatar->setEnabled(true);
|
||||
clearAvatar->setEnabled(false);
|
||||
|
||||
roleDelegate->addEntry(tr(Shared::VCard::Email::roleNames[0].toStdString().c_str()));
|
||||
roleDelegate->addEntry(tr(Shared::VCard::Email::roleNames[1].toStdString().c_str()));
|
||||
roleDelegate->addEntry(tr(Shared::VCard::Email::roleNames[2].toStdString().c_str()));
|
||||
|
||||
m_ui->emailsView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
m_ui->emailsView->setModel(&emails);
|
||||
m_ui->emailsView->setItemDelegateForColumn(1, roleDelegate);
|
||||
m_ui->emailsView->horizontalHeader()->setStretchLastSection(false);
|
||||
m_ui->emailsView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
|
||||
connect(m_ui->emailsView, &QWidget::customContextMenuRequested, this, &VCard::onContextMenu);
|
||||
|
||||
if (edit) {
|
||||
avatarMenu = new QMenu();
|
||||
m_ui->avatarButton->setMenu(avatarMenu);
|
||||
avatarMenu->addAction(setAvatar);
|
||||
avatarMenu->addAction(clearAvatar);
|
||||
m_ui->title->setText(tr("Your card"));
|
||||
} else {
|
||||
m_ui->buttonBox->hide();
|
||||
m_ui->fullName->setReadOnly(true);
|
||||
m_ui->firstName->setReadOnly(true);
|
||||
m_ui->middleName->setReadOnly(true);
|
||||
m_ui->lastName->setReadOnly(true);
|
||||
m_ui->nickName->setReadOnly(true);
|
||||
m_ui->birthday->setReadOnly(true);
|
||||
m_ui->organizationName->setReadOnly(true);
|
||||
m_ui->organizationDepartment->setReadOnly(true);
|
||||
m_ui->organizationTitle->setReadOnly(true);
|
||||
m_ui->organizationRole->setReadOnly(true);
|
||||
m_ui->description->setReadOnly(true);
|
||||
m_ui->url->setReadOnly(true);
|
||||
m_ui->title->setText(tr("Contact %1 card").arg(jid));
|
||||
}
|
||||
|
||||
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &VCard::onButtonBoxAccepted);
|
||||
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &VCard::close);
|
||||
|
||||
avatarButtonMargins = m_ui->avatarButton->size();
|
||||
|
||||
int height = m_ui->personalForm->minimumSize().height() - avatarButtonMargins.height();
|
||||
m_ui->avatarButton->setIconSize(QSize(height, height));
|
||||
|
||||
QGridLayout* gr = static_cast<QGridLayout*>(layout());
|
||||
gr->addWidget(overlay, 0, 0, 4, 1);
|
||||
QVBoxLayout* nl = new QVBoxLayout();
|
||||
QGraphicsOpacityEffect* opacity = new QGraphicsOpacityEffect();
|
||||
opacity->setOpacity(0.8);
|
||||
overlay->setLayout(nl);
|
||||
overlay->setBackgroundRole(QPalette::Base);
|
||||
overlay->setAutoFillBackground(true);
|
||||
overlay->setGraphicsEffect(opacity);
|
||||
progressLabel->setAlignment(Qt::AlignCenter);
|
||||
progressLabel->setStyleSheet("font: 16pt");
|
||||
nl->addStretch();
|
||||
nl->addWidget(progress);
|
||||
nl->addWidget(progressLabel);
|
||||
nl->addStretch();
|
||||
overlay->hide();
|
||||
}
|
||||
|
||||
VCard::~VCard()
|
||||
{
|
||||
if (editable) {
|
||||
avatarMenu->deleteLater();
|
||||
}
|
||||
|
||||
roleDelegate->deleteLater();
|
||||
contextMenu->deleteLater();
|
||||
}
|
||||
|
||||
void VCard::setVCard(const QString& jid, const Shared::VCard& card)
|
||||
{
|
||||
m_ui->jabberID->setText(jid);
|
||||
setVCard(card);
|
||||
}
|
||||
|
||||
void VCard::setVCard(const Shared::VCard& card)
|
||||
{
|
||||
m_ui->fullName->setText(card.getFullName());
|
||||
m_ui->firstName->setText(card.getFirstName());
|
||||
m_ui->middleName->setText(card.getMiddleName());
|
||||
m_ui->lastName->setText(card.getLastName());
|
||||
m_ui->nickName->setText(card.getNickName());
|
||||
m_ui->birthday->setDate(card.getBirthday());
|
||||
m_ui->organizationName->setText(card.getOrgName());
|
||||
m_ui->organizationDepartment->setText(card.getOrgUnit());
|
||||
m_ui->organizationTitle->setText(card.getOrgTitle());
|
||||
m_ui->organizationRole->setText(card.getOrgRole());
|
||||
m_ui->description->setText(card.getDescription());
|
||||
m_ui->url->setText(card.getUrl());
|
||||
|
||||
QDateTime receivingTime = card.getReceivingTime();
|
||||
m_ui->receivingTimeLabel->setText(tr("Received %1 at %2").arg(receivingTime.date().toString()).arg(receivingTime.time().toString()));
|
||||
currentAvatarType = card.getAvatarType();
|
||||
currentAvatarPath = card.getAvatarPath();
|
||||
|
||||
updateAvatar();
|
||||
}
|
||||
|
||||
QString VCard::getJid() const
|
||||
{
|
||||
return m_ui->jabberID->text();
|
||||
}
|
||||
|
||||
void VCard::onButtonBoxAccepted()
|
||||
{
|
||||
Shared::VCard card;
|
||||
card.setFullName(m_ui->fullName->text());
|
||||
card.setFirstName(m_ui->firstName->text());
|
||||
card.setMiddleName(m_ui->middleName->text());
|
||||
card.setLastName(m_ui->lastName->text());
|
||||
card.setNickName(m_ui->nickName->text());
|
||||
card.setBirthday(m_ui->birthday->date());
|
||||
card.setDescription(m_ui->description->toPlainText());
|
||||
card.setUrl(m_ui->url->text());
|
||||
card.setOrgName(m_ui->organizationName->text());
|
||||
card.setOrgUnit(m_ui->organizationDepartment->text());
|
||||
card.setOrgRole(m_ui->organizationRole->text());
|
||||
card.setOrgTitle(m_ui->organizationTitle->text());
|
||||
card.setAvatarPath(currentAvatarPath);
|
||||
card.setAvatarType(currentAvatarType);
|
||||
|
||||
emit saveVCard(card);
|
||||
}
|
||||
|
||||
void VCard::onClearAvatar()
|
||||
{
|
||||
currentAvatarType = Shared::Avatar::empty;
|
||||
currentAvatarPath = "";
|
||||
|
||||
updateAvatar();
|
||||
}
|
||||
|
||||
void VCard::onSetAvatar()
|
||||
{
|
||||
QFileDialog* d = new QFileDialog(this, tr("Chose your new avatar"));
|
||||
d->setFileMode(QFileDialog::ExistingFile);
|
||||
d->setNameFilter(tr("Images (*.png *.jpg *.jpeg)"));
|
||||
|
||||
connect(d, &QFileDialog::accepted, this, &VCard::onAvatarSelected);
|
||||
connect(d, &QFileDialog::rejected, d, &QFileDialog::deleteLater);
|
||||
|
||||
d->show();
|
||||
}
|
||||
|
||||
void VCard::updateAvatar()
|
||||
{
|
||||
int height = m_ui->personalForm->minimumSize().height() - avatarButtonMargins.height();
|
||||
switch (currentAvatarType) {
|
||||
case Shared::Avatar::empty:
|
||||
m_ui->avatarButton->setIcon(Shared::icon("user", true));
|
||||
m_ui->avatarButton->setIconSize(QSize(height, height));
|
||||
m_ui->actionClearAvatar->setEnabled(false);
|
||||
break;
|
||||
case Shared::Avatar::autocreated:
|
||||
case Shared::Avatar::valid:
|
||||
QPixmap pixmap(currentAvatarPath);
|
||||
qreal h = pixmap.height();
|
||||
qreal w = pixmap.width();
|
||||
qreal aspectRatio = w / h;
|
||||
m_ui->avatarButton->setIconSize(QSize(height * aspectRatio, height));
|
||||
m_ui->avatarButton->setIcon(QIcon(currentAvatarPath));
|
||||
m_ui->actionClearAvatar->setEnabled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VCard::onAvatarSelected()
|
||||
{
|
||||
QFileDialog* d = static_cast<QFileDialog*>(sender());
|
||||
QMimeDatabase db;
|
||||
QString path = d->selectedFiles().front();
|
||||
QMimeType type = db.mimeTypeForFile(path);
|
||||
d->deleteLater();
|
||||
|
||||
if (supportedTypes.find(type.name()) == supportedTypes.end()) {
|
||||
qDebug() << "Selected for avatar file is not supported, skipping";
|
||||
} else {
|
||||
QImage src(path);
|
||||
QImage dst;
|
||||
if (src.width() > 160 || src.height() > 160) {
|
||||
dst = src.scaled(160, 160, Qt::KeepAspectRatio);
|
||||
}
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + m_ui->jabberID->text() + ".temp." + type.preferredSuffix();
|
||||
QFile oldTemp(path);
|
||||
if (oldTemp.exists()) {
|
||||
if (!oldTemp.remove()) {
|
||||
qDebug() << "Error removing old temp avatar" << path;
|
||||
return;
|
||||
}
|
||||
}
|
||||
bool success = dst.save(path);
|
||||
if (success) {
|
||||
currentAvatarPath = path;
|
||||
currentAvatarType = Shared::Avatar::valid;
|
||||
|
||||
updateAvatar();
|
||||
} else {
|
||||
qDebug() << "couldn't save avatar" << path << ", skipping";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VCard::showProgress(const QString& line)
|
||||
{
|
||||
progressLabel->setText(line);
|
||||
overlay->show();
|
||||
progress->start();
|
||||
}
|
||||
|
||||
void VCard::hideProgress()
|
||||
{
|
||||
overlay->hide();
|
||||
progress->stop();
|
||||
}
|
||||
|
||||
void VCard::onContextMenu(const QPoint& point)
|
||||
{
|
||||
contextMenu->clear();
|
||||
bool hasMenu = false;
|
||||
QAbstractItemView* snd = static_cast<QAbstractItemView*>(sender());
|
||||
if (snd == m_ui->emailsView) {
|
||||
if (editable) {
|
||||
hasMenu = true;
|
||||
QAction* add = contextMenu->addAction(Shared::icon("list-add"), tr("Add email address"));
|
||||
connect(add, &QAction::triggered, this, &VCard::onAddEmail);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasMenu) {
|
||||
contextMenu->popup(snd->viewport()->mapToGlobal(point));
|
||||
}
|
||||
}
|
||||
|
||||
void VCard::onAddEmail()
|
||||
{
|
||||
QModelIndex index = emails.addNewEmptyLine();
|
||||
m_ui->emailsView->setCurrentIndex(index);
|
||||
m_ui->emailsView->edit(index);
|
||||
}
|
||||
|
||||
void VCard::onAddAddress()
|
||||
{
|
||||
|
||||
}
|
||||
void VCard::onAddPhone()
|
||||
{
|
||||
}
|
||||
void VCard::onRemoveAddress()
|
||||
{
|
||||
}
|
||||
void VCard::onRemoveEmail()
|
||||
{
|
||||
}
|
||||
|
||||
void VCard::onRemovePhone()
|
||||
{
|
||||
}
|
99
ui/widgets/vcard/vcard.h
Normal file
99
ui/widgets/vcard/vcard.h
Normal file
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* Squawk messenger.
|
||||
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VCARD_H
|
||||
#define VCARD_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScopedPointer>
|
||||
#include <QPixmap>
|
||||
#include <QMenu>
|
||||
#include <QFileDialog>
|
||||
#include <QMimeDatabase>
|
||||
#include <QImage>
|
||||
#include <QStandardPaths>
|
||||
#include <QLabel>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMenu>
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "global.h"
|
||||
#include "emailsmodel.h"
|
||||
#include "ui/utils/progress.h"
|
||||
#include "ui/utils/comboboxdelegate.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class VCard;
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo write docs
|
||||
*/
|
||||
class VCard : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VCard(const QString& jid, bool edit = false, QWidget* parent = nullptr);
|
||||
~VCard();
|
||||
|
||||
void setVCard(const Shared::VCard& card);
|
||||
void setVCard(const QString& jid, const Shared::VCard& card);
|
||||
QString getJid() const;
|
||||
void showProgress(const QString& = "");
|
||||
void hideProgress();
|
||||
|
||||
signals:
|
||||
void saveVCard(const Shared::VCard& card);
|
||||
|
||||
private slots:
|
||||
void onButtonBoxAccepted();
|
||||
void onClearAvatar();
|
||||
void onSetAvatar();
|
||||
void onAvatarSelected();
|
||||
void onAddAddress();
|
||||
void onRemoveAddress();
|
||||
void onAddEmail();
|
||||
void onRemoveEmail();
|
||||
void onAddPhone();
|
||||
void onRemovePhone();
|
||||
void onContextMenu(const QPoint& point);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::VCard> m_ui;
|
||||
QSize avatarButtonMargins;
|
||||
QMenu* avatarMenu;
|
||||
bool editable;
|
||||
Shared::Avatar currentAvatarType;
|
||||
QString currentAvatarPath;
|
||||
Progress* progress;
|
||||
QLabel* progressLabel;
|
||||
QWidget* overlay;
|
||||
QMenu* contextMenu;
|
||||
UI::VCard::EMailsModel emails;
|
||||
ComboboxDelegate* roleDelegate;
|
||||
|
||||
static const std::set<QString> supportedTypes;
|
||||
|
||||
private:
|
||||
void updateAvatar();
|
||||
};
|
||||
|
||||
#endif // VCARD_H
|
874
ui/widgets/vcard/vcard.ui
Normal file
874
ui/widgets/vcard/vcard.ui
Normal file
|
@ -0,0 +1,874 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VCard</class>
|
||||
<widget class="QWidget" name="VCard">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>578</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 16pt </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Contact john@dow.org card</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="receivingTimeLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: italic 8pt;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Received 12.07.2007 at 17.35</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::TabFocus</enum>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideNone</enum>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabBarAutoHide">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="General">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="1,2,2,1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QLabel" name="organizationHeading">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Organization</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QFormLayout" name="personalForm">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="middleName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="firstName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="middleNameLabel">
|
||||
<property name="text">
|
||||
<string>Middle name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>middleName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="firstNameLabel">
|
||||
<property name="text">
|
||||
<string>First name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>firstName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lastNameLabel">
|
||||
<property name="text">
|
||||
<string>Last name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>lastName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lastName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="nickNameLabel">
|
||||
<property name="text">
|
||||
<string>Nick name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>nickName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="nickName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="birthdayLabel">
|
||||
<property name="text">
|
||||
<string>Birthday</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>birthday</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDateEdit" name="birthday"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="2">
|
||||
<layout class="QFormLayout" name="organizationForm">
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="organizationNameLabel">
|
||||
<property name="text">
|
||||
<string>Organization name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>organizationName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="organizationName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="organizationDepartmentLabel">
|
||||
<property name="text">
|
||||
<string>Unit / Department</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>organizationDepartment</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="organizationDepartment">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="roleLabel">
|
||||
<property name="text">
|
||||
<string>Role / Profession</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>organizationRole</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="organizationRole">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="organizationTitleLabel">
|
||||
<property name="text">
|
||||
<string>Job title</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>organizationTitle</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="organizationTitle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="2">
|
||||
<widget class="Line" name="organizationLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<layout class="QFormLayout" name="commonForm">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="fullName"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="fullNameLabel">
|
||||
<property name="text">
|
||||
<string>Full name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>fullName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="7">
|
||||
<spacer name="generalLeftHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="Line" name="personalLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QLabel" name="generalHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:24pt; font-weight:600;">General</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" rowspan="7">
|
||||
<spacer name="generalRightHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="personalHeading">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Personal information</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QToolButton" name="avatarButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="user">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::NoArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Contact">
|
||||
<attribute name="title">
|
||||
<string>Contact</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="contactHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:24pt; font-weight:600;">Contact</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="contactScrollArea">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>566</width>
|
||||
<height>497</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3" columnstretch="1,3,1,0">
|
||||
<item row="7" column="1">
|
||||
<widget class="Line" name="phonesLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QTableView" name="emailsView">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="Line" name="addressesLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="12">
|
||||
<spacer name="contactLeftSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Line" name="contactFormLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="Line" name="emailsLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<spacer name="contactBottomSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="addressesHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Addresses</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QTableView" name="phonesView">
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="emailsHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">E-Mail addresses</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QFormLayout" name="contactForm">
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="jabberID">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="jabberIDLabel">
|
||||
<property name="text">
|
||||
<string>Jabber ID</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>jabberID</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="url">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="urlLabel">
|
||||
<property name="text">
|
||||
<string>Web site</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>url</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="12">
|
||||
<spacer name="contactRightSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="phenesHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Phone numbers</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QTableView" name="addressesView">
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Description">
|
||||
<attribute name="title">
|
||||
<string>Description</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="descriptionHeading">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:24pt; font-weight:600;">Description</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTextEdit" name="description">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionSetAvatar">
|
||||
<property name="icon">
|
||||
<iconset theme="photo">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set avatar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClearAvatar">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear-all">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear avatar</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>fullName</tabstop>
|
||||
<tabstop>firstName</tabstop>
|
||||
<tabstop>middleName</tabstop>
|
||||
<tabstop>lastName</tabstop>
|
||||
<tabstop>nickName</tabstop>
|
||||
<tabstop>birthday</tabstop>
|
||||
<tabstop>avatarButton</tabstop>
|
||||
<tabstop>organizationName</tabstop>
|
||||
<tabstop>organizationDepartment</tabstop>
|
||||
<tabstop>organizationRole</tabstop>
|
||||
<tabstop>organizationTitle</tabstop>
|
||||
<tabstop>jabberID</tabstop>
|
||||
<tabstop>url</tabstop>
|
||||
<tabstop>description</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../resources/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue