"added display of busy server package manager on the PageSetupWizardInstalling"
This commit is contained in:
parent
3964bffce4
commit
a40f365a54
4 changed files with 26 additions and 4 deletions
|
@ -85,6 +85,7 @@ void InstallController::install(DockerContainer container, int port, TransportPr
|
|||
void InstallController::installServer(DockerContainer container, QJsonObject &config)
|
||||
{
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
QMap<DockerContainer, QJsonObject> installedContainers;
|
||||
ErrorCode errorCode =
|
||||
|
@ -138,6 +139,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject
|
|||
qvariant_cast<ServerCredentials>(m_serversModel->data(serverIndex, ServersModel::Roles::CredentialsRole));
|
||||
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
QMap<DockerContainer, QJsonObject> installedContainers;
|
||||
ErrorCode errorCode = serverController.getAlreadyInstalledContainers(serverCredentials, installedContainers);
|
||||
|
@ -239,6 +241,7 @@ void InstallController::updateContainer(QJsonObject config)
|
|||
qvariant_cast<QJsonObject>(m_containersModel->data(modelIndex, ContainersModel::Roles::ConfigRole));
|
||||
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
auto errorCode = serverController.updateContainer(serverCredentials, container, oldContainerConfig, config);
|
||||
if (errorCode == ErrorCode::NoError) {
|
||||
|
|
|
@ -60,6 +60,8 @@ signals:
|
|||
void passphraseRequestStarted();
|
||||
void passphraseRequestFinished();
|
||||
|
||||
void serverIsBusy(const bool isBusy);
|
||||
|
||||
private:
|
||||
void installServer(DockerContainer container, QJsonObject &config);
|
||||
void installContainer(DockerContainer container, QJsonObject &config);
|
||||
|
|
|
@ -75,7 +75,7 @@ PageType {
|
|||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
progressBar.value += 0.001
|
||||
progressBar.value += 0.003
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@ PageType {
|
|||
Component.onCompleted: PageController.enableTabBar(false)
|
||||
Component.onDestruction: PageController.enableTabBar(true)
|
||||
|
||||
property bool isTimerRunning: true
|
||||
property string progressBarText: qsTr("Usually it takes no more than 5 minutes")
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
|
@ -57,6 +60,18 @@ PageType {
|
|||
|
||||
PageController.showErrorMessage(qsTr("The server has already been added to the application"))
|
||||
}
|
||||
|
||||
function onServerIsBusy(isBusy) {
|
||||
if (isBusy) {
|
||||
root.progressBarText = qsTr("Amnesia has detected that your server is currently ") +
|
||||
qsTr("busy installing other software. Amnesia installation ") +
|
||||
qsTr("will pause until the server finishes installing other software")
|
||||
root.isTimerRunning = false
|
||||
} else {
|
||||
root.progressBarText = qsTr("Usually it takes no more than 5 minutes")
|
||||
root.isTimerRunning = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
|
@ -122,18 +137,20 @@ PageType {
|
|||
|
||||
interval: 300
|
||||
repeat: true
|
||||
running: true
|
||||
running: root.isTimerRunning
|
||||
onTriggered: {
|
||||
progressBar.value += 0.001
|
||||
progressBar.value += 0.003
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ParagraphTextType {
|
||||
id: progressText
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
|
||||
text: qsTr("Usually it takes no more than 5 minutes")
|
||||
text: root.progressBarText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue