mirror of
https://github.com/tnodir/fort
synced 2024-11-15 10:15:07 +00:00
UI: RPC: Setup DriverManager install/uninstall.
This commit is contained in:
parent
6e6849e397
commit
b17f908c4f
@ -47,7 +47,7 @@ sc start %BASENAME%
|
||||
|
||||
:EXIT
|
||||
@echo End execution... Error Code = %RCODE%
|
||||
@if %RCODE% neq 0 (
|
||||
@pause
|
||||
@if "%FORT_SILENT%" equ "" (
|
||||
@if %RCODE% neq 0 @pause
|
||||
)
|
||||
@exit /b %RCODE%
|
||||
|
@ -748,10 +748,6 @@ bool ConfManager::validateDriver()
|
||||
QByteArray buf;
|
||||
|
||||
const int verSize = confUtil.writeVersion(buf);
|
||||
if (!verSize) {
|
||||
showErrorMessage(confUtil.errorMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
return driverManager()->validate(buf, verSize);
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ enum Command : qint8 {
|
||||
Rpc_AppInfoManager_checkLookupFinished,
|
||||
Rpc_ConfManager_,
|
||||
Rpc_DriverManager_updateState,
|
||||
Rpc_DriverManager_reinstallDriver,
|
||||
Rpc_DriverManager_uninstallDriver,
|
||||
Rpc_QuotaManager_alert,
|
||||
Rpc_StatManager_,
|
||||
Rpc_TaskManager_,
|
||||
|
@ -192,15 +192,14 @@ void FortManager::removeDriver()
|
||||
|
||||
bool FortManager::setupDriver()
|
||||
{
|
||||
bool opened = driverManager()->openDevice();
|
||||
bool ok = driverManager()->openDevice();
|
||||
|
||||
if (!confManager()->validateDriver()) {
|
||||
if (ok && !confManager()->validateDriver()) {
|
||||
driverManager()->closeDevice();
|
||||
|
||||
opened = false;
|
||||
ok = false;
|
||||
}
|
||||
|
||||
return opened;
|
||||
return ok;
|
||||
}
|
||||
|
||||
void FortManager::closeDriver()
|
||||
|
@ -76,6 +76,10 @@ void FortSettings::initialize(const QStringList &args, EnvManager *envManager)
|
||||
processArguments(args);
|
||||
setupPaths(envManager);
|
||||
setupIni();
|
||||
|
||||
if (isService()) {
|
||||
qputenv("FORT_SILENT", "1"); // For batch scripts
|
||||
}
|
||||
}
|
||||
|
||||
void FortSettings::processArguments(const QStringList &args)
|
||||
|
@ -21,9 +21,15 @@ RpcManager *DriverManagerRpc::rpcManager() const
|
||||
return fortManager()->rpcManager();
|
||||
}
|
||||
|
||||
void DriverManagerRpc::reinstallDriver() { }
|
||||
void DriverManagerRpc::reinstallDriver()
|
||||
{
|
||||
rpcManager()->invokeOnServer(Control::Rpc_DriverManager_reinstallDriver);
|
||||
}
|
||||
|
||||
void DriverManagerRpc::uninstallDriver() { }
|
||||
void DriverManagerRpc::uninstallDriver()
|
||||
{
|
||||
rpcManager()->invokeOnServer(Control::Rpc_DriverManager_uninstallDriver);
|
||||
}
|
||||
|
||||
void DriverManagerRpc::updateState(quint32 errorCode, bool isDeviceOpened)
|
||||
{
|
||||
|
@ -142,6 +142,12 @@ bool RpcManager::processCommandRpc(
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Control::Rpc_DriverManager_reinstallDriver:
|
||||
driverManager()->reinstallDriver();
|
||||
return true;
|
||||
case Control::Rpc_DriverManager_uninstallDriver:
|
||||
driverManager()->uninstallDriver();
|
||||
return true;
|
||||
case Control::Rpc_QuotaManager_alert:
|
||||
emit quotaManager()->alert(args.value(0).toInt());
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user