mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-09 20:05:53 +00:00
moved helper daemonization
add abillity to own users org.netctlgui.helper service
This commit is contained in:
@ -41,20 +41,6 @@
|
||||
#include "wirelesswidget.h"
|
||||
|
||||
|
||||
void MainWindow::checkHelperStatus()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[checkHelperStatus]";
|
||||
|
||||
if (useHelper) useHelper = isHelperActive();
|
||||
if (useHelper)
|
||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||
DBUS_HELPER_INTERFACE, QString("Update"),
|
||||
QList<QVariant>(), true, debug);
|
||||
if (isHelperServiceActive())
|
||||
configuration[QString("CLOSE_HELPER")] = QString("false");
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::reportABug()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[reportABug]";
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QTimer>
|
||||
#include <QTranslator>
|
||||
#include <QUrl>
|
||||
|
||||
@ -306,6 +305,7 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
if (args[QString("default")].toBool())
|
||||
settingsWin->setDefault();
|
||||
configuration = settingsWin->getSettings();
|
||||
delete settingsWin;
|
||||
QMap<QString, QString> optionsDict = parseOptions(args[QString("options")].toString());
|
||||
for (int i=0; i<optionsDict.keys().count(); i++)
|
||||
configuration[optionsDict.keys()[i]] = optionsDict[optionsDict.keys()[i]];
|
||||
@ -316,9 +316,6 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
useHelper = false;
|
||||
configuration[QString("USE_HELPER")] = QString("false");
|
||||
}
|
||||
// some helper fixs
|
||||
// because interface will be created with a delay
|
||||
QTimer::singleShot(1000, this, SLOT(checkHelperStatus()));
|
||||
|
||||
// update translation
|
||||
qApp->removeTranslator(translator);
|
||||
@ -326,10 +323,9 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
args[QString("options")].toString());
|
||||
translator->load(QString(":/translations/") + language);
|
||||
qApp->installTranslator(translator);
|
||||
// update settingsWin
|
||||
delete settingsWin;
|
||||
|
||||
createObjects();
|
||||
checkHelperStatus();
|
||||
createActions();
|
||||
|
||||
// tray
|
||||
|
@ -283,6 +283,20 @@ bool MainWindow::checkExternalApps(const QString apps = QString("all"))
|
||||
}
|
||||
|
||||
|
||||
bool MainWindow::checkHelperStatus()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[checkHelperStatus]";
|
||||
|
||||
if (useHelper) useHelper = isHelperActive();
|
||||
if (useHelper)
|
||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||
DBUS_HELPER_INTERFACE, QString("Update"),
|
||||
QList<QVariant>(), true, debug);
|
||||
if (isHelperServiceActive())
|
||||
configuration[QString("CLOSE_HELPER")] = QString("false");
|
||||
}
|
||||
|
||||
|
||||
QString MainWindow::checkStatus(const bool statusBool, const bool nullFalse)
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[checkStatus]";
|
||||
|
@ -95,7 +95,6 @@ public slots:
|
||||
void setHiddenName(const QString name);
|
||||
|
||||
private slots:
|
||||
void checkHelperStatus();
|
||||
void reportABug();
|
||||
// menu update slots
|
||||
void setMenuActionsShown(const bool state = true);
|
||||
@ -151,6 +150,7 @@ private:
|
||||
NetctlProfile *netctlProfile = nullptr;
|
||||
WpaSup *wpaCommand = nullptr;
|
||||
bool checkExternalApps(const QString apps);
|
||||
bool checkHelperStatus();
|
||||
QString checkStatus(const bool statusBool, const bool nullFalse = false);
|
||||
void createActions();
|
||||
void createDBusSession();
|
||||
|
Reference in New Issue
Block a user