added busy indicator when loading a list of clients, on the client management panel
This commit is contained in:
parent
a7030cdcb9
commit
24ea686e4d
4 changed files with 14 additions and 3 deletions
|
@ -60,8 +60,7 @@ void ClientInfoLogic::onLineEditNameAliasEditingFinished()
|
||||||
clientsTable);
|
clientsTable);
|
||||||
if (error != ErrorCode::NoError) {
|
if (error != ErrorCode::NoError) {
|
||||||
QMessageBox::warning(nullptr, APPLICATION_NAME,
|
QMessageBox::warning(nullptr, APPLICATION_NAME,
|
||||||
tr("An error occurred while getting the list of clients.") + "\n" + errorString(error));
|
tr("An error occurred while saving the list of clients.") + "\n" + errorString(error));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ ClientManagementLogic::ClientManagementLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void ClientManagementLogic::onUpdatePage()
|
void ClientManagementLogic::onUpdatePage()
|
||||||
{
|
{
|
||||||
|
set_busyIndicatorIsRunning(true);
|
||||||
|
|
||||||
qobject_cast<ClientManagementModel*>(uiLogic()->clientManagementModel())->clearData();
|
qobject_cast<ClientManagementModel*>(uiLogic()->clientManagementModel())->clearData();
|
||||||
DockerContainer selectedContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex);
|
DockerContainer selectedContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex);
|
||||||
QString selectedContainerName = ContainerProps::containerHumanNames().value(selectedContainer);
|
QString selectedContainerName = ContainerProps::containerHumanNames().value(selectedContainer);
|
||||||
|
@ -41,6 +43,8 @@ void ClientManagementLogic::onUpdatePage()
|
||||||
clientsArray.push_back(clients[clientId].toObject());
|
clientsArray.push_back(clients[clientId].toObject());
|
||||||
}
|
}
|
||||||
qobject_cast<ClientManagementModel*>(uiLogic()->clientManagementModel())->setContent(clientsArray);
|
qobject_cast<ClientManagementModel*>(uiLogic()->clientManagementModel())->setContent(clientsArray);
|
||||||
|
|
||||||
|
set_busyIndicatorIsRunning(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientManagementLogic::onClientItemClicked(int index)
|
void ClientManagementLogic::onClientItemClicked(int index)
|
||||||
|
|
|
@ -12,6 +12,7 @@ class ClientManagementLogic : public PageLogicBase
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(QString, labelCurrentVpnProtocolText)
|
AUTO_PROPERTY(QString, labelCurrentVpnProtocolText)
|
||||||
|
AUTO_PROPERTY(bool, busyIndicatorIsRunning);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ClientManagementLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
ClientManagementLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
@ -12,6 +12,7 @@ PageBase {
|
||||||
id: root
|
id: root
|
||||||
page: PageEnum.ClientManagement
|
page: PageEnum.ClientManagement
|
||||||
logic: ClientManagementLogic
|
logic: ClientManagementLogic
|
||||||
|
enabled: !ClientManagementLogic.busyIndicatorIsRunning
|
||||||
|
|
||||||
BackButton {
|
BackButton {
|
||||||
id: back
|
id: back
|
||||||
|
@ -43,7 +44,13 @@ PageBase {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ServerSettingsLogic.labelCurrentVpnProtocolText
|
text: ClientManagementLogic.labelCurrentVpnProtocolText
|
||||||
|
}
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
visible: ClientManagementLogic.busyIndicatorIsRunning
|
||||||
|
running: ClientManagementLogic.busyIndicatorIsRunning
|
||||||
}
|
}
|
||||||
|
|
||||||
SortFilterProxyModel {
|
SortFilterProxyModel {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue