mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
close #LINQT-1608 busy indicator when components are loading
This commit is contained in:
parent
0926cc12f4
commit
5f804e2e44
5 changed files with 21 additions and 1 deletions
|
|
@ -101,6 +101,7 @@ void AccountDeviceList::setDevices(QList<QSharedPointer<AccountDeviceCore>> devi
|
|||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||
add(devices);
|
||||
lDebug() << log().arg("Add %1 devices").arg(devices.size());
|
||||
emit devicesSet();
|
||||
}
|
||||
|
||||
void AccountDeviceList::deleteDevice(AccountDeviceGui *deviceGui) {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public:
|
|||
|
||||
signals:
|
||||
void componentReady();
|
||||
void devicesSet();
|
||||
|
||||
private:
|
||||
QSharedPointer<AccountCore> mAccountCore;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ DEFINE_GUI_OBJECT(AccountDeviceProxy)
|
|||
|
||||
AccountDeviceProxy::AccountDeviceProxy(QObject *parent) : LimitProxy(parent) {
|
||||
mAccountDeviceList = AccountDeviceList::create();
|
||||
connect(this, &AccountDeviceProxy::sourceModelChanged, this, [this] {
|
||||
auto model = getListModel<AccountDeviceList>();
|
||||
if (model) {
|
||||
connect(model, &AccountDeviceList::devicesSet, this, &AccountDeviceProxy::devicesSet);
|
||||
}
|
||||
});
|
||||
setSourceModels(new SortFilterList(mAccountDeviceList.get(), Qt::DescendingOrder));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ protected:
|
|||
signals:
|
||||
void lUpdate();
|
||||
void accountChanged();
|
||||
void devicesSet();
|
||||
|
||||
private:
|
||||
QString mSearchText;
|
||||
|
|
|
|||
|
|
@ -229,13 +229,24 @@ AbstractSettingsLayout {
|
|||
}
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 15 * DefaultStyle.dp
|
||||
BusyIndicator {
|
||||
Layout.preferredWidth: 60 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 60 * DefaultStyle.dp
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: devices.loading
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: devices
|
||||
visible: !loading
|
||||
property bool loading
|
||||
Component.onCompleted: loading = true
|
||||
model: AccountDeviceProxy {
|
||||
id: accountDeviceProxy
|
||||
account: model
|
||||
onDevicesSet: devices.loading = false;
|
||||
}
|
||||
Control.Control{
|
||||
Control.Control {
|
||||
Layout.fillWidth: true
|
||||
height: 133 * DefaultStyle.dp
|
||||
topPadding: 26 * DefaultStyle.dp
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue