mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:36:09 +00:00
UI: --boot unregisters booted provider only.
This commit is contained in:
parent
94b1ded272
commit
9fbe90e1f9
@ -165,11 +165,6 @@ bool FortCommon::confAppBlocked(const void *drvConf, int appIndex)
|
||||
return fort_conf_app_blocked(conf, appIndex);
|
||||
}
|
||||
|
||||
uint FortCommon::provRegister(bool isBoot)
|
||||
{
|
||||
return fort_prov_register(isBoot);
|
||||
}
|
||||
|
||||
void FortCommon::provUnregister()
|
||||
{
|
||||
fort_prov_unregister();
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
static quint8 confAppGroupIndex(const void *drvConf, int appIndex);
|
||||
static bool confAppBlocked(const void *drvConf, int appIndex);
|
||||
|
||||
static uint provRegister(bool isBoot);
|
||||
static void provUnregister();
|
||||
};
|
||||
|
||||
|
@ -12,8 +12,7 @@
|
||||
FortSettings::FortSettings(const QStringList &args,
|
||||
QObject *parent) :
|
||||
QObject(parent),
|
||||
m_hasProvBoot(false),
|
||||
m_provBoot(false)
|
||||
m_hasProvBoot(false)
|
||||
{
|
||||
processArguments(args);
|
||||
setupIni();
|
||||
@ -44,7 +43,7 @@ void FortSettings::processArguments(const QStringList &args)
|
||||
|
||||
const QCommandLineOption provBootOption(
|
||||
QStringList() << "b" << "boot",
|
||||
"Block access to network when Fort Firewall is not running.", "boot");
|
||||
"Unblock access to network when Fort Firewall is not running.", "boot");
|
||||
parser.addOption(provBootOption);
|
||||
|
||||
const QCommandLineOption profileOption(
|
||||
@ -58,9 +57,6 @@ void FortSettings::processArguments(const QStringList &args)
|
||||
parser.process(args);
|
||||
|
||||
m_hasProvBoot = parser.isSet(provBootOption);
|
||||
if (m_hasProvBoot) {
|
||||
m_provBoot = QVariant(parser.value(provBootOption)).toBool();
|
||||
}
|
||||
|
||||
m_profilePath = parser.value(profileOption);
|
||||
if (m_profilePath.isEmpty()) {
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
QObject *parent = nullptr);
|
||||
|
||||
bool hasProvBoot() const { return m_hasProvBoot; }
|
||||
bool provBoot() const { return m_provBoot; }
|
||||
|
||||
bool debug() const { return iniBool("base/debug"); }
|
||||
void setDebug(bool on) { setIniValue("base/debug", on); }
|
||||
@ -104,7 +103,6 @@ private:
|
||||
|
||||
private:
|
||||
uint m_hasProvBoot : 1;
|
||||
uint m_provBoot : 1;
|
||||
|
||||
QString m_profilePath;
|
||||
|
||||
|
@ -19,11 +19,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
FortSettings fortSettings(qApp->arguments());
|
||||
|
||||
// Register booted provider and exit
|
||||
// Unregister booted provider and exit
|
||||
if (fortSettings.hasProvBoot()) {
|
||||
FortCommon::provUnregister();
|
||||
return fortSettings.provBoot()
|
||||
? FortCommon::provRegister(true) : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// To check running instance
|
||||
|
Loading…
Reference in New Issue
Block a user