selected account: behaviour on conversation
This commit add a few changes to prevent bugs when account is changed
during call or conversation or when:
- Receiving an incoming call change selected account to be the same
as call destination account
- Making a call disable account selection
- Changing the selected account close current conversation
Tuleap: #1532
Change-Id: Ia37fabce0285a02233b35e69e73244e14d0a334a
Reviewed-by: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm
index 9f7e9ae..dec5330 100644
--- a/src/RingWindowController.mm
+++ b/src/RingWindowController.mm
@@ -108,15 +108,18 @@
if(!current.isValid()) {
[offlineVC animateOut];
[currentCallVC animateOut];
+ [chooseAccountVC enable];
return;
}
if (!call) {
[currentCallVC animateOut];
[offlineVC animateIn];
+ [chooseAccountVC enable];
} else {
[currentCallVC animateIn];
[offlineVC animateOut];
+ [chooseAccountVC disable];
}
});
@@ -130,16 +133,19 @@
if (previous.isValid()) {
// We were already on a call
[currentCallVC animateOut];
+ [chooseAccountVC enable];
} else {
// Make sure Conversation view hides when selecting a valid call
[currentCallVC animateIn];
[offlineVC animateOut];
+ [chooseAccountVC disable];
}
});
QObject::connect(AvailableAccountModel::instance().selectionModel(),
&QItemSelectionModel::currentChanged,
[self](const QModelIndex& idx){
[self updateRingID];
+ [offlineVC animateOut];
});
}