Commit 05ca83cd authored by Alexandre Lision's avatar Alexandre Lision

conversation: display blockchain name

Instead of displaying the ringID we display the registered name if
available

Change-Id: Ice93dbe9980e88b661c84b84b6d1c4226658a55d
Tuleap: #1342
parent e77f6f98
......@@ -49,6 +49,8 @@
NSMutableString* textSelection;
QNSTreeController* treeController;
QMetaObject::Connection contactMethodChanged;
ContactMethod* selectedContactMethod;
__unsafe_unretained IBOutlet NSView* sendPanel;
__unsafe_unretained IBOutlet NSTextField* conversationTitle;
......@@ -111,10 +113,6 @@
// Select first cm
[contactMethodsPopupButton selectItemAtIndex:0];
[self itemChanged:contactMethodsPopupButton];
NSString* localizedTitle = current.data((int)Ring::Role::Name).toString().toNSString();
[conversationTitle setStringValue:localizedTitle];
});
}
......@@ -355,7 +353,16 @@
- (IBAction)itemChanged:(id)sender {
NSInteger index = [(NSPopUpButton *)sender indexOfSelectedItem];
if (auto txtRecording = contactMethods.at(index)->textRecording()) {
selectedContactMethod = contactMethods.at(index);
[conversationTitle setStringValue:selectedContactMethod->primaryName().toNSString()];
QObject::disconnect(contactMethodChanged);
contactMethodChanged = QObject::connect(selectedContactMethod,
&ContactMethod::changed,
[self] {
[conversationTitle setStringValue:selectedContactMethod->primaryName().toNSString()];
});
if (auto txtRecording = selectedContactMethod->textRecording()) {
treeController = [[QNSTreeController alloc] initWithQModel:txtRecording->instantMessagingModel()];
[treeController setAvoidsEmptySelection:NO];
[treeController setChildrenKeyPath:@"children"];
......
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