Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-windows
Commits
2311f488
Commit
2311f488
authored
Apr 08, 2019
by
Andreas Traczyk
Browse files
SIP: draw sip contacts in the smartlist
Change-Id: I2603484d8a2fb158c439ff46acefbbcfedbb9ab5
parent
46fd3697
Changes
3
Hide whitespace changes
Inline
Side-by-side
callwidget.cpp
View file @
2311f488
...
...
@@ -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
);
...
...
conversationitemdelegate.cpp
View file @
2311f488
...
...
@@ -136,16 +136,15 @@ ConversationItemDelegate::paint(QPainter* painter
);
switch
(
type
)
{
case
profile
::
Type
::
RING
:
case
profile
::
Type
::
SIP
:
case
profile
::
Type
::
TEMPORARY
:
paint
Ring
ConversationItem
(
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:
paint
Ring
ConversationItem
(
painter
,
option
,
rect
,
index
);
paintConversationItem
(
painter
,
option
,
rect
,
index
);
break
;
}
}
...
...
@@ -160,10 +159,10 @@ ConversationItemDelegate::sizeHint(const QStyleOptionViewItem& option,
}
void
ConversationItemDelegate
::
paint
Ring
ConversationItem
(
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
);
}
conversationitemdelegate.h
View file @
2311f488
...
...
@@ -34,9 +34,8 @@ protected:
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
;
private:
void
paint
Ring
ConversationItem
(
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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment