mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 23:47:21 +00:00
added settings functions
added const type
This commit is contained in:
parent
fbad5a6c7d
commit
2cade97786
@ -40,7 +40,7 @@ void BridgeWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BridgeWidget::setShown(bool state)
|
void BridgeWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::BridgeWidget *ui;
|
Ui::BridgeWidget *ui;
|
||||||
|
@ -32,7 +32,7 @@ ErrorWindow::~ErrorWindow()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorWindow::setMessage(int mess)
|
void ErrorWindow::setMessage(const int mess)
|
||||||
{
|
{
|
||||||
QString message;
|
QString message;
|
||||||
switch(mess) {
|
switch(mess) {
|
||||||
|
@ -30,12 +30,13 @@ class ErrorWindow : public QMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ErrorWindow(QWidget *parent = 0, int messageNumber = 0);
|
explicit ErrorWindow(QWidget *parent = 0,
|
||||||
|
int messageNumber = 0);
|
||||||
~ErrorWindow();
|
~ErrorWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ErrorWindow *ui;
|
Ui::ErrorWindow *ui;
|
||||||
void setMessage(int mess);
|
void setMessage(const int mess);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ERRORWINDOW_H */
|
#endif /* ERRORWINDOW_H */
|
||||||
|
@ -54,7 +54,7 @@ void EthernetWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EthernetWidget::setShown(bool state)
|
void EthernetWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
@ -96,7 +96,7 @@ void EthernetWidget::showAdvanced()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EthernetWidget::showWpa(int state)
|
void EthernetWidget::showWpa(const int state)
|
||||||
{
|
{
|
||||||
if (state == 0)
|
if (state == 0)
|
||||||
ui->widget_wpa->setHidden(true);
|
ui->widget_wpa->setHidden(true);
|
||||||
|
@ -39,12 +39,12 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectWpaConfig();
|
void selectWpaConfig();
|
||||||
void showAdvanced();
|
void showAdvanced();
|
||||||
void showWpa(int state);
|
void showWpa(const int state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::EthernetWidget *ui;
|
Ui::EthernetWidget *ui;
|
||||||
|
@ -21,14 +21,14 @@
|
|||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
|
|
||||||
GeneralWidget::GeneralWidget(QWidget *parent, QString ifaceDir, QString profileDir)
|
GeneralWidget::GeneralWidget(QWidget *parent, QMap<QString, QString> settings)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
ifaceDirectory(new QDir(ifaceDir)),
|
|
||||||
profileDirectory(new QDir(profileDir)),
|
|
||||||
ui(new Ui::GeneralWidget)
|
ui(new Ui::GeneralWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connectionType = ui->comboBox_connection;
|
connectionType = ui->comboBox_connection;
|
||||||
|
ifaceDirectory = new QDir(settings[QString("IFACE_DIR")]);
|
||||||
|
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
|
||||||
createActions();
|
createActions();
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ void GeneralWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GeneralWidget::setShown(bool state)
|
void GeneralWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
|
@ -34,8 +34,7 @@ class GeneralWidget : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GeneralWidget(QWidget *parent = 0,
|
explicit GeneralWidget(QWidget *parent = 0,
|
||||||
QString ifaceDir = QString(""),
|
QMap<QString, QString> settings = QMap<QString, QString>());
|
||||||
QString profileDir = QString(""));
|
|
||||||
~GeneralWidget();
|
~GeneralWidget();
|
||||||
QComboBox *connectionType;
|
QComboBox *connectionType;
|
||||||
QMap<QString, QString> getSettings();
|
QMap<QString, QString> getSettings();
|
||||||
@ -44,7 +43,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addAfter();
|
void addAfter();
|
||||||
|
@ -89,7 +89,7 @@ void IpWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::setShown(bool state)
|
void IpWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
@ -168,7 +168,7 @@ void IpWidget::keyPressEvent(QKeyEvent *pressedKey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString IpWidget::getIp(QString rawIp)
|
QString IpWidget::getIp(const QString rawIp)
|
||||||
{
|
{
|
||||||
QStringList ip = rawIp.split(QString("."));
|
QStringList ip = rawIp.split(QString("."));
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ QString IpWidget::getIp(QString rawIp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString IpWidget::getPrefix(QString rawPrefix)
|
QString IpWidget::getPrefix(const QString rawPrefix)
|
||||||
{
|
{
|
||||||
QString prefix;
|
QString prefix;
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ QString IpWidget::getPrefix(QString rawPrefix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString IpWidget::getIp6(QString rawIp)
|
QString IpWidget::getIp6(const QString rawIp)
|
||||||
{
|
{
|
||||||
QString ip = rawIp;
|
QString ip = rawIp;
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ QString IpWidget::getIp6(QString rawIp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString IpWidget::getPrefix6(QString rawPrefix)
|
QString IpWidget::getPrefix6(const QString rawPrefix)
|
||||||
{
|
{
|
||||||
QString prefix;
|
QString prefix;
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ void IpWidget::addDnsOpt()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::changeIpMode(QString currentText)
|
void IpWidget::changeIpMode(const QString currentText)
|
||||||
{
|
{
|
||||||
if (currentText == QString("dhcp"))
|
if (currentText == QString("dhcp"))
|
||||||
ui->widget_ip->setHidden(true);
|
ui->widget_ip->setHidden(true);
|
||||||
@ -309,7 +309,7 @@ void IpWidget::changeIpMode(QString currentText)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::ipEnable(int state)
|
void IpWidget::ipEnable(const int state)
|
||||||
{
|
{
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
ui->comboBox_ip->setDisabled(true);
|
ui->comboBox_ip->setDisabled(true);
|
||||||
@ -324,7 +324,7 @@ void IpWidget::ipEnable(int state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::changeIp6Mode(QString currentText)
|
void IpWidget::changeIp6Mode(const QString currentText)
|
||||||
{
|
{
|
||||||
if ((currentText == QString("dhcp")) ||
|
if ((currentText == QString("dhcp")) ||
|
||||||
(currentText == QString("dhcp-noaddr")))
|
(currentText == QString("dhcp-noaddr")))
|
||||||
@ -335,7 +335,7 @@ void IpWidget::changeIp6Mode(QString currentText)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::ip6Enable(int state)
|
void IpWidget::ip6Enable(const int state)
|
||||||
{
|
{
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
ui->comboBox_ip6->setDisabled(true);
|
ui->comboBox_ip6->setDisabled(true);
|
||||||
@ -350,7 +350,7 @@ void IpWidget::ip6Enable(int state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IpWidget::changeDhcpClient(QString currentText)
|
void IpWidget::changeDhcpClient(const QString currentText)
|
||||||
{
|
{
|
||||||
if (currentText == QString("dhcpcd")) {
|
if (currentText == QString("dhcpcd")) {
|
||||||
ui->widget_dhcpcdOpt->setShown(true);
|
ui->widget_dhcpcdOpt->setShown(true);
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// buttons
|
// buttons
|
||||||
@ -50,13 +50,13 @@ private slots:
|
|||||||
void addDns();
|
void addDns();
|
||||||
void addDnsOpt();
|
void addDnsOpt();
|
||||||
// ip mode
|
// ip mode
|
||||||
void changeIpMode(QString currentText);
|
void changeIpMode(const QString currentText);
|
||||||
void ipEnable(int state);
|
void ipEnable(const int state);
|
||||||
// ipv6 mode
|
// ipv6 mode
|
||||||
void changeIp6Mode(QString currentText);
|
void changeIp6Mode(const QString currentText);
|
||||||
void ip6Enable(int state);
|
void ip6Enable(int state);
|
||||||
// dhcp client
|
// dhcp client
|
||||||
void changeDhcpClient(QString currentText);
|
void changeDhcpClient(const QString currentText);
|
||||||
void showAdvanced();
|
void showAdvanced();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -64,10 +64,10 @@ private:
|
|||||||
void createActions();
|
void createActions();
|
||||||
void createFilter();
|
void createFilter();
|
||||||
void keyPressEvent(QKeyEvent *pressedKey);
|
void keyPressEvent(QKeyEvent *pressedKey);
|
||||||
QString getIp(QString rawIp);
|
QString getIp(const QString rawIp);
|
||||||
QString getPrefix(QString rawPrefix);
|
QString getPrefix(const QString rawPrefix);
|
||||||
QString getIp6(QString rawIp);
|
QString getIp6(const QString rawIp);
|
||||||
QString getPrefix6(QString rawPrefix);
|
QString getPrefix6(const QString rawPrefix);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
#include "bridgewidget.h"
|
#include "bridgewidget.h"
|
||||||
@ -31,6 +32,7 @@
|
|||||||
#include "netctlprofile.h"
|
#include "netctlprofile.h"
|
||||||
#include "passwdwidget.h"
|
#include "passwdwidget.h"
|
||||||
#include "pppoewidget.h"
|
#include "pppoewidget.h"
|
||||||
|
#include "settingswindow.h"
|
||||||
#include "tunnelwidget.h"
|
#include "tunnelwidget.h"
|
||||||
#include "tuntapwidget.h"
|
#include "tuntapwidget.h"
|
||||||
#include "vlanwidget.h"
|
#include "vlanwidget.h"
|
||||||
@ -39,36 +41,22 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent, bool defaultSettings, int tabNum)
|
MainWindow::MainWindow(QWidget *parent, const bool defaultSettings, const int tabNum)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
ui(new Ui::MainWindow)
|
ui(new Ui::MainWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tabWidget->setCurrentIndex(tabNum-1);
|
ui->tabWidget->setCurrentIndex(tabNum-1);
|
||||||
|
|
||||||
// SettingsWindow *settingsWindow;
|
QString configPath = QDir::homePath() + QDir::separator() + QString(".config") +
|
||||||
// settingsWindow = new SettingsWindow(this);
|
QDir::separator() + QString("netctl-gui.conf");
|
||||||
// if (defaultSettings)
|
settingsWin = new SettingsWindow(this, configPath);
|
||||||
// стандартные настройки
|
if (defaultSettings)
|
||||||
// delete settingsWindow;
|
settingsWin->setDefault();
|
||||||
|
configuration = settingsWin->getSettings();
|
||||||
// temporary block
|
|
||||||
netctlPath = QString("/usr/bin/netctl");
|
|
||||||
profileDir = QString("/etc/netctl");
|
|
||||||
sudoPath = QString("/usr/bin/kdesu");
|
|
||||||
wpaConfig.append(QString("/usr/bin/wpa_cli"));
|
|
||||||
wpaConfig.append(QString("/usr/bin/wpa_supplicant"));
|
|
||||||
preferedInterface = QString("");
|
|
||||||
//// additional settings
|
|
||||||
ifaceDir = QString("/sys/class/net/");
|
|
||||||
rfkillDir = QString("/sys/class/rfkill/");
|
|
||||||
wpaConfig.append(QString("/run/wpa_supplicant_netctl-gui.pid"));
|
|
||||||
wpaConfig.append(QString("nl80211,wext"));
|
|
||||||
wpaConfig.append(QString("/run/wpa_supplicant_netctl-gui"));
|
|
||||||
wpaConfig.append(QString("users"));
|
|
||||||
|
|
||||||
// gui
|
// gui
|
||||||
generalWid = new GeneralWidget(this, ifaceDir, profileDir);
|
generalWid = new GeneralWidget(this, configuration);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(generalWid);
|
ui->scrollAreaWidgetContents->layout()->addWidget(generalWid);
|
||||||
ipWid = new IpWidget(this);
|
ipWid = new IpWidget(this);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(ipWid);
|
ui->scrollAreaWidgetContents->layout()->addWidget(ipWid);
|
||||||
@ -86,12 +74,12 @@ MainWindow::MainWindow(QWidget *parent, bool defaultSettings, int tabNum)
|
|||||||
ui->scrollAreaWidgetContents->layout()->addWidget(tuntapWid);
|
ui->scrollAreaWidgetContents->layout()->addWidget(tuntapWid);
|
||||||
vlanWid = new VlanWidget(this);
|
vlanWid = new VlanWidget(this);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(vlanWid);
|
ui->scrollAreaWidgetContents->layout()->addWidget(vlanWid);
|
||||||
wirelessWid = new WirelessWidget(this, rfkillDir);
|
wirelessWid = new WirelessWidget(this, configuration);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid);
|
ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid);
|
||||||
// backend
|
// backend
|
||||||
netctlCommand = new Netctl(this, netctlPath, profileDir, sudoPath);
|
netctlCommand = new Netctl(this, configuration);
|
||||||
netctlProfile = new NetctlProfile(this, profileDir, sudoPath);
|
netctlProfile = new NetctlProfile(this, configuration);
|
||||||
wpaCommand = new WpaSup(this, wpaConfig, sudoPath, ifaceDir, preferedInterface);
|
wpaCommand = new WpaSup(this, configuration);
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
updateTabs(ui->tabWidget->currentIndex());
|
updateTabs(ui->tabWidget->currentIndex());
|
||||||
@ -115,21 +103,23 @@ MainWindow::~MainWindow()
|
|||||||
delete tuntapWid;
|
delete tuntapWid;
|
||||||
delete vlanWid;
|
delete vlanWid;
|
||||||
delete wirelessWid;
|
delete wirelessWid;
|
||||||
|
|
||||||
|
delete settingsWin;
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MainWindow::checkExternalApps(QString apps = QString("all"))
|
bool MainWindow::checkExternalApps(const QString apps = QString("all"))
|
||||||
{
|
{
|
||||||
QStringList commandLine;
|
QStringList commandLine;
|
||||||
commandLine.append("which");
|
commandLine.append("which");
|
||||||
commandLine.append(sudoPath);
|
commandLine.append(configuration[QString("SUDO_PATH")]);
|
||||||
if ((apps == QString("netctl")) || (apps == QString("all"))) {
|
if ((apps == QString("netctl")) || (apps == QString("all"))) {
|
||||||
commandLine.append(netctlPath);
|
commandLine.append(configuration[QString("NETCTL_PATH")]);
|
||||||
}
|
}
|
||||||
if ((apps == QString("wpasup")) || (apps == QString("all"))) {
|
if ((apps == QString("wpasup")) || (apps == QString("all"))) {
|
||||||
commandLine.append(wpaConfig[0]);
|
commandLine.append(configuration[QString("WPACLI_PATH")]);
|
||||||
commandLine.append(wpaConfig[1]);
|
commandLine.append(configuration[QString("WPASUP_PATH")]);
|
||||||
}
|
}
|
||||||
QProcess command;
|
QProcess command;
|
||||||
command.start(commandLine.join(QString(" ")));
|
command.start(commandLine.join(QString(" ")));
|
||||||
@ -141,7 +131,7 @@ bool MainWindow::checkExternalApps(QString apps = QString("all"))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MainWindow::checkState(QString state, QString item)
|
bool MainWindow::checkState(const QString state, const QString item)
|
||||||
{
|
{
|
||||||
if (item.indexOf(state) > -1)
|
if (item.indexOf(state) > -1)
|
||||||
return true;
|
return true;
|
||||||
@ -154,6 +144,7 @@ bool MainWindow::checkState(QString state, QString item)
|
|||||||
void MainWindow::createActions()
|
void MainWindow::createActions()
|
||||||
{
|
{
|
||||||
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
|
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
|
||||||
|
connect(ui->actionSettings, SIGNAL(triggered(bool)), settingsWin, SLOT(showWindow()));
|
||||||
connect(ui->actionQuit, SIGNAL(triggered(bool)), this, SLOT(close()));
|
connect(ui->actionQuit, SIGNAL(triggered(bool)), this, SLOT(close()));
|
||||||
|
|
||||||
// main page events
|
// main page events
|
||||||
@ -415,7 +406,7 @@ void MainWindow::profileTabBrowseProfile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::profileTabChangeState(QString current)
|
void MainWindow::profileTabChangeState(const QString current)
|
||||||
{
|
{
|
||||||
if (current == QString("ethernet")) {
|
if (current == QString("ethernet")) {
|
||||||
generalWid->setShown(true);
|
generalWid->setShown(true);
|
||||||
@ -806,7 +797,7 @@ void MainWindow::profileTabLoadProfile()
|
|||||||
|
|
||||||
|
|
||||||
// wifi tab slots
|
// wifi tab slots
|
||||||
void MainWindow::wifiTabSetEnabled(bool state)
|
void MainWindow::wifiTabSetEnabled(const bool state)
|
||||||
{
|
{
|
||||||
if (state) {
|
if (state) {
|
||||||
ui->tableWidget_wifi->show();
|
ui->tableWidget_wifi->show();
|
||||||
@ -822,7 +813,7 @@ void MainWindow::wifiTabSetEnabled(bool state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::connectToUnknownEssid(QString passwd)
|
void MainWindow::connectToUnknownEssid(const QString passwd)
|
||||||
{
|
{
|
||||||
if (!passwd.isEmpty())
|
if (!passwd.isEmpty())
|
||||||
delete passwdWid;
|
delete passwdWid;
|
||||||
|
@ -33,6 +33,7 @@ class Netctl;
|
|||||||
class NetctlProfile;
|
class NetctlProfile;
|
||||||
class PasswdWidget;
|
class PasswdWidget;
|
||||||
class PppoeWidget;
|
class PppoeWidget;
|
||||||
|
class SettingsWindow;
|
||||||
class TunnelWidget;
|
class TunnelWidget;
|
||||||
class TuntapWidget;
|
class TuntapWidget;
|
||||||
class VlanWidget;
|
class VlanWidget;
|
||||||
@ -49,25 +50,17 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0,
|
explicit MainWindow(QWidget *parent = 0,
|
||||||
bool defaultSettings = false,
|
const bool defaultSettings = false,
|
||||||
int tabNum = 0);
|
const int tabNum = 0);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
Netctl *netctlCommand;
|
Netctl *netctlCommand;
|
||||||
NetctlProfile *netctlProfile;
|
NetctlProfile *netctlProfile;
|
||||||
WpaSup *wpaCommand;
|
WpaSup *wpaCommand;
|
||||||
enum wpaConfigIndex {
|
|
||||||
wpaCliPath = 0,
|
|
||||||
wpaSupplicantPath = 1,
|
|
||||||
wpaPidPath = 2,
|
|
||||||
wpadSupDrivers = 3,
|
|
||||||
wpaConfDir = 4,
|
|
||||||
wpaConfGroup = 5
|
|
||||||
};
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateTabs(const int tab);
|
void updateTabs(const int tab);
|
||||||
// wifi tab slots
|
// wifi tab slots
|
||||||
void connectToUnknownEssid(QString passwd);
|
void connectToUnknownEssid(const QString passwd);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateMainTab();
|
void updateMainTab();
|
||||||
@ -80,12 +73,12 @@ private slots:
|
|||||||
void mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
void mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||||
// profile tab slots
|
// profile tab slots
|
||||||
void profileTabBrowseProfile();
|
void profileTabBrowseProfile();
|
||||||
void profileTabChangeState(QString current);
|
void profileTabChangeState(const QString current);
|
||||||
void profileTabClear();
|
void profileTabClear();
|
||||||
void profileTabCreateProfile();
|
void profileTabCreateProfile();
|
||||||
void profileTabLoadProfile();
|
void profileTabLoadProfile();
|
||||||
// wifi tab slots
|
// wifi tab slots
|
||||||
void wifiTabSetEnabled(bool state);
|
void wifiTabSetEnabled(const bool state);
|
||||||
void wifiTabStart();
|
void wifiTabStart();
|
||||||
void wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
void wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||||
|
|
||||||
@ -105,17 +98,12 @@ private:
|
|||||||
// backend
|
// backend
|
||||||
ErrorWindow *errorWin;
|
ErrorWindow *errorWin;
|
||||||
PasswdWidget *passwdWid;
|
PasswdWidget *passwdWid;
|
||||||
bool checkExternalApps(QString apps);
|
SettingsWindow *settingsWin;
|
||||||
bool checkState(QString state, QString item);
|
bool checkExternalApps(const QString apps);
|
||||||
|
bool checkState(const QString state, const QString item);
|
||||||
void createActions();
|
void createActions();
|
||||||
// configuration
|
// configuration
|
||||||
QString ifaceDir;
|
QMap<QString, QString> configuration;
|
||||||
QString netctlPath;
|
|
||||||
QString preferedInterface;
|
|
||||||
QString profileDir;
|
|
||||||
QString rfkillDir;
|
|
||||||
QString sudoPath;
|
|
||||||
QStringList wpaConfig;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ void MobileWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MobileWidget::setShown(bool state)
|
void MobileWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectOptionsFile();
|
void selectOptionsFile();
|
||||||
|
@ -23,13 +23,12 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
|
||||||
Netctl::Netctl(MainWindow *wid, QString netctlPath, QString profileDir, QString sudoPath)
|
Netctl::Netctl(MainWindow *wid, QMap<QString, QString> settings)
|
||||||
: parent(wid),
|
: parent(wid)
|
||||||
netctlCommand(netctlPath),
|
|
||||||
profileDirectory(new QDir(profileDir)),
|
|
||||||
sudoCommand(sudoPath)
|
|
||||||
{
|
{
|
||||||
|
netctlCommand = settings[QString("NETCTL_PATH")];
|
||||||
|
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
|
||||||
|
sudoCommand = settings[QString("SUDO_PATH")];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -58,7 +57,7 @@ QList<QStringList> Netctl::getProfileList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList Netctl::getProfileDescriptions(QStringList profileList)
|
QStringList Netctl::getProfileDescriptions(const QStringList profileList)
|
||||||
{
|
{
|
||||||
QStringList descriptions;
|
QStringList descriptions;
|
||||||
|
|
||||||
@ -88,7 +87,7 @@ QStringList Netctl::getProfileDescriptions(QStringList profileList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList Netctl::getProfileStatuses(QStringList profileList)
|
QStringList Netctl::getProfileStatuses(const QStringList profileList)
|
||||||
{
|
{
|
||||||
QStringList statuses;
|
QStringList statuses;
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ QStringList Netctl::getProfileStatuses(QStringList profileList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString Netctl::getSsidFromProfile(QString profile)
|
QString Netctl::getSsidFromProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QString ssidName = QString("");
|
QString ssidName = QString("");
|
||||||
QFile profileFile(profileDirectory->absolutePath() + QDir::separator() + profile);
|
QFile profileFile(profileDirectory->absolutePath() + QDir::separator() + profile);
|
||||||
@ -136,7 +135,7 @@ QString Netctl::getSsidFromProfile(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Netctl::isProfileActive(QString profile)
|
bool Netctl::isProfileActive(const QString profile)
|
||||||
{
|
{
|
||||||
bool status = false;
|
bool status = false;
|
||||||
QProcess command;
|
QProcess command;
|
||||||
@ -153,7 +152,7 @@ bool Netctl::isProfileActive(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Netctl::isProfileEnabled(QString profile)
|
bool Netctl::isProfileEnabled(const QString profile)
|
||||||
{
|
{
|
||||||
bool status = false;
|
bool status = false;
|
||||||
QProcess command;
|
QProcess command;
|
||||||
@ -175,7 +174,7 @@ bool Netctl::isProfileEnabled(QString profile)
|
|||||||
|
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
bool Netctl::enableProfile(QString profile)
|
bool Netctl::enableProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QProcess command;
|
QProcess command;
|
||||||
if (isProfileEnabled(profile))
|
if (isProfileEnabled(profile))
|
||||||
@ -190,7 +189,7 @@ bool Netctl::enableProfile(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Netctl::restartProfile(QString profile)
|
bool Netctl::restartProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QProcess command;
|
QProcess command;
|
||||||
if (isProfileActive(profile))
|
if (isProfileActive(profile))
|
||||||
@ -203,7 +202,7 @@ bool Netctl::restartProfile(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Netctl::startProfile(QString profile)
|
bool Netctl::startProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QProcess command;
|
QProcess command;
|
||||||
if (isProfileActive(profile))
|
if (isProfileActive(profile))
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define NETCTLINTERACT_H
|
#define NETCTLINTERACT_H
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMap>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
@ -30,23 +31,21 @@ class Netctl : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Netctl(MainWindow *wid = 0,
|
explicit Netctl(MainWindow *wid = 0,
|
||||||
QString netctlPath = QString(""),
|
QMap<QString, QString> settings = QMap<QString, QString>());
|
||||||
QString profileDir = QString(""),
|
|
||||||
QString sudoPath = QString(""));
|
|
||||||
~Netctl();
|
~Netctl();
|
||||||
// general information
|
// general information
|
||||||
QList<QStringList> getProfileList();
|
QList<QStringList> getProfileList();
|
||||||
QStringList getProfileDescriptions(QStringList profileList);
|
QStringList getProfileDescriptions(const QStringList profileList);
|
||||||
QStringList getProfileStatuses(QStringList profileList);
|
QStringList getProfileStatuses(const QStringList profileList);
|
||||||
QString getSsidFromProfile(QString profile);
|
QString getSsidFromProfile(const QString profile);
|
||||||
bool isProfileActive(QString profile);
|
bool isProfileActive(const QString profile);
|
||||||
bool isProfileEnabled(QString profile);
|
bool isProfileEnabled(const QString profile);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// functions
|
// functions
|
||||||
bool enableProfile(QString profile);
|
bool enableProfile(const QString profile);
|
||||||
bool restartProfile(QString profile);
|
bool restartProfile(const QString profile);
|
||||||
bool startProfile(QString profile);
|
bool startProfile(const QString profile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MainWindow *parent;
|
MainWindow *parent;
|
||||||
|
@ -26,12 +26,11 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
|
||||||
NetctlProfile::NetctlProfile(MainWindow *wid, QString profileDir, QString sudoPath)
|
NetctlProfile::NetctlProfile(MainWindow *wid, QMap<QString, QString> settings)
|
||||||
: parent(wid),
|
: parent(wid)
|
||||||
profileDirectory(new QDir(profileDir)),
|
|
||||||
sudoCommand(sudoPath)
|
|
||||||
{
|
{
|
||||||
|
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
|
||||||
|
sudoCommand = settings[QString("SUDO_PATH")];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ NetctlProfile::~NetctlProfile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool NetctlProfile::copyProfile(QString oldPath)
|
bool NetctlProfile::copyProfile(const QString oldPath)
|
||||||
{
|
{
|
||||||
QString newPath = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(oldPath).fileName();
|
QString newPath = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(oldPath).fileName();
|
||||||
QProcess command;
|
QProcess command;
|
||||||
@ -54,7 +53,7 @@ bool NetctlProfile::copyProfile(QString oldPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString NetctlProfile::createProfile(QString profile, QMap<QString, QString> settings)
|
QString NetctlProfile::createProfile(const QString profile, const QMap<QString, QString> settings)
|
||||||
{
|
{
|
||||||
|
|
||||||
QString profileTempName = QDir::homePath() + QDir::separator() +
|
QString profileTempName = QDir::homePath() + QDir::separator() +
|
||||||
@ -88,7 +87,7 @@ QString NetctlProfile::createProfile(QString profile, QMap<QString, QString> set
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QMap<QString, QString> NetctlProfile::getSettingsFromProfile(QString profile)
|
QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QMap<QString, QString> settings;
|
QMap<QString, QString> settings;
|
||||||
QFile profileFile;
|
QFile profileFile;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define NETCTLPROFILE_H
|
#define NETCTLPROFILE_H
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMap>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
@ -30,12 +31,11 @@ class NetctlProfile : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NetctlProfile(MainWindow *wid = 0,
|
explicit NetctlProfile(MainWindow *wid = 0,
|
||||||
QString profileDir = QString(""),
|
QMap<QString, QString> settings = QMap<QString, QString>());
|
||||||
QString sudoPath = QString(""));
|
|
||||||
~NetctlProfile();
|
~NetctlProfile();
|
||||||
bool copyProfile(QString oldPath);
|
bool copyProfile(const QString oldPath);
|
||||||
QString createProfile(QString profile, QMap<QString, QString> settings);
|
QString createProfile(const QString profile, const QMap<QString, QString> settings);
|
||||||
QMap<QString, QString> getSettingsFromProfile(QString profile);
|
QMap<QString, QString> getSettingsFromProfile(const QString profile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MainWindow *parent;
|
MainWindow *parent;
|
||||||
|
@ -27,8 +27,8 @@ PasswdWidget::PasswdWidget(MainWindow *wid)
|
|||||||
ui(new Ui::PasswdWidget)
|
ui(new Ui::PasswdWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
okButton = ui->buttonBox->button(QDialogButtonBox::Ok);
|
|
||||||
cancelButton = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
cancelButton = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
||||||
|
okButton = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||||
createActions();
|
createActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ void PppoeWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PppoeWidget::setShown(bool state)
|
void PppoeWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
@ -91,7 +91,7 @@ void PppoeWidget::createActions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PppoeWidget::changeMode(QString currentText)
|
void PppoeWidget::changeMode(const QString currentText)
|
||||||
{
|
{
|
||||||
if (currentText == QString("persist"))
|
if (currentText == QString("persist"))
|
||||||
ui->widget_timeout->setHidden(true);
|
ui->widget_timeout->setHidden(true);
|
||||||
|
@ -38,10 +38,10 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void changeMode(QString currentText);
|
void changeMode(const QString currentText);
|
||||||
void selectOptionsFile();
|
void selectOptionsFile();
|
||||||
void showAdvanced();
|
void showAdvanced();
|
||||||
|
|
||||||
|
@ -18,16 +18,261 @@
|
|||||||
#include "settingswindow.h"
|
#include "settingswindow.h"
|
||||||
#include "ui_settingswindow.h"
|
#include "ui_settingswindow.h"
|
||||||
|
|
||||||
|
#include <QFile>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
SettingsWindow::SettingsWindow(QWidget *parent)
|
#include "mainwindow.h"
|
||||||
: QMainWindow(parent),
|
#include <cstdio>
|
||||||
|
|
||||||
|
|
||||||
|
SettingsWindow::SettingsWindow(MainWindow *wid, QString configFile)
|
||||||
|
: QMainWindow(wid),
|
||||||
|
parent(wid),
|
||||||
|
file(configFile),
|
||||||
ui(new Ui::SettingsWindow)
|
ui(new Ui::SettingsWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
cancelButton = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
||||||
|
defaultButton = ui->buttonBox->button(QDialogButtonBox::Reset);
|
||||||
|
okButton = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||||
|
ui->comboBox_language->addItem(QString("english"));
|
||||||
|
ui->comboBox_language->addItem(QString("russian"));
|
||||||
|
createActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SettingsWindow::~SettingsWindow()
|
SettingsWindow::~SettingsWindow()
|
||||||
{
|
{
|
||||||
|
delete cancelButton;
|
||||||
|
delete defaultButton;
|
||||||
|
delete okButton;
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::createActions()
|
||||||
|
{
|
||||||
|
connect(ui->comboBox_language, SIGNAL(currentIndexChanged(int)), ui->label_info, SLOT(show()));
|
||||||
|
connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close()));
|
||||||
|
connect(defaultButton, SIGNAL(clicked(bool)), this, SLOT(setDefault()));
|
||||||
|
connect(okButton, SIGNAL(clicked(bool)), this, SLOT(saveSettings()));
|
||||||
|
connect(okButton, SIGNAL(clicked(bool)), this, SLOT(close()));
|
||||||
|
// buttons
|
||||||
|
connect(ui->pushButton_interfaceDir, SIGNAL(clicked(bool)), SLOT(selectIfaceDir()));
|
||||||
|
connect(ui->pushButton_netctlPath, SIGNAL(clicked(bool)), SLOT(selectNetctlPath()));
|
||||||
|
connect(ui->pushButton_profilePath, SIGNAL(clicked(bool)), SLOT(selectProfileDir()));
|
||||||
|
connect(ui->pushButton_rfkill, SIGNAL(clicked(bool)), SLOT(selectRfkillDir()));
|
||||||
|
connect(ui->pushButton_sudo, SIGNAL(clicked(bool)), SLOT(selectSudoPath()));
|
||||||
|
connect(ui->pushButton_wpaCliPath, SIGNAL(clicked(bool)), SLOT(selectWpaCliPath()));
|
||||||
|
connect(ui->pushButton_wpaSupPath, SIGNAL(clicked(bool)), SLOT(selectWpaSupPath()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ESC press event
|
||||||
|
void SettingsWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||||
|
{
|
||||||
|
if (pressedKey->key() == Qt::Key_Escape)
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::saveSettings()
|
||||||
|
{
|
||||||
|
QMap<QString, QString> settings = readSettings();
|
||||||
|
QFile configFile(file);
|
||||||
|
|
||||||
|
if (!configFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
|
return;
|
||||||
|
QTextStream out(&configFile);
|
||||||
|
for (int i=0; i<settings.keys().count(); i++)
|
||||||
|
out << settings.keys()[i] << QString("=") << settings[settings.keys()[i]] << QString("\n");
|
||||||
|
configFile.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::setDefault()
|
||||||
|
{
|
||||||
|
setSettings(getDefault());
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectIfaceDir()
|
||||||
|
{
|
||||||
|
QString directory = QFileDialog::getExistingDirectory(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select path to directory with interfaces"),
|
||||||
|
QString("/sys/"));
|
||||||
|
if (!directory.isEmpty())
|
||||||
|
ui->lineEdit_interfacesDir->setText(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectNetctlPath()
|
||||||
|
{
|
||||||
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select netctl command"),
|
||||||
|
QString("/usr/bin/"),
|
||||||
|
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||||
|
if (!filename.isEmpty())
|
||||||
|
ui->lineEdit_netctlPath->setText(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectProfileDir()
|
||||||
|
{
|
||||||
|
QString directory = QFileDialog::getExistingDirectory(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select path to profile directory"),
|
||||||
|
QString("/etc/"));
|
||||||
|
if (!directory.isEmpty())
|
||||||
|
ui->lineEdit_profilePath->setText(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectRfkillDir()
|
||||||
|
{
|
||||||
|
QString directory = QFileDialog::getExistingDirectory(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select path to directory with rfkill devices"),
|
||||||
|
QString("/sys/"));
|
||||||
|
if (!directory.isEmpty())
|
||||||
|
ui->lineEdit_rfkill->setText(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectSudoPath()
|
||||||
|
{
|
||||||
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select sudo command"),
|
||||||
|
QString("/usr/bin/"),
|
||||||
|
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||||
|
if (!filename.isEmpty())
|
||||||
|
ui->lineEdit_sudo->setText(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectWpaCliPath()
|
||||||
|
{
|
||||||
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select wpa_cli command"),
|
||||||
|
QString("/usr/bin/"),
|
||||||
|
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||||
|
if (!filename.isEmpty())
|
||||||
|
ui->lineEdit_wpaCliPath->setText(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::selectWpaSupPath()
|
||||||
|
{
|
||||||
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
QApplication::translate("SettingsWindow", "Select wpa_supplicant command"),
|
||||||
|
QString("/usr/bin/"),
|
||||||
|
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||||
|
if (!filename.isEmpty())
|
||||||
|
ui->lineEdit_wpaSupPath->setText(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::showWindow()
|
||||||
|
{
|
||||||
|
setSettings(getSettings());
|
||||||
|
ui->label_info->hide();
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QMap<QString, QString> SettingsWindow::readSettings()
|
||||||
|
{
|
||||||
|
QMap<QString, QString> settings;
|
||||||
|
|
||||||
|
settings[QString("CTRL_DIR")] = ui->lineEdit_wpaDir->text();
|
||||||
|
settings[QString("CTRL_GROUP")] = ui->lineEdit_wpaGroup->text();
|
||||||
|
settings[QString("IFACE_DIR")] = ui->lineEdit_interfacesDir->text();
|
||||||
|
settings[QString("LANGUAGE")] = ui->comboBox_language->currentText();
|
||||||
|
settings[QString("NETCTL_PATH")] = ui->lineEdit_netctlPath->text();
|
||||||
|
settings[QString("PID_FILE")] = ui->lineEdit_pid->text();
|
||||||
|
settings[QString("PREFERED_IFACE")] = ui->lineEdit_interface->text();
|
||||||
|
settings[QString("PROFILE_DIR")] = ui->lineEdit_profilePath->text();
|
||||||
|
settings[QString("RFKILL_DIR")] = ui->lineEdit_rfkill->text();
|
||||||
|
settings[QString("SUDO_PATH")] = ui->lineEdit_sudo->text();
|
||||||
|
settings[QString("WPA_DRIVERS")] = ui->lineEdit_wpaSupDrivers->text();
|
||||||
|
settings[QString("WPACLI_PATH")] = ui->lineEdit_wpaCliPath->text();
|
||||||
|
settings[QString("WPASUP_PATH")] = ui->lineEdit_wpaSupPath->text();
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsWindow::setSettings(QMap<QString, QString> settings)
|
||||||
|
{
|
||||||
|
ui->lineEdit_wpaDir->setText(settings[QString("CTRL_DIR")]);
|
||||||
|
ui->lineEdit_wpaGroup->setText(settings[QString("CTRL_GROUP")]);
|
||||||
|
ui->lineEdit_interfacesDir->setText(settings[QString("IFACE_DIR")]);
|
||||||
|
ui->comboBox_language->setCurrentIndex(0);
|
||||||
|
for (int i=0; i<ui->comboBox_language->count(); i++)
|
||||||
|
if (ui->comboBox_language->itemText(i) == settings[QString("LANGUAGE")])
|
||||||
|
ui->comboBox_language->setCurrentIndex(i);
|
||||||
|
ui->lineEdit_netctlPath->setText(settings[QString("NETCTL_PATH")]);
|
||||||
|
ui->lineEdit_pid->setText(settings[QString("PID_FILE")]);
|
||||||
|
ui->lineEdit_interface->setText(settings[QString("PREFERED_IFACE")]);
|
||||||
|
ui->lineEdit_profilePath->setText(settings[QString("PROFILE_DIR")]);
|
||||||
|
ui->lineEdit_rfkill->setText(settings[QString("RFKILL_DIR")]);
|
||||||
|
ui->lineEdit_sudo->setText(settings[QString("SUDO_PATH")]);
|
||||||
|
ui->lineEdit_wpaSupDrivers->setText(settings[QString("WPA_DRIVERS")]);
|
||||||
|
ui->lineEdit_wpaCliPath->setText(settings[QString("WPACLI_PATH")]);
|
||||||
|
ui->lineEdit_wpaSupPath->setText(settings[QString("WPASUP_PATH")]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QMap<QString, QString> SettingsWindow::getDefault()
|
||||||
|
{
|
||||||
|
QMap<QString, QString> settings;
|
||||||
|
|
||||||
|
settings[QString("CTRL_DIR")] = QString("/run/wpa_supplicant_netctl-gui");
|
||||||
|
settings[QString("CTRL_GROUP")] = QString("users");
|
||||||
|
settings[QString("IFACE_DIR")] = QString("/sys/class/net/");
|
||||||
|
settings[QString("LANGUAGE")] = QString("english");
|
||||||
|
settings[QString("NETCTL_PATH")] = QString("/usr/bin/netctl");
|
||||||
|
settings[QString("PID_FILE")] = QString("/run/wpa_supplicant_netctl-gui.pid");
|
||||||
|
settings[QString("PREFERED_IFACE")] = QString("");
|
||||||
|
settings[QString("PROFILE_DIR")] = QString("/etc/netctl/");
|
||||||
|
settings[QString("RFKILL_DIR")] = QString("/sys/class/rfkill/");
|
||||||
|
settings[QString("SUDO_PATH")] = QString("/usr/bin/kdesu");
|
||||||
|
settings[QString("WPA_DRIVERS")] = QString("nl80211,wext");
|
||||||
|
settings[QString("WPACLI_PATH")] = QString("/usr/bin/wpa_cli");
|
||||||
|
settings[QString("WPASUP_PATH")] = QString("/usr/bin/wpa_supplicant");
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QMap<QString, QString> SettingsWindow::getSettings()
|
||||||
|
{
|
||||||
|
QMap<QString, QString> settings;
|
||||||
|
QFile configFile(file);
|
||||||
|
QString fileStr;
|
||||||
|
|
||||||
|
if (!configFile.open(QIODevice::ReadOnly))
|
||||||
|
return getDefault();
|
||||||
|
while (true) {
|
||||||
|
fileStr = QString(configFile.readLine());
|
||||||
|
if (configFile.atEnd())
|
||||||
|
break;
|
||||||
|
else if (fileStr[0] != '#') {
|
||||||
|
if (fileStr.indexOf(QString("=")) > -1)
|
||||||
|
settings[fileStr.split(QString("="))[0]] = fileStr.split(QString("="))[1]
|
||||||
|
.remove(QString(" "))
|
||||||
|
.trimmed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configFile.close();
|
||||||
|
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
@ -18,9 +18,13 @@
|
|||||||
#ifndef SETTINGSWINDOW_H
|
#ifndef SETTINGSWINDOW_H
|
||||||
#define SETTINGSWINDOW_H
|
#define SETTINGSWINDOW_H
|
||||||
|
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class SettingsWindow;
|
class SettingsWindow;
|
||||||
}
|
}
|
||||||
@ -30,11 +34,39 @@ class SettingsWindow : public QMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SettingsWindow(QWidget *parent = 0);
|
explicit SettingsWindow(MainWindow *wid = 0,
|
||||||
|
QString configFile = QString(""));
|
||||||
~SettingsWindow();
|
~SettingsWindow();
|
||||||
|
QMap<QString, QString> getDefault();
|
||||||
|
QMap<QString, QString> getSettings();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setDefault();
|
||||||
|
void showWindow();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void saveSettings();
|
||||||
|
// buttons
|
||||||
|
void selectIfaceDir();
|
||||||
|
void selectNetctlPath();
|
||||||
|
void selectProfileDir();
|
||||||
|
void selectRfkillDir();
|
||||||
|
void selectSudoPath();
|
||||||
|
void selectWpaCliPath();
|
||||||
|
void selectWpaSupPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
MainWindow *parent;
|
||||||
|
QString file;
|
||||||
Ui::SettingsWindow *ui;
|
Ui::SettingsWindow *ui;
|
||||||
|
QPushButton *cancelButton;
|
||||||
|
QPushButton *defaultButton;
|
||||||
|
QPushButton *okButton;
|
||||||
|
void createActions();
|
||||||
|
// ESC pressed event
|
||||||
|
void keyPressEvent(QKeyEvent *pressedKey);
|
||||||
|
QMap<QString, QString> readSettings();
|
||||||
|
void setSettings(QMap<QString, QString> settings);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -490,7 +490,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -43,7 +43,7 @@ void TunnelWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TunnelWidget::setShown(bool state)
|
void TunnelWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
@ -61,7 +61,7 @@ void TunnelWidget::createFilter()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString TunnelWidget::getIp(QString rawIp)
|
QString TunnelWidget::getIp(const QString rawIp)
|
||||||
{
|
{
|
||||||
QStringList ip = rawIp.split(QString("."));
|
QStringList ip = rawIp.split(QString("."));
|
||||||
|
|
||||||
|
@ -38,12 +38,12 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::TunnelWidget *ui;
|
Ui::TunnelWidget *ui;
|
||||||
void createFilter();
|
void createFilter();
|
||||||
QString getIp(QString rawIp);
|
QString getIp(const QString rawIp);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void TuntapWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TuntapWidget::setShown(bool state)
|
void TuntapWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::TuntapWidget *ui;
|
Ui::TuntapWidget *ui;
|
||||||
|
@ -40,7 +40,7 @@ void VlanWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VlanWidget::setShown(bool state)
|
void VlanWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::VlanWidget *ui;
|
Ui::VlanWidget *ui;
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
|
|
||||||
WirelessWidget::WirelessWidget(QWidget *parent, QString rfkillDir)
|
WirelessWidget::WirelessWidget(QWidget *parent, QMap<QString, QString> settings)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
rfkillDirectory(new QDir(rfkillDir)),
|
|
||||||
ui(new Ui::WirelessWidget)
|
ui(new Ui::WirelessWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
rfkillDirectory = new QDir(settings[QString("RFKILL_DIR")]);
|
||||||
createActions();
|
createActions();
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ void WirelessWidget::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WirelessWidget::setShown(bool state)
|
void WirelessWidget::setShown(const bool state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
show();
|
show();
|
||||||
@ -150,7 +150,7 @@ void WirelessWidget::addOption()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WirelessWidget::changeSecurity(QString currentText)
|
void WirelessWidget::changeSecurity(const QString currentText)
|
||||||
{
|
{
|
||||||
if (currentText == QString("none")) {
|
if (currentText == QString("none")) {
|
||||||
ui->widget_essid->setShown(true);
|
ui->widget_essid->setShown(true);
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define WIRELESSWIDGET_H
|
#define WIRELESSWIDGET_H
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMap>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ class WirelessWidget : public QWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WirelessWidget(QWidget *parent = 0,
|
explicit WirelessWidget(QWidget *parent = 0,
|
||||||
QString rfkillDir = QString(""));
|
QMap<QString, QString> settings = QMap<QString, QString>());
|
||||||
~WirelessWidget();
|
~WirelessWidget();
|
||||||
QMap<QString, QString> getSettings();
|
QMap<QString, QString> getSettings();
|
||||||
int isOk();
|
int isOk();
|
||||||
@ -40,13 +41,13 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setShown(bool state);
|
void setShown(const bool state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addDriver();
|
void addDriver();
|
||||||
void addFreq();
|
void addFreq();
|
||||||
void addOption();
|
void addOption();
|
||||||
void changeSecurity(QString currentText);
|
void changeSecurity(const QString currentText);
|
||||||
void showAdvanced();
|
void showAdvanced();
|
||||||
void selectWpaConfig();
|
void selectWpaConfig();
|
||||||
|
|
||||||
|
@ -24,15 +24,21 @@
|
|||||||
#include "sleepthread.h"
|
#include "sleepthread.h"
|
||||||
|
|
||||||
|
|
||||||
WpaSup::WpaSup(MainWindow *wid, QStringList wpaConfig, QString sudoPath, QString ifaceDir, QString preferedInterface)
|
WpaSup::WpaSup(MainWindow *wid, QMap<QString, QString> settings)
|
||||||
: parent(wid),
|
: parent(wid)
|
||||||
wpaConf(wpaConfig),
|
|
||||||
sudoCommand(sudoPath),
|
|
||||||
ifaceDirectory(new QDir(ifaceDir)),
|
|
||||||
mainInterface(preferedInterface)
|
|
||||||
{
|
{
|
||||||
|
ctrlDir = settings[QString("CTRL_DIR")];
|
||||||
|
ctrlGroup = settings[QString("CTRL_GROUP")];
|
||||||
|
ifaceDirectory = new QDir(settings[QString("IFACE_DIR")]);
|
||||||
|
mainInterface = settings[QString("PREFERED_IFACE")];
|
||||||
|
pidFile = settings[QString("PID_FILE")];
|
||||||
|
sudoCommand = settings[QString("SUDO_PATH")];
|
||||||
|
wpaCliPath = settings[QString("WPACLI_PATH")];
|
||||||
|
wpaDrivers = settings[QString("WPA_DRIVERS")];
|
||||||
|
wpaSupPath = settings[QString("WPASUP_PATH")];
|
||||||
|
|
||||||
// terminate old loaded profile
|
// terminate old loaded profile
|
||||||
if (QFile(wpaConf[2]).exists() || QDir(wpaConf[4]).exists())
|
if (QFile(pidFile).exists() || QDir(ctrlDir).exists())
|
||||||
stopWpaSupplicant();
|
stopWpaSupplicant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,12 +68,12 @@ QStringList WpaSup::getInterfaceList()
|
|||||||
|
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
bool WpaSup::wpaCliCall(QString commandLine)
|
bool WpaSup::wpaCliCall(const QString commandLine)
|
||||||
{
|
{
|
||||||
QString interface = getInterfaceList()[0];
|
QString interface = getInterfaceList()[0];
|
||||||
QProcess command;
|
QProcess command;
|
||||||
command.start(wpaConf[0] + QString(" -i ") + interface + QString(" -p ") + wpaConf[4] +
|
command.start(wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
|
||||||
QString(" -P ") + wpaConf[2] + QString(" ") + commandLine);
|
QString(" -P ") + pidFile + QString(" ") + commandLine);
|
||||||
command.waitForFinished(-1);
|
command.waitForFinished(-1);
|
||||||
SleepThread::sleep(1);
|
SleepThread::sleep(1);
|
||||||
if (command.exitCode() == 0)
|
if (command.exitCode() == 0)
|
||||||
@ -77,18 +83,18 @@ bool WpaSup::wpaCliCall(QString commandLine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString WpaSup::getWpaCliOutput(QString commandLine)
|
QString WpaSup::getWpaCliOutput(const QString commandLine)
|
||||||
{
|
{
|
||||||
QString interface = getInterfaceList()[0];
|
QString interface = getInterfaceList()[0];
|
||||||
QProcess command;
|
QProcess command;
|
||||||
command.start(wpaConf[0] + QString(" -i ") + interface + QString(" -p ") + wpaConf[4] +
|
command.start(wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
|
||||||
QString(" -P ") + wpaConf[2] + QString(" ") + commandLine);
|
QString(" -P ") + pidFile + QString(" ") + commandLine);
|
||||||
command.waitForFinished(-1);
|
command.waitForFinished(-1);
|
||||||
return command.readAllStandardOutput();
|
return command.readAllStandardOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WpaSup::isProfileActive(QString profile)
|
bool WpaSup::isProfileActive(const QString profile)
|
||||||
{
|
{
|
||||||
QString profileFile;
|
QString profileFile;
|
||||||
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
||||||
@ -99,7 +105,7 @@ bool WpaSup::isProfileActive(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WpaSup::isProfileExists(QString profile)
|
bool WpaSup::isProfileExists(const QString profile)
|
||||||
{
|
{
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
||||||
@ -110,7 +116,7 @@ bool WpaSup::isProfileExists(QString profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString WpaSup::existentProfile(QString profile)
|
QString WpaSup::existentProfile(const QString profile)
|
||||||
{
|
{
|
||||||
QString profileFile = QString("");
|
QString profileFile = QString("");
|
||||||
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
|
||||||
@ -123,12 +129,12 @@ QString WpaSup::existentProfile(QString profile)
|
|||||||
|
|
||||||
bool WpaSup::startWpaSupplicant()
|
bool WpaSup::startWpaSupplicant()
|
||||||
{
|
{
|
||||||
if (!QFile(wpaConf[2]).exists()) {
|
if (!QFile(pidFile).exists()) {
|
||||||
QString interface = getInterfaceList()[0];
|
QString interface = getInterfaceList()[0];
|
||||||
QProcess command;
|
QProcess command;
|
||||||
command.start(sudoCommand + QString(" ") + wpaConf[1] + QString(" -B -P ") + wpaConf[2] +
|
command.start(sudoCommand + QString(" ") + wpaSupPath + QString(" -B -P ") + pidFile +
|
||||||
QString(" -i ") + interface + QString(" -D ") + wpaConf[3] +
|
QString(" -i ") + interface + QString(" -D ") + wpaDrivers +
|
||||||
QString(" -C \"DIR=") + wpaConf[4] + QString(" GROUP=") + wpaConf[5]);
|
QString(" -C \"DIR=") + ctrlDir + QString(" GROUP=") + ctrlGroup);
|
||||||
command.waitForFinished(-1);
|
command.waitForFinished(-1);
|
||||||
SleepThread::sleep(1);
|
SleepThread::sleep(1);
|
||||||
if (command.exitCode() != 0)
|
if (command.exitCode() != 0)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define WPASUPINTERACT_H
|
#define WPASUPINTERACT_H
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMap>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
@ -30,19 +31,16 @@ class WpaSup : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WpaSup(MainWindow *wid = 0,
|
explicit WpaSup(MainWindow *wid = 0,
|
||||||
QStringList wpaConfig = QStringList(),
|
QMap<QString, QString> settings = QMap<QString, QString>());
|
||||||
QString sudoPath = QString(""),
|
|
||||||
QString ifaceDir = QString(""),
|
|
||||||
QString preferedInterface = QString(""));
|
|
||||||
~WpaSup();
|
~WpaSup();
|
||||||
// general information
|
// general information
|
||||||
QStringList getInterfaceList();
|
QStringList getInterfaceList();
|
||||||
// functions
|
// functions
|
||||||
bool wpaCliCall(QString commandLine);
|
bool wpaCliCall(const QString commandLine);
|
||||||
QString getWpaCliOutput(QString commandLine);
|
QString getWpaCliOutput(const QString commandLine);
|
||||||
bool isProfileExists(QString profile);
|
bool isProfileExists(const QString profile);
|
||||||
QString existentProfile(QString profile);
|
QString existentProfile(const QString profile);
|
||||||
bool isProfileActive(QString profile);
|
bool isProfileActive(const QString profile);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// functions
|
// functions
|
||||||
@ -52,10 +50,15 @@ public slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MainWindow *parent;
|
MainWindow *parent;
|
||||||
QStringList wpaConf;
|
QString ctrlDir;
|
||||||
QString sudoCommand;
|
QString ctrlGroup;
|
||||||
QDir *ifaceDirectory;
|
QDir *ifaceDirectory;
|
||||||
QString mainInterface;
|
QString mainInterface;
|
||||||
|
QString pidFile;
|
||||||
|
QString sudoCommand;
|
||||||
|
QString wpaCliPath;
|
||||||
|
QString wpaDrivers;
|
||||||
|
QString wpaSupPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user