diff --git a/sources/.kdev4/sources.kdev4 b/sources/.kdev4/sources.kdev4
index 587b19d..d7d83c5 100644
--- a/sources/.kdev4/sources.kdev4
+++ b/sources/.kdev4/sources.kdev4
@@ -8,7 +8,7 @@ ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/arcanis/Documents/github/netctl-gui/build
-Build Type=Debug
+Build Type=Release
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=
diff --git a/sources/gui/src/bridgewidget.ui b/sources/gui/src/bridgewidget.ui
index 25dfcdf..eff0381 100644
--- a/sources/gui/src/bridgewidget.ui
+++ b/sources/gui/src/bridgewidget.ui
@@ -7,13 +7,13 @@
0
0
550
- 76
+ 44
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
diff --git a/sources/gui/src/ethernetwidget.ui b/sources/gui/src/ethernetwidget.ui
index 10beec6..336fde4 100644
--- a/sources/gui/src/ethernetwidget.ui
+++ b/sources/gui/src/ethernetwidget.ui
@@ -7,13 +7,13 @@
0
0
550
- 275
+ 227
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
@@ -51,6 +54,9 @@
-
+
+ 0
+
-
-
@@ -117,6 +123,9 @@
-
+
+ 0
+
-
-
diff --git a/sources/gui/src/generalwidget.ui b/sources/gui/src/generalwidget.ui
index 36d6262..3d5d32f 100644
--- a/sources/gui/src/generalwidget.ui
+++ b/sources/gui/src/generalwidget.ui
@@ -7,13 +7,13 @@
0
0
550
- 492
+ 452
-
- Form
-
+
+ 0
+
-
@@ -30,6 +30,9 @@
+
+ 0
+
-
-
@@ -282,6 +285,9 @@
-
+
+ 0
+
-
-
diff --git a/sources/gui/src/ipwidget.ui b/sources/gui/src/ipwidget.ui
index 205a6c5..59d9152 100644
--- a/sources/gui/src/ipwidget.ui
+++ b/sources/gui/src/ipwidget.ui
@@ -7,13 +7,13 @@
0
0
550
- 1286
+ 1154
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
@@ -76,6 +79,9 @@
-
+
+ 0
+
-
-
@@ -238,6 +244,9 @@ Should be according to standards
-
+
+ 0
+
-
-
@@ -371,9 +380,15 @@ Should be according to standards
-
+
+ 0
+
-
+
+ 0
+
-
-
@@ -478,6 +493,9 @@ Should be according to standards
-
+
+ 0
+
-
-
@@ -717,6 +735,9 @@ Should be according to standards
-
+
+ 0
+
-
-
@@ -763,6 +784,9 @@ Should be according to standards
-
+
+ 0
+
-
@@ -798,6 +822,9 @@ Should be according to standards
-
+
+ 0
+
-
-
@@ -945,6 +972,9 @@ Should be according to standards
-
+
+ 0
+
-
-
diff --git a/sources/gui/src/macvlanwidget.ui b/sources/gui/src/macvlanwidget.ui
index 4aa9749..185fdc5 100644
--- a/sources/gui/src/macvlanwidget.ui
+++ b/sources/gui/src/macvlanwidget.ui
@@ -7,13 +7,13 @@
0
0
396
- 103
+ 79
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
diff --git a/sources/gui/src/main.cpp b/sources/gui/src/main.cpp
index f1e7ce7..7c8b500 100644
--- a/sources/gui/src/main.cpp
+++ b/sources/gui/src/main.cpp
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -130,6 +131,9 @@ int main(int argc, char *argv[])
args[QString("error")] = true;
}
}
+ QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
+ QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
+ if (!args[QString("debug")].toBool()) args[QString("debug")] = (debugEnv == QString("yes"));
if ((args[QString("debug")].toBool()) ||
(args[QString("help")].toBool()) ||
(args[QString("info")].toBool()) ||
@@ -143,6 +147,13 @@ int main(int argc, char *argv[])
if (args[QString("select")].toString() != QString("PROFILE"))
args[QString("tab")] = static_cast(1);
+ // check
+ QString robotEnv = environment.value(QString("SKYNET"), QString(""));
+ if (!robotEnv.isEmpty()) {
+ cout << "Sorry, this software is only for humans" << endl;
+ return 2;
+ }
+
// detach from console
if (args[QString("detached")].toBool())
daemon(0, 0);
diff --git a/sources/gui/src/mainwidget.cpp b/sources/gui/src/mainwidget.cpp
index 3c19386..66d5166 100644
--- a/sources/gui/src/mainwidget.cpp
+++ b/sources/gui/src/mainwidget.cpp
@@ -31,7 +31,7 @@
MainWidget::MainWidget(QWidget *parent, const QMap settings, const bool debugCmd)
- : QWidget(parent),
+ : QMainWindow(parent),
debug(debugCmd),
configuration(settings)
{
@@ -39,7 +39,6 @@ MainWidget::MainWidget(QWidget *parent, const QMap settings, c
useHelper = (configuration[QString("USE_HELPER")] == QString("true"));
createObjects();
- createToolBars();
createActions();
}
@@ -52,6 +51,20 @@ MainWidget::~MainWidget()
}
+bool MainWidget::mainTabSelectProfileSlot(const QString profile)
+{
+ if (debug) qDebug() << PDEBUG;
+ if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile;
+
+ for (int i=0; itableWidget_main->rowCount(); i++) {
+ if (ui->tableWidget_main->item(i, 0)->text() != profile) continue;
+ ui->tableWidget_main->setCurrentCell(i, 0);
+ }
+
+ return (ui->tableWidget_main->currentItem() != nullptr);
+}
+
+
void MainWidget::showNetctlAutoWindow()
{
if (debug) qDebug() << PDEBUG;
@@ -74,33 +87,32 @@ void MainWidget::updateMenuMain()
if (debug) qDebug() << PDEBUG;
bool selected = (ui->tableWidget_main->currentItem() != nullptr);
- toolBarActions[QString("mainStart")]->setVisible(selected);
- toolBarActions[QString("mainEnable")]->setVisible(selected);
- toolBarActions[QString("mainEdit")]->setVisible(selected);
- toolBarActions[QString("mainRemove")]->setVisible(selected);
- toolBarActions[QString("mainStopAll")]->setVisible(!mainTabGetActiveProfiles().isEmpty());
+ ui->actionStart->setEnabled(selected);
+ ui->actionEnable->setEnabled(selected);
+ ui->actionEdit->setEnabled(selected);
+ ui->actionRemove->setEnabled(selected);
if (selected && !ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 2)->text().isEmpty()) {
// visible
- toolBarActions[QString("mainRestart")]->setVisible(true);
- toolBarActions[QString("mainSwitch")]->setVisible(true);
+ ui->actionRestart->setEnabled(true);
+ ui->actionSwitch->setEnabled(false);
// text
- toolBarActions[QString("mainStart")]->setText(QApplication::translate("MainWidget", "Stop"));
- toolBarActions[QString("mainStart")]->setIcon(QIcon::fromTheme("process-stop"));
+ ui->actionStart->setText(QApplication::translate("MainWidget", "Stop"));
+ ui->actionStart->setIcon(QIcon::fromTheme("process-stop"));
} else {
// visible
- toolBarActions[QString("mainRestart")]->setVisible(false);
- toolBarActions[QString("mainSwitch")]->setVisible(false);
+ ui->actionRestart->setEnabled(false);
+ ui->actionSwitch->setEnabled(selected);
// text
- toolBarActions[QString("mainStart")]->setText(QApplication::translate("MainWidget", "Start"));
- toolBarActions[QString("mainStart")]->setIcon(QIcon::fromTheme("system-run"));
+ ui->actionStart->setText(QApplication::translate("MainWidget", "Start"));
+ ui->actionStart->setIcon(QIcon::fromTheme("system-run"));
}
if (selected && !ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 3)->text().isEmpty()) {
- toolBarActions[QString("mainEnable")]->setText(QApplication::translate("MainWidget", "Disable"));
- toolBarActions[QString("mainEnable")]->setIcon(QIcon::fromTheme("edit-remove"));
+ ui->actionEnable->setText(QApplication::translate("MainWidget", "Disable"));
+ ui->actionEnable->setIcon(QIcon::fromTheme("edit-remove"));
} else {
- toolBarActions[QString("mainEnable")]->setText(QApplication::translate("MainWidget", "Enable"));
- toolBarActions[QString("mainEnable")]->setIcon(QIcon::fromTheme("list-add"));
+ ui->actionEnable->setText(QApplication::translate("MainWidget", "Enable"));
+ ui->actionEnable->setIcon(QIcon::fromTheme("list-add"));
}
}
@@ -286,20 +298,6 @@ void MainWidget::mainTabEnableProfile()
}
-QStringList MainWidget::mainTabGetActiveProfiles()
-{
- if (debug) qDebug() << PDEBUG;
-
- QStringList profiles;
- for (int i=0; itableWidget_main->rowCount(); i++) {
- if (ui->tableWidget_main->item(i, 2)->text().isEmpty()) continue;
- profiles.append(ui->tableWidget_main->item(i, 0)->text());
- }
-
- return profiles;
-}
-
-
void MainWidget::mainTabRemoveProfile()
{
if (debug) qDebug() << PDEBUG;
@@ -411,6 +409,16 @@ void MainWidget::createActions()
{
if (debug) qDebug() << PDEBUG;
+ // menu actions
+ connect(ui->actionEnable, SIGNAL(triggered(bool)), this, SLOT(mainTabEnableProfile()));
+ connect(ui->actionEdit, SIGNAL(triggered(bool)), this, SLOT(mainTabEditProfile()));
+ connect(ui->actionNetctl_auto, SIGNAL(triggered(bool)), this, SLOT(showNetctlAutoWindow()));
+ connect(ui->actionRefresh, SIGNAL(triggered(bool)), this, SLOT(updateMainTab()));
+ connect(ui->actionRemove, SIGNAL(triggered(bool)), this, SLOT(mainTabRemoveProfile()));
+ connect(ui->actionRestart, SIGNAL(triggered(bool)), this, SLOT(mainTabRestartProfile()));
+ connect(ui->actionStart, SIGNAL(triggered(bool)), this, SLOT(mainTabStartProfile()));
+ connect(ui->actionStop_all, SIGNAL(triggered(bool)), this, SLOT(mainTabStopAllProfiles()));
+ connect(ui->actionSwitch, SIGNAL(triggered(bool)), this, SLOT(mainTabSwitchToProfile()));
// main tab events
connect(ui->pushButton_netctlAuto, SIGNAL(clicked(bool)), this, SLOT(showNetctlAutoWindow()));
connect(ui->tableWidget_main, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(mainTabStartProfile()));
@@ -433,52 +441,13 @@ void MainWidget::createObjects()
ui->tableWidget_main->setColumnHidden(2, true);
ui->tableWidget_main->setColumnHidden(3, true);
netctlAutoWin = new NetctlAutoWindow(this, debug, configuration);
-}
-
-void MainWidget::createToolBars()
-{
- if (debug) qDebug() << PDEBUG;
-
- actionToolBar = new QToolBar(this);
- actionToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
- toolBarActions[QString("netctlAuto")] = actionToolBar->addAction(QApplication::translate("MainWidget", "netctl-auto"),
- this, SLOT(showNetctlAutoWindow()));
- toolBarActions[QString("mainRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("view-refresh")),
- QApplication::translate("MainWidget", "Refresh"),
- this, SLOT(updateMainTab()));
-
- actionMenu = new QToolButton(this);
- actionMenu->setPopupMode(QToolButton::DelayedPopup);
- actionMenu->setToolButtonStyle(Qt::ToolButtonFollowStyle);
- QMenu *menu = new QMenu(actionMenu);
- toolBarActions[QString("mainStart")] = menu->addAction(QIcon::fromTheme(QString("system-run")),
- QApplication::translate("MainWidget", "Start"),
- this, SLOT(mainTabStartProfile()));
- toolBarActions[QString("mainSwitch")] = menu->addAction(QIcon::fromTheme(QString("system-run")),
- QApplication::translate("MainWidget", "Switch"),
- this, SLOT(mainTabSwitchToProfile()));
- toolBarActions[QString("mainRestart")] = menu->addAction(QIcon::fromTheme(QString("view-refresh")),
- QApplication::translate("MainWidget", "Restart"),
- this, SLOT(mainTabRestartProfile()));
- toolBarActions[QString("mainEnable")] = menu->addAction(QIcon::fromTheme(QString("list-add")),
- QApplication::translate("MainWidget", "Enable"),
- this, SLOT(mainTabEnableProfile()));
- toolBarActions[QString("mainStopAll")] = menu->addAction(QIcon::fromTheme(QString("process-stop")),
- QApplication::translate("MainWidget", "Stop all"),
- this, SLOT(mainTabStopAllProfiles()));
- actionMenu->setMenu(menu);
- actionToolBar->addWidget(actionMenu);
-
- toolBarActions[QString("mainEdit")] = actionToolBar->addAction(QIcon::fromTheme(QString("document-edit")),
- QApplication::translate("MainWidget", "Edit"),
- this, SLOT(mainTabEditProfile()));
- toolBarActions[QString("mainRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
- QApplication::translate("MainWidget", "Remove"),
- this, SLOT(mainTabRemoveProfile()));
-
- actionMenu->setDefaultAction(toolBarActions[QString("mainStart")]);
- ui->verticalLayout->insertWidget(0, actionToolBar);
+ // append toolbar
+ QMenu *actionMenu = new QMenu(this);
+ actionMenu->addAction(ui->actionSwitch);
+ actionMenu->addAction(ui->actionRestart);
+ actionMenu->addAction(ui->actionEnable);
+ ui->actionStart->setMenu(actionMenu);
}
@@ -490,13 +459,5 @@ void MainWidget::deleteObjects()
if (netctlProfile != nullptr) delete netctlProfile;
if (netctlAutoWin != nullptr) delete netctlAutoWin;
- if (actionMenu != nullptr) {
- actionMenu->menu()->clear();
- delete actionMenu;
- }
- if (actionToolBar != nullptr) {
- actionToolBar->clear();
- delete actionToolBar;
- }
if (ui != nullptr) delete ui;
}
diff --git a/sources/gui/src/mainwidget.h b/sources/gui/src/mainwidget.h
index 7c40e78..1a8cb48 100644
--- a/sources/gui/src/mainwidget.h
+++ b/sources/gui/src/mainwidget.h
@@ -18,10 +18,8 @@
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
+#include
#include
-#include
-#include
-#include
#include
@@ -33,7 +31,7 @@ namespace Ui {
class MainWidget;
}
-class MainWidget : public QWidget
+class MainWidget : public QMainWindow
{
Q_OBJECT
@@ -44,6 +42,7 @@ public:
~MainWidget();
public slots:
+ bool mainTabSelectProfileSlot(const QString profile);
void showNetctlAutoWindow();
void update();
@@ -55,7 +54,6 @@ private slots:
void mainTabContextualMenu(const QPoint &pos);
void mainTabEditProfile();
void mainTabEnableProfile();
- QStringList mainTabGetActiveProfiles();
void mainTabRemoveProfile();
void mainTabRestartProfile();
void mainTabStartProfile();
@@ -64,9 +62,6 @@ private slots:
private:
// ui
- QMap toolBarActions;
- QToolButton *actionMenu = nullptr;
- QToolBar *actionToolBar = nullptr;
MainWindow *mainWindow = nullptr;
Ui::MainWidget *ui = nullptr;
NetctlAutoWindow *netctlAutoWin = nullptr;
@@ -75,7 +70,6 @@ private:
NetctlProfile *netctlProfile = nullptr;
void createActions();
void createObjects();
- void createToolBars();
void deleteObjects();
QString configPath;
bool debug = false;
diff --git a/sources/gui/src/mainwidget.ui b/sources/gui/src/mainwidget.ui
index 286ef00..328cd8a 100644
--- a/sources/gui/src/mainwidget.ui
+++ b/sources/gui/src/mainwidget.ui
@@ -1,92 +1,229 @@
MainWidget
-
+
0
0
- 516
+ 515
477
-
- Form
-
-
-
-
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- netctl-auto is running
-
-
-
- -
-
-
- Show
-
-
-
-
-
-
- -
-
-
- Qt::CustomContextMenu
-
-
- QAbstractItemView::NoEditTriggers
-
-
- QAbstractItemView::SingleSelection
-
-
- QAbstractItemView::SelectRows
-
-
- true
-
-
- 4
-
-
- true
-
-
- false
-
-
-
- Name
+
+
+
+ 0
+
+
-
+
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ netctl-auto is running
+
+
+
+ -
+
+
+ Show
+
+
+
+
+
+
+ -
+
+
+ Qt::CustomContextMenu
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ QAbstractItemView::NoEditTriggers
-
-
-
- Description
+
+ QAbstractItemView::SingleSelection
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ QAbstractItemView::SelectRows
-
-
-
-
-
-
+
+ true
+
+
+ 4
+
+
+ true
+
+
+ false
+
+
+
+ Name
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+ Description
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+
+
+
+
+
+
+ Main actions toolbar
+
+
+ Qt::ToolButtonFollowStyle
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+ netctl-auto
+
+
+ Show netctl-auto window
+
+
+
+
+
+
+
+
+
+ Refresh
+
+
+ Refresh table
+
+
+ Ctrl+R
+
+
+
+
+
+
+
+
+
+ Start
+
+
+ Start or stop selected profile
+
+
+
+
+ Switch
+
+
+ Switch to selected profile
+
+
+
+
+
+
+
+
+
+ Restart
+
+
+ Restart selected profile
+
+
+
+
+
+
+
+
+
+ Enable
+
+
+ Enable or disable selected profile
+
+
+
+
+
+
+
+
+
+ Stop all
+
+
+ Stop all profiles
+
+
+
+
+
+
+
+
+
+ Edit
+
+
+ Edit selected profile
+
+
+
+
+
+
+
+
+
+ Remove
+
+
+ Remove selected profile
+
+
diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp
index 2fdf57a..cac20f0 100644
--- a/sources/gui/src/mainwindow.cpp
+++ b/sources/gui/src/mainwindow.cpp
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include
@@ -73,22 +74,15 @@ MainWindow::MainWindow(QWidget *parent,
updateConfiguration(args);
// main actions
-// if (args[QString("essid")].toString() != QString("ESSID")) {
-// for (int i=0; itableWidget_wifi->rowCount(); i++)
-// if (ui->tableWidget_wifi->item(i, 0)->text() == args[QString("essid")].toString())
-// ui->tableWidget_wifi->setCurrentCell(i, 0);
-// if (ui->tableWidget_wifi->currentItem() == nullptr)
-// ErrorWindow::showWindow(18, QString(PDEBUG), debug);
-// } else if (args[QString("open")].toString() != QString("PROFILE")) {
-// ui->comboBox_profile->addItem(args[QString("open")].toString());
-// ui->comboBox_profile->setCurrentIndex(ui->comboBox_profile->count()-1);
-// } else if (args[QString("select")].toString() != QString("PROFILE")) {
-// for (int i=0; itableWidget_main->rowCount(); i++)
-// if (ui->tableWidget_main->item(i, 0)->text() == args[QString("select")].toString())
-// ui->tableWidget_main->setCurrentCell(i, 0);
-// if (ui->tableWidget_main->currentItem() == nullptr)
-// ErrorWindow::showWindow(17, QString(PDEBUG), debug);
-// }
+ if (args[QString("essid")].toString() != QString("ESSID")) {
+ if (!wifiMenuWidget->wifiTabSelectEssidSlot(args[QString("essid")].toString()))
+ ErrorWindow::showWindow(18, QString(PDEBUG), debug);
+ } else if (args[QString("open")].toString() != QString("PROFILE")) {
+ newProfileWidget->profileTabOpenProfileSlot(args[QString("open")].toString());
+ } else if (args[QString("select")].toString() != QString("PROFILE")) {
+ if (!mainWidget->mainTabSelectProfileSlot(args[QString("select")].toString()))
+ ErrorWindow::showWindow(17, QString(PDEBUG), debug);
+ }
// show windows
if (args[QString("about")].toBool())
@@ -341,7 +335,7 @@ void MainWindow::openProfileSlot(const QString profile)
{
if (debug) qDebug() << PDEBUG;
- newProfileWidget->profileTabOpenProfile(profile);
+ newProfileWidget->profileTabOpenProfileSlot(profile);
}
@@ -687,8 +681,8 @@ void MainWindow::createActions()
{
if (debug) qDebug() << PDEBUG;
- connect(ui->actionConnect_to_profile, SIGNAL(triggered()), this, SLOT(setMainTab()));
- connect(ui->actionCreate_a_new_profile, SIGNAL(triggered()), this, SLOT(setProfileTab()));
+ connect(ui->actionNetctl, SIGNAL(triggered()), this, SLOT(setMainTab()));
+ connect(ui->actionProfiles, SIGNAL(triggered()), this, SLOT(setProfileTab()));
connect(ui->actionWiFi_menu, SIGNAL(triggered()), this, SLOT(setWifiTab()));
connect(ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(setTab(int)));
connect(this, SIGNAL(needToBeConfigured()), this, SLOT(showSettingsWindow()));
@@ -775,9 +769,9 @@ QMap MainWindow::parseOptions(const QString options)
QMap settings;
for (int i=0; i
-
+
+
+ 0
+
+
-
+
+
+ 0
+
+
-
+
+
+ 0
+
+
@@ -64,8 +76,8 @@
-
- false
+
+ Toolbar
Qt::ToolButtonFollowStyle
@@ -76,8 +88,8 @@
false
-
-
+
+
@@ -89,16 +101,25 @@
Security
+
+ Show security notes
+
DBus API
+
+ Show DBus API
+
Library
+
+ Show library docs
+
@@ -119,6 +140,9 @@
About
+
+ About this application
+
@@ -146,32 +170,37 @@
Ctrl+S
-
+
:/icon.png:/icon.png
- Connect to profile
-
-
- Ctrl+P
-
-
-
-
-
-
-
- Create a new profile
+ netctl control
- Create a new profile
+ netctl control
Ctrl+N
+
+
+
+
+
+
+
+ Profiles
+
+
+ Profiles
+
+
+ Ctrl+P
+
+
diff --git a/sources/gui/src/mobilewidget.ui b/sources/gui/src/mobilewidget.ui
index 19af3b6..195ee4c 100644
--- a/sources/gui/src/mobilewidget.ui
+++ b/sources/gui/src/mobilewidget.ui
@@ -7,13 +7,13 @@
0
0
445
- 350
+ 314
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
@@ -247,6 +250,9 @@
-
+
+ 0
+
-
-
diff --git a/sources/gui/src/netctlautowindow.cpp b/sources/gui/src/netctlautowindow.cpp
index f601ec1..e3e5d54 100644
--- a/sources/gui/src/netctlautowindow.cpp
+++ b/sources/gui/src/netctlautowindow.cpp
@@ -169,23 +169,19 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
enabled = netctlCommand->isNetctlAutoEnabled();
running = netctlCommand->isNetctlAutoRunning();
}
+ ui->actionDisableAll->setEnabled(running);
+ ui->actionEnableAll->setEnabled(running);
+ ui->actionRestartService->setEnabled(running);
if (enabled)
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Disable service"));
else
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Enable service"));
- ui->actionEnableService->setVisible(true);
if (running) {
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is running"));
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Stop service"));
- ui->actionDisableAll->setVisible(true);
- ui->actionEnableAll->setVisible(true);
- ui->actionRestartService->setVisible(true);
} else {
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is not running"));
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
- ui->actionDisableAll->setVisible(false);
- ui->actionEnableAll->setVisible(false);
- ui->actionRestartService->setVisible(false);
netctlAutoRefreshButtons(nullptr, nullptr);
return;
}
@@ -441,15 +437,10 @@ void NetctlAutoWindow::netctlAutoRefreshButtons(QTableWidgetItem *current, QTabl
Q_UNUSED(previous);
if (debug) qDebug() << PDEBUG;
- if (current == nullptr) {
- // menu
- ui->actionEnable->setEnabled(false);
- ui->actionSwitch->setEnabled(false);
- return;
- }
- ui->actionSwitch->setEnabled(ui->tableWidget->item(current->row(), 2)->text().isEmpty());
- ui->actionEnable->setEnabled(true);
- if (!ui->tableWidget->item(current->row(), 3)->text().isEmpty()) {
+ bool selected = (current != nullptr);
+ ui->actionEnable->setEnabled(selected);
+ 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", "Enable"));
ui->actionEnable->setIcon(QIcon::fromTheme("list-add"));
} else {
diff --git a/sources/gui/src/netctlautowindow.ui b/sources/gui/src/netctlautowindow.ui
index 11cd457..078822c 100644
--- a/sources/gui/src/netctlautowindow.ui
+++ b/sources/gui/src/netctlautowindow.ui
@@ -66,8 +66,8 @@
-
- false
+
+ Toolbar
Qt::ToolButtonFollowStyle
@@ -79,6 +79,7 @@
false
+
@@ -143,6 +144,9 @@
Start service
+
+ Start or stop service
+
@@ -153,6 +157,9 @@
Enable service
+
+ Enable or disable service
+
@@ -163,6 +170,9 @@
Refresh
+
+ Refresh table
+
Ctrl+R
@@ -176,6 +186,9 @@
Enable
+
+ Enable or disable profile
+
@@ -186,6 +199,9 @@
Switch
+
+ Switch to profile
+
diff --git a/sources/gui/src/newprofilewidget.cpp b/sources/gui/src/newprofilewidget.cpp
index 7c24dd5..19584ac 100644
--- a/sources/gui/src/newprofilewidget.cpp
+++ b/sources/gui/src/newprofilewidget.cpp
@@ -42,7 +42,7 @@
NewProfileWidget::NewProfileWidget(QWidget *parent, const QMap settings, const bool debugCmd)
- : QWidget(parent),
+ : QMainWindow(parent),
debug(debugCmd),
configuration(settings)
{
@@ -50,7 +50,6 @@ NewProfileWidget::NewProfileWidget(QWidget *parent, const QMap
useHelper = (configuration[QString("USE_HELPER")] == QString("true"));
createObjects();
- createToolBars();
createActions();
}
@@ -63,7 +62,7 @@ NewProfileWidget::~NewProfileWidget()
}
-void NewProfileWidget::profileTabOpenProfile(const QString profile)
+void NewProfileWidget::profileTabOpenProfileSlot(const QString profile)
{
if (debug) qDebug() << PDEBUG;
@@ -84,12 +83,11 @@ void NewProfileWidget::update()
void NewProfileWidget::updateMenuProfile()
{
if (debug) qDebug() << PDEBUG;
- actionMenu->setDefaultAction(toolBarActions[QString("profileSave")]);
bool selected = !ui->comboBox_profile->currentText().isEmpty();
- toolBarActions[QString("profileLoad")]->setVisible(selected);
- toolBarActions[QString("profileRemove")]->setVisible(selected);
- toolBarActions[QString("profileSave")]->setVisible(selected);
+ ui->actionLoad->setEnabled(selected);
+ ui->actionRemove->setEnabled(selected);
+ ui->actionSave->setEnabled(selected);
}
@@ -427,6 +425,11 @@ void NewProfileWidget::createActions()
{
if (debug) qDebug() << PDEBUG;
+ // menu actions
+ connect(ui->actionClear, SIGNAL(triggered(bool)), this, SLOT(profileTabClear()));
+ 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()));
// main tab events
connect(ui->comboBox_profile, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabLoadProfile()));
connect(ui->comboBox_profile, SIGNAL(editTextChanged(QString)), this, SLOT(updateMenuProfile()));
@@ -471,38 +474,6 @@ void NewProfileWidget::createObjects()
}
-void NewProfileWidget::createToolBars()
-{
- if (debug) qDebug() << PDEBUG;
-
- actionToolBar = new QToolBar(this);
- actionToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
- toolBarActions[QString("profileClear")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-clear")),
- QApplication::translate("NewProfileWidget", "Clear"),
- this, SLOT(profileTabClear()));
-
- actionMenu = new QToolButton(this);
- actionMenu->setPopupMode(QToolButton::DelayedPopup);
- actionMenu->setToolButtonStyle(Qt::ToolButtonFollowStyle);
- QMenu *menu = new QMenu(actionMenu);
- toolBarActions[QString("profileLoad")] = menu->addAction(QIcon::fromTheme(QString("document-open")),
- QApplication::translate("NewProfileWidget", "Load"),
- this, SLOT(profileTabLoadProfile()));
- toolBarActions[QString("profileSave")] = menu->addAction(QIcon::fromTheme(QString("document-save")),
- QApplication::translate("NewProfileWidget", "Save"),
- this, SLOT(profileTabCreateProfile()));
- actionMenu->setMenu(menu);
- actionToolBar->addWidget(actionMenu);
-
- toolBarActions[QString("profileRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
- QApplication::translate("NewProfileWidget", "Remove"),
- this, SLOT(profileTabRemoveProfile()));
-
- actionMenu->setDefaultAction(toolBarActions[QString("profileSave")]);
- ui->verticalLayout->insertWidget(0, actionToolBar);
-}
-
-
void NewProfileWidget::deleteObjects()
{
if (debug) qDebug() << PDEBUG;
@@ -522,13 +493,5 @@ void NewProfileWidget::deleteObjects()
if (vlanWid != nullptr) delete vlanWid;
if (wirelessWid != nullptr) delete wirelessWid;
- if (actionMenu != nullptr) {
- actionMenu->menu()->clear();
- delete actionMenu;
- }
- if (actionToolBar != nullptr) {
- actionToolBar->clear();
- delete actionToolBar;
- }
if (ui != nullptr) delete ui;
}
diff --git a/sources/gui/src/newprofilewidget.h b/sources/gui/src/newprofilewidget.h
index 8e180df..9f6617c 100644
--- a/sources/gui/src/newprofilewidget.h
+++ b/sources/gui/src/newprofilewidget.h
@@ -18,9 +18,7 @@
#ifndef NEWPROFILEWIDGET_H
#define NEWPROFILEWIDGET_H
-#include
-#include
-#include
+#include
#include
@@ -42,7 +40,7 @@ namespace Ui {
class NewProfileWidget;
}
-class NewProfileWidget : public QWidget
+class NewProfileWidget : public QMainWindow
{
Q_OBJECT
@@ -53,7 +51,7 @@ public:
~NewProfileWidget();
public slots:
- void profileTabOpenProfile(const QString profile);
+ void profileTabOpenProfileSlot(const QString profile);
void update();
private slots:
@@ -69,9 +67,6 @@ private slots:
private:
// ui
- QMap toolBarActions;
- QToolButton *actionMenu = nullptr;
- QToolBar *actionToolBar = nullptr;
MainWindow *mainWindow;
Ui::NewProfileWidget *ui = nullptr;
BridgeWidget *bridgeWid = nullptr;
@@ -90,7 +85,6 @@ private:
NetctlProfile *netctlProfile = nullptr;
void createActions();
void createObjects();
- void createToolBars();
void deleteObjects();
bool debug = false;
bool useHelper = true;
diff --git a/sources/gui/src/newprofilewidget.ui b/sources/gui/src/newprofilewidget.ui
index 032cddf..6114f87 100644
--- a/sources/gui/src/newprofilewidget.ui
+++ b/sources/gui/src/newprofilewidget.ui
@@ -1,80 +1,164 @@
NewProfileWidget
-
+
0
0
- 473
- 410
+ 472
+ 409
-
- Form
-
-
- -
-
-
-
-
+
+
+
+ 0
+
+
-
+
+
-
+
+
+
+ 1
+ 0
+
+
+
+ Profile
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 2
+ 0
+
+
+
+ true
+
+
+ true
+
+
+
+
+
+ -
+
+
+ Qt::ScrollBarAlwaysOn
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 461
+ 342
+
+
-
- 1
+
+ 0
0
-
- Profile
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
+
+
+ 0
+
+
-
- -
-
-
-
- 2
- 0
-
-
-
- true
-
-
- true
-
-
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 457
- 363
-
-
-
-
- 0
- 0
-
-
-
-
-
-
+
+
+
+
+
+ New profile toolbar
+
+
+ Qt::ToolButtonFollowStyle
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Clear
+
+
+ Clear data
+
+
+ Ctrl+R
+
+
+
+
+
+
+
+
+
+ Load
+
+
+ Load selected profile
+
+
+
+
+
+
+
+
+
+ Save
+
+
+ Save selected profile
+
+
+
+
+
+
+
+
+
+ Remove
+
+
+ Remove selected profile
+
+
diff --git a/sources/gui/src/passwdwidget.ui b/sources/gui/src/passwdwidget.ui
index 5a597c6..68562f9 100644
--- a/sources/gui/src/passwdwidget.ui
+++ b/sources/gui/src/passwdwidget.ui
@@ -16,9 +16,6 @@
0
-
- Form
-
-
diff --git a/sources/gui/src/pppoewidget.ui b/sources/gui/src/pppoewidget.ui
index 5392b36..eeffc09 100644
--- a/sources/gui/src/pppoewidget.ui
+++ b/sources/gui/src/pppoewidget.ui
@@ -10,9 +10,6 @@
561
-
- Form
-
-
diff --git a/sources/gui/src/tunnelwidget.ui b/sources/gui/src/tunnelwidget.ui
index 7f38aa2..3232a88 100644
--- a/sources/gui/src/tunnelwidget.ui
+++ b/sources/gui/src/tunnelwidget.ui
@@ -7,13 +7,13 @@
0
0
411
- 146
+ 108
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
diff --git a/sources/gui/src/tuntapwidget.ui b/sources/gui/src/tuntapwidget.ui
index 786a2ed..ff5a99d 100644
--- a/sources/gui/src/tuntapwidget.ui
+++ b/sources/gui/src/tuntapwidget.ui
@@ -7,13 +7,13 @@
0
0
424
- 146
+ 108
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
diff --git a/sources/gui/src/vlanwidget.ui b/sources/gui/src/vlanwidget.ui
index f385561..5f94bd1 100644
--- a/sources/gui/src/vlanwidget.ui
+++ b/sources/gui/src/vlanwidget.ui
@@ -7,13 +7,13 @@
0
0
393
- 81
+ 46
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
diff --git a/sources/gui/src/wifimenuwidget.cpp b/sources/gui/src/wifimenuwidget.cpp
index 420ce07..ac2f3df 100644
--- a/sources/gui/src/wifimenuwidget.cpp
+++ b/sources/gui/src/wifimenuwidget.cpp
@@ -31,7 +31,7 @@
WiFiMenuWidget::WiFiMenuWidget(QWidget *parent, const QMap settings, const bool debugCmd)
- : QWidget(parent),
+ : QMainWindow(parent),
debug(debugCmd),
configuration(settings)
{
@@ -39,7 +39,6 @@ WiFiMenuWidget::WiFiMenuWidget(QWidget *parent, const QMap set
useHelper = (configuration[QString("USE_HELPER")] == QString("true"));
createObjects();
- createToolBars();
createActions();
}
@@ -61,6 +60,19 @@ void WiFiMenuWidget::update()
}
+bool WiFiMenuWidget::wifiTabSelectEssidSlot(const QString essid)
+{
+ if (debug) qDebug() << PDEBUG;
+ if (debug) qDebug() << PDEBUG << ":" << "Essid" << essid;
+
+ for (int i=0; itableWidget_wifi->rowCount(); i++) {
+ if (ui->tableWidget_wifi->item(i, 0)->text() != essid) continue;
+ ui->tableWidget_wifi->setCurrentCell(i, 0);
+ }
+ return (ui->tableWidget_wifi->currentItem() != nullptr);
+}
+
+
void WiFiMenuWidget::connectToUnknownEssid(const QString passwd)
{
if (debug) qDebug() << PDEBUG;
@@ -155,13 +167,13 @@ void WiFiMenuWidget::updateMenuWifi()
if (debug) qDebug() << PDEBUG;
bool selected = (ui->tableWidget_wifi->currentItem() != nullptr);
- toolBarActions[QString("wifiStart")]->setVisible(selected);
+ ui->actionStart->setEnabled(selected);
if (selected && ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 5)->text().isEmpty()) {
- toolBarActions[QString("wifiStart")]->setText(QApplication::translate("WiFiMenuWidget", "Start"));
- toolBarActions[QString("wifiStart")]->setIcon(QIcon::fromTheme("system-run"));
+ ui->actionStart->setText(QApplication::translate("WiFiMenuWidget", "Start"));
+ ui->actionStart->setIcon(QIcon::fromTheme("system-run"));
} else {
- toolBarActions[QString("wifiStart")]->setText(QApplication::translate("WiFiMenuWidget", "Stop"));
- toolBarActions[QString("wifiStart")]->setIcon(QIcon::fromTheme("process-stop"));
+ ui->actionStart->setText(QApplication::translate("WiFiMenuWidget", "Stop"));
+ ui->actionStart->setIcon(QIcon::fromTheme("process-stop"));
}
}
@@ -394,6 +406,9 @@ void WiFiMenuWidget::createActions()
{
if (debug) qDebug() << PDEBUG;
+ // menu actions
+ connect(ui->actionRefresh, SIGNAL(triggered(bool)), this, SLOT(updateWifiTab()));
+ connect(ui->actionStart, SIGNAL(triggered(bool)), this, SLOT(wifiTabStart()));
// wifi tab events
connect(ui->tableWidget_wifi, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(wifiTabStart()));
connect(ui->tableWidget_wifi, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),
@@ -418,23 +433,6 @@ void WiFiMenuWidget::createObjects()
}
-void WiFiMenuWidget::createToolBars()
-{
- if (debug) qDebug() << PDEBUG;
-
- actionToolBar = new QToolBar(this);
- actionToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
- toolBarActions[QString("wifiRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("view-refresh")),
- QApplication::translate("WiFiMenuWidget", "Refresh"),
- this, SLOT(updateWifiTab()));
- toolBarActions[QString("wifiStart")] = actionToolBar->addAction(QIcon::fromTheme(QString("system-run")),
- QApplication::translate("WiFiMenuWidget", "Start"),
- this, SLOT(wifiTabStart()));
-
- ui->verticalLayout->insertWidget(0, actionToolBar);
-}
-
-
void WiFiMenuWidget::deleteObjects()
{
if (debug) qDebug() << PDEBUG;
@@ -443,9 +441,5 @@ void WiFiMenuWidget::deleteObjects()
if (netctlProfile != nullptr) delete netctlProfile;
if (wpaCommand != nullptr) delete wpaCommand;
- if (actionToolBar != nullptr) {
- actionToolBar->clear();
- delete actionToolBar;
- }
if (ui != nullptr) delete ui;
}
diff --git a/sources/gui/src/wifimenuwidget.h b/sources/gui/src/wifimenuwidget.h
index 8ee6ba6..7f08e69 100644
--- a/sources/gui/src/wifimenuwidget.h
+++ b/sources/gui/src/wifimenuwidget.h
@@ -19,9 +19,7 @@
#define WIFIMENUWIDGET_H
#include
-#include
-#include
-#include
+#include
#include
@@ -33,7 +31,7 @@ namespace Ui {
class WiFiMenuWidget;
}
-class WiFiMenuWidget : public QWidget
+class WiFiMenuWidget : public QMainWindow
{
Q_OBJECT
@@ -45,6 +43,7 @@ public:
public slots:
void update();
+ bool wifiTabSelectEssidSlot(const QString essid);
// wifi tab slots
void connectToUnknownEssid(const QString passwd);
void setHiddenName(const QString name);
@@ -60,8 +59,6 @@ private slots:
private:
// ui
- QMap toolBarActions;
- QToolBar *actionToolBar = nullptr;
MainWindow *mainWindow = nullptr;
Ui::WiFiMenuWidget *ui = nullptr;
PasswdWidget *passwdWid = nullptr;
@@ -71,7 +68,6 @@ private:
WpaSup *wpaCommand = nullptr;
void createActions();
void createObjects();
- void createToolBars();
void deleteObjects();
bool debug = false;
bool hiddenNetwork;
diff --git a/sources/gui/src/wifimenuwidget.ui b/sources/gui/src/wifimenuwidget.ui
index 86b75be..0116233 100644
--- a/sources/gui/src/wifimenuwidget.ui
+++ b/sources/gui/src/wifimenuwidget.ui
@@ -1,100 +1,148 @@
WiFiMenuWidget
-
+
0
0
- 571
+ 570
467
-
- Form
-
-
-
-
-
-
- Please install 'wpa_supplicant' before using it
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Qt::CustomContextMenu
-
-
- QAbstractItemView::NoEditTriggers
-
-
- QAbstractItemView::SingleSelection
-
-
- QAbstractItemView::SelectRows
-
-
- true
-
-
- 7
-
-
- true
-
-
- false
-
-
+
+
+
+ 0
+
+
-
+
- Name
+ Please install 'wpa_supplicant' before using it
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ Qt::AlignCenter
-
-
-
- Type
+
+
+ -
+
+
+ Qt::CustomContextMenu
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ QAbstractItemView::NoEditTriggers
-
-
-
- # of points
+
+ QAbstractItemView::SingleSelection
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ QAbstractItemView::SelectRows
-
-
-
- Signal
+
+ true
-
- AlignHCenter|AlignVCenter|AlignCenter
+
+ 7
-
-
-
- Security
-
-
- AlignHCenter|AlignVCenter|AlignCenter
-
-
-
-
-
-
-
+
+ true
+
+
+ false
+
+
+
+ Name
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+ Type
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+ # of points
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+ Signal
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+ Security
+
+
+ AlignHCenter|AlignVCenter|AlignCenter
+
+
+
+
+
+
+
+
+
+
+ WiFi menu toolbar
+
+
+ Qt::ToolButtonFollowStyle
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+ Refresh
+
+
+ Refresh table
+
+
+ Ctrl+R
+
+
+
+
+
+
+
+
+
+ Start
+
+
+ Connect or disconnect from selected ESSID
+
+
diff --git a/sources/gui/src/wirelesswidget.cpp b/sources/gui/src/wirelesswidget.cpp
index 45e4157..fe2a434 100644
--- a/sources/gui/src/wirelesswidget.cpp
+++ b/sources/gui/src/wirelesswidget.cpp
@@ -50,6 +50,7 @@ void WirelessWidget::clear()
ui->listWidget_wpaConfigSection->setCurrentRow(-1);
ui->listWidget_wpaConfigSection->clear();
ui->lineEdit_wpaConfig->setText(QString("/etc/wpa_supplicant/wpa_supplicant.conf"));
+ ui->checkBox_key->setCheckState(Qt::Unchecked);
ui->lineEdit_key->clear();
ui->checkBox_hidden->setCheckState(Qt::Unchecked);
ui->checkBox_adhoc->setCheckState(Qt::Unchecked);
@@ -93,6 +94,7 @@ void WirelessWidget::createActions()
connect(ui->lineEdit_wpaConfigSection, SIGNAL(returnPressed()), this, SLOT(addOption()));
connect(ui->pushButton_wpaConfig, SIGNAL(clicked(bool)), this, SLOT(selectWpaConfig()));
connect(ui->comboBox_security, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeSecurity(QString)));
+ connect(ui->checkBox_key, SIGNAL(stateChanged(int)), this, SLOT(setKeyEchoMode(int)));
}
@@ -157,6 +159,15 @@ void WirelessWidget::selectWpaConfig()
}
+void WirelessWidget::setKeyEchoMode(const int mode)
+{
+ if (mode == 0)
+ ui->lineEdit_key->setEchoMode(QLineEdit::Password);
+ else
+ ui->lineEdit_key->setEchoMode(QLineEdit::Normal);
+}
+
+
void WirelessWidget::showAdvanced()
{
if (ui->pushButton_wirelessAdvanced->isChecked()) {
diff --git a/sources/gui/src/wirelesswidget.h b/sources/gui/src/wirelesswidget.h
index 09ffcd6..08cdf5f 100644
--- a/sources/gui/src/wirelesswidget.h
+++ b/sources/gui/src/wirelesswidget.h
@@ -47,6 +47,7 @@ private slots:
void addFreq();
void addOption();
void changeSecurity(const QString currentText);
+ void setKeyEchoMode(const int mode);
void showAdvanced();
void selectWpaConfig();
diff --git a/sources/gui/src/wirelesswidget.ui b/sources/gui/src/wirelesswidget.ui
index da21e18..b387852 100644
--- a/sources/gui/src/wirelesswidget.ui
+++ b/sources/gui/src/wirelesswidget.ui
@@ -7,13 +7,13 @@
0
0
584
- 776
+ 697
-
- Form
-
+
+ 0
+
-
@@ -24,6 +24,9 @@
+
+ 0
+
-
-
@@ -82,6 +85,9 @@
-
+
+ 0
+
-
@@ -117,6 +123,9 @@
-
+
+ 0
+
-
-
@@ -179,6 +188,9 @@
-
+
+ 0
+
-
@@ -227,20 +239,23 @@
-
+
+ 0
+
-
-
+
-
+
1
0
+
+ Qt::RightToLeft
+
Key
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
@@ -254,6 +269,9 @@
The secret key to a WEP, or WPA encrypted network
+
+ QLineEdit::Password
+
@@ -292,6 +310,9 @@
-
+
+ 0
+
-
-
diff --git a/sources/helper/src/controladaptor.h b/sources/helper/src/controladaptor.h
index fabde9a..b6ac94b 100644
--- a/sources/helper/src/controladaptor.h
+++ b/sources/helper/src/controladaptor.h
@@ -70,7 +70,7 @@ public slots:
// wpaCommand
QString CurrentWiFi();
QStringList VerboseWiFi();
- QStringList WiFi();
+ Q_DECL_DEPRECATED QStringList WiFi();
private:
bool debug;
diff --git a/sources/helper/src/main.cpp b/sources/helper/src/main.cpp
index 6a1739b..412af8c 100644
--- a/sources/helper/src/main.cpp
+++ b/sources/helper/src/main.cpp
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -87,6 +88,9 @@ int main(int argc, char *argv[])
args[QString("error")] = true;
}
}
+ QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
+ QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
+ if (!args[QString("debug")].toBool()) args[QString("debug")] = (debugEnv == QString("yes"));
if ((args[QString("debug")].toBool()) ||
(args[QString("help")].toBool()) ||
(args[QString("info")].toBool()) ||
@@ -102,6 +106,13 @@ int main(int argc, char *argv[])
args[QString("session")] = true;
}
+ // check
+ QString robotEnv = environment.value(QString("SKYNET"), QString(""));
+ if (!robotEnv.isEmpty()) {
+ cout << "Sorry, this software is only for humans" << endl;
+ return 2;
+ }
+
#if QT_VERSION >= 0x050000
QCoreApplication::setSetuidAllowed(true);
#endif
diff --git a/sources/helper/src/netctladaptor.h b/sources/helper/src/netctladaptor.h
index 5fe3c93..67bcadd 100644
--- a/sources/helper/src/netctladaptor.h
+++ b/sources/helper/src/netctladaptor.h
@@ -49,7 +49,7 @@ public slots:
QString netctlActiveProfile();
QStringList netctlProfileList();
QStringList netctlVerboseProfileList();
- QStringList ProfileList();
+ Q_DECL_DEPRECATED QStringList ProfileList();
QStringList VerboseProfileList();
// netctlProfile
QStringList Profile(const QString profile);