From 61bf2627ccf0eccfe8476b39c2eb0ffe7674ad45 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Tue, 11 Feb 2014 16:40:26 +0400 Subject: [PATCH] added wirelesswidget --- sources/gui/src/mainwindow.cpp | 6 +- sources/gui/src/mainwindow.h | 2 + sources/gui/src/mainwindow.ui | 66 +++- sources/gui/src/wirelesswidget.cpp | 33 ++ sources/gui/src/wirelesswidget.h | 41 +++ sources/gui/src/wirelesswidget.ui | 527 +++++++++++++++++++++++++++++ 6 files changed, 670 insertions(+), 5 deletions(-) create mode 100644 sources/gui/src/wirelesswidget.cpp create mode 100644 sources/gui/src/wirelesswidget.h create mode 100644 sources/gui/src/wirelesswidget.ui diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index 9fbbff1..40ad3c9 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -29,6 +29,7 @@ #include "netctlprofile.h" #include "passwdwidget.h" #include "wpasupinteract.h" +#include "wirelesswidget.h" #include @@ -64,6 +65,8 @@ MainWindow::MainWindow(QWidget *parent) ui->scrollAreaWidgetContents->layout()->addWidget(ipWid); ethernetWid = new EthernetWidget(this); ui->scrollAreaWidgetContents->layout()->addWidget(ethernetWid); + wirelessWid = new WirelessWidget(this); + ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid); // backend netctlCommand = new Netctl(this, netctlPath, profileDir, sudoPath); netctlProfile = new NetctlProfile(this, profileDir, sudoPath); @@ -81,8 +84,9 @@ MainWindow::~MainWindow() delete ipWid; delete netctlCommand; delete netctlProfile; - delete wpaCommand; delete ui; + delete wpaCommand; + delete wirelessWid; } diff --git a/sources/gui/src/mainwindow.h b/sources/gui/src/mainwindow.h index 200e044..b7feaac 100644 --- a/sources/gui/src/mainwindow.h +++ b/sources/gui/src/mainwindow.h @@ -31,6 +31,7 @@ class IpWidget; class Netctl; class NetctlProfile; class PasswdWidget; +class WirelessWidget; class WpaSup; namespace Ui { @@ -81,6 +82,7 @@ private: EthernetWidget *ethernetWid; GeneralWidget *generalWid; IpWidget *ipWid; + WirelessWidget *wirelessWid; // backend ErrorWindow *errorWin; PasswdWidget *passwdWid; diff --git a/sources/gui/src/mainwindow.ui b/sources/gui/src/mainwindow.ui index 57432e0..e7f69e7 100644 --- a/sources/gui/src/mainwindow.ui +++ b/sources/gui/src/mainwindow.ui @@ -18,7 +18,7 @@ - 1 + 0 @@ -153,6 +153,33 @@ Create a new profile + + + + + + + 150 + 0 + + + + Profile + + + + + + + + + + Browse + + + + + @@ -163,8 +190,8 @@ 0 0 - 429 - 410 + 439 + 357 @@ -283,6 +310,37 @@ + + + + + + Clear + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Save + + + + + @@ -291,7 +349,7 @@ 0 0 471 - 20 + 23 diff --git a/sources/gui/src/wirelesswidget.cpp b/sources/gui/src/wirelesswidget.cpp new file mode 100644 index 0000000..7655975 --- /dev/null +++ b/sources/gui/src/wirelesswidget.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * This file is part of netctl-plasmoid * + * * + * netctl-plasmoid is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * netctl-plasmoid is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with netctl-plasmoid. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "wirelesswidget.h" +#include "ui_wirelesswidget.h" + + +WirelessWidget::WirelessWidget(QWidget *parent) + : QWidget(parent), + ui(new Ui::WirelessWidget) +{ + ui->setupUi(this); +} + + +WirelessWidget::~WirelessWidget() +{ + delete ui; +} diff --git a/sources/gui/src/wirelesswidget.h b/sources/gui/src/wirelesswidget.h new file mode 100644 index 0000000..18696c4 --- /dev/null +++ b/sources/gui/src/wirelesswidget.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * This file is part of netctl-plasmoid * + * * + * netctl-plasmoid is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * netctl-plasmoid is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with netctl-plasmoid. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#ifndef WIRELESSWIDGET_H +#define WIRELESSWIDGET_H + +#include + + +namespace Ui { +class WirelessWidget; +} + +class WirelessWidget : public QWidget +{ + Q_OBJECT + +public: + explicit WirelessWidget(QWidget *parent = 0); + ~WirelessWidget(); + +private: + Ui::WirelessWidget *ui; +}; + + +#endif /* WIRELESSWIDGET_H */ diff --git a/sources/gui/src/wirelesswidget.ui b/sources/gui/src/wirelesswidget.ui new file mode 100644 index 0000000..455ef91 --- /dev/null +++ b/sources/gui/src/wirelesswidget.ui @@ -0,0 +1,527 @@ + + + WirelessWidget + + + + 0 + 0 + 431 + 760 + + + + Form + + + + + + QDockWidget::NoDockWidgetFeatures + + + Wireless options + + + + + + + + + + 150 + 0 + + + + Security + + + + + + + + none + + + + + wep + + + + + wpa + + + + + wpa-configsection + + + + + wpa-config + + + + + + + + + + + + + 150 + 0 + + + + ESSID + + + + + + + The name of the network to connect to + + + + + + + + + + + + + + + 150 + 0 + + + + Wpa config section + + + + + + + + + + Add + + + + + + + + + + 16777215 + 50 + + + + Array of lines that form a network block for wpa_supplicant + + + + + + + + + + + + + + 150 + 0 + + + + Wpa config file + + + + + + + Path to a wpa_supplicant configuration file + + + + + + + + + + + + + + 150 + 0 + + + + Key + + + + + + + The secret key to a WEP, or WPA encrypted network + + + + + + + + + + Whether or not the specified network is a hidden network + + + Hidden + + + + + + + Whether or not to use ad-hoc mode + + + Ad-hoc + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Show advanced + + + + + + + + + + + + + + + + + 150 + 0 + + + + Scan frequencies + + + + + + + 2000 + + + 6000 + + + 2412 + + + + + + + Add + + + + + + + + + + 16777215 + 50 + + + + A space-separated list of frequencies in MHz to scan when searching for the network + + + + + + + + + + + + 150 + 0 + + + + Priority + + + + + + + Priority group for the network + + + + + + + + + + + + 150 + 0 + + + + Country + + + + + + + The country for which frequency regulations will be enforced + + + + + + + + + + + + 150 + 0 + + + + WPA group + + + + + + + Group that has the authority to configure wpa_supplicant via its control interface + + + + + + + + + + + + + + 150 + 0 + + + + Drivers + + + + + + + + west + + + + + nl80211 + + + + + wired + + + + + + + + Add + + + + + + + + + + 16777215 + 50 + + + + The wpa_supplicant driver to use + + + + + + + + + + + + 150 + 0 + + + + RFkill device + + + + + + + The name of an rfkill device + + + + + + + + + + + + 150 + 0 + + + + Timeout WPA + + + + + + + Maximum time, in seconds, to wait for steps in the association and authentication to succeed + + + 999 + + + 15 + + + + + + + + + Whether or not to exclude this profile from automatic profile selection + + + Exclude auto + + + + + + + + + + + + + + comboBox_security + lineEdit_essid + lineEdit_wpaConfigSection + pushButton_wpaConfigSection + listWidget_wpaConfigSection + lineEdit_wpaConfigFile + lineEdit_key + checkBox_hidden + checkBox_adhoc + pushButton_wirelessAdvanced + spinBox_freq + pushButton_freq + listWidget_freq + spinBox_priority + lineEdit_country + lineEdit_wpaGroup + comboBox_drivers + pushButton_drivers + listWidget_drivers + comboBox_rfkill + spinBox_timeoutWpa + checkBox_exclude + + + +