mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
parent
308f9824b4
commit
9aa1f6d715
@ -35,25 +35,7 @@ bool checkExternalApps(const QString apps, const QMap<QString, QString> configur
|
||||
cmd.append("which");
|
||||
// avoid null-lines arguments
|
||||
cmd.append("true");
|
||||
if ((apps == QString("helper")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("HELPER_PATH")]);
|
||||
}
|
||||
if ((apps == QString("netctl")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("NETCTL_PATH")]);
|
||||
cmd.append(configuration[QString("NETCTLAUTO_PATH")]);
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("sudo")) || (apps == QString("wpasup")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("systemctl")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("SYSTEMCTL_PATH")]);
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("wpasup")) || (apps == QString("wpasup-only")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("WPACLI_PATH")]);
|
||||
cmd.append(configuration[QString("WPASUP_PATH")]);
|
||||
}
|
||||
cmd.append(externalApps(apps, configuration));
|
||||
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd.join(QChar(' '));
|
||||
TaskResult process = runTask(cmd.join(QChar(' ')), false);
|
||||
@ -77,25 +59,30 @@ QString checkStatus(const bool statusBool, const bool nullFalse)
|
||||
QStringList externalApps(const QString apps, const QMap<QString, QString> configuration)
|
||||
{
|
||||
QStringList app;
|
||||
// editor works always over cmd
|
||||
if ((apps == QString("editor")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("EDITOR_PATH")]);
|
||||
app.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("helper")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("HELPER_PATH")]);
|
||||
}
|
||||
if ((apps == QString("netctl")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("NETCTL_PATH")]);
|
||||
app.append(configuration[QString("NETCTLAUTO_PATH")]);
|
||||
app.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("sudo")) || (apps == QString("wpasup")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("systemctl")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("SYSTEMCTL_PATH")]);
|
||||
app.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("wpasup")) || (apps == QString("wpasup-only")) || (apps == QString("all"))) {
|
||||
app.append(configuration[QString("WPACLI_PATH")]);
|
||||
app.append(configuration[QString("WPASUP_PATH")]);
|
||||
}
|
||||
// append sudo
|
||||
// FORCE_SUDO is always true if helper is not running
|
||||
if ((apps.contains(QRegExp(QString("(^all$|^editor$|^netctl$|^sudo$|^systemctl$|^wpasup$)")))) &&
|
||||
(configuration[QString("FORCE_SUDO")] == QString("true")))
|
||||
app.append(configuration[QString("SUDO_PATH")]);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
@ -316,6 +316,10 @@ void MainWidget::mainTabEnableProfile()
|
||||
void MainWidget::mainTabRemoveProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("sudo"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("sudo"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
if (ui->tableWidget_main->currentItem() == nullptr) return;
|
||||
|
||||
mainWindow->setDisabled(true);
|
||||
|
@ -464,8 +464,10 @@ bool MainWindow::checkHelperStatus()
|
||||
if (useHelper) useHelper = isHelperActive();
|
||||
if (useHelper)
|
||||
sendRequestToCtrl(QString("Update"), debug);
|
||||
else
|
||||
else {
|
||||
configuration[QString("FORCE_SUDO")] = QString("true");
|
||||
configuration[QString("USE_HELPER")] = QString("false");
|
||||
}
|
||||
if (isHelperServiceActive())
|
||||
configuration[QString("CLOSE_HELPER")] = QString("false");
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>550</width>
|
||||
<width>600</width>
|
||||
<height>497</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -33,7 +33,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>550</width>
|
||||
<width>600</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -25,16 +25,20 @@
|
||||
#include "calls.h"
|
||||
#include "commonfunctions.h"
|
||||
#include "dbusoperation.h"
|
||||
#include "errorwindow.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
||||
NetctlAutoWindow::NetctlAutoWindow(QWidget *parent, const QMap<QString, QString> settings, const bool debugCmd)
|
||||
: QMainWindow(parent),
|
||||
ui(new Ui::NetctlAutoWindow),
|
||||
debug(debugCmd)
|
||||
debug(debugCmd),
|
||||
configuration(settings)
|
||||
{
|
||||
mainWindow = dynamic_cast<MainWindow *>(parent);
|
||||
useHelper = (settings[QString("USE_HELPER")] == QString("true"));
|
||||
useHelper = (configuration[QString("USE_HELPER")] == QString("true"));
|
||||
|
||||
// ui
|
||||
ui = new Ui::NetctlAutoWindow;
|
||||
ui->setupUi(this);
|
||||
ui->tableWidget->setColumnHidden(2, true);
|
||||
ui->tableWidget->setColumnHidden(3, true);
|
||||
@ -165,6 +169,10 @@ void NetctlAutoWindow::netctlAutoContextualMenu(const QPoint &pos)
|
||||
void NetctlAutoWindow::netctlAutoUpdateTable()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
netctlInformation info = generalInformation(mainWindow->netctlInterface,
|
||||
@ -255,6 +263,10 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
||||
void NetctlAutoWindow::netctlAutoDisableAllProfiles()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
bool responce = false;
|
||||
@ -274,6 +286,10 @@ void NetctlAutoWindow::netctlAutoDisableAllProfiles()
|
||||
void NetctlAutoWindow::netctlAutoEnableProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
if (ui->tableWidget->currentItem() == nullptr) return;
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
@ -297,6 +313,10 @@ void NetctlAutoWindow::netctlAutoEnableProfile()
|
||||
void NetctlAutoWindow::netctlAutoEnableAllProfiles()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
bool responce = false;
|
||||
@ -316,6 +336,10 @@ void NetctlAutoWindow::netctlAutoEnableAllProfiles()
|
||||
void NetctlAutoWindow::netctlAutoStartProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
if (ui->tableWidget->currentItem() == nullptr) return;
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
@ -339,6 +363,10 @@ void NetctlAutoWindow::netctlAutoStartProfile()
|
||||
void NetctlAutoWindow::netctlAutoEnableService()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
bool responce = false;
|
||||
if (!useHelper)
|
||||
@ -357,6 +385,10 @@ void NetctlAutoWindow::netctlAutoEnableService()
|
||||
void NetctlAutoWindow::netctlAutoRestartService()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("systemctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("systemctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
bool responce = false;
|
||||
if (!useHelper)
|
||||
@ -375,6 +407,10 @@ void NetctlAutoWindow::netctlAutoRestartService()
|
||||
void NetctlAutoWindow::netctlAutoStartService()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("systemctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("systemctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
bool responce = false;
|
||||
if (!useHelper)
|
||||
@ -400,9 +436,9 @@ void NetctlAutoWindow::netctlAutoRefreshButtons(QTableWidgetItem *current, QTabl
|
||||
ui->actionSwitch->setEnabled(selected && ui->tableWidget->item(current->row(), 2)->text().isEmpty());
|
||||
if (selected && !ui->tableWidget->item(current->row(), 3)->text().isEmpty()) {
|
||||
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
|
||||
ui->actionEnable->setIcon(QIcon::fromTheme("list-add"));
|
||||
ui->actionEnable->setIcon(QIcon::fromTheme("edit-delete"));
|
||||
} else {
|
||||
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Enable"));
|
||||
ui->actionEnable->setIcon(QIcon::fromTheme("edit-delete"));
|
||||
ui->actionEnable->setIcon(QIcon::fromTheme("list-add"));
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ private:
|
||||
void createActions();
|
||||
bool debug = false;
|
||||
bool useHelper = true;
|
||||
QMap<QString, QString> configuration;
|
||||
};
|
||||
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QMenu>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
#include <task/taskadds.h>
|
||||
|
||||
#include "calls.h"
|
||||
#include "bridgewidget.h"
|
||||
@ -149,6 +150,7 @@ void NewProfileWidget::updateMenuProfile()
|
||||
ui->actionLoad->setEnabled(selected);
|
||||
ui->actionRemove->setEnabled(selected);
|
||||
ui->actionSave->setEnabled(selected);
|
||||
ui->actionEditor->setEnabled(selected);
|
||||
}
|
||||
|
||||
|
||||
@ -207,6 +209,10 @@ void NewProfileWidget::profileTabChangeState(const QString current)
|
||||
void NewProfileWidget::profileTabCreateProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("sudo"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("sudo"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
// error checking
|
||||
if (ui->comboBox_profile->currentText().isEmpty())
|
||||
@ -411,9 +417,35 @@ void NewProfileWidget::profileTabLoadProfile()
|
||||
}
|
||||
|
||||
|
||||
void NewProfileWidget::profileTabOpenInEditor()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("editor"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("editor"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
QString profile = QFileInfo(ui->comboBox_profile->currentText()).fileName();
|
||||
QString cmd = QString("%1 %2 %3").arg(configuration[QString("SUDO_PATH")])
|
||||
.arg(configuration[QString("EDITOR_PATH")])
|
||||
.arg(profile);
|
||||
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd;
|
||||
TaskResult process = runTask(cmd, false);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
if (process.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
|
||||
mainWindow->showMessage(process.exitCode == 0);
|
||||
}
|
||||
|
||||
|
||||
void NewProfileWidget::profileTabRemoveProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("sudo"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("sudo"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
|
||||
mainWindow->setDisabled(true);
|
||||
QString profile = QFileInfo(ui->comboBox_profile->currentText()).fileName();
|
||||
@ -431,6 +463,7 @@ void NewProfileWidget::createActions()
|
||||
|
||||
// menu actions
|
||||
connect(ui->actionClear, SIGNAL(triggered(bool)), this, SLOT(updateProfileTab()));
|
||||
connect(ui->actionEditor, SIGNAL(triggered(bool)), this, SLOT(profileTabOpenInEditor()));
|
||||
connect(ui->actionLoad, SIGNAL(triggered(bool)), this, SLOT(profileTabLoadProfile()));
|
||||
connect(ui->actionRemove, SIGNAL(triggered(bool)), this, SLOT(profileTabRemoveProfile()));
|
||||
connect(ui->actionSave, SIGNAL(triggered(bool)), this, SLOT(profileTabCreateProfile()));
|
||||
|
@ -64,6 +64,7 @@ private slots:
|
||||
void profileTabChangeState(const QString current);
|
||||
void profileTabCreateProfile();
|
||||
void profileTabLoadProfile();
|
||||
void profileTabOpenInEditor();
|
||||
void profileTabRemoveProfile();
|
||||
|
||||
private:
|
||||
|
@ -64,7 +64,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>461</width>
|
||||
<width>459</width>
|
||||
<height>342</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -103,6 +103,7 @@
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRemove"/>
|
||||
<addaction name="actionEditor"/>
|
||||
</widget>
|
||||
<action name="actionClear">
|
||||
<property name="icon">
|
||||
@ -159,6 +160,19 @@
|
||||
<string>Remove selected profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditor">
|
||||
<property name="icon">
|
||||
<iconset theme="document-open">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open in editor</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open in an external editor</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -67,6 +67,7 @@ void SettingsWindow::createActions()
|
||||
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
|
||||
this, SLOT(changePage(QTreeWidgetItem *, QTreeWidgetItem *)));
|
||||
// buttons
|
||||
connect(ui->pushButton_editorPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||
connect(ui->pushButton_helperPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||
connect(ui->pushButton_interfacesDir, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||
connect(ui->pushButton_netctlPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||
@ -282,6 +283,7 @@ void SettingsWindow::saveSettings()
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup(QString("Other"));
|
||||
settings.setValue(QString("EDITOR_PATH"), config[QString("EDITOR_PATH")]);
|
||||
settings.setValue(QString("IFACE_DIR"), config[QString("IFACE_DIR")]);
|
||||
settings.setValue(QString("RFKILL_DIR"), config[QString("RFKILL_DIR")]);
|
||||
settings.setValue(QString("PREFERED_IFACE"), config[QString("PREFERED_IFACE")]);
|
||||
@ -365,8 +367,11 @@ void SettingsWindow::selectAbstractSomething()
|
||||
bool isDir = false;
|
||||
QString path = QString("/usr/bin");
|
||||
QString text = QApplication::translate("SettingsWindow", "Select helper command");
|
||||
QLineEdit *lineEdit = ui->lineEdit_helperPath;
|
||||
if (sender() == ui->pushButton_helperPath) {
|
||||
QLineEdit *lineEdit = ui->lineEdit_editorPath;
|
||||
if (sender() == ui->pushButton_editorPath) {
|
||||
text = QApplication::translate("SettingsWindow", "Select editor command");
|
||||
lineEdit = ui->lineEdit_editorPath;
|
||||
} else if (sender() == ui->pushButton_helperPath) {
|
||||
text = QApplication::translate("SettingsWindow", "Select helper command");
|
||||
lineEdit = ui->lineEdit_helperPath;
|
||||
} else if (sender() == ui->pushButton_interfacesDir) {
|
||||
@ -448,6 +453,7 @@ QMap<QString, QString> SettingsWindow::readSettings()
|
||||
config[QString("FORCE_SUDO")] = QString("true");
|
||||
else
|
||||
config[QString("FORCE_SUDO")] = QString("false");
|
||||
config[QString("EDITOR_PATH")] = ui->lineEdit_editorPath->text();
|
||||
config[QString("HELPER_PATH")] = ui->lineEdit_helperPath->text();
|
||||
config[QString("HELPER_SERVICE")] = ui->lineEdit_helperService->text();
|
||||
config[QString("IFACE_DIR")] = ui->lineEdit_interfacesDir->text();
|
||||
@ -511,6 +517,7 @@ void SettingsWindow::setSettings(const QMap<QString, QString> config)
|
||||
ui->checkBox_forceSudo->setCheckState(Qt::Checked);
|
||||
else
|
||||
ui->checkBox_forceSudo->setCheckState(Qt::Unchecked);
|
||||
ui->lineEdit_editorPath->setText(config[QString("EDITOR_PATH")]);
|
||||
ui->lineEdit_helperPath->setText(config[QString("HELPER_PATH")]);
|
||||
ui->lineEdit_helperService->setText(config[QString("HELPER_SERVICE")]);
|
||||
ui->lineEdit_interfacesDir->setText(config[QString("IFACE_DIR")]);
|
||||
@ -615,6 +622,7 @@ QMap<QString, QString> SettingsWindow::getSettings(QString fileName)
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup(QString("Other"));
|
||||
config[QString("EDITOR_PATH")] = settings.value(QString("EDITOR_PATH"), QString("/usr/bin/gvim")).toString();
|
||||
config[QString("IFACE_DIR")] = settings.value(QString("IFACE_DIR"), QString("/sys/class/net/")).toString();
|
||||
config[QString("RFKILL_DIR")] = settings.value(QString("RFKILL_DIR"), QString("/sys/class/rfkill/")).toString();
|
||||
config[QString("PREFERED_IFACE")] = settings.value(QString("PREFERED_IFACE"), QString("")).toString();
|
||||
|
@ -1252,11 +1252,57 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>436</width>
|
||||
<height>107</height>
|
||||
<width>542</width>
|
||||
<height>330</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_editorPath">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_editorPath">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>7</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>External editor</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_editorPath">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Path to directory which contains network devices</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_editorPath">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>4</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_interfacesDir">
|
||||
<item>
|
||||
@ -1413,8 +1459,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>201</width>
|
||||
<height>177</height>
|
||||
<width>542</width>
|
||||
<height>330</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
|
@ -105,6 +105,10 @@ bool WiFiMenuWidget::wifiTabSelectEssidSlot(const QString essid)
|
||||
void WiFiMenuWidget::connectToUnknownEssid(const QString passwd)
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
if (ui->tableWidget_wifi->currentItem() == nullptr) return;
|
||||
if (passwdWid != nullptr) delete passwdWid;
|
||||
|
||||
@ -183,11 +187,6 @@ void WiFiMenuWidget::updateText(const netctlWifiInfo current)
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!wifiTabSetEnabled(checkExternalApps(QString("wpasup-only"), configuration, debug))) return;
|
||||
if (!checkExternalApps(QString("wpasup"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("wpasup"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
ui->label_wifi->setText(QApplication::translate("WiFiMenuWidget", "Processing..."));
|
||||
|
||||
QString text = QString("");
|
||||
text += QString("%1 - %2 - %3 ").arg(current.name).arg(current.security).arg(current.macs[0]);
|
||||
@ -373,8 +372,8 @@ int WiFiMenuWidget::wifiTabShowInfo()
|
||||
void WiFiMenuWidget::wifiTabStart()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("wpasup"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("wpasup"), configuration).join(QChar('\n')), debug);
|
||||
if (!checkExternalApps(QString("netctl"), configuration, debug)) {
|
||||
ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
|
||||
return mainWindow->emitNeedToBeConfigured();
|
||||
}
|
||||
if (ui->tableWidget_wifi->currentItem() == nullptr) return;
|
||||
|
@ -67,6 +67,9 @@ CTRL_DIR=/run/wpa_supplicant
|
||||
CTRL_GROUP=users
|
||||
|
||||
[Other]
|
||||
# path to external editor
|
||||
# This option is not recognized by netctlgui-helper
|
||||
EDITOR_PATH=/usr/bin/gvim
|
||||
# path to directory which contains interface information
|
||||
IFACE_DIR=/sys/class/net/
|
||||
# path to directory with rfkill devices.
|
||||
|
@ -32,6 +32,9 @@ force use
|
||||
for helper instead of using
|
||||
.BR setuid (3)
|
||||
to child processes
|
||||
.IP "EDITOR_PATH=/usr/bin/gvim"
|
||||
path to an external editor. This option is not recognized by
|
||||
.BR netctlgui-helper (1)
|
||||
.IP "HELPER_PATH=/usr/bin/netctlgui-helper"
|
||||
path to
|
||||
.BR netctlgui-helper (1)
|
||||
|
@ -184,6 +184,7 @@ QMap<QString, QString> NetctlHelper::getSettings(const QString file)
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup(QString("Other"));
|
||||
config[QString("EDITOR_PATH")] = settings.value(QString("EDITOR_PATH"), QString("/usr/bin/gvim")).toString();
|
||||
config[QString("IFACE_DIR")] = settings.value(QString("IFACE_DIR"), QString("/sys/class/net/")).toString();
|
||||
config[QString("RFKILL_DIR")] = settings.value(QString("RFKILL_DIR"), QString("/sys/class/rfkill/")).toString();
|
||||
config[QString("PREFERED_IFACE")] = settings.value(QString("PREFERED_IFACE"), QString("")).toString();
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en">
|
||||
<TS version="2.0" language="en">
|
||||
<context>
|
||||
<name>NetctlHelper</name>
|
||||
<message>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="ru_RU">
|
||||
<TS version="2.0" language="ru_RU">
|
||||
<context>
|
||||
<name>NetctlHelper</name>
|
||||
<message>
|
||||
|
@ -1748,6 +1748,14 @@ Should be according to standards</translation>
|
||||
<source>New profile toolbar</source>
|
||||
<translation>New profile toolbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open in editor</source>
|
||||
<translation>Open in editor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open in an external editor</source>
|
||||
<translation>Open in an external editor</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswdWidget</name>
|
||||
@ -2269,6 +2277,14 @@ Should be according to standards</translation>
|
||||
<source>WiFi toolbar</source>
|
||||
<translation>WiFi toolbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select editor command</source>
|
||||
<translation>Select editor command</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>External editor</source>
|
||||
<translation>External editor</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TrayIcon</name>
|
||||
@ -2518,7 +2534,7 @@ Should be according to standards</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Processing...</source>
|
||||
<translation>Processing...</translation>
|
||||
<translation type="obsolete">Processing...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MHz</source>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1747,6 +1747,14 @@ Should be according to standards</source>
|
||||
<source>New profile toolbar</source>
|
||||
<translation>Управление профилями</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open in editor</source>
|
||||
<translation>Открыть в редакторе</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open in an external editor</source>
|
||||
<translation>Открыть во внешнем редакторе</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswdWidget</name>
|
||||
@ -2268,6 +2276,14 @@ Should be according to standards</source>
|
||||
<source>WiFi toolbar</source>
|
||||
<translation>Управление WiFi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select editor command</source>
|
||||
<translation>Выберете внешний редактор</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>External editor</source>
|
||||
<translation>Внешний редактор</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TrayIcon</name>
|
||||
@ -2517,7 +2533,7 @@ Should be according to standards</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Processing...</source>
|
||||
<translation>Обработка</translation>
|
||||
<translation type="obsolete">Обработка</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MHz</source>
|
||||
|
Loading…
Reference in New Issue
Block a user