Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-client-macos
Commits
d14bda3b
Commit
d14bda3b
authored
Oct 13, 2015
by
Alexandre Lision
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smartlist: use new PeopleProxy model
Issue: #81198 Change-Id: I5618a510d2ed781af022f701bcf19afbf53514fb
parent
7f3c37de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/SmartViewVC.mm
src/SmartViewVC.mm
+8
-7
No files found.
src/SmartViewVC.mm
View file @
d14bda3b
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#import <recentmodel.h>
#import <recentmodel.h>
#import <callmodel.h>
#import <callmodel.h>
#import <call.h>
#import <call.h>
#import <itemdataroles.h>
#import <person.h>
#import <person.h>
#import <contactmethod.h>
#import <contactmethod.h>
#import <globalinstances.h>
#import <globalinstances.h>
...
@@ -66,7 +67,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
...
@@ -66,7 +67,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
NSLog
(
@"INIT SmartView VC"
);
NSLog
(
@"INIT SmartView VC"
);
isShowingContacts
=
false
;
isShowingContacts
=
false
;
treeController
=
[[
QNSTreeController
alloc
]
initWithQModel
:
RecentModel
:
:
instance
()];
treeController
=
[[
QNSTreeController
alloc
]
initWithQModel
:
RecentModel
:
:
instance
()
->
peopleProxy
()
];
[
treeController
setAvoidsEmptySelection
:
NO
];
[
treeController
setAvoidsEmptySelection
:
NO
];
[
treeController
setChildrenKeyPath
:
@"children"
];
[
treeController
setChildrenKeyPath
:
@"children"
];
...
@@ -113,7 +114,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
...
@@ -113,7 +114,7 @@ NSInteger const TXT_BUTTON_TAG = 500;
// Before calling check if we properly extracted a contact method and that
// Before calling check if we properly extracted a contact method and that
// there is NOT already an ongoing call for this index (e.g: no children for this node)
// there is NOT already an ongoing call for this index (e.g: no children for this node)
if
(
m
&&
!
RecentModel
::
instance
()
->
index
(
0
,
0
,
qIdx
).
isValid
()){
if
(
m
&&
!
RecentModel
::
instance
()
->
peopleProxy
()
->
index
(
0
,
0
,
qIdx
).
isValid
()){
Call
*
c
=
CallModel
::
instance
()
->
dialingCall
();
Call
*
c
=
CallModel
::
instance
()
->
dialingCall
();
c
->
setPeerContactMethod
(
m
);
c
->
setPeerContactMethod
(
m
);
c
<<
Call
::
Action
::
ACCEPT
;
c
<<
Call
::
Action
::
ACCEPT
;
...
@@ -181,9 +182,9 @@ NSInteger const TXT_BUTTON_TAG = 500;
...
@@ -181,9 +182,9 @@ NSInteger const TXT_BUTTON_TAG = 500;
QModelIndex
qIdx
=
[
treeController
toQIdx
:[
treeController
selectedNodes
][
0
]];
QModelIndex
qIdx
=
[
treeController
toQIdx
:[
treeController
selectedNodes
][
0
]];
// ask the tree controller for the current selection
// ask the tree controller for the current selection
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
))
{
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
))
)
{
CallModel
::
instance
()
->
selectCall
(
selected
);
CallModel
::
instance
()
->
selectCall
(
selected
);
}
else
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
.
parent
())){
}
else
if
(
auto
selected
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
.
parent
()))
)
{
CallModel
::
instance
()
->
selectCall
(
selected
);
CallModel
::
instance
()
->
selectCall
(
selected
);
}
else
{
}
else
{
CallModel
::
instance
()
->
selectionModel
()
->
clearCurrentIndex
();
CallModel
::
instance
()
->
selectionModel
()
->
clearCurrentIndex
();
...
@@ -202,11 +203,11 @@ NSInteger const TXT_BUTTON_TAG = 500;
...
@@ -202,11 +203,11 @@ NSInteger const TXT_BUTTON_TAG = 500;
[((
ContextualTableCellView
*
)
result
)
setContextualsControls
:[
NSMutableArray
arrayWithObject
:[
result
viewWithTag
:
CALL_BUTTON_TAG
]]];
[((
ContextualTableCellView
*
)
result
)
setContextualsControls
:[
NSMutableArray
arrayWithObject
:[
result
viewWithTag
:
CALL_BUTTON_TAG
]]];
if
(
auto
call
=
RecentModel
::
instance
()
->
getActiveCall
(
qIdx
))
{
if
(
auto
call
=
RecentModel
::
instance
()
->
getActiveCall
(
RecentModel
::
instance
()
->
peopleProxy
()
->
mapToSource
(
qIdx
))
)
{
[
details
setStringValue
:
call
->
roleData
((
int
)
Call
:
:
Role
::
HumanStateNam
e
).
toString
().
toNSString
()];
[
details
setStringValue
:
call
->
roleData
((
int
)
Ring
:
:
Role
::
FormattedStat
e
).
toString
().
toNSString
()];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
YES
];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
YES
];
}
else
{
}
else
{
[
details
setStringValue
:
qIdx
.
data
((
int
)
Person
:
:
Role
::
FormattedLastUsed
).
toString
().
toNSString
()];
[
details
setStringValue
:
qIdx
.
data
((
int
)
Ring
:
:
Role
::
FormattedLastUsed
).
toString
().
toNSString
()];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
NO
];
[((
ContextualTableCellView
*
)
result
)
setActiveState
:
NO
];
}
}
...
...
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