added a button to cancel installation if the package manager on the server is busy

This commit is contained in:
vladimir.kuznetsov 2023-11-30 19:21:57 +07:00
parent dd233f77fc
commit 3defb09da9
7 changed files with 29 additions and 4 deletions

View file

@ -634,9 +634,9 @@ QString ServerController::checkSshConnection(const ServerCredentials &credential
return stdOut;
}
void ServerController::setCancelInstallation(const bool cancel)
void ServerController::cancelInstallation()
{
m_cancelInstallation = cancel;
m_cancelInstallation = true;
}
ErrorCode ServerController::setupServerFirewall(const ServerCredentials &credentials)
@ -737,6 +737,7 @@ ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, D
ErrorCode ServerController::isServerDpkgBusy(const ServerCredentials &credentials, DockerContainer container)
{
m_cancelInstallation = false;
QString stdOut;
auto cbReadStdOut = [&](const QString &data, libssh::Client &) {
stdOut += data + "\n";
@ -784,7 +785,6 @@ ErrorCode ServerController::isServerDpkgBusy(const ServerCredentials &credential
watcher.setFuture(future);
wait.exec();
m_cancelInstallation = false;
emit serverIsBusy(false);
return future.result();

View file

@ -56,7 +56,7 @@ public:
QString checkSshConnection(const ServerCredentials &credentials, ErrorCode *errorCode = nullptr);
void setCancelInstallation(const bool cancel);
void cancelInstallation();
ErrorCode getDecryptedPrivateKey(const ServerCredentials &credentials, QString &decryptedPrivateKey,
const std::function<QString()> &callback);