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,
|
&AccountManagerServicesModel::requestError,
|
||||||
[this](const std::shared_ptr<const linphone::AccountManagerServicesRequest> &request, int statusCode,
|
[this](const std::shared_ptr<const linphone::AccountManagerServicesRequest> &request, int statusCode,
|
||||||
const std::string &errorMessage,
|
const std::string &errorMessage,
|
||||||
const std::shared_ptr<const linphone::Dictionary> ¶meterErrors) {
|
const std::shared_ptr<const linphone::Dictionary> ¶meterErrors) {
|
||||||
lDebug() << "REQUEST ERROR" << errorMessage;
|
lDebug() << "REQUEST ERROR" << errorMessage << "/" << int(request->getType());
|
||||||
if (request->getType() == linphone::AccountManagerServicesRequest::Type::GetDevicesList) {
|
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(
|
mAccountManagerServicesModelConnection->makeConnectToModel(
|
||||||
&AccountManagerServicesModel::devicesListFetched,
|
&AccountManagerServicesModel::devicesListFetched,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void componentReady();
|
void componentReady();
|
||||||
void devicesSet();
|
void devicesSet();
|
||||||
|
void requestError(QString errorMessage = QString());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedPointer<AccountCore> mAccountCore;
|
QSharedPointer<AccountCore> mAccountCore;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ AccountDeviceProxy::AccountDeviceProxy(QObject *parent) : LimitProxy(parent) {
|
||||||
auto model = getListModel<AccountDeviceList>();
|
auto model = getListModel<AccountDeviceList>();
|
||||||
if (model) {
|
if (model) {
|
||||||
connect(model, &AccountDeviceList::devicesSet, this, &AccountDeviceProxy::devicesSet);
|
connect(model, &AccountDeviceList::devicesSet, this, &AccountDeviceProxy::devicesSet);
|
||||||
|
connect(model, &AccountDeviceList::requestError, this, &AccountDeviceProxy::requestError);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setSourceModels(new SortFilterList(mAccountDeviceList.get(), Qt::DescendingOrder));
|
setSourceModels(new SortFilterList(mAccountDeviceList.get(), Qt::DescendingOrder));
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ signals:
|
||||||
void lUpdate();
|
void lUpdate();
|
||||||
void accountChanged();
|
void accountChanged();
|
||||||
void devicesSet();
|
void devicesSet();
|
||||||
|
void requestError(QString message = QString());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mSearchText;
|
QString mSearchText;
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,10 @@ AbstractSettingsLayout {
|
||||||
id: accountDeviceProxy
|
id: accountDeviceProxy
|
||||||
account: model
|
account: model
|
||||||
onDevicesSet: devices.loading = false;
|
onDevicesSet: devices.loading = false;
|
||||||
|
onRequestError: (errorMessage) => {
|
||||||
|
devices.loading = false;
|
||||||
|
mainWindow.showInformationPopup(qsTr("Erreur"), errorMessage, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Control.Control {
|
Control.Control {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue