added wirelesswidget

This commit is contained in:
arcan1s 2014-02-11 16:40:26 +04:00
parent ec27411b1d
commit 61bf2627cc
6 changed files with 670 additions and 5 deletions

View File

@ -29,6 +29,7 @@
#include "netctlprofile.h" #include "netctlprofile.h"
#include "passwdwidget.h" #include "passwdwidget.h"
#include "wpasupinteract.h" #include "wpasupinteract.h"
#include "wirelesswidget.h"
#include <cstdio> #include <cstdio>
@ -64,6 +65,8 @@ MainWindow::MainWindow(QWidget *parent)
ui->scrollAreaWidgetContents->layout()->addWidget(ipWid); ui->scrollAreaWidgetContents->layout()->addWidget(ipWid);
ethernetWid = new EthernetWidget(this); ethernetWid = new EthernetWidget(this);
ui->scrollAreaWidgetContents->layout()->addWidget(ethernetWid); ui->scrollAreaWidgetContents->layout()->addWidget(ethernetWid);
wirelessWid = new WirelessWidget(this);
ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid);
// backend // backend
netctlCommand = new Netctl(this, netctlPath, profileDir, sudoPath); netctlCommand = new Netctl(this, netctlPath, profileDir, sudoPath);
netctlProfile = new NetctlProfile(this, profileDir, sudoPath); netctlProfile = new NetctlProfile(this, profileDir, sudoPath);
@ -81,8 +84,9 @@ MainWindow::~MainWindow()
delete ipWid; delete ipWid;
delete netctlCommand; delete netctlCommand;
delete netctlProfile; delete netctlProfile;
delete wpaCommand;
delete ui; delete ui;
delete wpaCommand;
delete wirelessWid;
} }

View File

