Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-client-windows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
savoirfairelinux
jami-client-windows
Commits
7a8517d2
Commit
7a8517d2
authored
Jan 22, 2016
by
Edric Milaret
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the selection model from the recent model
Change-Id: I3b371a53f193944eccc349b5d0c42ef13dc41270 Tuleap: #148
parent
a20501fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
28 deletions
+41
-28
callwidget.cpp
callwidget.cpp
+39
-27
callwidget.h
callwidget.h
+2
-1
No files found.
callwidget.cpp
View file @
7a8517d2
...
...
@@ -95,15 +95,6 @@ CallWidget::CallWidget(QWidget* parent) :
RecentModel
::
instance
().
peopleProxy
()
->
setFilterRole
(
static_cast
<
int
>
(
Ring
::
Role
::
Name
));
RecentModel
::
instance
().
peopleProxy
()
->
setFilterCaseSensitivity
(
Qt
::
CaseInsensitive
);
ui
->
smartList
->
setModel
(
RecentModel
::
instance
().
peopleProxy
());
connect
(
ui
->
smartList
->
selectionModel
(),
SIGNAL
(
selectionChanged
(
QItemSelection
,
QItemSelection
)),
this
,
SLOT
(
smartListSelectionChanged
(
QItemSelection
,
QItemSelection
)));
connect
(
ui
->
smartList
,
&
QTreeView
::
entered
,
this
,
&
CallWidget
::
on_entered
);
smartListDelegate_
=
new
SmartListDelegate
();
ui
->
smartList
->
setSmartListItemDelegate
(
smartListDelegate_
);
PersonModel
::
instance
().
addCollection
<
WindowsContactBackend
>
(
LoadOptions
::
FORCE_ENABLED
);
...
...
@@ -129,6 +120,11 @@ CallWidget::CallWidget(QWidget* parent) :
ui
->
historyList
->
setExpanded
(
idx
,
true
);
});
connect
(
ui
->
smartList
,
&
QTreeView
::
entered
,
this
,
&
CallWidget
::
on_entered
);
smartListDelegate_
=
new
SmartListDelegate
();
ui
->
smartList
->
setSmartListItemDelegate
(
smartListDelegate_
);
ui
->
historyList
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
connect
(
ui
->
historyList
,
&
QListView
::
customContextMenuRequested
,
[
=
](
const
QPoint
&
pos
){
if
(
ui
->
historyList
->
currentIndex
().
parent
().
isValid
())
{
...
...
@@ -160,6 +156,21 @@ CallWidget::CallWidget(QWidget* parent) :
setupOutOfCallIM
();
setupSmartListMenu
();
connect
(
RecentModel
::
instance
().
selectionModel
(),
SIGNAL
(
selectionChanged
(
QItemSelection
,
QItemSelection
)),
this
,
SLOT
(
smartListSelectionChanged
(
QItemSelection
,
QItemSelection
)));
connect
(
RecentModel
::
instance
().
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
[
=
](
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
)
{
Q_UNUSED
(
deselected
)
if
(
selected
.
size
())
{
auto
idx
=
selected
.
indexes
().
first
();
auto
realIdx
=
RecentModel
::
instance
().
peopleProxy
()
->
mapFromSource
(
idx
);
ui
->
smartList
->
selectionModel
()
->
setCurrentIndex
(
realIdx
,
QItemSelectionModel
::
ClearAndSelect
);
}
else
ui
->
smartList
->
clearSelection
();
});
}
catch
(
const
std
::
exception
&
e
)
{
qDebug
()
<<
"INIT ERROR"
<<
e
.
what
();
}
...
...
@@ -173,6 +184,7 @@ CallWidget::~CallWidget()
delete
imDelegate_
;
delete
welcomePageAnim_
;
delete
messagingPageAnim_
;
delete
smartListDelegate_
;
}
void
...
...
@@ -371,12 +383,7 @@ CallWidget::callStateChanged(Call* call, Call::State previousState)
setActualCall
(
nullptr
);
ui
->
instantMessagingWidget
->
setMediaText
(
nullptr
);
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
welcomePage
);
//TODO : Link this so that recentModel get selected correctly
// auto onHoldCall = callModel_->getActiveCalls().first();
// if (onHoldCall != nullptr && onHoldCall->state() == Call::State::HOLD) {
// setActualCall(onHoldCall);
// onHoldCall->performAction(Call::Action::HOLD);
// }
RecentModel
::
instance
().
selectionModel
()
->
clear
();
}
else
if
(
call
->
state
()
==
Call
::
State
::
CURRENT
)
{
ui
->
instantMessagingWidget
->
setMediaText
(
actualCall_
);
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
videoPage
);
...
...
@@ -483,15 +490,17 @@ CallWidget::smartListSelectionChanged(const QItemSelection& newSel, const QItemS
if
(
not
newIdx
.
isValid
())
return
;
auto
nodeIdx
=
RecentModel
::
instance
().
peopleProxy
()
->
mapToSource
(
newIdx
);
auto
newIdxCall
=
RecentModel
::
instance
().
getActiveCall
(
nodeIdx
);
auto
newIdxCall
=
RecentModel
::
instance
().
getActiveCall
(
newIdx
);
if
(
newIdxCall
&&
newIdxCall
!=
actualCall_
)
{
setActualCall
(
newIdxCall
);
if
(
newIdxCall
->
state
()
==
Call
::
State
::
INCOMING
&&
!
newIdxCall
->
account
()
->
isAutoAnswer
())
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
callInvitePage
);
else
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
videoPage
);
}
else
if
(
newIdxCall
==
nullptr
){
setActualCall
(
nullptr
);
showIMOutOfCall
();
showIMOutOfCall
(
newIdx
);
}
else
{
setActualCall
(
nullptr
);
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
welcomePage
);
...
...
@@ -552,16 +561,10 @@ CallWidget::on_btnvideo_clicked()
}
void
CallWidget
::
showIMOutOfCall
()
CallWidget
::
showIMOutOfCall
(
const
QModelIndex
&
nodeIdx
)
{
if
(
not
highLightedIndex_
.
isValid
())
return
;
ui
->
smartList
->
selectionModel
()
->
select
(
highLightedIndex_
,
QItemSelectionModel
::
ClearAndSelect
);
ui
->
contactMethodComboBox
->
clear
();
auto
nodeIdx
=
RecentModel
::
instance
().
peopleProxy
()
->
mapToSource
(
highLightedIndex_
);
ui
->
imNameLabel
->
setText
(
QString
(
tr
(
"Conversation with %1"
,
"%1 is the contact name"
))
.
arg
(
nodeIdx
.
data
(
static_cast
<
int
>
(
Ring
::
Role
::
Name
)).
toString
()));
auto
cmVector
=
RecentModel
::
instance
().
getContactMethods
(
nodeIdx
);
...
...
@@ -647,6 +650,7 @@ CallWidget::on_ringContactLineEdit_textChanged(const QString& text)
void
CallWidget
::
on_imBackButton_clicked
()
{
RecentModel
::
instance
().
selectionModel
()
->
clear
();
slideToLeft
(
welcomePageAnim_
,
ui
->
welcomePage
);
}
...
...
@@ -671,3 +675,11 @@ CallWidget::slideToRight(QPropertyAnimation* anim, QWidget* widget)
anim
->
setEasingCurve
(
QEasingCurve
::
OutQuad
);
anim
->
start
();
}
void
CallWidget
::
on_smartList_clicked
(
const
QModelIndex
&
index
)
{
RecentModel
::
instance
().
selectionModel
()
->
setCurrentIndex
(
RecentModel
::
instance
().
peopleProxy
()
->
mapToSource
(
index
),
QItemSelectionModel
::
ClearAndSelect
);
}
callwidget.h
View file @
7a8517d2
...
...
@@ -63,7 +63,7 @@ public slots:
void
on_ringContactLineEdit_returnPressed
();
void
on_btnCall_clicked
();
void
on_btnvideo_clicked
();
void
showIMOutOfCall
();
void
showIMOutOfCall
(
const
QModelIndex
&
newIdx
);
inline
void
on_entered
(
const
QModelIndex
&
i
){
highLightedIndex_
=
i
;};
//UI SLOTS
...
...
@@ -79,6 +79,7 @@ private slots:
void
on_contactMethodComboBox_currentIndexChanged
(
const
QString
&
number
);
void
on_ringContactLineEdit_textChanged
(
const
QString
&
text
);
void
on_imBackButton_clicked
();
void
on_smartList_clicked
(
const
QModelIndex
&
index
);
private
slots
:
void
callIncoming
(
Call
*
call
);
...
...
Write
Preview
Markdown
is supported
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