diff --git a/sources/gui/netctl-gui.1 b/sources/gui/netctl-gui.1 index cb90080..c453988 100644 --- a/sources/gui/netctl-gui.1 +++ b/sources/gui/netctl-gui.1 @@ -5,63 +5,65 @@ netctl-gui is a graphical interface for netctl .B netctl-gui [ options ] .SH DESCRIPTION -Graphical user interface for netctl written on C++ using Qt toolkit. Provides shared library for interaction with netctl and Plasmoid and DataEngine for KDE. +.B netctl-gui +is a project which provides graphical user interface for +.B netctl +written on C++ using Qt toolkit. It provides shared library and DBus API (through helper daemon) and Plasmoid and DataEngine for KDE. .SH OPTIONS -.TP ---daemon +.IP "--daemon" run as daemon -.TP ---maximized +.IP "--maximized" run maximized -.TP ---minimized +.IP "--minimized" run to system tray if it is available -.TP ---about +.IP "--about" show about window -.TP ---netctl-auto +.IP "--netctl-auto" show netctl-auto window -.TP ---settings +.IP "--settings" show settings window -.TP --e, --essid ESSID -select ESSID ESSID. This option will set tab to 3 automatically -.TP --o, --open PROFILE -open profile PROFILE. This option will set tab to 2 automatically -.TP --s, --select PROFILE -select profile PROFILE. This option will set tab to 1 automatically -.TP --c, --config FILE -read configuration from file FILE -.TP --d, --debug +.IP "-e, --essid ESSID" +select ESSID +.I ESSID +This option will set tab to 3 automatically +.IP "-o, --open PROFILE" +open profile +.I PROFILE +This option will set tab to 2 automatically +.IP "-s, --select PROFILE" +select profile +.I PROFILE +This option will set tab to 1 automatically +.IP "-c, --config FILE" +read configuration from file +.I FILE +.IP "-d, --debug" print debug information -.TP ---default +.IP "--default" start with default settings -.TP ---set-opts OPTIONS -set options OPTIONS for this run, comma separated. Example "LANGUAGE=en,NETCTL_PATH=/usr/bin/netctl" -.TP --t, --tab NUM -open a tab with number NUM -.TP --v, --version +.IP "--set-opts OPTIONS" +set options +.I OPTIONS +for this run, comma separated. Example: +.nf + LANGUAGE=en,NETCTL_PATH=/path/to/ponies +.fi +.IP "-t, --tab NUM" +open a tab with number +.I NUM +.IP "-v, --version" show version and exit -.TP --i, --info +.IP "-i, --info" show build information and exit -.TP --h, --help +.IP "-h, --help" show this help and exit .SH FILES -.TP -$HOME/.config/netctl-gui.conf +.I $HOME/.config/netctl-gui.conf +.RS Configuration file +.RE +.SH SEE ALSO +.BR netctl-gui (1) .SH AUTHOR @PROJECT_AUTHOR@ <\fI@PROJECT_CONTACT@\fR> .SH LICENSE diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index f15cfc4..d0eced9 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -171,6 +171,23 @@ bool MainWindow::isHelperActive() } +bool MainWindow::isHelperServiceActive() +{ + if (debug) qDebug() << "[MainWindow]" << "[isHelperServiceActive]"; + + QString cmd = configuration[QString("SYSTEMCTL_PATH")] + QString(" is-active ") + + configuration[QString("HELPER_SERVICE")]; + if (debug) qDebug() << "[MainWindow]" << "[isHelperServiceActive]" << ":" << "Run cmd" << cmd; + TaskResult process = runTask(cmd, false); + if (debug) qDebug() << "[MainWindow]" << "[isHelperServiceActive]" << ":" << "Cmd returns" << process.exitCode; + + if (process.exitCode != 0) + return false; + else + return true; +} + + bool MainWindow::checkExternalApps(const QString apps = QString("all")) { if (debug) qDebug() << "[MainWindow]" << "[checkExternalApps]"; @@ -436,11 +453,15 @@ void MainWindow::updateConfiguration(const QMap args) delete settingsWin; createObjects(); + // some helper fixs if (useHelper) useHelper = isHelperActive(); if (useHelper) sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH, DBUS_HELPER_INTERFACE, QString("Update"), QList(), true, debug); + if (isHelperServiceActive()) + configuration[QString("CLOSE_HELPER")] = QString("false"); + // update ui setTab(args[QString("tab")].toInt() - 1); createActions(); setIconsToTabs(); diff --git a/sources/gui/src/mainwindow.h b/sources/gui/src/mainwindow.h index 3d988d0..488d3c2 100644 --- a/sources/gui/src/mainwindow.h +++ b/sources/gui/src/mainwindow.h @@ -59,6 +59,7 @@ public: QString printInformation(); QStringList printSettings(); bool isHelperActive(); + bool isHelperServiceActive(); protected: void closeEvent(QCloseEvent *event); diff --git a/sources/gui/src/settingswindow.cpp b/sources/gui/src/settingswindow.cpp index cc86846..2a65378 100644 --- a/sources/gui/src/settingswindow.cpp +++ b/sources/gui/src/settingswindow.cpp @@ -489,14 +489,22 @@ void SettingsWindow::updateHelper() { if (debug) qDebug() << "[SettingsWindow]" << "[updateHelper]"; - if (((MainWindow *)parent())->isHelperActive()) { + if (((MainWindow *)parent())->isHelperServiceActive()) { + ui->label_status->setText(QApplication::translate("SettingsWindow", "Active (systemd)")); + ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop")); + ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop")); + ui->pushButton_status->setDisabled(true); + } + else if (((MainWindow *)parent())->isHelperActive()) { ui->label_status->setText(QApplication::translate("SettingsWindow", "Active")); ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop")); ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop")); + ui->pushButton_status->setEnabled(true); } else { ui->label_status->setText(QApplication::translate("SettingsWindow", "Inactive")); ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Start")); ui->pushButton_status->setIcon(QIcon::fromTheme("system-run")); + ui->pushButton_status->setEnabled(true); } } diff --git a/sources/gui/src/settingswindow.ui b/sources/gui/src/settingswindow.ui index 23003a3..2194965 100644 --- a/sources/gui/src/settingswindow.ui +++ b/sources/gui/src/settingswindow.ui @@ -6,8 +6,8 @@ 0 0 - 656 - 317 + 654 + 315 @@ -136,8 +136,8 @@ 0 0 - 440 - 256 + 438 + 254 @@ -211,11 +211,21 @@ 0 0 - 440 - 256 + 438 + 254 + + + + It is recommended to use systemd integration. See `man 1 netctlgui-helper` for more details. + + + true + + + @@ -282,7 +292,7 @@ - Close helper after exit + Close helper after exit (doesn't work while systemd service is active) @@ -342,12 +352,6 @@ Qt::Vertical - - - 20 - 104 - - @@ -371,8 +375,8 @@ 0 0 - 440 - 256 + 436 + 165 @@ -825,8 +829,8 @@ 0 0 - 436 - 103 + 438 + 254 diff --git a/sources/helper/netctlgui-helper.1 b/sources/helper/netctlgui-helper.1 index b30f1a4..4fda74a 100644 --- a/sources/helper/netctlgui-helper.1 +++ b/sources/helper/netctlgui-helper.1 @@ -5,36 +5,60 @@ netctlgui-helper is a helper daemon for netctl-gui .B netctlgui-helper [ options ] .SH DESCRIPTION -Qt based helper daemon which provides a DBus interface for interaction with netctl without any additional permissions. +.B netctlgui-helper +is a Qt based helper daemon which provides a DBus interface for interaction with +.B netctl +without any additional permissions. To have access to DBus interface user should have group +.B network .SH OPTIONS -.TP ---nodaemon +.IP "--nodaemon" do not run as daemon -.TP --c, --config FILE -read configuration from file FILE -.TP --d, --debug +.IP "-c, --config FILE" +read configuration from file +.I FILE +.IP "-d, --debug" print debug information -.TP --v, --version +.IP "-v, --version" show version and exit -.TP --i, --info +.IP "-i, --info" show build information and exit -.TP --h, --help +.IP "-h, --help" show this help and exit .SH FILES -.TP -$HOME/.config/netctl-gui.conf +.I $HOME/.config/netctl-gui.conf +.RS Configuration file -.TP -/usr/lib/systemd/system/netctlgui-helper.service +.RE +.I /usr/lib/systemd/system/netctlgui-helper.service +.RS Systemd service file -.TP -/etc/dbus-1/system.d/org.netctlgui.helper.conf +.RE +.I /etc/dbus-1/system.d/org.netctlgui.helper.conf +.RS DBus policy configuration file +.RE +.SH USAGE WITH SYSTEMD +It is a recommended way to use this daemon. To start helper as systemd daemon type: +.nf + # systemctl start netctlgui-helper +.fi +If you want to setup non-standard configuration file edit source service file and replace the following line: +.nf + ExecStart=/usr/bin/netctlgui-helper +.fi +to +.nf + ExecStart=/usr/bin/netctlgui-helper -c /path/to/your/file +.fi +By the way it is highly recommended to copy source service file before to +.B /etc/systemd/system +and edit copied file to avoid upgrade problems. +.SH SEE ALSO +.BR netctl-gui (1) +.SH STANDARDS +Some text will be here +.SH SECURITY CONSIDERATIONS +Some text will be here. .SH AUTHOR @PROJECT_AUTHOR@ <\fI@PROJECT_CONTACT@\fR> .SH LICENSE diff --git a/sources/helper/org.netctlgui.helper.conf b/sources/helper/org.netctlgui.helper.conf index 855ba0e..1abbaa9 100644 --- a/sources/helper/org.netctlgui.helper.conf +++ b/sources/helper/org.netctlgui.helper.conf @@ -8,8 +8,8 @@ - - + + diff --git a/sources/resources/translations/en.ts b/sources/resources/translations/en.ts index e91bdf8..b959190 100644 --- a/sources/resources/translations/en.ts +++ b/sources/resources/translations/en.ts @@ -167,6 +167,10 @@ Sender : %1 Sender : %1 + + Could not run helper + Could not run helper + EthernetWidget @@ -938,7 +942,7 @@ Build date: %1 - Build date: %1 + Build date: %1 cmake flags: @@ -1064,11 +1068,11 @@ cmake flags - cmake flags + cmake flags DBus configuration - DBus configuration + DBus configuration @@ -1325,6 +1329,21 @@ Profile + + NetctlHelper + + Build date: %1 + Build date: %1 + + + cmake flags + cmake flags + + + DBus configuration + DBus configuration + + PasswdWidget @@ -1721,6 +1740,70 @@ Start minimized to tray Start minimized to tray + + Select helper command + Select helper command + + + Active + Active + + + Stop + Stop + + + Inactive + Inactive + + + Start + Start + + + Helper + Helper + + + Helper status + Helper status + + + Use helper + Use helper + + + Force use sudo in helper + Force use sudo in helper + + + Close helper after exit + Close helper after exit + + + Helper command + Helper command + + + Helper service + Helper service + + + Name of netctlgui-helper service + Name of netctlgui-helper service + + + Active (systemd) + Active (systemd) + + + It is recommended to use systemd integration. See `man 1 netctlgui-helper` for more details. + It is recommended to use systemd integration. See `man 1 netctlgui-helper` for more details. + + + Close helper after exit (doesn't work while systemd service is active) + Close helper after exit (doesn't work while systemd service is active) + TrayIcon diff --git a/sources/resources/translations/netctl-gui.ts b/sources/resources/translations/netctl-gui.ts index 7b5e9ba..516bc4e 100644 --- a/sources/resources/translations/netctl-gui.ts +++ b/sources/resources/translations/netctl-gui.ts @@ -91,121 +91,127 @@ ErrorWindow - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Error! - + Could not find components - + Does not support yet - + Profile name is not set - + Bind interfaces are not set - + Description is not set - + Ip settings are not set - + Configuration file does not exist - + Key is not set - + Wireless settings are not set - + Configuration file is not set - + ESSID is not set - + MAC address is incorrect - + Session ID is not set - - + + APN is not set - + Empty user/group name - + Could not find profile - + Could not find ESSID - + + Could not run helper + + + + Unknown error - + Sender : %1 @@ -743,27 +749,27 @@ - - + + Name - + Description - + Status - - + + @@ -783,9 +789,9 @@ - - - + + + Start @@ -797,8 +803,8 @@ - - + + Profile @@ -845,13 +851,13 @@ - + Signal - + Security @@ -892,35 +898,35 @@ - - - + + + Start profile - + Restart profile - - - + + + Enable profile - + Edit profile - + Remove profile @@ -947,114 +953,108 @@ - + Ready - + yes - + no - - - - + + + + Active - - + + Enabled - - - + + + Updated - - + + Stop profile - - + + Disable profile - - + + Exists - + ESSID - - + + Stop WiFi - - - - - + + + + + Start WiFi - - - - - - - - - - - - + + + + + + + + + Done - - - - - - - - - - - - + + + + + + + + + Error - - + + Stop @@ -1159,16 +1159,6 @@ open a tab with this number - - - cmake flags - - - - - DBus configuration - - Show messages: @@ -1190,22 +1180,17 @@ - - Build date: %1 - - - - + Version - + Author - + License @@ -1384,26 +1369,26 @@ - + Name - + Description - - + + Active - - + + Disabled @@ -1418,123 +1403,123 @@ - + Ready - + Disable service - + Enable service - + netctl-auto is running - + Stop service - + Start service - + netctl-auto is not running - + yes - + no - + Profile - + Updated - - + + Enable profile - + Enable all profiles - + Disable all profiles - - + + Enable - - + + Disable - - - - - - - + + + + + + + Done - - - - - - - + + + + + + + Error - + Disable profile - + Switch to profile @@ -1545,6 +1530,24 @@ + + NetctlHelper + + + Build date: %1 + + + + + cmake flags + + + + + DBus configuration + + + PasswdWidget @@ -1768,274 +1771,353 @@ SettingsWindow - + Settings - + General - + Language - + Select a language - + netctl - + netctl path - + Path to netctl - - - - - - - - - + + + + + + + + + + Browse - + Profile path - + Path to profile directory - + sudo - + sudo path - + Path to sudo - + wpa_supplicant - + + Helper + + + + Enable system tray - + Minimize to tray instead of closing - + Start minimized to tray - + + It is recommended to use systemd integration. See `man 1 netctlgui-helper` for more details. + + + + + Helper status + + + + + Use helper + + + + + Force use sudo in helper + + + + + Helper command + + + + + Helper service + + + + + Name of netctlgui-helper service + + + + systemctl path - + Path to systemctl - + netctl-auto path - + Path to netctl-auto - + netctl-auto service - + Name of netctl-auto systemd service - + wpa_supplicant path - + Path to wpa_supplicant - + wpa_cli path - + Path to wpa_cli - + PID file - + wpa_supplicant PID file - + wpa_supplicant drivers - + wpa_supplicant drivers comma separated - + ctrl_interface directory - + Path to control directory - + ctrl_interface group - + Group of control directory - + Other - + + Close helper after exit (doesn't work while systemd service is active) + + + + Path to interface list - + Path to directory which contains network devices - + Path to rfkill device list - + Path to directory which contains rfkill devices - - + + Prefered wireless interface - + Select path to directory with interfaces - + Select netctl command - - - - - - + + + + + + + All files (*) - + + Select helper command + + + + Select netctl-auto command - + Select path to profile directory - + Select path to directory with rfkill devices - + Select sudo command - + Select systemctl command - + Select wpa_cli command - + Select wpa_supplicant command + + + Active (systemd) + + + + + Active + + + + + + Stop + + + + + Inactive + + + + + + Start + + TrayIcon diff --git a/sources/resources/translations/ru.ts b/sources/resources/translations/ru.ts index 0328fa4..d7954ab 100644 --- a/sources/resources/translations/ru.ts +++ b/sources/resources/translations/ru.ts @@ -167,6 +167,10 @@ Sender : %1 Отправитель : %1 + + Could not run helper + Не могу запустить хелпер + EthernetWidget @@ -937,7 +941,7 @@ Build date: %1 - Дата сборки: %1 + Дата сборки: %1 cmake flags: @@ -1063,11 +1067,11 @@ cmake flags - Флаги cmake + Флаги cmake DBus configuration - Настройка DBus + Настройка DBus @@ -1324,6 +1328,21 @@ Профиль + + NetctlHelper + + Build date: %1 + Дата сборки: %1 + + + cmake flags + Флаги cmake + + + DBus configuration + Настройка DBus + + PasswdWidget @@ -1720,6 +1739,70 @@ Start minimized to tray Запускать свернутым в трей + + Select helper command + Выберете команду для хелпера + + + Active + Активен + + + Stop + Стоп + + + Inactive + Неактивен + + + Start + Старт + + + Helper + Хелпер + + + Helper status + Статус + + + Use helper + Использовать хелпер + + + Force use sudo in helper + Принудительно использовать sudo + + + Close helper after exit + Закрыть хелпер после выхода + + + Helper command + Команда + + + Helper service + Сервис + + + Name of netctlgui-helper service + Имя сервиса для netctlgui-helper + + + Active (systemd) + Активен (systemd) + + + It is recommended to use systemd integration. See `man 1 netctlgui-helper` for more details. + Рекомендуется использовать интеграцию с systemd. Смотри `man 1 netctlgui-helper` для более подробной информации. + + + Close helper after exit (doesn't work while systemd service is active) + Закрыть хелпер после выхода (не работает, если запущен сервис systemd) + TrayIcon