mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 13:01:42 +00:00
Changed: COperationDialog supports different types of operations
--HG-- branch : develop
This commit is contained in:
parent
304a1eac43
commit
2a4ae9ba6c
2 changed files with 57 additions and 4 deletions
|
@ -84,7 +84,33 @@ COperationDialog::~COperationDialog()
|
|||
{
|
||||
}
|
||||
|
||||
void COperationDialog::setOperation(Operation operation)
|
||||
{
|
||||
m_operation = operation;
|
||||
}
|
||||
|
||||
void COperationDialog::processNextStep()
|
||||
{
|
||||
switch (m_operation)
|
||||
{
|
||||
case OperationMigrate:
|
||||
processMigrateNextStep();
|
||||
break;
|
||||
|
||||
case OperationInstall:
|
||||
processInstallNextStep();
|
||||
break;
|
||||
|
||||
case OperationUninstall:
|
||||
processUninstallNextStep();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void COperationDialog::processMigrateNextStep()
|
||||
{
|
||||
CConfigFile *config = CConfigFile::getInstance();
|
||||
|
||||
|
@ -132,16 +158,20 @@ void COperationDialog::processNextStep()
|
|||
QtConcurrent::run(this, &COperationDialog::copyProfileFiles);
|
||||
break;
|
||||
|
||||
case CConfigFile::CleanFiles:
|
||||
QtConcurrent::run(this, &COperationDialog::cleanFiles);
|
||||
break;
|
||||
|
||||
case CConfigFile::ExtractBnpClient:
|
||||
QtConcurrent::run(this, &COperationDialog::extractBnpClient);
|
||||
break;
|
||||
|
||||
case CConfigFile::CopyInstaller:
|
||||
QtConcurrent::run(this, &COperationDialog::copyIntaller);
|
||||
QtConcurrent::run(this, &COperationDialog::copyInstaller);
|
||||
break;
|
||||
|
||||
case CConfigFile::CleanFiles:
|
||||
QtConcurrent::run(this, &COperationDialog::cleanFiles);
|
||||
case CConfigFile::UninstallOldClient:
|
||||
uninstallOldClient();
|
||||
break;
|
||||
|
||||
case CConfigFile::CreateProfile:
|
||||
|
@ -166,6 +196,14 @@ void COperationDialog::processNextStep()
|
|||
}
|
||||
}
|
||||
|
||||
void COperationDialog::processInstallNextStep()
|
||||
{
|
||||
}
|
||||
|
||||
void COperationDialog::processUninstallNextStep()
|
||||
{
|
||||
}
|
||||
|
||||
void COperationDialog::showEvent(QShowEvent *e)
|
||||
{
|
||||
#if defined(Q_OS_WIN32) && defined(QT_WINEXTRAS_LIB)
|
||||
|
@ -415,7 +453,7 @@ void COperationDialog::extractBnpClient()
|
|||
emit done();
|
||||
}
|
||||
|
||||
void COperationDialog::copyIntaller()
|
||||
void COperationDialog::copyInstaller()
|
||||
{
|
||||
CConfigFile *config = CConfigFile::getInstance();
|
||||
|
||||
|
|
|
@ -38,6 +38,16 @@ public:
|
|||
COperationDialog(QWidget *parent = NULL);
|
||||
virtual ~COperationDialog();
|
||||
|
||||
enum Operation
|
||||
{
|
||||
OperationNone,
|
||||
OperationMigrate,
|
||||
OperationInstall,
|
||||
OperationUninstall
|
||||
};
|
||||
|
||||
void setOperation(Operation operation);
|
||||
|
||||
public slots:
|
||||
void onAbortClicked();
|
||||
|
||||
|
@ -80,6 +90,9 @@ protected:
|
|||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
void processNextStep();
|
||||
void processMigrateNextStep();
|
||||
void processInstallNextStep();
|
||||
void processUninstallNextStep();
|
||||
|
||||
// operations
|
||||
void downloadData();
|
||||
|
@ -113,6 +126,8 @@ protected:
|
|||
|
||||
QMutex m_abortingMutex;
|
||||
bool m_aborting;
|
||||
|
||||
Operation m_operation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue