Commit d51a3252 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

smart list: add contextual menu

Add next options for contacts in smart list:
- video call
- audio call
- clear conversation
- block contact
- add contact

Change-Id: I9e668f0cc0848d35e0aad31d0efd16d94a78d916
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 1004caa8
......@@ -48,6 +48,7 @@
QMetaObject::Connection modelSortedSignal_;
QMetaObject::Connection filterChangedSignal_;
QMetaObject::Connection interactionStatusUpdatedSignal_;
QMetaObject::Connection conversationClearedSignal;
}
@property (nonatomic, strong, readonly) INDSequentialTextSelectionManager* selectionManager;
......@@ -89,6 +90,7 @@ NSInteger const GENERIC_INT_TEXT_TAG = 100;
// Signal triggered when messages are received or their status updated
QObject::disconnect(newInteractionSignal_);
QObject::disconnect(interactionStatusUpdatedSignal_);
QObject::disconnect(conversationClearedSignal);
newInteractionSignal_ = QObject::connect(convModel_, &lrc::api::ConversationModel::newInteraction,
[self](const std::string& uid, uint64_t interactionId, const lrc::api::interaction::Info& interaction){
if (uid != convUid_)
......@@ -105,6 +107,12 @@ NSInteger const GENERIC_INT_TEXT_TAG = 100;
[conversationView reloadData];
[conversationView scrollToEndOfDocument:nil];
});
conversationClearedSignal = QObject::connect(convModel_, &lrc::api::ConversationModel::conversationCleared,
[self](){
cachedConv_ = nil;
[conversationView reloadData];
[conversationView scrollToEndOfDocument:nil];
});
// Signals tracking changes in conversation list, we need them as cached conversation can be invalid
// after a reordering.
......
This diff is collapsed.
......@@ -24,7 +24,7 @@
@required
- (NSMenu*) contextualMenuForIndex:(NSTreeNode*) path;
- (NSMenu*) contextualMenuForRow:(int) index;
@end
......
......@@ -26,11 +26,11 @@
- (NSMenu*)menuForEvent:(NSEvent*)evt
{
// TODO : Reimplement without outlineView itemAtRow: method
// NSPoint pt = [self convertPoint:[evt locationInWindow] fromView:nil];
// int rowIdx = [self rowAtPoint:pt];
// if (self.contextMenuDelegate && rowIdx >= 0) {
// return [self.contextMenuDelegate contextualMenuForIndex:[self itemAtRow:rowIdx]];
// }
NSPoint pt = [self convertPoint:[evt locationInWindow] fromView:nil];
int rowIdx = [self rowAtPoint:pt];
if (self.contextMenuDelegate && rowIdx >= 0) {
return [self.contextMenuDelegate contextualMenuForRow:rowIdx];
}
return nil;
}
......
......@@ -7,6 +7,18 @@
/* Contextual menu action */
"Add to contacts" = "Add to contacts";
/* Contextual menu action */
"Place video call" = "Place video call";
/* Contextual menu action */
"Place audio call" = "Place audio call";
/* Contextual menu action */
"Clear conversation" = "Clear conversation";
/* Contextual menu action */
"Block contact" = "Block contact";
/* Text shown to the user */
"Alias : " = "Alias : ";
......
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