diff --git a/sources/gui/bash-completions b/sources/gui/bash-completions index 9213366..ee9efc2 100644 --- a/sources/gui/bash-completions +++ b/sources/gui/bash-completions @@ -47,14 +47,18 @@ _netctl_gui_arglist=( ) _netctl_gui_settings=( + 'CLOSE_HELPER' 'CLOSETOTRAY' 'CTRL_DIR' 'CTRL_GROUP' + 'FORCE_SUDO' + 'HELPER_PATH' + 'HELPER_SERVICE' 'IFACE_DIR' 'LANGUAGE' + 'NETCTL_PATH' 'NETCTLAUTO_PATH' 'NETCTLAUTO_SERVICE' - 'NETCTL_PATH' 'PID_FILE' 'PREFERED_IFACE' 'PROFILE_DIR' @@ -63,6 +67,7 @@ _netctl_gui_settings=( 'SUDO_PATH' 'SYSTEMCTL_PATH' 'SYSTRAY' + 'USE_HELPER' 'WPACLI_PATH' 'WPASUP_PATH' 'WPA_DRIVERS' diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index 35de10f..f15cfc4 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -437,6 +437,10 @@ void MainWindow::updateConfiguration(const QMap args) createObjects(); if (useHelper) useHelper = isHelperActive(); + if (useHelper) + sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH, + DBUS_HELPER_INTERFACE, QString("Update"), + QList(), true, debug); setTab(args[QString("tab")].toInt() - 1); createActions(); setIconsToTabs(); diff --git a/sources/gui/src/settingswindow.cpp b/sources/gui/src/settingswindow.cpp index f6aab5e..cc86846 100644 --- a/sources/gui/src/settingswindow.cpp +++ b/sources/gui/src/settingswindow.cpp @@ -322,6 +322,7 @@ QMap SettingsWindow::readSettings() else settings[QString("FORCE_SUDO")] = QString("false"); settings[QString("HELPER_PATH")] = ui->lineEdit_helperPath->text(); + settings[QString("HELPER_SERVICE")] = ui->lineEdit_helperService->text(); settings[QString("IFACE_DIR")] = ui->lineEdit_interfacesDir->text(); settings[QString("LANGUAGE")] = ui->comboBox_language->currentText(); settings[QString("NETCTL_PATH")] = ui->lineEdit_netctlPath->text(); @@ -375,6 +376,7 @@ void SettingsWindow::setSettings(const QMap settings) else ui->checkBox_forceSudo->setCheckState(Qt::Unchecked); ui->lineEdit_helperPath->setText(settings[QString("HELPER_PATH")]); + ui->lineEdit_helperPath->setText(settings[QString("HELPER_SERVICE")]); ui->lineEdit_interfacesDir->setText(settings[QString("IFACE_DIR")]); ui->comboBox_language->setCurrentIndex(0); for (int i=0; icomboBox_language->count(); i++) @@ -421,6 +423,7 @@ QMap SettingsWindow::getDefault() settings[QString("CTRL_GROUP")] = QString("users"); settings[QString("FORCE_SUDO")] = QString("false"); settings[QString("HELPER_PATH")] = QString("/usr/bin/netctlgui-helper"); + settings[QString("HELPER_SERVICE")] = QString("netctlgui-helper.service"); settings[QString("IFACE_DIR")] = QString("/sys/class/net/"); settings[QString("LANGUAGE")] = QString("en"); settings[QString("NETCTL_PATH")] = QString("/usr/bin/netctl"); diff --git a/sources/gui/src/settingswindow.ui b/sources/gui/src/settingswindow.ui index 5135af5..23003a3 100644 --- a/sources/gui/src/settingswindow.ui +++ b/sources/gui/src/settingswindow.ui @@ -6,8 +6,8 @@ 0 0 - 658 - 319 + 656 + 317 @@ -119,7 +119,7 @@ - 1 + 0 @@ -136,8 +136,8 @@ 0 0 - 442 - 258 + 440 + 256 @@ -211,8 +211,8 @@ 0 0 - 442 - 258 + 440 + 256 @@ -220,6 +220,12 @@ + + + 150 + 0 + + Helper status @@ -251,7 +257,9 @@ Start - + + + @@ -282,6 +290,12 @@ + + + 150 + 0 + + Helper command @@ -299,6 +313,30 @@ + + + + + + + 150 + 0 + + + + Helper service + + + + + + + Name of netctlgui-helper service + + + + + @@ -333,8 +371,8 @@ 0 0 - 436 - 165 + 440 + 256 diff --git a/sources/gui/zsh-completions b/sources/gui/zsh-completions index 4fa2be5..a2b22e0 100644 --- a/sources/gui/zsh-completions +++ b/sources/gui/zsh-completions @@ -39,14 +39,18 @@ _netctl_gui_arglist=( ) _netctl_gui_settings=( + 'CLOSE_HELPER' 'CLOSETOTRAY' 'CTRL_DIR' 'CTRL_GROUP' + 'FORCE_SUDO' + 'HELPER_PATH' + 'HELPER_SERVICE' 'IFACE_DIR' 'LANGUAGE' + 'NETCTL_PATH' 'NETCTLAUTO_PATH' 'NETCTLAUTO_SERVICE' - 'NETCTL_PATH' 'PID_FILE' 'PREFERED_IFACE' 'PROFILE_DIR' @@ -55,6 +59,7 @@ _netctl_gui_settings=( 'SUDO_PATH' 'SYSTEMCTL_PATH' 'SYSTRAY' + 'USE_HELPER' 'WPACLI_PATH' 'WPASUP_PATH' 'WPA_DRIVERS' diff --git a/sources/helper/src/controladaptor.cpp b/sources/helper/src/controladaptor.cpp index 4a9e43a..3239e58 100644 --- a/sources/helper/src/controladaptor.cpp +++ b/sources/helper/src/controladaptor.cpp @@ -59,9 +59,9 @@ QStringList ControlAdaptor::Settings() } -bool ControlAdaptor::Update(const QString configPath) +bool ControlAdaptor::Update() { - helper->updateConfiguration(configPath); + helper->updateConfiguration(); return true; } diff --git a/sources/helper/src/controladaptor.h b/sources/helper/src/controladaptor.h index 01da6d6..688a078 100644 --- a/sources/helper/src/controladaptor.h +++ b/sources/helper/src/controladaptor.h @@ -40,7 +40,7 @@ public slots: bool Active(); bool Close(); QStringList Settings(); - bool Update(const QString configPath = QString("")); + bool Update(); // netctlCommand bool autoDisableAll(); bool autoEnable(const QString profile); diff --git a/sources/helper/src/netctlhelper.cpp b/sources/helper/src/netctlhelper.cpp index 422ba67..e2bc687 100644 --- a/sources/helper/src/netctlhelper.cpp +++ b/sources/helper/src/netctlhelper.cpp @@ -32,10 +32,10 @@ NetctlHelper::NetctlHelper(QObject *parent, QMap args) : QObject(parent), - initConfigPath(args[QString("config")].toString()), + configPath(args[QString("config")].toString()), debug(args[QString("debug")].toBool()) { - updateConfiguration(initConfigPath); + updateConfiguration(); } @@ -108,6 +108,7 @@ QMap NetctlHelper::getDefault() settings[QString("CTRL_GROUP")] = QString("users"); settings[QString("FORCE_SUDO")] = QString("false"); settings[QString("HELPER_PATH")] = QString("/usr/bin/netctlgui-helper"); + settings[QString("HELPER_SERVICE")] = QString("netctlgui-helper.service"); settings[QString("IFACE_DIR")] = QString("/sys/class/net/"); settings[QString("LANGUAGE")] = QString("en"); settings[QString("NETCTL_PATH")] = QString("/usr/bin/netctl"); @@ -133,7 +134,7 @@ QMap NetctlHelper::getDefault() } -QMap NetctlHelper::getSettings(const QString configPath) +QMap NetctlHelper::getSettings() { if (debug) qDebug() << "[NetctlHelper]" << "[getSettings]"; @@ -160,15 +161,13 @@ QMap NetctlHelper::getSettings(const QString configPath) } -void NetctlHelper::updateConfiguration(QString configPath) +void NetctlHelper::updateConfiguration() { if (debug) qDebug() << "[NetctlHelper]" << "[updateConfiguration]"; deleteInterface(); - if (configPath.isEmpty()) - configPath = initConfigPath; - configuration = getSettings(configPath); + configuration = getSettings(); createInterface(); } diff --git a/sources/helper/src/netctlhelper.h b/sources/helper/src/netctlhelper.h index ec293d5..3cb4bc4 100644 --- a/sources/helper/src/netctlhelper.h +++ b/sources/helper/src/netctlhelper.h @@ -34,17 +34,17 @@ public: QStringList printSettings(); public slots: - void updateConfiguration(QString configPath = QString("")); + void updateConfiguration(); void quitHelper(); private: - QString initConfigPath; + QString configPath; QMap configuration; bool debug; void createInterface(); void deleteInterface(); QMap getDefault(); - QMap getSettings(const QString configPath); + QMap getSettings(); };