@ -31,6 +31,7 @@ class IpWidget;
class Netctl; class Netctl;
class NetctlProfile; class NetctlProfile;
class PasswdWidget; class PasswdWidget;
class WirelessWidget;
class WpaSup; class WpaSup;
namespace Ui { namespace Ui {
@ -81,6 +82,7 @@ private:
EthernetWidget *ethernetWid; EthernetWidget *ethernetWid;
GeneralWidget *generalWid; GeneralWidget *generalWid;
IpWidget *ipWid; IpWidget *ipWid;
WirelessWidget *wirelessWid;
// backend // backend
ErrorWindow *errorWin; ErrorWindow *errorWin;
PasswdWidget *passwdWid; PasswdWidget *passwdWid;

View File

@ -18,7 +18,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab_main"> <widget class="QWidget" name="tab_main">
<attribute name="title"> <attribute name="title">
@ -153,6 +153,33 @@
<string>Create a new profile</string> <string>Create a new profile</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="layout_profile">
<item>
<widget class="QLabel" name="label_profile">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Profile</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_profile"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_profile">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable"> <property name="widgetResizable">
@ -163,8 +190,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>429</width> <width>439</width>
<height>410</height> <height>357</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -283,6 +310,37 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="layout_newProfileButtons">
<item>
<widget class="QPushButton" name="pushButton_profileClear">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_newProfileButtons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_profileSave">
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menuBar"> <widget class="QMenuBar" name="menuBar">
@ -291,7 +349,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>471</width> <width>471</width>
<height>20</height> <height>23</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuMenu"> <widget class="QMenu" name="menuMenu">

View File

@ -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;
}

View File

@ -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 <QWidget>
namespace Ui {
class WirelessWidget;
}
class WirelessWidget : public QWidget
{
Q_OBJECT
public:
explicit WirelessWidget(QWidget *parent = 0);
~WirelessWidget();
private:
Ui::WirelessWidget *ui;
};
#endif /* WIRELESSWIDGET_H */

View File

@ -0,0 +1,527 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WirelessWidget</class>
<widget class="QWidget" name="WirelessWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>760</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QDockWidget" name="dockWidget_wireless">
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Wireless options</string>
</property>
<widget class="QWidget" name="dockWidgetContents_wireless">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="layout_security">
<item>
<widget class="QLabel" name="label_security">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Security</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_security">
<item>
<property name="text">
<string>none</string>
</property>
</item>
<item>
<property name="text">
<string>wep</string>
</property>
</item>
<item>
<property name="text">
<string>wpa</string>
</property>
</item>
<item>
<property name="text">
<string>wpa-configsection</string>
</property>
</item>
<item>
<property name="text">
<string>wpa-config</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_essid">
<item>
<widget class="QLabel" name="label_essid">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>ESSID</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_essid">
<property name="toolTip">
<string>The name of the network to connect to</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget_wpaConfigSection" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="layout_wpaConfigSection">
<item>
<widget class="QLabel" name="label_wpaConfigSection">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Wpa config section</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_wpaConfigSection"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_wpaConfigSection">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_wpaConfigSection">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="toolTip">
<string>Array of lines that form a network block for wpa_supplicant</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_wpaConfigFile" native="true">
<layout class="QHBoxLayout" name="layout_wpaConfigFile">
<item>
<widget class="QLabel" name="label_wpaConfigFile">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Wpa config file</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_wpaConfigFile">
<property name="toolTip">
<string>Path to a wpa_supplicant configuration file</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_key" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_key">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Key</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_key">
<property name="toolTip">
<string>The secret key to a WEP, or WPA encrypted network</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_hidden">
<property name="toolTip">
<string>Whether or not the specified network is a hidden network</string>
</property>
<property name="text">
<string>Hidden</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_adhoc">
<property name="toolTip">
<string>Whether or not to use ad-hoc mode</string>
</property>
<property name="text">
<string>Ad-hoc</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_wirelessAdvanced">
<item>
<spacer name="spacer_wirelessAdvanced">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_wirelessAdvanced">
<property name="text">
<string>Show advanced</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget_wirelessAdvanced" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="layout_freq">
<item>
<layout class="QHBoxLayout" name="layout_freqLine">
<item>
<widget class="QLabel" name="label_freq">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Scan frequencies</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_freq">
<property name="minimum">
<number>2000</number>
</property>
<property name="maximum">
<number>6000</number>
</property>
<property name="value">
<number>2412</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_freq">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_freq">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="toolTip">
<string>A space-separated list of frequencies in MHz to scan when searching for the network</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_priority">
<item>
<widget class="QLabel" name="label_priority">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Priority</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_priority">
<property name="toolTip">
<string>Priority group for the network</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_country">
<item>
<widget class="QLabel" name="label_country">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Country</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_country">
<property name="toolTip">
<string>The country for which frequency regulations will be enforced</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layourt_wpaGroup">
<item>
<widget class="QLabel" name="label_wpaGroup">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>WPA group</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_wpaGroup">
<property name="toolTip">
<string>Group that has the authority to configure wpa_supplicant via its control interface</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_drivers">
<item>
<layout class="QHBoxLayout" name="layout_driversLine">
<item>
<widget class="QLabel" name="label_drivers">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Drivers</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_drivers">
<item>
<property name="text">
<string>west</string>
</property>
</item>
<item>
<property name="text">
<string>nl80211</string>
</property>
</item>
<item>
<property name="text">
<string>wired</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_drivers">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_drivers">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="toolTip">
<string>The wpa_supplicant driver to use</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_rfkill">
<item>
<widget class="QLabel" name="label_rfkill">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>RFkill device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_rfkill">
<property name="toolTip">
<string>The name of an rfkill device</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_timeoutWpa">
<item>
<widget class="QLabel" name="label_timeoutWpa">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Timeout WPA</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_timeoutWpa">
<property name="toolTip">
<string>Maximum time, in seconds, to wait for steps in the association and authentication to succeed</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>15</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox_exclude">
<property name="toolTip">
<string>Whether or not to exclude this profile from automatic profile selection</string>
</property>
<property name="text">
<string>Exclude auto</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>comboBox_security</tabstop>
<tabstop>lineEdit_essid</tabstop>
<tabstop>lineEdit_wpaConfigSection</tabstop>
<tabstop>pushButton_wpaConfigSection</tabstop>
<tabstop>listWidget_wpaConfigSection</tabstop>
<tabstop>lineEdit_wpaConfigFile</tabstop>
<tabstop>lineEdit_key</tabstop>
<tabstop>checkBox_hidden</tabstop>
<tabstop>checkBox_adhoc</tabstop>
<tabstop>pushButton_wirelessAdvanced</tabstop>
<tabstop>spinBox_freq</tabstop>
<tabstop>pushButton_freq</tabstop>
<tabstop>listWidget_freq</tabstop>
<tabstop>spinBox_priority</tabstop>
<tabstop>lineEdit_country</tabstop>
<tabstop>lineEdit_wpaGroup</tabstop>
<tabstop>comboBox_drivers</tabstop>
<tabstop>pushButton_drivers</tabstop>
<tabstop>listWidget_drivers</tabstop>
<tabstop>comboBox_rfkill</tabstop>
<tabstop>spinBox_timeoutWpa</tabstop>
<tabstop>checkBox_exclude</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>