added a "Cancel" button to interrupt the server configuration process when it is found that it is busy installing other software
This commit is contained in:
parent
08a8eadb49
commit
6ec090ea0d
17 changed files with 193 additions and 48 deletions
|
@ -97,6 +97,11 @@ void ShadowSocksLogic::onPushButtonSaveClicked()
|
|||
set_labelServerBusyVisible(visible);
|
||||
};
|
||||
|
||||
ServerConfiguringProgressLogic::ButtonFunc cancelButtonFunc;
|
||||
cancelButtonFunc.setVisibleFunc = [this] (bool visible) -> void {
|
||||
set_pushButtonCancelVisible(visible);
|
||||
};
|
||||
|
||||
progressBarFunc.setTextVisibleFunc(true);
|
||||
progressBarFunc.setTextFunc(QString("Configuring..."));
|
||||
ErrorCode e = uiLogic()->pageLogic<ServerConfiguringProgressLogic>()->doInstallAction([this, containerConfig, &newContainerConfig](){
|
||||
|
@ -106,7 +111,8 @@ void ShadowSocksLogic::onPushButtonSaveClicked()
|
|||
newContainerConfig);
|
||||
},
|
||||
pageFunc, progressBarFunc,
|
||||
saveButtonFunc, waitInfoFunc, busyInfoFuncy);
|
||||
saveButtonFunc, waitInfoFunc,
|
||||
busyInfoFuncy, cancelButtonFunc);
|
||||
|
||||
if (!e) {
|
||||
m_settings->setContainerConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, newContainerConfig);
|
||||
|
@ -114,3 +120,8 @@ void ShadowSocksLogic::onPushButtonSaveClicked()
|
|||
}
|
||||
qDebug() << "Protocol saved with code:" << e << "for" << uiLogic()->selectedServerIndex << uiLogic()->selectedDockerContainer;
|
||||
}
|
||||
|
||||
void ShadowSocksLogic::onPushButtonCancelClicked()
|
||||
{
|
||||
emit uiLogic()->pageLogic<ServerConfiguringProgressLogic>()->cancelDoInstallAction(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue