selected account: change UI when select SIP
Hide controls on MainWindow related to RING ID when user select
SIP account
Tuleap: #1532
Change-Id: I472c647545dfc7ba4a68461f2357b91cce1cadda
Reviewed-by: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm
index d2e0ec9..8ef5f40 100644
--- a/src/RingWindowController.mm
+++ b/src/RingWindowController.mm
@@ -166,8 +166,10 @@
QModelIndex index = AvailableAccountModel::instance().selectionModel()->currentIndex();
finalChoice = index.data(static_cast<int>(Account::Role::Object)).value<Account*>();
if(finalChoice == nil || (finalChoice->protocol() != Account::Protocol::RING)) {
+ self.hideRingID = YES;
return;
}
+ self.hideRingID = NO;
auto name = finalChoice->registeredName();
NSString* uriToDisplay = nullptr;
if (!name.isNull() && !name.isEmpty()) {
@@ -175,7 +177,6 @@
} else {
uriToDisplay = finalChoice->username().toNSString();
}
-
[ringIDLabel setStringValue:uriToDisplay];
[self drawQRCode:finalChoice->username().toNSString()];
}
@@ -323,6 +324,7 @@
[shareButton sendActionOn:NSLeftMouseDownMask];
[self connect];
+ [self updateRingID];
// display accounts to select
NSToolbar *toolbar = self.window.toolbar;
toolbar.delegate = self;