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