mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-13 11:15:39 +02:00
qml: reconnect models on account's change
Change-Id: I7e88828308c8d64ea30e8ad15db950e0605d86dc
This commit is contained in:
parent
929bc9b9ce
commit
5f35e19260
7 changed files with 38 additions and 1 deletions
|
@ -42,12 +42,22 @@ CallAdapter::initQmlObject()
|
||||||
&BehaviorController::showIncomingCallView,
|
&BehaviorController::showIncomingCallView,
|
||||||
this,
|
this,
|
||||||
&CallAdapter::slotShowIncomingCallView);
|
&CallAdapter::slotShowIncomingCallView);
|
||||||
|
connect(&LRCInstance::instance(),
|
||||||
|
&LRCInstance::currentAccountChanged,
|
||||||
|
this,
|
||||||
|
&CallAdapter::slotAccountChanged);
|
||||||
connect(&LRCInstance::behaviorController(),
|
connect(&LRCInstance::behaviorController(),
|
||||||
&BehaviorController::showCallView,
|
&BehaviorController::showCallView,
|
||||||
this,
|
this,
|
||||||
&CallAdapter::slotShowCallView);
|
&CallAdapter::slotShowCallView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CallAdapter::slotAccountChanged()
|
||||||
|
{
|
||||||
|
connectCallModel(LRCInstance::getCurrAccId());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CallAdapter::placeAudioOnlyCall()
|
CallAdapter::placeAudioOnlyCall()
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,6 +86,7 @@ public slots:
|
||||||
void slotShowIncomingCallView(const QString &accountId,
|
void slotShowIncomingCallView(const QString &accountId,
|
||||||
const lrc::api::conversation::Info &convInfo);
|
const lrc::api::conversation::Info &convInfo);
|
||||||
void slotShowCallView(const QString &accountId, const lrc::api::conversation::Info &convInfo);
|
void slotShowCallView(const QString &accountId, const lrc::api::conversation::Info &convInfo);
|
||||||
|
void slotAccountChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateCall(const QString &convUid = {},
|
void updateCall(const QString &convUid = {},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 by Savoir-faire Linux
|
* Copyright (C) 2020 by Savoir-faire Linux
|
||||||
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>
|
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>
|
||||||
* Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
|
* Author: Anthony L�onard <anthony.leonard@savoirfairelinux.com>
|
||||||
* Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
|
* Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
|
||||||
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
|
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
|
||||||
* Author: Isa Nanic <isa.nanic@savoirfairelinux.com>
|
* Author: Isa Nanic <isa.nanic@savoirfairelinux.com>
|
||||||
|
@ -45,10 +45,20 @@ ConversationsAdapter::initQmlObject()
|
||||||
[this](const QString &accountId, lrc::api::conversation::Info convInfo) {
|
[this](const QString &accountId, lrc::api::conversation::Info convInfo) {
|
||||||
emit showChatView(accountId, convInfo.uid);
|
emit showChatView(accountId, convInfo.uid);
|
||||||
});
|
});
|
||||||
|
connect(&LRCInstance::instance(),
|
||||||
|
&LRCInstance::currentAccountChanged,
|
||||||
|
this,
|
||||||
|
&ConversationsAdapter::slotAccountChanged);
|
||||||
|
|
||||||
connectConversationModel();
|
connectConversationModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ConversationsAdapter::slotAccountChanged()
|
||||||
|
{
|
||||||
|
connectConversationModel();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ConversationsAdapter::backToWelcomePage()
|
ConversationsAdapter::backToWelcomePage()
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,9 @@ signals:
|
||||||
void showChatView(const QString &accountId, const QString &convUid);
|
void showChatView(const QString &accountId, const QString &convUid);
|
||||||
void showConversationTabs(bool visible);
|
void showConversationTabs(bool visible);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void slotAccountChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initQmlObject() override;
|
void initQmlObject() override;
|
||||||
void setConversationFilter(lrc::api::profile::Type filter);
|
void setConversationFilter(lrc::api::profile::Type filter);
|
||||||
|
|
|
@ -284,6 +284,7 @@ public:
|
||||||
setSelectedAccountId(const QString &accountId = {})
|
setSelectedAccountId(const QString &accountId = {})
|
||||||
{
|
{
|
||||||
instance().selectedAccountId_ = accountId;
|
instance().selectedAccountId_ = accountId;
|
||||||
|
emit instance().currentAccountChanged();
|
||||||
QSettings settings("jami.net", "Jami");
|
QSettings settings("jami.net", "Jami");
|
||||||
settings.setValue(SettingsKey::selectedAccount, accountId);
|
settings.setValue(SettingsKey::selectedAccount, accountId);
|
||||||
|
|
||||||
|
@ -454,6 +455,7 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void accountListChanged();
|
void accountListChanged();
|
||||||
|
void currentAccountChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LRCInstance(migrateCallback willMigrateCb = {}, migrateCallback didMigrateCb = {})
|
LRCInstance(migrateCallback willMigrateCb = {}, migrateCallback didMigrateCb = {})
|
||||||
|
|
|
@ -40,6 +40,16 @@ MessagesAdapter::~MessagesAdapter() {}
|
||||||
|
|
||||||
void
|
void
|
||||||
MessagesAdapter::initQmlObject()
|
MessagesAdapter::initQmlObject()
|
||||||
|
{
|
||||||
|
connect(&LRCInstance::instance(),
|
||||||
|
&LRCInstance::currentAccountChanged,
|
||||||
|
this,
|
||||||
|
&MessagesAdapter::slotAccountChanged);
|
||||||
|
connectConversationModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MessagesAdapter::slotAccountChanged()
|
||||||
{
|
{
|
||||||
connectConversationModel();
|
connectConversationModel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ public slots:
|
||||||
void slotUpdateDraft(const QString &content);
|
void slotUpdateDraft(const QString &content);
|
||||||
void slotMessagesCleared();
|
void slotMessagesCleared();
|
||||||
void slotMessagesLoaded();
|
void slotMessagesLoaded();
|
||||||
|
void slotAccountChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initQmlObject() override final;
|
void initQmlObject() override final;
|
||||||
|
|
Loading…
Add table
Reference in a new issue