Commit 2311f488 authored by Andreas Traczyk's avatar Andreas Traczyk

SIP: draw sip contacts in the smartlist

Change-Id: I2603484d8a2fb158c439ff46acefbbcfedbb9ab5
parent 46fd3697
......@@ -351,25 +351,25 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos)
selectConversation(*conversation, *convModel);
}
});
// clear conversation
auto clearConversationAction = new QAction(tr("Clear conversation"), this);
menu.addAction(clearConversationAction);
connect(clearConversationAction, &QAction::triggered,
[convUid]() {
LRCInstance::getCurrentConversationModel()->clearHistory(convUid);
});
// remove contact
auto removeContactAction = new QAction(tr("Remove contact"), this);
menu.addAction(removeContactAction);
connect(removeContactAction, &QAction::triggered,
[convUid]() {
LRCInstance::getCurrentConversationModel()->removeConversation(convUid, false);
});
if (contact.profileInfo.type == lrc::api::profile::Type::RING) {
// separator
menu.addSeparator();
// clear conversation
auto clearConversationAction = new QAction(tr("Clear conversation"), this);
menu.addAction(clearConversationAction);
connect(clearConversationAction, &QAction::triggered,
[convUid]() {
LRCInstance::getCurrentConversationModel()->clearHistory(convUid);
});
// remove contact
auto removeContactAction = new QAction(tr("Remove contact"), this);
menu.addAction(removeContactAction);
connect(removeContactAction, &QAction::triggered,
[convUid]() {
LRCInstance::getCurrentConversationModel()->removeConversation(convUid, false);
});
// block contact
auto blockContactAction = new QAction(tr("Block contact"), this);
menu.addAction(blockContactAction);
......
......@@ -136,16 +136,15 @@ ConversationItemDelegate::paint(QPainter* painter
);
switch (type) {
case profile::Type::RING:
case profile::Type::SIP:
case profile::Type::TEMPORARY:
paintRingConversationItem(painter, option, rect, index);
paintConversationItem(painter, option, rect, index);
break;
case profile::Type::PENDING:
paintRingInviteConversationItem(painter, option, rect, index);
break;
case profile::Type::SIP:
break;
default:
paintRingConversationItem(painter, option, rect, index);
paintConversationItem(painter, option, rect, index);
break;
}
}
......@@ -160,10 +159,10 @@ ConversationItemDelegate::sizeHint(const QStyleOptionViewItem& option,
}
void
ConversationItemDelegate::paintRingConversationItem(QPainter* painter,
const QStyleOptionViewItem& option,
const QRect& rect,
const QModelIndex& index) const
ConversationItemDelegate::paintConversationItem(QPainter* painter,
const QStyleOptionViewItem& option,
const QRect& rect,
const QModelIndex& index) const
{
Q_UNUSED(option);
QFont font(painter->font());
......@@ -352,13 +351,3 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter,
painter->drawText(rectName2, Qt::AlignVCenter | Qt::AlignLeft, idStr);
}
}
void
ConversationItemDelegate::paintSIPConversationItem(QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index) const
{
Q_UNUSED(painter);
Q_UNUSED(option);
Q_UNUSED(index);
}
......@@ -34,9 +34,8 @@ protected:
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
private:
void paintRingConversationItem(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QModelIndex& index) const;
void paintConversationItem(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QModelIndex& index) const;
void paintRingInviteConversationItem(QPainter* painter, const QStyleOptionViewItem& option, const QRect& rect, const QModelIndex& index) const;
void paintSIPConversationItem(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
constexpr static int sizeImage_ = 48;
constexpr static int cellHeight_ = 60;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment