mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
fix request error ui get account devices
This commit is contained in:
parent
37daee36f7
commit
c20a54df48
5 changed files with 14 additions and 4 deletions
|
|
@ -150,10 +150,13 @@ void AccountDeviceList::setSelf(QSharedPointer<AccountDeviceList> me) {
|
|||
&AccountManagerServicesModel::requestError,
|
||||
[this](const std::shared_ptr<const linphone::AccountManagerServicesRequest> &request, int statusCode,
|
||||
const std::string &errorMessage,
|
||||
const std::shared_ptr<const linphone::Dictionary> ¶meterErrors) {
|
||||
lDebug() << "REQUEST ERROR" << errorMessage;
|
||||
if (request->getType() == linphone::AccountManagerServicesRequest::Type::GetDevicesList) {
|
||||
}
|
||||
const std::shared_ptr<const linphone::Dictionary> ¶meterErrors) {
|
||||
lDebug() << "REQUEST ERROR" << errorMessage << "/" << int(request->getType());
|
||||
QString message = QString::fromStdString(errorMessage);
|
||||
if (request->getType() == linphone::AccountManagerServicesRequest::Type::GetDevicesList) {
|
||||
message = tr("Erreur lors de la récupération des appareils");
|
||||
}
|
||||
emit requestError(message);
|
||||
});
|
||||
mAccountManagerServicesModelConnection->makeConnectToModel(
|
||||
&AccountManagerServicesModel::devicesListFetched,
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public:
|
|||
signals:
|
||||
void componentReady();
|
||||
void devicesSet();
|
||||
void requestError(QString errorMessage = QString());
|
||||
|
||||
private:
|
||||
QSharedPointer<AccountCore> mAccountCore;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ AccountDeviceProxy::AccountDeviceProxy(QObject *parent) : LimitProxy(parent) {
|
|||
auto model = getListModel<AccountDeviceList>();
|
||||
if (model) {
|
||||
connect(model, &AccountDeviceList::devicesSet, this, &AccountDeviceProxy::devicesSet);
|
||||
connect(model, &AccountDeviceList::requestError, this, &AccountDeviceProxy::requestError);
|
||||
}
|
||||
});
|
||||
setSourceModels(new SortFilterList(mAccountDeviceList.get(), Qt::DescendingOrder));
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ signals:
|
|||
void lUpdate();
|
||||
void accountChanged();
|
||||
void devicesSet();
|
||||
void requestError(QString message = QString());
|
||||
|
||||
private:
|
||||
QString mSearchText;
|
||||
|
|
|
|||
|
|
@ -245,6 +245,10 @@ AbstractSettingsLayout {
|
|||
id: accountDeviceProxy
|
||||
account: model
|
||||
onDevicesSet: devices.loading = false;
|
||||
onRequestError: (errorMessage) => {
|
||||
devices.loading = false;
|
||||
mainWindow.showInformationPopup(qsTr("Erreur"), errorMessage, false)
|
||||
}
|
||||
}
|
||||
Control.Control {
|
||||
Layout.fillWidth: true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue