First commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
.moc
|
||||
.obj
|
||||
.ui
|
||||
qrc_icons.cpp
|
||||
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* wpa_gui - AddInterface class
|
||||
* Copyright (c) 2008, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include "common/wpa_ctrl.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "wpagui.h"
|
||||
#include "addinterface.h"
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef WPA_KEY_ROOT
|
||||
#define WPA_KEY_ROOT HKEY_LOCAL_MACHINE
|
||||
#endif
|
||||
#ifndef WPA_KEY_PREFIX
|
||||
#define WPA_KEY_PREFIX TEXT("SOFTWARE\\wpa_supplicant")
|
||||
#endif
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
|
||||
AddInterface::AddInterface(WpaGui *_wpagui, QWidget *parent)
|
||||
: QDialog(parent), wpagui(_wpagui)
|
||||
{
|
||||
setWindowTitle(tr("Select network interface to add"));
|
||||
resize(400, 200);
|
||||
vboxLayout = new QVBoxLayout(this);
|
||||
|
||||
interfaceWidget = new QTreeWidget(this);
|
||||
interfaceWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
interfaceWidget->setUniformRowHeights(true);
|
||||
interfaceWidget->setSortingEnabled(true);
|
||||
interfaceWidget->setColumnCount(3);
|
||||
interfaceWidget->headerItem()->setText(0, tr("driver"));
|
||||
interfaceWidget->headerItem()->setText(1, tr("interface"));
|
||||
interfaceWidget->headerItem()->setText(2, tr("description"));
|
||||
interfaceWidget->setItemsExpandable(FALSE);
|
||||
interfaceWidget->setRootIsDecorated(FALSE);
|
||||
vboxLayout->addWidget(interfaceWidget);
|
||||
|
||||
connect(interfaceWidget,
|
||||
SIGNAL(itemActivated(QTreeWidgetItem *, int)), this,
|
||||
SLOT(interfaceSelected(QTreeWidgetItem *)));
|
||||
|
||||
addInterfaces();
|
||||
}
|
||||
|
||||
|
||||
void AddInterface::addInterfaces()
|
||||
{
|
||||
#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
struct wpa_ctrl *ctrl;
|
||||
int ret;
|
||||
char buf[2048];
|
||||
size_t len;
|
||||
|
||||
ctrl = wpa_ctrl_open(NULL);
|
||||
if (ctrl == NULL)
|
||||
return;
|
||||
|
||||
len = sizeof(buf) - 1;
|
||||
ret = wpa_ctrl_request(ctrl, "INTERFACE_LIST", 14, buf, &len, NULL);
|
||||
if (ret < 0) {
|
||||
wpa_ctrl_close(ctrl);
|
||||
return;
|
||||
}
|
||||
buf[len] = '\0';
|
||||
|
||||
wpa_ctrl_close(ctrl);
|
||||
|
||||
QString ifaces(buf);
|
||||
QStringList lines = ifaces.split(QRegExp("\\n"));
|
||||
for (QStringList::Iterator it = lines.begin();
|
||||
it != lines.end(); it++) {
|
||||
QStringList arg = (*it).split(QChar('\t'));
|
||||
if (arg.size() < 3)
|
||||
continue;
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(interfaceWidget);
|
||||
if (!item)
|
||||
break;
|
||||
|
||||
item->setText(0, arg[0]);
|
||||
item->setText(1, arg[1]);
|
||||
item->setText(2, arg[2]);
|
||||
}
|
||||
|
||||
interfaceWidget->resizeColumnToContents(0);
|
||||
interfaceWidget->resizeColumnToContents(1);
|
||||
interfaceWidget->resizeColumnToContents(2);
|
||||
#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
bool AddInterface::addRegistryInterface(const QString &ifname)
|
||||
{
|
||||
HKEY hk, ihk;
|
||||
LONG ret;
|
||||
int id, tmp;
|
||||
TCHAR name[10];
|
||||
DWORD val, i;
|
||||
|
||||
ret = RegOpenKeyEx(WPA_KEY_ROOT, WPA_KEY_PREFIX TEXT("\\interfaces"),
|
||||
0, KEY_ENUMERATE_SUB_KEYS | KEY_CREATE_SUB_KEY,
|
||||
&hk);
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return false;
|
||||
|
||||
id = -1;
|
||||
|
||||
for (i = 0; ; i++) {
|
||||
TCHAR name[255];
|
||||
DWORD namelen;
|
||||
|
||||
namelen = 255;
|
||||
ret = RegEnumKeyEx(hk, i, name, &namelen, NULL, NULL, NULL,
|
||||
NULL);
|
||||
|
||||
if (ret == ERROR_NO_MORE_ITEMS)
|
||||
break;
|
||||
|
||||
if (ret != ERROR_SUCCESS)
|
||||
break;
|
||||
|
||||
if (namelen >= 255)
|
||||
namelen = 255 - 1;
|
||||
name[namelen] = '\0';
|
||||
|
||||
#ifdef UNICODE
|
||||
QString s((QChar *) name, namelen);
|
||||
#else /* UNICODE */
|
||||
QString s(name);
|
||||
#endif /* UNICODE */
|
||||
tmp = s.toInt();
|
||||
if (tmp > id)
|
||||
id = tmp;
|
||||
}
|
||||
|
||||
id += 1;
|
||||
|
||||
#ifdef UNICODE
|
||||
wsprintf(name, L"%04d", id);
|
||||
#else /* UNICODE */
|
||||
os_snprintf(name, sizeof(name), "%04d", id);
|
||||
#endif /* UNICODE */
|
||||
ret = RegCreateKeyEx(hk, name, 0, NULL, 0, KEY_WRITE, NULL, &ihk,
|
||||
NULL);
|
||||
RegCloseKey(hk);
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return false;
|
||||
|
||||
#ifdef UNICODE
|
||||
RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ,
|
||||
(LPBYTE) ifname.unicode(),
|
||||
(ifname.length() + 1) * sizeof(TCHAR));
|
||||
|
||||
#else /* UNICODE */
|
||||
RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ,
|
||||
(LPBYTE) ifname.toLocal8Bit(), ifname.length() + 1);
|
||||
#endif /* UNICODE */
|
||||
RegSetValueEx(ihk, TEXT("config"), 0, REG_SZ,
|
||||
(LPBYTE) TEXT("default"), 8 * sizeof(TCHAR));
|
||||
RegSetValueEx(ihk, TEXT("ctrl_interface"), 0, REG_SZ,
|
||||
(LPBYTE) TEXT(""), 1 * sizeof(TCHAR));
|
||||
val = 1;
|
||||
RegSetValueEx(ihk, TEXT("skip_on_error"), 0, REG_DWORD, (LPBYTE) &val,
|
||||
sizeof(val));
|
||||
|
||||
RegCloseKey(ihk);
|
||||
return true;
|
||||
}
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
|
||||
void AddInterface::interfaceSelected(QTreeWidgetItem *sel)
|
||||
{
|
||||
if (!sel)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
struct wpa_ctrl *ctrl;
|
||||
int ret;
|
||||
char buf[20], cmd[256];
|
||||
size_t len;
|
||||
|
||||
/*
|
||||
* INTERFACE_ADD <ifname>TAB<confname>TAB<driver>TAB<ctrl_interface>TAB
|
||||
* <driver_param>TAB<bridge_name>
|
||||
*/
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"INTERFACE_ADD %s\t%s\t%s\t%s\t%s\t%s",
|
||||
sel->text(1).toAscii().constData(),
|
||||
"default",
|
||||
sel->text(0).toAscii().constData(),
|
||||
"yes", "", "");
|
||||
cmd[sizeof(cmd) - 1] = '\0';
|
||||
|
||||
ctrl = wpa_ctrl_open(NULL);
|
||||
if (ctrl == NULL)
|
||||
return;
|
||||
|
||||
len = sizeof(buf) - 1;
|
||||
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL);
|
||||
wpa_ctrl_close(ctrl);
|
||||
|
||||
if (ret < 0) {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Add interface command could not be "
|
||||
"completed."));
|
||||
return;
|
||||
}
|
||||
|
||||
buf[len] = '\0';
|
||||
if (buf[0] != 'O' || buf[1] != 'K') {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Failed to add the interface."));
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
if (!addRegistryInterface(sel->text(1))) {
|
||||
QMessageBox::information(this, "wpa_gui",
|
||||
tr("Failed to add the interface into "
|
||||
"registry."));
|
||||
}
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
wpagui->selectAdapter(sel->text(1));
|
||||
close();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* wpa_gui - AddInterface class
|
||||
* Copyright (c) 2008, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef ADDINTERFACE_H
|
||||
#define ADDINTERFACE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QTreeWidget>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
class WpaGui;
|
||||
|
||||
class AddInterface : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AddInterface(WpaGui *_wpagui, QWidget *parent = 0);
|
||||
|
||||
public slots:
|
||||
virtual void interfaceSelected(QTreeWidgetItem *sel);
|
||||
|
||||
private:
|
||||
void addInterfaces();
|
||||
bool addRegistryInterface(const QString &ifname);
|
||||
|
||||
QVBoxLayout *vboxLayout;
|
||||
QTreeWidget *interfaceWidget;
|
||||
WpaGui *wpagui;
|
||||
};
|
||||
|
||||
#endif /* ADDINTERFACE_H */
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* wpa_gui - EventHistory class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "eventhistory.h"
|
||||
|
||||
|
||||
int EventListModel::rowCount(const QModelIndex &) const
|
||||
{
|
||||
return msgList.count();
|
||||
}
|
||||
|
||||
|
||||
int EventListModel::columnCount(const QModelIndex &) const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
QVariant EventListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
if (index.column() == 0) {
|
||||
if (index.row() >= timeList.size())
|
||||
return QVariant();
|
||||
return timeList.at(index.row());
|
||||
} else {
|
||||
if (index.row() >= msgList.size())
|
||||
return QVariant();
|
||||
return msgList.at(index.row());
|
||||
}
|
||||
else
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
QVariant EventListModel::headerData(int section, Qt::Orientation orientation,
|
||||
int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
if (orientation == Qt::Horizontal) {
|
||||
switch (section) {
|
||||
case 0:
|
||||
return QString(tr("Timestamp"));
|
||||
case 1:
|
||||
return QString(tr("Message"));
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
} else
|
||||
return QString("%1").arg(section);
|
||||
}
|
||||
|
||||
|
||||
void EventListModel::addEvent(QString time, QString msg)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), msgList.size(), msgList.size() + 1);
|
||||
timeList << time;
|
||||
msgList << msg;
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
|
||||
EventHistory::EventHistory(QWidget *parent, const char *, bool, Qt::WFlags)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
|
||||
eventListView->setItemsExpandable(FALSE);
|
||||
eventListView->setRootIsDecorated(FALSE);
|
||||
elm = new EventListModel(parent);
|
||||
eventListView->setModel(elm);
|
||||
}
|
||||
|
||||
|
||||
EventHistory::~EventHistory()
|
||||
{
|
||||
destroy();
|
||||
delete elm;
|
||||
}
|
||||
|
||||
|
||||
void EventHistory::languageChange()
|
||||
{
|
||||
retranslateUi(this);
|
||||
}
|
||||
|
||||
|
||||
void EventHistory::addEvents(WpaMsgList msgs)
|
||||
{
|
||||
WpaMsgList::iterator it;
|
||||
for (it = msgs.begin(); it != msgs.end(); it++)
|
||||
addEvent(*it);
|
||||
}
|
||||
|
||||
|
||||
void EventHistory::addEvent(WpaMsg msg)
|
||||
{
|
||||
bool scroll = true;
|
||||
|
||||
if (eventListView->verticalScrollBar()->value() <
|
||||
eventListView->verticalScrollBar()->maximum())
|
||||
scroll = false;
|
||||
|
||||
elm->addEvent(msg.getTimestamp().toString("yyyy-MM-dd hh:mm:ss.zzz"),
|
||||
msg.getMsg());
|
||||
|
||||
if (scroll)
|
||||
eventListView->scrollToBottom();
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* wpa_gui - EventHistory class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef EVENTHISTORY_H
|
||||
#define EVENTHISTORY_H
|
||||
|
||||
#include <QObject>
|
||||
#include "ui_eventhistory.h"
|
||||
|
||||
|
||||
class EventListModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EventListModel(QObject *parent = 0)
|
||||
: QAbstractTableModel(parent) {}
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const;
|
||||
void addEvent(QString time, QString msg);
|
||||
|
||||
private:
|
||||
QStringList timeList;
|
||||
QStringList msgList;
|
||||
};
|
||||
|
||||
|
||||
class EventHistory : public QDialog, public Ui::EventHistory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EventHistory(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = false, Qt::WFlags fl = 0);
|
||||
~EventHistory();
|
||||
|
||||
public slots:
|
||||
virtual void addEvents(WpaMsgList msgs);
|
||||
virtual void addEvent(WpaMsg msg);
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
|
||||
private:
|
||||
EventListModel *elm;
|
||||
};
|
||||
|
||||
#endif /* EVENTHISTORY_H */
|
||||
@@ -0,0 +1,61 @@
|
||||
<ui version="4.0" >
|
||||
<class>EventHistory</class>
|
||||
<widget class="QDialog" name="EventHistory" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>533</width>
|
||||
<height>285</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Event history</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QTreeView" name="eventListView" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy" >
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="selectionMode" >
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="closeButton" >
|
||||
<property name="text" >
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<includes>
|
||||
<include location="local" >wpamsg.h</include>
|
||||
</includes>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,9 @@
|
||||
<RCC>
|
||||
<qresource prefix="/icons" >
|
||||
<file alias="wpa_gui.svg">icons/wpa_gui.svg</file>
|
||||
<file alias="ap.svg">icons/ap.svg</file>
|
||||
<file alias="laptop.svg">icons/laptop.svg</file>
|
||||
<file alias="group.svg">icons/group.svg</file>
|
||||
<file alias="invitation.svg">icons/invitation.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,74 @@
|
||||
wpa_gui icon files
|
||||
|
||||
To convert the svg icons to other formats, make sure inkscape and imagemagick
|
||||
are installed and use `make' to create various sized png and xpm icons.
|
||||
|
||||
|
||||
wpa_gui.svg
|
||||
-----------
|
||||
|
||||
Copyright (c) 2008 Bernard Gray <bernard.gray@gmail.com>
|
||||
|
||||
The wpa_gui icon is licensed under the GPL version 2. Alternatively, the icon
|
||||
may be distributed under the terms of BSD license.
|
||||
|
||||
|
||||
ap.svg
|
||||
------
|
||||
|
||||
mystica_Wireless_Router.svg
|
||||
|
||||
http://openclipart.org/media/files/mystica/8390
|
||||
Wireless Router
|
||||
by: mystica
|
||||
last change: April 20, 2008 10:32 pm (File added)
|
||||
date: April 20, 2008 10:31 pm
|
||||
license: PD
|
||||
|
||||
|
||||
laptop.svg
|
||||
----------
|
||||
|
||||
metalmarious_Laptop.svg
|
||||
|
||||
http://openclipart.org/media/files/metalmarious/4056
|
||||
Laptop
|
||||
by: metalmarious
|
||||
last change: May 18, 2008 07:04 pm (File added)
|
||||
date: August 27, 2007 04:44 am
|
||||
license: PD
|
||||
|
||||
|
||||
group.svg
|
||||
---------
|
||||
|
||||
http://www.openclipart.org/detail/25428
|
||||
http://www.openclipart.org/people/Anonymous/Anonymous_Network.svg
|
||||
Uploader:
|
||||
Anonymous
|
||||
Drawn by:
|
||||
Andrew Fitzsimon / Anonymous
|
||||
Created:
|
||||
2009-04-29 04:07:37
|
||||
Description:
|
||||
A network icon by Andrew Fitzsimon. Etiquette Icon set.
|
||||
From 0.18 OCAL database.
|
||||
|
||||
Public Domain
|
||||
|
||||
|
||||
|
||||
invitation.svg
|
||||
--------------
|
||||
|
||||
http://www.openclipart.org/detail/974
|
||||
http://www.openclipart.org/people/jean_victor_balin/jean_victor_balin_unknown_green.svg
|
||||
Uploader:
|
||||
jean_victor_balin
|
||||
Drawn by:
|
||||
jean_victor_balin
|
||||
Created:
|
||||
2006-10-27 02:12:13
|
||||
Description:
|
||||
|
||||
Public Domain
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 67 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,374 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64.000000px"
|
||||
height="64.000000px"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.42"
|
||||
sodipodi:docbase="G:\Projs\Cliparts Stocker\released"
|
||||
sodipodi:docname="unknown_green.svg"
|
||||
inkscape:export-filename="/datas/wiki/unknown_green.png"
|
||||
inkscape:export-xdpi="90.000000"
|
||||
inkscape:export-ydpi="90.000000">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2842"
|
||||
id="linearGradient1363"
|
||||
x1="25.403513"
|
||||
y1="19.175573"
|
||||
x2="35.541985"
|
||||
y2="49.068703"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-2.402975,4.759656e-3)" />
|
||||
<linearGradient
|
||||
id="linearGradient2900">
|
||||
<stop
|
||||
id="stop2902"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop2904"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2842">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop2844" />
|
||||
<stop
|
||||
style="stop-color:#c8c8c8;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop2846" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2814">
|
||||
<stop
|
||||
id="stop2816"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#e6e6e6;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop2818"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#11661d;stop-opacity:0.0000000;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2171">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop2173" />
|
||||
<stop
|
||||
style="stop-color:#a3a5ee;stop-opacity:0.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop2175" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2160">
|
||||
<stop
|
||||
id="stop2162"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#d3cece;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop2164"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#474240;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1367">
|
||||
<stop
|
||||
id="stop1369"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#f67e36;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop1371"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#602604;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1347">
|
||||
<stop
|
||||
style="stop-color:#f0da27;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop1349" />
|
||||
<stop
|
||||
style="stop-color:#bf4d09;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop1351" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1315">
|
||||
<stop
|
||||
style="stop-color:#97ff82;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop1317" />
|
||||
<stop
|
||||
style="stop-color:#ceff24;stop-opacity:0.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop1319" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2122">
|
||||
<stop
|
||||
style="stop-color:#2edc32;stop-opacity:1.0000000;"
|
||||
offset="0.0000000"
|
||||
id="stop2124" />
|
||||
<stop
|
||||
style="stop-color:#11661d;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop2126" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1364">
|
||||
<stop
|
||||
style="stop-color:#236b0d;stop-opacity:1.0000000;"
|
||||
offset="0.00000000"
|
||||
id="stop1366" />
|
||||
<stop
|
||||
style="stop-color:#0a2205;stop-opacity:1.0000000;"
|
||||
offset="1.0000000"
|
||||
id="stop1368" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1367"
|
||||
id="radialGradient1402"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.211118e-16,1.330643,-1.347411,2.027373e-5,44.09678,-13.39507)"
|
||||
cx="21.959658"
|
||||
cy="14.921703"
|
||||
fx="21.959658"
|
||||
fy="14.921703"
|
||||
r="27.500000" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2122"
|
||||
id="radialGradient1404"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.211118e-16,1.330643,-1.347411,2.027373e-5,44.09678,-13.39507)"
|
||||
cx="21.959658"
|
||||
cy="14.921703"
|
||||
fx="21.959658"
|
||||
fy="14.921703"
|
||||
r="27.500000" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1364"
|
||||
id="linearGradient1419"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="74.910713"
|
||||
y1="32.362179"
|
||||
x2="84.910713"
|
||||
y2="47.451466" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2122"
|
||||
id="linearGradient1421"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="73.839287"
|
||||
y1="34.428566"
|
||||
x2="76.875000"
|
||||
y2="43.714283" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1315"
|
||||
id="linearGradient1423"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="72.946426"
|
||||
y1="35.589287"
|
||||
x2="85.000000"
|
||||
y2="47.375000" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2171"
|
||||
id="linearGradient2177"
|
||||
x1="24.916031"
|
||||
y1="28.824427"
|
||||
x2="39.816792"
|
||||
y2="49.099239"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2122"
|
||||
id="radialGradient2184"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(9.909149e-17,1.088708,-1.102427,1.658760e-5,41.48828,-4.732338)"
|
||||
cx="21.959658"
|
||||
cy="14.921703"
|
||||
fx="21.959658"
|
||||
fy="14.921703"
|
||||
r="27.500000" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1364"
|
||||
id="linearGradient2189"
|
||||
x1="10.018247"
|
||||
y1="8.6306763"
|
||||
x2="63.487556"
|
||||
y2="63.660282"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2171"
|
||||
id="linearGradient1339"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="24.916031"
|
||||
y1="28.824427"
|
||||
x2="39.816792"
|
||||
y2="49.099239" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2122"
|
||||
id="radialGradient1343"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.521415e-2,1.026125,-0.978137,2.404729e-2,38.83024,-3.575704)"
|
||||
cx="24.764277"
|
||||
cy="16.361967"
|
||||
fx="24.764277"
|
||||
fy="16.361967"
|
||||
r="27.500000" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1364"
|
||||
id="linearGradient1346"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="10.018247"
|
||||
y1="8.6306763"
|
||||
x2="63.487556"
|
||||
y2="63.660282" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2814"
|
||||
id="radialGradient2812"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.142398e-2,1.098850,-1.843995,1.878760e-2,52.15051,-5.667446)"
|
||||
cx="18.387238"
|
||||
cy="14.046815"
|
||||
fx="18.387238"
|
||||
fy="14.046815"
|
||||
r="27.500000" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1364"
|
||||
id="linearGradient2832"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-2.841000e-3,-2.841000e-3)"
|
||||
x1="10.018247"
|
||||
y1="8.6306763"
|
||||
x2="63.487556"
|
||||
y2="63.660282" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2842"
|
||||
id="linearGradient2848"
|
||||
x1="-0.56685609"
|
||||
y1="22.651009"
|
||||
x2="-0.33713850"
|
||||
y2="23.858734"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2842"
|
||||
id="linearGradient2864"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-0.82287467"
|
||||
y1="22.444542"
|
||||
x2="-0.33713850"
|
||||
y2="23.858734" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8.2031250"
|
||||
inkscape:cx="32.000000"
|
||||
inkscape:cy="32.000000"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:grid-points="true"
|
||||
inkscape:window-width="1156"
|
||||
inkscape:window-height="693"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25"
|
||||
showguides="false" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Green Unknown</dc:title>
|
||||
<dc:date>2005-11-01</dc:date>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jean-Victor Balin</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:description>jean.victor.balin@gmail.com</dc:description>
|
||||
<cc:license
|
||||
rdf:resource="http://web.resource.org/cc/PublicDomain" />
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>icon</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://web.resource.org/cc/PublicDomain">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g1354">
|
||||
<path
|
||||
id="path1373"
|
||||
d="M 32.000000,8.6306766 C 19.113097,8.6306766 8.6306766,19.113097 8.6306766,32.000000 C 8.6306766,44.886903 19.113097,55.369323 32.000000,55.369323 C 44.886903,55.369323 55.369323,44.886903 55.369323,32.000000 C 55.369323,19.113097 44.886903,8.6306766 32.000000,8.6306766 z "
|
||||
style="fill:url(#linearGradient1346);fill-opacity:1.0000000;stroke:none;stroke-width:2.0000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
|
||||
<path
|
||||
id="path1339"
|
||||
d="M 54.500005,32.000000 C 54.500005,44.420003 44.420003,54.500005 32.000000,54.500005 C 19.579997,54.500005 9.4999950,44.420003 9.4999950,32.000000 C 9.4999950,19.579997 19.579997,9.4999950 32.000000,9.4999950 C 44.420003,9.4999950 54.500005,19.579997 54.500005,32.000000 z "
|
||||
style="fill:url(#radialGradient1343);fill-opacity:1.0000000;stroke:none;stroke-width:2.0000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
|
||||
<path
|
||||
id="path1341"
|
||||
d="M 32.016991,9.1562500 C 22.574792,9.1562500 14.505423,14.865048 11.062500,22.968750 C 16.006322,25.801817 21.393258,27.855853 27.181339,27.593750 C 32.755311,27.279922 37.553510,23.530916 43.236968,23.812500 C 47.451058,23.716455 52.244330,25.294372 54.488550,29.000000 C 53.142630,17.846718 43.657640,9.1562500 32.016991,9.1562500 z "
|
||||
style="fill:url(#radialGradient2812);fill-opacity:1.0000000;stroke:none;stroke-width:2.0000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
|
||||
<path
|
||||
id="path2827"
|
||||
d="M 32.000000,8.6250000 C 19.113098,8.6250000 8.6250000,19.113097 8.6250000,32.000000 C 8.6250000,44.886904 19.113097,55.375000 32.000000,55.375000 C 44.886904,55.375000 55.375000,44.886903 55.375000,32.000000 C 55.375000,19.113098 44.886903,8.6250000 32.000000,8.6250000 z M 32.000000,9.5000000 C 44.420004,9.4999998 54.500000,19.579997 54.500000,32.000000 C 54.499998,44.420004 44.420003,54.500000 32.000000,54.500000 C 19.579998,54.499998 9.5000000,44.420003 9.5000000,32.000000 C 9.5000000,19.579998 19.579997,9.5000000 32.000000,9.5000000 z "
|
||||
style="fill:url(#linearGradient2832);fill-opacity:1.0000000;stroke:none;stroke-width:2.0000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
|
||||
<path
|
||||
id="text1353"
|
||||
d="M 32.556888,39.006317 C 32.692760,35.835967 33.100380,35.066018 35.908404,32.892064 C 39.395790,30.219911 39.803410,29.902873 40.120445,29.631129 C 41.705621,28.272407 42.611437,26.189029 42.611437,24.015074 C 42.611437,19.078386 38.625844,15.953318 32.285143,15.953318 C 26.306768,15.953318 22.094721,18.851931 22.094721,23.018677 C 22.094721,25.464376 23.906354,27.230718 26.397344,27.230718 C 28.707171,27.230718 30.292350,25.736121 30.292350,23.607457 C 30.292350,22.384608 29.794150,21.388209 28.843045,20.663558 C 28.027812,20.029488 27.982521,19.984196 27.982521,19.667161 C 27.982521,19.033091 28.978919,18.534892 30.382931,18.534892 C 33.100374,18.534892 34.640263,20.346525 34.640263,23.516876 C 34.640263,25.373795 33.960900,27.683628 32.828632,29.721710 C 30.337643,34.160201 29.975314,35.066023 29.975314,37.104105 C 29.975314,37.557012 30.020605,38.281665 30.111187,39.006317 L 32.556888,39.006317 M 31.424619,41.497309 C 29.069501,41.497309 27.167287,43.399523 27.167287,45.754641 C 27.167287,48.064467 29.069501,50.011973 31.379328,50.011973 C 33.779736,50.011973 35.681951,48.109758 35.681951,45.754641 C 35.681951,43.399523 33.779736,41.497309 31.424619,41.497309"
|
||||
style="font-size:45.290764px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient1363);fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Century Schoolbook L" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 14 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 289 KiB |
@@ -0,0 +1,256 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.46"
|
||||
sodipodi:docname="wpa_gui.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
||||
<metadata
|
||||
id="metadata47">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
inkscape:window-height="771"
|
||||
inkscape:window-width="640"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
guidetolerance="10.0"
|
||||
gridtolerance="10.0"
|
||||
objecttolerance="10.0"
|
||||
borderopacity="1.0"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"
|
||||
id="base"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.2421875"
|
||||
inkscape:cx="64"
|
||||
inkscape:cy="64"
|
||||
inkscape:window-x="634"
|
||||
inkscape:window-y="0"
|
||||
inkscape:current-layer="svg2" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 64 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="128 : 64 : 1"
|
||||
inkscape:persp3d-origin="64 : 42.666667 : 1"
|
||||
id="perspective49" />
|
||||
<linearGradient
|
||||
id="linearGradient39133">
|
||||
<stop
|
||||
id="stop39135"
|
||||
style="stop-color:#252525;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39137"
|
||||
style="stop-color:#515151;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39139"
|
||||
style="stop-color:#878787;stop-opacity:1"
|
||||
offset="0.28677997" />
|
||||
<stop
|
||||
id="stop39141"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0.92151743" />
|
||||
<stop
|
||||
id="stop39143"
|
||||
style="stop-color:#ffffff;stop-opacity:0.73786408"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient39119">
|
||||
<stop
|
||||
id="stop39121"
|
||||
style="stop-color:#ffffff;stop-opacity:0.82905984"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39123"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient39106">
|
||||
<stop
|
||||
id="stop39108"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39110"
|
||||
style="stop-color:#a8a8a8;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient39094">
|
||||
<stop
|
||||
id="stop39096"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39098"
|
||||
style="stop-color:#333333;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient39062">
|
||||
<stop
|
||||
id="stop39064"
|
||||
style="stop-color:#252525;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop39086"
|
||||
style="stop-color:#515151;stop-opacity:1"
|
||||
offset="0.21101321" />
|
||||
<stop
|
||||
id="stop39088"
|
||||
style="stop-color:#878787;stop-opacity:1"
|
||||
offset="0.75" />
|
||||
<stop
|
||||
id="stop39090"
|
||||
style="stop-color:#6c6c6c;stop-opacity:1"
|
||||
offset="0.875" />
|
||||
<stop
|
||||
id="stop39066"
|
||||
style="stop-color:#1e1e1e;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="4"
|
||||
y1="40"
|
||||
x2="124"
|
||||
y2="60"
|
||||
id="linearGradient39068"
|
||||
xlink:href="#linearGradient39062"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
cx="100.70589"
|
||||
cy="96"
|
||||
r="60"
|
||||
fx="158.07428"
|
||||
fy="95.718063"
|
||||
id="radialGradient39100"
|
||||
xlink:href="#linearGradient39094"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.7837903e-8,-1,0.99999999,-2.1864248e-6,-32.000004,164.7061)" />
|
||||
<radialGradient
|
||||
cx="100.44444"
|
||||
cy="34.363636"
|
||||
r="32"
|
||||
fx="83.18"
|
||||
fy="34.228985"
|
||||
id="radialGradient39104"
|
||||
xlink:href="#linearGradient39106"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(3.1472435e-6,1.0227273,-0.87499999,-9.5061964e-8,94.067865,-4.7272712)" />
|
||||
<radialGradient
|
||||
cx="75.999977"
|
||||
cy="-2.7730541"
|
||||
r="48"
|
||||
fx="55.266491"
|
||||
fy="-2.5338216"
|
||||
id="radialGradient39125"
|
||||
xlink:href="#linearGradient39119"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0,0.83333324,-1.6666667,2.518705e-6,59.378243,-35.333302)" />
|
||||
<radialGradient
|
||||
cx="64.066589"
|
||||
cy="63.713329"
|
||||
r="60"
|
||||
fx="64.066589"
|
||||
fy="63.713329"
|
||||
id="radialGradient39131"
|
||||
xlink:href="#linearGradient39133"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.1333333,5.1768857e-8,5.2556881e-6,1.1666667,-8.6091298,-10.332226)" />
|
||||
<filter
|
||||
id="filter39153">
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur39155"
|
||||
stdDeviation="2.28"
|
||||
inkscape:collect="always" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter39159">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="1.68"
|
||||
id="feGaussianBlur39161" />
|
||||
</filter>
|
||||
</defs>
|
||||
<g
|
||||
id="layer1"
|
||||
style="display:inline">
|
||||
<path
|
||||
d="M 29,4 C 15.147058,4 4,15.14706 4,29 l 0,70 c 0,13.85294 11.147058,25 25,25 l 70,0 c 13.85294,0 25,-11.14706 25,-25 l 0,-70 C 124,15.14706 112.85294,4 99,4 L 29,4 z"
|
||||
id="path39151"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter39153)" />
|
||||
<path
|
||||
d="M 29,4 C 15.147058,4 4,15.14706 4,29 l 0,70 c 0,13.85294 11.147058,25 25,25 l 70,0 c 13.85294,0 25,-11.14706 25,-25 l 0,-70 C 124,15.14706 112.85294,4 99,4 L 29,4 z"
|
||||
id="path39157"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter39159)" />
|
||||
<rect
|
||||
width="120"
|
||||
height="120"
|
||||
ry="25.00531"
|
||||
x="4"
|
||||
y="0"
|
||||
id="rect2573"
|
||||
style="opacity:1;fill:url(#radialGradient39100);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 29,0 C 15.147058,0 4,11.14706 4,25 l 0,70 c 0,13.85294 11.147058,25 25,25 l 70,0 c 13.85294,0 25,-11.14706 25,-25 l 0,-70 C 124,11.14706 112.85294,0 99,0 L 29,0 z"
|
||||
id="path39127"
|
||||
style="opacity:0.20512821;fill:url(#radialGradient39131);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="m 44,68 40,0 12,40 c -20,7.27273 -44,7.27273 -64,0 L 44,68 z"
|
||||
id="path39102"
|
||||
style="opacity:0.53418801;fill:url(#radialGradient39104);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 25.339207,12 C 52,8 76,8 102.66079,12 107.83471,12 112,16.165286 112,21.339207 L 116,52 C 100,73.339207 28,73.339207 12,52 L 16,21.339207 C 16,16.165286 20.165286,12 25.339207,12 z"
|
||||
id="rect39116"
|
||||
style="opacity:0.92307691;fill:url(#radialGradient39125);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 29,8 C 15.147058,8 4,19.14706 4,33 l 0,70 c 0,13.85294 11.147058,25 25,25 l 70,0 c 13.85294,0 25,-11.14706 25,-25 l 0,-70 C 124,19.14706 112.85294,8 99,8 L 29,8 z"
|
||||
id="path39147"
|
||||
style="opacity:0.20512821;fill:#000000;fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 29,0 C 15.147058,0 4,11.147058 4,25 l 0,70 c 0,13.85294 11.147058,25 25,25 l 70,0 c 13.85294,0 25,-11.14706 25,-25 l 0,-70 C 124,11.147058 112.85294,0 99,0 L 29,0 z m 0,4 70,0 c 11.70613,0 21,9.293869 21,21 l 0,70 c 0,11.70613 -9.29387,21 -21,21 l -70,0 C 17.293869,116 8,106.70613 8,95 L 8,25 C 8,13.293869 17.293869,4 29,4 z"
|
||||
id="rect39029"
|
||||
style="opacity:1;fill:url(#linearGradient39068);fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 66.35081,74.771345 A 36,36 0 1 1 54.34964,35.777782"
|
||||
transform="matrix(-0.16680323,0.53082142,-0.53082142,-0.16680323,103.31027,53.117897)"
|
||||
id="path3351"
|
||||
style="opacity:1;fill:none;stroke:#ffffff;stroke-width:21.56673813;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
d="m 36,56 a 4,4 0 1 1 -8,0 4,4 0 1 1 8,0 z"
|
||||
transform="matrix(1.4851301,0,0,1.4851301,16.475837,-23.948973)"
|
||||
id="path3353"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
d="M 66.35081,74.771345 A 36,36 0 1 1 54.34964,35.777782"
|
||||
transform="matrix(-0.35033273,1.1148712,-1.1148712,-0.35033273,146.5624,46.88078)"
|
||||
id="path2622"
|
||||
style="opacity:1;fill:none;stroke:#ffffff;stroke-width:10.26852894;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.0 KiB |
@@ -0,0 +1,9 @@
|
||||
<RCC>
|
||||
<qresource prefix="/icons" >
|
||||
<file alias="wpa_gui.png">icons/hicolor/16x16/apps/wpa_gui.png</file>
|
||||
<file alias="ap.png">icons/hicolor/32x32/apps/ap.png</file>
|
||||
<file alias="laptop.png">icons/hicolor/32x32/apps/laptop.png</file>
|
||||
<file alias="group.png">icons/hicolor/32x32/apps/group.png</file>
|
||||
<file alias="invitation.png">icons/hicolor/32x32/apps/invitation.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1 @@
|
||||
*.qm
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* wpa_gui - Application startup
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
#include <winsock.h>
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
#include <QApplication>
|
||||
#include <QtCore/QLibraryInfo>
|
||||
#include <QtCore/QTranslator>
|
||||
#include "wpagui.h"
|
||||
|
||||
|
||||
class WpaGuiApp : public QApplication
|
||||
{
|
||||
public:
|
||||
WpaGuiApp(int &argc, char **argv);
|
||||
|
||||
#ifndef QT_NO_SESSIONMANAGER
|
||||
virtual void saveState(QSessionManager &manager);
|
||||
#endif
|
||||
|
||||
WpaGui *w;
|
||||
};
|
||||
|
||||
WpaGuiApp::WpaGuiApp(int &argc, char **argv) : QApplication(argc, argv)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef QT_NO_SESSIONMANAGER
|
||||
void WpaGuiApp::saveState(QSessionManager &manager)
|
||||
{
|
||||
QApplication::saveState(manager);
|
||||
w->saveState();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
WpaGuiApp app(argc, argv);
|
||||
QTranslator translator;
|
||||
QString locale;
|
||||
QString resourceDir;
|
||||
int ret;
|
||||
|
||||
locale = QLocale::system().name();
|
||||
resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
if (!translator.load("wpa_gui_" + locale, resourceDir))
|
||||
translator.load("wpa_gui_" + locale, "lang");
|
||||
app.installTranslator(&translator);
|
||||
|
||||
WpaGui w(&app);
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
WSADATA wsaData;
|
||||
if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
|
||||
/* printf("Could not find a usable WinSock.dll\n"); */
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
app.w = &w;
|
||||
|
||||
ret = app.exec();
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
WSACleanup();
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,858 @@
|
||||
/*
|
||||
* wpa_gui - NetworkConfig class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "networkconfig.h"
|
||||
#include "wpagui.h"
|
||||
|
||||
enum {
|
||||
AUTH_NONE_OPEN,
|
||||
AUTH_NONE_WEP,
|
||||
AUTH_NONE_WEP_SHARED,
|
||||
AUTH_IEEE8021X,
|
||||
AUTH_WPA_PSK,
|
||||
AUTH_WPA_EAP,
|
||||
AUTH_WPA2_PSK,
|
||||
AUTH_WPA2_EAP
|
||||
};
|
||||
|
||||
#define WPA_GUI_KEY_DATA "[key is configured]"
|
||||
|
||||
|
||||
NetworkConfig::NetworkConfig(QWidget *parent, const char *, bool, Qt::WFlags)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
encrSelect->setEnabled(false);
|
||||
connect(authSelect, SIGNAL(activated(int)), this,
|
||||
SLOT(authChanged(int)));
|
||||
connect(cancelButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(addButton, SIGNAL(clicked()), this, SLOT(addNetwork()));
|
||||
connect(encrSelect, SIGNAL(activated(const QString &)), this,
|
||||
SLOT(encrChanged(const QString &)));
|
||||
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeNetwork()));
|
||||
connect(eapSelect, SIGNAL(activated(int)), this,
|
||||
SLOT(eapChanged(int)));
|
||||
connect(useWpsButton, SIGNAL(clicked()), this, SLOT(useWps()));
|
||||
|
||||
wpagui = NULL;
|
||||
new_network = false;
|
||||
}
|
||||
|
||||
|
||||
NetworkConfig::~NetworkConfig()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::languageChange()
|
||||
{
|
||||
retranslateUi(this);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::paramsFromScanResults(QTreeWidgetItem *sel)
|
||||
{
|
||||
new_network = true;
|
||||
|
||||
/* SSID BSSID frequency signal flags */
|
||||
setWindowTitle(sel->text(0));
|
||||
ssidEdit->setText(sel->text(0));
|
||||
|
||||
QString flags = sel->text(4);
|
||||
int auth, encr = 0;
|
||||
if (flags.indexOf("[WPA2-EAP") >= 0)
|
||||
auth = AUTH_WPA2_EAP;
|
||||
else if (flags.indexOf("[WPA-EAP") >= 0)
|
||||
auth = AUTH_WPA_EAP;
|
||||
else if (flags.indexOf("[WPA2-PSK") >= 0)
|
||||
auth = AUTH_WPA2_PSK;
|
||||
else if (flags.indexOf("[WPA-PSK") >= 0)
|
||||
auth = AUTH_WPA_PSK;
|
||||
else
|
||||
auth = AUTH_NONE_OPEN;
|
||||
|
||||
if (flags.indexOf("-CCMP") >= 0)
|
||||
encr = 1;
|
||||
else if (flags.indexOf("-TKIP") >= 0)
|
||||
encr = 0;
|
||||
else if (flags.indexOf("WEP") >= 0) {
|
||||
encr = 1;
|
||||
if (auth == AUTH_NONE_OPEN)
|
||||
auth = AUTH_NONE_WEP;
|
||||
} else
|
||||
encr = 0;
|
||||
|
||||
authSelect->setCurrentIndex(auth);
|
||||
authChanged(auth);
|
||||
encrSelect->setCurrentIndex(encr);
|
||||
|
||||
wepEnabled(auth == AUTH_NONE_WEP);
|
||||
|
||||
getEapCapa();
|
||||
|
||||
if (flags.indexOf("[WPS") >= 0)
|
||||
useWpsButton->setEnabled(true);
|
||||
bssid = sel->text(1);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::authChanged(int sel)
|
||||
{
|
||||
encrSelect->setEnabled(sel != AUTH_NONE_OPEN && sel != AUTH_NONE_WEP &&
|
||||
sel != AUTH_NONE_WEP_SHARED);
|
||||
pskEdit->setEnabled(sel == AUTH_WPA_PSK || sel == AUTH_WPA2_PSK);
|
||||
bool eap = sel == AUTH_IEEE8021X || sel == AUTH_WPA_EAP ||
|
||||
sel == AUTH_WPA2_EAP;
|
||||
eapSelect->setEnabled(eap);
|
||||
identityEdit->setEnabled(eap);
|
||||
passwordEdit->setEnabled(eap);
|
||||
cacertEdit->setEnabled(eap);
|
||||
phase2Select->setEnabled(eap);
|
||||
if (eap)
|
||||
eapChanged(eapSelect->currentIndex());
|
||||
|
||||
while (encrSelect->count())
|
||||
encrSelect->removeItem(0);
|
||||
|
||||
if (sel == AUTH_NONE_OPEN || sel == AUTH_NONE_WEP ||
|
||||
sel == AUTH_NONE_WEP_SHARED || sel == AUTH_IEEE8021X) {
|
||||
encrSelect->addItem("None");
|
||||
encrSelect->addItem("WEP");
|
||||
encrSelect->setCurrentIndex(sel == AUTH_NONE_OPEN ? 0 : 1);
|
||||
} else {
|
||||
encrSelect->addItem("TKIP");
|
||||
encrSelect->addItem("CCMP");
|
||||
encrSelect->setCurrentIndex((sel == AUTH_WPA2_PSK ||
|
||||
sel == AUTH_WPA2_EAP) ? 1 : 0);
|
||||
}
|
||||
|
||||
wepEnabled(sel == AUTH_NONE_WEP || sel == AUTH_NONE_WEP_SHARED);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::eapChanged(int sel)
|
||||
{
|
||||
QString prev_val = phase2Select->currentText();
|
||||
while (phase2Select->count())
|
||||
phase2Select->removeItem(0);
|
||||
|
||||
QStringList inner;
|
||||
inner << "PEAP" << "TTLS" << "FAST";
|
||||
if (!inner.contains(eapSelect->itemText(sel)))
|
||||
return;
|
||||
|
||||
phase2Select->addItem("[ any ]");
|
||||
|
||||
/* Add special cases based on outer method */
|
||||
if (eapSelect->currentText().compare("TTLS") == 0) {
|
||||
phase2Select->addItem("PAP");
|
||||
phase2Select->addItem("CHAP");
|
||||
phase2Select->addItem("MSCHAP");
|
||||
phase2Select->addItem("MSCHAPv2");
|
||||
} else if (eapSelect->currentText().compare("FAST") == 0)
|
||||
phase2Select->addItem("GTC(auth) + MSCHAPv2(prov)");
|
||||
|
||||
/* Add all enabled EAP methods that can be used in the tunnel */
|
||||
int i;
|
||||
QStringList allowed;
|
||||
allowed << "MSCHAPV2" << "MD5" << "GTC" << "TLS" << "OTP" << "SIM"
|
||||
<< "AKA";
|
||||
for (i = 0; i < eapSelect->count(); i++) {
|
||||
if (allowed.contains(eapSelect->itemText(i))) {
|
||||
phase2Select->addItem("EAP-" + eapSelect->itemText(i));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < phase2Select->count(); i++) {
|
||||
if (phase2Select->itemText(i).compare(prev_val) == 0) {
|
||||
phase2Select->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::addNetwork()
|
||||
{
|
||||
char reply[10], cmd[256];
|
||||
size_t reply_len;
|
||||
int id;
|
||||
int psklen = pskEdit->text().length();
|
||||
int auth = authSelect->currentIndex();
|
||||
|
||||
if (auth == AUTH_WPA_PSK || auth == AUTH_WPA2_PSK) {
|
||||
if (psklen < 8 || psklen > 64) {
|
||||
QMessageBox::warning(
|
||||
this,
|
||||
tr("WPA Pre-Shared Key Error"),
|
||||
tr("WPA-PSK requires a passphrase of 8 to 63 "
|
||||
"characters\n"
|
||||
"or 64 hex digit PSK"));
|
||||
pskEdit->setFocus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (idstrEdit->isEnabled() && !idstrEdit->text().isEmpty()) {
|
||||
QRegExp rx("^(\\w|-)+$");
|
||||
if (rx.indexIn(idstrEdit->text()) < 0) {
|
||||
QMessageBox::warning(
|
||||
this, tr("Network ID Error"),
|
||||
tr("Network ID String contains non-word "
|
||||
"characters.\n"
|
||||
"It must be a simple string, "
|
||||
"without spaces, containing\n"
|
||||
"only characters in this range: "
|
||||
"[A-Za-z0-9_-]\n"));
|
||||
idstrEdit->setFocus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (wpagui == NULL)
|
||||
return;
|
||||
|
||||
memset(reply, 0, sizeof(reply));
|
||||
reply_len = sizeof(reply) - 1;
|
||||
|
||||
if (new_network) {
|
||||
wpagui->ctrlRequest("ADD_NETWORK", reply, &reply_len);
|
||||
if (reply[0] == 'F') {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Failed to add "
|
||||
"network to wpa_supplicant\n"
|
||||
"configuration."));
|
||||
return;
|
||||
}
|
||||
id = atoi(reply);
|
||||
} else
|
||||
id = edit_network_id;
|
||||
|
||||
setNetworkParam(id, "ssid", ssidEdit->text().toAscii().constData(),
|
||||
true);
|
||||
|
||||
const char *key_mgmt = NULL, *proto = NULL, *pairwise = NULL;
|
||||
switch (auth) {
|
||||
case AUTH_NONE_OPEN:
|
||||
case AUTH_NONE_WEP:
|
||||
case AUTH_NONE_WEP_SHARED:
|
||||
key_mgmt = "NONE";
|
||||
break;
|
||||
case AUTH_IEEE8021X:
|
||||
key_mgmt = "IEEE8021X";
|
||||
break;
|
||||
case AUTH_WPA_PSK:
|
||||
key_mgmt = "WPA-PSK";
|
||||
proto = "WPA";
|
||||
break;
|
||||
case AUTH_WPA_EAP:
|
||||
key_mgmt = "WPA-EAP";
|
||||
proto = "WPA";
|
||||
break;
|
||||
case AUTH_WPA2_PSK:
|
||||
key_mgmt = "WPA-PSK";
|
||||
proto = "WPA2";
|
||||
break;
|
||||
case AUTH_WPA2_EAP:
|
||||
key_mgmt = "WPA-EAP";
|
||||
proto = "WPA2";
|
||||
break;
|
||||
}
|
||||
|
||||
if (auth == AUTH_NONE_WEP_SHARED)
|
||||
setNetworkParam(id, "auth_alg", "SHARED", false);
|
||||
else
|
||||
setNetworkParam(id, "auth_alg", "OPEN", false);
|
||||
|
||||
if (auth == AUTH_WPA_PSK || auth == AUTH_WPA_EAP ||
|
||||
auth == AUTH_WPA2_PSK || auth == AUTH_WPA2_EAP) {
|
||||
int encr = encrSelect->currentIndex();
|
||||
if (encr == 0)
|
||||
pairwise = "TKIP";
|
||||
else
|
||||
pairwise = "CCMP";
|
||||
}
|
||||
|
||||
if (proto)
|
||||
setNetworkParam(id, "proto", proto, false);
|
||||
if (key_mgmt)
|
||||
setNetworkParam(id, "key_mgmt", key_mgmt, false);
|
||||
if (pairwise) {
|
||||
setNetworkParam(id, "pairwise", pairwise, false);
|
||||
setNetworkParam(id, "group", "TKIP CCMP WEP104 WEP40", false);
|
||||
}
|
||||
if (pskEdit->isEnabled() &&
|
||||
strcmp(pskEdit->text().toAscii().constData(),
|
||||
WPA_GUI_KEY_DATA) != 0)
|
||||
setNetworkParam(id, "psk",
|
||||
pskEdit->text().toAscii().constData(),
|
||||
psklen != 64);
|
||||
if (eapSelect->isEnabled()) {
|
||||
const char *eap =
|
||||
eapSelect->currentText().toAscii().constData();
|
||||
setNetworkParam(id, "eap", eap, false);
|
||||
if (strcmp(eap, "SIM") == 0 || strcmp(eap, "AKA") == 0)
|
||||
setNetworkParam(id, "pcsc", "", true);
|
||||
else
|
||||
setNetworkParam(id, "pcsc", "NULL", false);
|
||||
}
|
||||
if (phase2Select->isEnabled()) {
|
||||
QString eap = eapSelect->currentText();
|
||||
QString inner = phase2Select->currentText();
|
||||
char phase2[32];
|
||||
phase2[0] = '\0';
|
||||
if (eap.compare("PEAP") == 0) {
|
||||
if (inner.startsWith("EAP-"))
|
||||
snprintf(phase2, sizeof(phase2), "auth=%s",
|
||||
inner.right(inner.size() - 4).
|
||||
toAscii().constData());
|
||||
} else if (eap.compare("TTLS") == 0) {
|
||||
if (inner.startsWith("EAP-"))
|
||||
snprintf(phase2, sizeof(phase2), "autheap=%s",
|
||||
inner.right(inner.size() - 4).
|
||||
toAscii().constData());
|
||||
else
|
||||
snprintf(phase2, sizeof(phase2), "auth=%s",
|
||||
inner.toAscii().constData());
|
||||
} else if (eap.compare("FAST") == 0) {
|
||||
const char *provisioning = NULL;
|
||||
if (inner.startsWith("EAP-")) {
|
||||
snprintf(phase2, sizeof(phase2), "auth=%s",
|
||||
inner.right(inner.size() - 4).
|
||||
toAscii().constData());
|
||||
provisioning = "fast_provisioning=2";
|
||||
} else if (inner.compare("GTC(auth) + MSCHAPv2(prov)")
|
||||
== 0) {
|
||||
snprintf(phase2, sizeof(phase2),
|
||||
"auth=GTC auth=MSCHAPV2");
|
||||
provisioning = "fast_provisioning=1";
|
||||
} else
|
||||
provisioning = "fast_provisioning=3";
|
||||
if (provisioning) {
|
||||
char blob[32];
|
||||
setNetworkParam(id, "phase1", provisioning,
|
||||
true);
|
||||
snprintf(blob, sizeof(blob),
|
||||
"blob://fast-pac-%d", id);
|
||||
setNetworkParam(id, "pac_file", blob, true);
|
||||
}
|
||||
}
|
||||
if (phase2[0])
|
||||
setNetworkParam(id, "phase2", phase2, true);
|
||||
else
|
||||
setNetworkParam(id, "phase2", "NULL", false);
|
||||
} else
|
||||
setNetworkParam(id, "phase2", "NULL", false);
|
||||
if (identityEdit->isEnabled() && identityEdit->text().length() > 0)
|
||||
setNetworkParam(id, "identity",
|
||||
identityEdit->text().toAscii().constData(),
|
||||
true);
|
||||
else
|
||||
setNetworkParam(id, "identity", "NULL", false);
|
||||
if (passwordEdit->isEnabled() && passwordEdit->text().length() > 0 &&
|
||||
strcmp(passwordEdit->text().toAscii().constData(),
|
||||
WPA_GUI_KEY_DATA) != 0)
|
||||
setNetworkParam(id, "password",
|
||||
passwordEdit->text().toAscii().constData(),
|
||||
true);
|
||||
else if (passwordEdit->text().length() == 0)
|
||||
setNetworkParam(id, "password", "NULL", false);
|
||||
if (cacertEdit->isEnabled() && cacertEdit->text().length() > 0)
|
||||
setNetworkParam(id, "ca_cert",
|
||||
cacertEdit->text().toAscii().constData(),
|
||||
true);
|
||||
else
|
||||
setNetworkParam(id, "ca_cert", "NULL", false);
|
||||
writeWepKey(id, wep0Edit, 0);
|
||||
writeWepKey(id, wep1Edit, 1);
|
||||
writeWepKey(id, wep2Edit, 2);
|
||||
writeWepKey(id, wep3Edit, 3);
|
||||
|
||||
if (wep0Radio->isEnabled() && wep0Radio->isChecked())
|
||||
setNetworkParam(id, "wep_tx_keyidx", "0", false);
|
||||
else if (wep1Radio->isEnabled() && wep1Radio->isChecked())
|
||||
setNetworkParam(id, "wep_tx_keyidx", "1", false);
|
||||
else if (wep2Radio->isEnabled() && wep2Radio->isChecked())
|
||||
setNetworkParam(id, "wep_tx_keyidx", "2", false);
|
||||
else if (wep3Radio->isEnabled() && wep3Radio->isChecked())
|
||||
setNetworkParam(id, "wep_tx_keyidx", "3", false);
|
||||
|
||||
if (idstrEdit->isEnabled() && idstrEdit->text().length() > 0)
|
||||
setNetworkParam(id, "id_str",
|
||||
idstrEdit->text().toAscii().constData(),
|
||||
true);
|
||||
else
|
||||
setNetworkParam(id, "id_str", "NULL", false);
|
||||
|
||||
if (prioritySpinBox->isEnabled()) {
|
||||
QString prio;
|
||||
prio = prio.setNum(prioritySpinBox->value());
|
||||
setNetworkParam(id, "priority", prio.toAscii().constData(),
|
||||
false);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %d", id);
|
||||
reply_len = sizeof(reply);
|
||||
wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
if (strncmp(reply, "OK", 2) != 0) {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Failed to enable "
|
||||
"network in wpa_supplicant\n"
|
||||
"configuration."));
|
||||
/* Network was added, so continue anyway */
|
||||
}
|
||||
wpagui->triggerUpdate();
|
||||
wpagui->ctrlRequest("SAVE_CONFIG", reply, &reply_len);
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::setWpaGui(WpaGui *_wpagui)
|
||||
{
|
||||
wpagui = _wpagui;
|
||||
}
|
||||
|
||||
|
||||
int NetworkConfig::setNetworkParam(int id, const char *field,
|
||||
const char *value, bool quote)
|
||||
{
|
||||
char reply[10], cmd[256];
|
||||
size_t reply_len;
|
||||
snprintf(cmd, sizeof(cmd), "SET_NETWORK %d %s %s%s%s",
|
||||
id, field, quote ? "\"" : "", value, quote ? "\"" : "");
|
||||
reply_len = sizeof(reply);
|
||||
wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
return strncmp(reply, "OK", 2) == 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::encrChanged(const QString &)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::wepEnabled(bool enabled)
|
||||
{
|
||||
wep0Edit->setEnabled(enabled);
|
||||
wep1Edit->setEnabled(enabled);
|
||||
wep2Edit->setEnabled(enabled);
|
||||
wep3Edit->setEnabled(enabled);
|
||||
wep0Radio->setEnabled(enabled);
|
||||
wep1Radio->setEnabled(enabled);
|
||||
wep2Radio->setEnabled(enabled);
|
||||
wep3Radio->setEnabled(enabled);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::writeWepKey(int network_id, QLineEdit *edit, int id)
|
||||
{
|
||||
char buf[10];
|
||||
bool hex;
|
||||
const char *txt, *pos;
|
||||
size_t len;
|
||||
|
||||
if (!edit->isEnabled() || edit->text().isEmpty())
|
||||
return;
|
||||
|
||||
/*
|
||||
* Assume hex key if only hex characters are present and length matches
|
||||
* with 40, 104, or 128-bit key
|
||||
*/
|
||||
txt = edit->text().toAscii().constData();
|
||||
if (strcmp(txt, WPA_GUI_KEY_DATA) == 0)
|
||||
return;
|
||||
len = strlen(txt);
|
||||
if (len == 0)
|
||||
return;
|
||||
pos = txt;
|
||||
hex = true;
|
||||
while (*pos) {
|
||||
if (!((*pos >= '0' && *pos <= '9') ||
|
||||
(*pos >= 'a' && *pos <= 'f') ||
|
||||
(*pos >= 'A' && *pos <= 'F'))) {
|
||||
hex = false;
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
if (hex && len != 10 && len != 26 && len != 32)
|
||||
hex = false;
|
||||
snprintf(buf, sizeof(buf), "wep_key%d", id);
|
||||
setNetworkParam(network_id, buf, txt, !hex);
|
||||
}
|
||||
|
||||
|
||||
static int key_value_isset(const char *reply, size_t reply_len)
|
||||
{
|
||||
return reply_len > 0 && (reply_len < 4 || memcmp(reply, "FAIL", 4) != 0);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::paramsFromConfig(int network_id)
|
||||
{
|
||||
int i, res;
|
||||
|
||||
edit_network_id = network_id;
|
||||
getEapCapa();
|
||||
|
||||
char reply[1024], cmd[256], *pos;
|
||||
size_t reply_len;
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d ssid", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
ssidEdit->setText(reply + 1);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d proto", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
int wpa = 0;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) {
|
||||
reply[reply_len] = '\0';
|
||||
if (strstr(reply, "RSN") || strstr(reply, "WPA2"))
|
||||
wpa = 2;
|
||||
else if (strstr(reply, "WPA"))
|
||||
wpa = 1;
|
||||
}
|
||||
|
||||
int auth = AUTH_NONE_OPEN, encr = 0;
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d key_mgmt", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) {
|
||||
reply[reply_len] = '\0';
|
||||
if (strstr(reply, "WPA-EAP"))
|
||||
auth = wpa & 2 ? AUTH_WPA2_EAP : AUTH_WPA_EAP;
|
||||
else if (strstr(reply, "WPA-PSK"))
|
||||
auth = wpa & 2 ? AUTH_WPA2_PSK : AUTH_WPA_PSK;
|
||||
else if (strstr(reply, "IEEE8021X")) {
|
||||
auth = AUTH_IEEE8021X;
|
||||
encr = 1;
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d pairwise", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) {
|
||||
reply[reply_len] = '\0';
|
||||
if (strstr(reply, "CCMP") && auth != AUTH_NONE_OPEN &&
|
||||
auth != AUTH_NONE_WEP && auth != AUTH_NONE_WEP_SHARED)
|
||||
encr = 1;
|
||||
else if (strstr(reply, "TKIP"))
|
||||
encr = 0;
|
||||
else if (strstr(reply, "WEP"))
|
||||
encr = 1;
|
||||
else
|
||||
encr = 0;
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d psk", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
res = wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
if (res >= 0 && reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
pskEdit->setText(reply + 1);
|
||||
} else if (res >= 0 && key_value_isset(reply, reply_len)) {
|
||||
pskEdit->setText(WPA_GUI_KEY_DATA);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d identity", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
identityEdit->setText(reply + 1);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d password", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
res = wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
if (res >= 0 && reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
passwordEdit->setText(reply + 1);
|
||||
} else if (res >= 0 && key_value_isset(reply, reply_len)) {
|
||||
passwordEdit->setText(WPA_GUI_KEY_DATA);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d ca_cert", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
cacertEdit->setText(reply + 1);
|
||||
}
|
||||
|
||||
enum { NO_INNER, PEAP_INNER, TTLS_INNER, FAST_INNER } eap = NO_INNER;
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d eap", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 1) {
|
||||
reply[reply_len] = '\0';
|
||||
for (i = 0; i < eapSelect->count(); i++) {
|
||||
if (eapSelect->itemText(i).compare(reply) == 0) {
|
||||
eapSelect->setCurrentIndex(i);
|
||||
if (strcmp(reply, "PEAP") == 0)
|
||||
eap = PEAP_INNER;
|
||||
else if (strcmp(reply, "TTLS") == 0)
|
||||
eap = TTLS_INNER;
|
||||
else if (strcmp(reply, "FAST") == 0)
|
||||
eap = FAST_INNER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (eap != NO_INNER) {
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d phase2",
|
||||
network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 1) {
|
||||
reply[reply_len] = '\0';
|
||||
eapChanged(eapSelect->currentIndex());
|
||||
} else
|
||||
eap = NO_INNER;
|
||||
}
|
||||
|
||||
char *val;
|
||||
val = reply + 1;
|
||||
while (*(val + 1))
|
||||
val++;
|
||||
if (*val == '"')
|
||||
*val = '\0';
|
||||
|
||||
switch (eap) {
|
||||
case PEAP_INNER:
|
||||
if (strncmp(reply, "\"auth=", 6))
|
||||
break;
|
||||
val = reply + 2;
|
||||
memcpy(val, "EAP-", 4);
|
||||
break;
|
||||
case TTLS_INNER:
|
||||
if (strncmp(reply, "\"autheap=", 9) == 0) {
|
||||
val = reply + 5;
|
||||
memcpy(val, "EAP-", 4);
|
||||
} else if (strncmp(reply, "\"auth=", 6) == 0)
|
||||
val = reply + 6;
|
||||
break;
|
||||
case FAST_INNER:
|
||||
if (strncmp(reply, "\"auth=", 6))
|
||||
break;
|
||||
if (strcmp(reply + 6, "GTC auth=MSCHAPV2") == 0) {
|
||||
val = (char *) "GTC(auth) + MSCHAPv2(prov)";
|
||||
break;
|
||||
}
|
||||
val = reply + 2;
|
||||
memcpy(val, "EAP-", 4);
|
||||
break;
|
||||
case NO_INNER:
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < phase2Select->count(); i++) {
|
||||
if (phase2Select->itemText(i).compare(val) == 0) {
|
||||
phase2Select->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
QLineEdit *wepEdit;
|
||||
switch (i) {
|
||||
default:
|
||||
case 0:
|
||||
wepEdit = wep0Edit;
|
||||
break;
|
||||
case 1:
|
||||
wepEdit = wep1Edit;
|
||||
break;
|
||||
case 2:
|
||||
wepEdit = wep2Edit;
|
||||
break;
|
||||
case 3:
|
||||
wepEdit = wep3Edit;
|
||||
break;
|
||||
}
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d wep_key%d",
|
||||
network_id, i);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
res = wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
if (res >= 0 && reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
if (auth == AUTH_NONE_OPEN || auth == AUTH_IEEE8021X) {
|
||||
if (auth == AUTH_NONE_OPEN)
|
||||
auth = AUTH_NONE_WEP;
|
||||
encr = 1;
|
||||
}
|
||||
|
||||
wepEdit->setText(reply + 1);
|
||||
} else if (res >= 0 && key_value_isset(reply, reply_len)) {
|
||||
if (auth == AUTH_NONE_OPEN || auth == AUTH_IEEE8021X) {
|
||||
if (auth == AUTH_NONE_OPEN)
|
||||
auth = AUTH_NONE_WEP;
|
||||
encr = 1;
|
||||
}
|
||||
wepEdit->setText(WPA_GUI_KEY_DATA);
|
||||
}
|
||||
}
|
||||
|
||||
if (auth == AUTH_NONE_WEP) {
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d auth_alg",
|
||||
network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0) {
|
||||
reply[reply_len] = '\0';
|
||||
if (strcmp(reply, "SHARED") == 0)
|
||||
auth = AUTH_NONE_WEP_SHARED;
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d wep_tx_keyidx", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && reply_len >= 1)
|
||||
{
|
||||
reply[reply_len] = '\0';
|
||||
switch (atoi(reply)) {
|
||||
case 0:
|
||||
wep0Radio->setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
wep1Radio->setChecked(true);
|
||||
break;
|
||||
case 2:
|
||||
wep2Radio->setChecked(true);
|
||||
break;
|
||||
case 3:
|
||||
wep3Radio->setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d id_str", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 &&
|
||||
reply_len >= 2 && reply[0] == '"') {
|
||||
reply[reply_len] = '\0';
|
||||
pos = strchr(reply + 1, '"');
|
||||
if (pos)
|
||||
*pos = '\0';
|
||||
idstrEdit->setText(reply + 1);
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "GET_NETWORK %d priority", network_id);
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) >= 0 && reply_len >= 1)
|
||||
{
|
||||
reply[reply_len] = '\0';
|
||||
prioritySpinBox->setValue(atoi(reply));
|
||||
}
|
||||
|
||||
authSelect->setCurrentIndex(auth);
|
||||
authChanged(auth);
|
||||
encrSelect->setCurrentIndex(encr);
|
||||
wepEnabled(auth == AUTH_NONE_WEP || auth == AUTH_NONE_WEP_SHARED);
|
||||
|
||||
removeButton->setEnabled(true);
|
||||
addButton->setText("Save");
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::removeNetwork()
|
||||
{
|
||||
char reply[10], cmd[256];
|
||||
size_t reply_len;
|
||||
|
||||
if (QMessageBox::information(
|
||||
this, "wpa_gui",
|
||||
tr("This will permanently remove the network\n"
|
||||
"from the configuration. Do you really want\n"
|
||||
"to remove this network?"),
|
||||
tr("Yes"), tr("No")) != 0)
|
||||
return;
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "REMOVE_NETWORK %d", edit_network_id);
|
||||
reply_len = sizeof(reply);
|
||||
wpagui->ctrlRequest(cmd, reply, &reply_len);
|
||||
if (strncmp(reply, "OK", 2) != 0) {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Failed to remove network from "
|
||||
"wpa_supplicant\n"
|
||||
"configuration."));
|
||||
} else {
|
||||
wpagui->triggerUpdate();
|
||||
wpagui->ctrlRequest("SAVE_CONFIG", reply, &reply_len);
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::newNetwork()
|
||||
{
|
||||
new_network = true;
|
||||
getEapCapa();
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::getEapCapa()
|
||||
{
|
||||
char reply[256];
|
||||
size_t reply_len;
|
||||
|
||||
if (wpagui == NULL)
|
||||
return;
|
||||
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest("GET_CAPABILITY eap", reply, &reply_len) < 0)
|
||||
return;
|
||||
reply[reply_len] = '\0';
|
||||
|
||||
QString res(reply);
|
||||
QStringList types = res.split(QChar(' '));
|
||||
eapSelect->insertItems(-1, types);
|
||||
}
|
||||
|
||||
|
||||
void NetworkConfig::useWps()
|
||||
{
|
||||
if (wpagui == NULL)
|
||||
return;
|
||||
wpagui->setBssFromScan(bssid);
|
||||
wpagui->wpsDialog();
|
||||
close();
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* wpa_gui - NetworkConfig class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef NETWORKCONFIG_H
|
||||
#define NETWORKCONFIG_H
|
||||
|
||||
#include <QObject>
|
||||
#include "ui_networkconfig.h"
|
||||
|
||||
class WpaGui;
|
||||
|
||||
class NetworkConfig : public QDialog, public Ui::NetworkConfig
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NetworkConfig(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = false, Qt::WFlags fl = 0);
|
||||
~NetworkConfig();
|
||||
|
||||
virtual void paramsFromScanResults(QTreeWidgetItem *sel);
|
||||
virtual void setWpaGui(WpaGui *_wpagui);
|
||||
virtual int setNetworkParam(int id, const char *field,
|
||||
const char *value, bool quote);
|
||||
virtual void paramsFromConfig(int network_id);
|
||||
virtual void newNetwork();
|
||||
|
||||
public slots:
|
||||
virtual void authChanged(int sel);
|
||||
virtual void addNetwork();
|
||||
virtual void encrChanged(const QString &sel);
|
||||
virtual void writeWepKey(int network_id, QLineEdit *edit, int id);
|
||||
virtual void removeNetwork();
|
||||
virtual void eapChanged(int sel);
|
||||
virtual void useWps();
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
|
||||
private:
|
||||
WpaGui *wpagui;
|
||||
int edit_network_id;
|
||||
bool new_network;
|
||||
QString bssid;
|
||||
|
||||
virtual void wepEnabled(bool enabled);
|
||||
virtual void getEapCapa();
|
||||
};
|
||||
|
||||
#endif /* NETWORKCONFIG_H */
|
||||
@@ -0,0 +1,435 @@
|
||||
<ui version="4.0" >
|
||||
<class>NetworkConfig</class>
|
||||
<widget class="QDialog" name="NetworkConfig" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>410</width>
|
||||
<height>534</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>NetworkConfig</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="cancelButton" >
|
||||
<property name="text" >
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4" >
|
||||
<widget class="QFrame" name="frame9" >
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="ssidLabel" >
|
||||
<property name="text" >
|
||||
<string>SSID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="ssidEdit" >
|
||||
<property name="toolTip" >
|
||||
<string>Network name (Service Set IDentifier)</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="authLabel" >
|
||||
<property name="text" >
|
||||
<string>Authentication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="authSelect" >
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Plaintext (open / no authentication)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Static WEP (no authentication)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Static WEP (Shared Key authentication)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>IEEE 802.1X</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>WPA-Personal (PSK)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>WPA-Enterprise (EAP)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>WPA2-Personal (PSK)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>WPA2-Enterprise (EAP)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="encrLabel" >
|
||||
<property name="text" >
|
||||
<string>Encryption</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QComboBox" name="encrSelect" >
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>WEP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>TKIP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>CCMP</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="pskLabel" >
|
||||
<property name="text" >
|
||||
<string>PSK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QLineEdit" name="pskEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>WPA/WPA2 pre-shared key or passphrase</string>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="echoMode" >
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<widget class="QLabel" name="eapLabel" >
|
||||
<property name="text" >
|
||||
<string>EAP method</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" >
|
||||
<widget class="QComboBox" name="eapSelect" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QLabel" name="identityLabel" >
|
||||
<property name="text" >
|
||||
<string>Identity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
<widget class="QLineEdit" name="identityEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Username/Identity for EAP methods</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QLabel" name="passwordLabel" >
|
||||
<property name="text" >
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" >
|
||||
<widget class="QLineEdit" name="passwordEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Password for EAP methods</string>
|
||||
</property>
|
||||
<property name="echoMode" >
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" >
|
||||
<widget class="QLabel" name="cacertLabel" >
|
||||
<property name="text" >
|
||||
<string>CA certificate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" >
|
||||
<widget class="QLineEdit" name="cacertEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2" >
|
||||
<widget class="QGroupBox" name="wepBox" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>WEP keys</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QRadioButton" name="wep0Radio" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>key 0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QRadioButton" name="wep1Radio" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>key 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QRadioButton" name="wep3Radio" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>key 3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QRadioButton" name="wep2Radio" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>key 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="wep0Edit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QLineEdit" name="wep1Edit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLineEdit" name="wep2Edit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QLineEdit" name="wep3Edit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2" >
|
||||
<widget class="QGroupBox" name="optionalSettingsBox" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>Optional Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLineEdit" name="idstrEdit" >
|
||||
<property name="toolTip" >
|
||||
<string>Network Identification String</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" >
|
||||
<widget class="QSpinBox" name="prioritySpinBox" >
|
||||
<property name="toolTip" >
|
||||
<string>Network Priority</string>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<number>10000</number>
|
||||
</property>
|
||||
<property name="singleStep" >
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="idstrLabel" >
|
||||
<property name="text" >
|
||||
<string>IDString</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QLabel" name="priorityLabel" >
|
||||
<property name="text" >
|
||||
<string>Priority</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="phase2Label" >
|
||||
<property name="text" >
|
||||
<string>Inner auth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="phase2Select" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="addButton" >
|
||||
<property name="text" >
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="removeButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="useWpsButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>WPS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<tabstops>
|
||||
<tabstop>ssidEdit</tabstop>
|
||||
<tabstop>authSelect</tabstop>
|
||||
<tabstop>encrSelect</tabstop>
|
||||
<tabstop>pskEdit</tabstop>
|
||||
<tabstop>eapSelect</tabstop>
|
||||
<tabstop>identityEdit</tabstop>
|
||||
<tabstop>passwordEdit</tabstop>
|
||||
<tabstop>cacertEdit</tabstop>
|
||||
<tabstop>wep0Radio</tabstop>
|
||||
<tabstop>wep0Edit</tabstop>
|
||||
<tabstop>wep1Radio</tabstop>
|
||||
<tabstop>wep1Edit</tabstop>
|
||||
<tabstop>wep2Radio</tabstop>
|
||||
<tabstop>wep2Edit</tabstop>
|
||||
<tabstop>wep3Radio</tabstop>
|
||||
<tabstop>wep3Edit</tabstop>
|
||||
<tabstop>idstrEdit</tabstop>
|
||||
<tabstop>prioritySpinBox</tabstop>
|
||||
<tabstop>phase2Select</tabstop>
|
||||
<tabstop>addButton</tabstop>
|
||||
<tabstop>removeButton</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
</tabstops>
|
||||
<includes>
|
||||
<include location="global" >qtreewidget.h</include>
|
||||
</includes>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* wpa_gui - Peers class
|
||||
* Copyright (c) 2009-2010, Atheros Communications
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef PEERS_H
|
||||
#define PEERS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStandardItemModel>
|
||||
#include "wpamsg.h"
|
||||
#include "ui_peers.h"
|
||||
|
||||
class WpaGui;
|
||||
|
||||
class Peers : public QDialog, public Ui::Peers
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Peers(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = false, Qt::WFlags fl = 0);
|
||||
~Peers();
|
||||
void setWpaGui(WpaGui *_wpagui);
|
||||
void event_notify(WpaMsg msg);
|
||||
|
||||
public slots:
|
||||
virtual void context_menu(const QPoint &pos);
|
||||
virtual void enter_pin();
|
||||
virtual void connect_pbc();
|
||||
virtual void learn_ap_config();
|
||||
virtual void ctx_refresh();
|
||||
virtual void ctx_p2p_start();
|
||||
virtual void ctx_p2p_stop();
|
||||
virtual void ctx_p2p_listen();
|
||||
virtual void ctx_p2p_start_group();
|
||||
virtual void ctx_p2p_remove_group();
|
||||
virtual void ctx_p2p_connect();
|
||||
virtual void ctx_p2p_req_pin();
|
||||
virtual void ctx_p2p_show_pin();
|
||||
virtual void ctx_p2p_display_pin();
|
||||
virtual void ctx_p2p_display_pin_pd();
|
||||
virtual void ctx_p2p_enter_pin();
|
||||
virtual void properties();
|
||||
virtual void ctx_hide_ap();
|
||||
virtual void ctx_show_ap();
|
||||
virtual void ctx_p2p_show_passphrase();
|
||||
virtual void ctx_p2p_start_persistent();
|
||||
virtual void ctx_p2p_invite();
|
||||
virtual void ctx_p2p_delete();
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
void add_station(QString info);
|
||||
void add_stations();
|
||||
void add_single_station(const char *addr);
|
||||
bool add_bss(const char *cmd);
|
||||
void remove_bss(int id);
|
||||
void add_scan_results();
|
||||
void add_persistent(int id, const char *ssid, const char *bssid);
|
||||
void add_persistent_groups();
|
||||
void update_peers();
|
||||
QStandardItem * find_addr(QString addr);
|
||||
QStandardItem * find_addr_type(QString addr, int type);
|
||||
void add_p2p_group_client(QStandardItem *parent, QString params);
|
||||
QStandardItem * find_uuid(QString uuid);
|
||||
void done(int r);
|
||||
void remove_enrollee_uuid(QString uuid);
|
||||
QString ItemType(int type);
|
||||
void enable_persistent(int id);
|
||||
|
||||
WpaGui *wpagui;
|
||||
QStandardItemModel model;
|
||||
QIcon *default_icon;
|
||||
QIcon *ap_icon;
|
||||
QIcon *laptop_icon;
|
||||
QIcon *group_icon;
|
||||
QIcon *invitation_icon;
|
||||
QStandardItem *ctx_item;
|
||||
|
||||
bool hide_ap;
|
||||
};
|
||||
|
||||
#endif /* PEERS_H */
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Peers</class>
|
||||
<widget class="QDialog" name="Peers">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Peers</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QListView" name="peers">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="viewMode">
|
||||
<enum>QListView::IconMode</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* wpa_gui - ScanResults class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "scanresults.h"
|
||||
#include "wpagui.h"
|
||||
#include "networkconfig.h"
|
||||
|
||||
|
||||
ScanResults::ScanResults(QWidget *parent, const char *, bool, Qt::WFlags)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(scanButton, SIGNAL(clicked()), this, SLOT(scanRequest()));
|
||||
connect(scanResultsWidget,
|
||||
SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this,
|
||||
SLOT(bssSelected(QTreeWidgetItem *)));
|
||||
|
||||
wpagui = NULL;
|
||||
scanResultsWidget->setItemsExpandable(FALSE);
|
||||
scanResultsWidget->setRootIsDecorated(FALSE);
|
||||
}
|
||||
|
||||
|
||||
ScanResults::~ScanResults()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::languageChange()
|
||||
{
|
||||
retranslateUi(this);
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::setWpaGui(WpaGui *_wpagui)
|
||||
{
|
||||
wpagui = _wpagui;
|
||||
updateResults();
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::updateResults()
|
||||
{
|
||||
char reply[2048];
|
||||
size_t reply_len;
|
||||
int index;
|
||||
char cmd[20];
|
||||
|
||||
scanResultsWidget->clear();
|
||||
|
||||
index = 0;
|
||||
while (wpagui) {
|
||||
snprintf(cmd, sizeof(cmd), "BSS %d", index++);
|
||||
if (index > 1000)
|
||||
break;
|
||||
|
||||
reply_len = sizeof(reply) - 1;
|
||||
if (wpagui->ctrlRequest(cmd, reply, &reply_len) < 0)
|
||||
break;
|
||||
reply[reply_len] = '\0';
|
||||
|
||||
QString bss(reply);
|
||||
if (bss.isEmpty() || bss.startsWith("FAIL"))
|
||||
break;
|
||||
|
||||
QString ssid, bssid, freq, signal, flags;
|
||||
|
||||
QStringList lines = bss.split(QRegExp("\\n"));
|
||||
for (QStringList::Iterator it = lines.begin();
|
||||
it != lines.end(); it++) {
|
||||
int pos = (*it).indexOf('=') + 1;
|
||||
if (pos < 1)
|
||||
continue;
|
||||
|
||||
if ((*it).startsWith("bssid="))
|
||||
bssid = (*it).mid(pos);
|
||||
else if ((*it).startsWith("freq="))
|
||||
freq = (*it).mid(pos);
|
||||
else if ((*it).startsWith("qual="))
|
||||
signal = (*it).mid(pos);
|
||||
else if ((*it).startsWith("flags="))
|
||||
flags = (*it).mid(pos);
|
||||
else if ((*it).startsWith("ssid="))
|
||||
ssid = (*it).mid(pos);
|
||||
}
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(scanResultsWidget);
|
||||
if (item) {
|
||||
item->setText(0, ssid);
|
||||
item->setText(1, bssid);
|
||||
item->setText(2, freq);
|
||||
item->setText(3, signal);
|
||||
item->setText(4, flags);
|
||||
}
|
||||
|
||||
if (bssid.isEmpty())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::scanRequest()
|
||||
{
|
||||
char reply[10];
|
||||
size_t reply_len = sizeof(reply);
|
||||
|
||||
if (wpagui == NULL)
|
||||
return;
|
||||
|
||||
wpagui->ctrlRequest("SCAN", reply, &reply_len);
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::getResults()
|
||||
{
|
||||
updateResults();
|
||||
}
|
||||
|
||||
|
||||
void ScanResults::bssSelected(QTreeWidgetItem *sel)
|
||||
{
|
||||
NetworkConfig *nc = new NetworkConfig();
|
||||
if (nc == NULL)
|
||||
return;
|
||||
nc->setWpaGui(wpagui);
|
||||
nc->paramsFromScanResults(sel);
|
||||
nc->show();
|
||||
nc->exec();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* wpa_gui - ScanResults class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef SCANRESULTS_H
|
||||
#define SCANRESULTS_H
|
||||
|
||||
#include <QObject>
|
||||
#include "ui_scanresults.h"
|
||||
|
||||
class WpaGui;
|
||||
|
||||
class ScanResults : public QDialog, public Ui::ScanResults
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ScanResults(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = false, Qt::WFlags fl = 0);
|
||||
~ScanResults();
|
||||
|
||||
public slots:
|
||||
virtual void setWpaGui(WpaGui *_wpagui);
|
||||
virtual void updateResults();
|
||||
virtual void scanRequest();
|
||||
virtual void getResults();
|
||||
virtual void bssSelected(QTreeWidgetItem *sel);
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
|
||||
private:
|
||||
WpaGui *wpagui;
|
||||
};
|
||||
|
||||
#endif /* SCANRESULTS_H */
|
||||
@@ -0,0 +1,94 @@
|
||||
<ui version="4.0" >
|
||||
<class>ScanResults</class>
|
||||
<widget class="QDialog" name="ScanResults" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>452</width>
|
||||
<height>244</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Scan results</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="scanResultsWidget" >
|
||||
<property name="editTriggers" >
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="uniformRowHeights" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="columnCount" >
|
||||
<number>5</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>SSID</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>BSSID</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>frequency</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>signal</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>flags</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="scanButton" >
|
||||
<property name="text" >
|
||||
<string>Scan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeButton" >
|
||||
<property name="text" >
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* wpa_gui - StringQuery class
|
||||
* Copyright (c) 2009, Atheros Communications
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <QLabel>
|
||||
|
||||
#include "stringquery.h"
|
||||
|
||||
|
||||
StringQuery::StringQuery(QString label)
|
||||
{
|
||||
edit = new QLineEdit;
|
||||
edit->setFocus();
|
||||
QGridLayout *layout = new QGridLayout;
|
||||
layout->addWidget(new QLabel(label), 0, 0);
|
||||
layout->addWidget(edit, 0, 1);
|
||||
setLayout(layout);
|
||||
|
||||
connect(edit, SIGNAL(returnPressed()), this, SLOT(accept()));
|
||||
}
|
||||
|
||||
|
||||
QString StringQuery::get_string()
|
||||
{
|
||||
return edit->text();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* wpa_gui - StringQuery class
|
||||
* Copyright (c) 2009, Atheros Communications
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef STRINGQUERY_H
|
||||
#define STRINGQUERY_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QGridLayout>
|
||||
|
||||
class StringQuery : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StringQuery(QString label);
|
||||
QString get_string();
|
||||
|
||||
private:
|
||||
QLineEdit *edit;
|
||||
};
|
||||
|
||||
#endif /* STRINGQUERY_H */
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* wpa_gui - UserDataRequest class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include "userdatarequest.h"
|
||||
#include "wpagui.h"
|
||||
#include "common/wpa_ctrl.h"
|
||||
|
||||
|
||||
UserDataRequest::UserDataRequest(QWidget *parent, const char *, bool,
|
||||
Qt::WFlags)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(sendReply()));
|
||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||
connect(queryEdit, SIGNAL(returnPressed()), this, SLOT(sendReply()));
|
||||
}
|
||||
|
||||
|
||||
UserDataRequest::~UserDataRequest()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void UserDataRequest::languageChange()
|
||||
{
|
||||
retranslateUi(this);
|
||||
}
|
||||
|
||||
|
||||
int UserDataRequest::setParams(WpaGui *_wpagui, const char *reqMsg)
|
||||
{
|
||||
char *tmp, *pos, *pos2;
|
||||
wpagui = _wpagui;
|
||||
tmp = strdup(reqMsg);
|
||||
if (tmp == NULL)
|
||||
return -1;
|
||||
pos = strchr(tmp, '-');
|
||||
if (pos == NULL) {
|
||||
free(tmp);
|
||||
return -1;
|
||||
}
|
||||
*pos++ = '\0';
|
||||
field = tmp;
|
||||
pos2 = strchr(pos, ':');
|
||||
if (pos2 == NULL) {
|
||||
free(tmp);
|
||||
return -1;
|
||||
}
|
||||
*pos2++ = '\0';
|
||||
|
||||
networkid = atoi(pos);
|
||||
queryInfo->setText(pos2);
|
||||
if (strcmp(tmp, "PASSWORD") == 0) {
|
||||
queryField->setText(tr("Password: "));
|
||||
queryEdit->setEchoMode(QLineEdit::Password);
|
||||
} else if (strcmp(tmp, "NEW_PASSWORD") == 0) {
|
||||
queryField->setText(tr("New password: "));
|
||||
queryEdit->setEchoMode(QLineEdit::Password);
|
||||
} else if (strcmp(tmp, "IDENTITY") == 0)
|
||||
queryField->setText(tr("Identity: "));
|
||||
else if (strcmp(tmp, "PASSPHRASE") == 0) {
|
||||
queryField->setText(tr("Private key passphrase: "));
|
||||
queryEdit->setEchoMode(QLineEdit::Password);
|
||||
} else
|
||||
queryField->setText(field + ":");
|
||||
free(tmp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void UserDataRequest::sendReply()
|
||||
{
|
||||
char reply[10];
|
||||
size_t reply_len = sizeof(reply);
|
||||
|
||||
if (wpagui == NULL) {
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
|
||||
QString cmd = QString(WPA_CTRL_RSP) + field + '-' +
|
||||
QString::number(networkid) + ':' +
|
||||
queryEdit->text();
|
||||
wpagui->ctrlRequest(cmd.toAscii().constData(), reply, &reply_len);
|
||||
accept();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* wpa_gui - UserDataRequest class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef USERDATAREQUEST_H
|
||||
#define USERDATAREQUEST_H
|
||||
|
||||
#include <QObject>
|
||||
#include "ui_userdatarequest.h"
|
||||
|
||||
class WpaGui;
|
||||
|
||||
class UserDataRequest : public QDialog, public Ui::UserDataRequest
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UserDataRequest(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = false, Qt::WFlags fl = 0);
|
||||
~UserDataRequest();
|
||||
|
||||
int setParams(WpaGui *_wpagui, const char *reqMsg);
|
||||
|
||||
public slots:
|
||||
virtual void sendReply();
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
|
||||
private:
|
||||
WpaGui *wpagui;
|
||||
int networkid;
|
||||
QString field;
|
||||
};
|
||||
|
||||
#endif /* USERDATAREQUEST_H */
|
||||
@@ -0,0 +1,109 @@
|
||||
<ui version="4.0" stdsetdef="1" >
|
||||
<author></author>
|
||||
<comment></comment>
|
||||
<exportmacro></exportmacro>
|
||||
<class>UserDataRequest</class>
|
||||
<widget class="QDialog" name="UserDataRequest" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>216</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Authentication credentials required</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="queryInfo" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="queryField" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="queryEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="echoMode" >
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="spacer4" >
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonOk" >
|
||||
<property name="text" >
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonCancel" >
|
||||
<property name="text" >
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoDefault" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
</ui>
|
||||
@@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=wpa_gui
|
||||
Comment=Graphical user interface for wpa_supplicant
|
||||
Exec=wpa_gui
|
||||
Icon=wpa_gui
|
||||
GenericName=wpa_supplicant user interface
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Qt;Network;
|
||||
@@ -0,0 +1,68 @@
|
||||
TEMPLATE = app
|
||||
LANGUAGE = C++
|
||||
TRANSLATIONS = lang/wpa_gui_de.ts
|
||||
|
||||
CONFIG += qt warn_on release
|
||||
|
||||
DEFINES += CONFIG_CTRL_IFACE
|
||||
|
||||
win32 {
|
||||
LIBS += -lws2_32 -static
|
||||
DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
SOURCES += ../../src/utils/os_win32.c
|
||||
} else:win32-g++ {
|
||||
# cross compilation to win32
|
||||
LIBS += -lws2_32 -static -mwindows
|
||||
DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
SOURCES += ../../src/utils/os_win32.c
|
||||
RESOURCES += icons_png.qrc
|
||||
} else:win32-x-g++ {
|
||||
# cross compilation to win32
|
||||
LIBS += -lws2_32 -static -mwindows
|
||||
DEFINES += CONFIG_NATIVE_WINDOWS CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
DEFINES += _X86_
|
||||
SOURCES += ../../src/utils/os_win32.c
|
||||
RESOURCES += icons_png.qrc
|
||||
} else {
|
||||
DEFINES += CONFIG_CTRL_IFACE_UNIX
|
||||
SOURCES += ../../src/utils/os_unix.c
|
||||
}
|
||||
|
||||
INCLUDEPATH += . .. ../../src ../../src/utils
|
||||
|
||||
HEADERS += wpamsg.h \
|
||||
wpagui.h \
|
||||
eventhistory.h \
|
||||
scanresults.h \
|
||||
userdatarequest.h \
|
||||
networkconfig.h \
|
||||
addinterface.h \
|
||||
peers.h \
|
||||
stringquery.h
|
||||
|
||||
SOURCES += main.cpp \
|
||||
wpagui.cpp \
|
||||
eventhistory.cpp \
|
||||
scanresults.cpp \
|
||||
userdatarequest.cpp \
|
||||
networkconfig.cpp \
|
||||
addinterface.cpp \
|
||||
peers.cpp \
|
||||
stringquery.cpp \
|
||||
../../src/common/wpa_ctrl.c
|
||||
|
||||
RESOURCES += icons.qrc
|
||||
|
||||
FORMS = wpagui.ui \
|
||||
eventhistory.ui \
|
||||
scanresults.ui \
|
||||
userdatarequest.ui \
|
||||
networkconfig.ui \
|
||||
peers.ui
|
||||
|
||||
|
||||
unix {
|
||||
UI_DIR = .ui
|
||||
MOC_DIR = .moc
|
||||
OBJECTS_DIR = .obj
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* wpa_gui - WpaGui class
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef WPAGUI_H
|
||||
#define WPAGUI_H
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QObject>
|
||||
#include "ui_wpagui.h"
|
||||
#include "addinterface.h"
|
||||
|
||||
class UserDataRequest;
|
||||
|
||||
|
||||
class WpaGui : public QMainWindow, public Ui::WpaGui
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WpaGui(QApplication *app, QWidget *parent = 0, const char *name = 0,
|
||||
Qt::WFlags fl = 0);
|
||||
~WpaGui();
|
||||
|
||||
virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen);
|
||||
virtual void triggerUpdate();
|
||||
virtual void editNetwork(const QString &sel);
|
||||
virtual void removeNetwork(const QString &sel);
|
||||
virtual void enableNetwork(const QString &sel);
|
||||
virtual void disableNetwork(const QString &sel);
|
||||
virtual int getNetworkDisabled(const QString &sel);
|
||||
void setBssFromScan(const QString &bssid);
|
||||
#ifndef QT_NO_SESSIONMANAGER
|
||||
void saveState();
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
virtual void parse_argv();
|
||||
virtual void updateStatus();
|
||||
virtual void updateNetworks();
|
||||
virtual void helpIndex();
|
||||
virtual void helpContents();
|
||||
virtual void helpAbout();
|
||||
virtual void disconnect();
|
||||
virtual void scan();
|
||||
virtual void eventHistory();
|
||||
virtual void ping();
|
||||
virtual void processMsg(char *msg);
|
||||
virtual void processCtrlReq(const char *req);
|
||||
virtual void receiveMsgs();
|
||||
virtual void connectB();
|
||||
virtual void selectNetwork(const QString &sel);
|
||||
virtual void editSelectedNetwork();
|
||||
virtual void editListedNetwork();
|
||||
virtual void removeSelectedNetwork();
|
||||
virtual void removeListedNetwork();
|
||||
virtual void addNetwork();
|
||||
virtual void enableAllNetworks();
|
||||
virtual void disableAllNetworks();
|
||||
virtual void removeAllNetworks();
|
||||
virtual void saveConfig();
|
||||
virtual void selectAdapter(const QString &sel);
|
||||
virtual void updateNetworkDisabledStatus();
|
||||
virtual void enableListedNetwork(bool);
|
||||
virtual void disableListedNetwork(bool);
|
||||
virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type,
|
||||
int sec, const QString &msg);
|
||||
virtual void showTrayStatus();
|
||||
virtual void wpsDialog();
|
||||
virtual void peersDialog();
|
||||
virtual void tabChanged(int index);
|
||||
virtual void wpsPbc();
|
||||
virtual void wpsGeneratePin();
|
||||
virtual void wpsApPinChanged(const QString &text);
|
||||
virtual void wpsApPin();
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
virtual void startService();
|
||||
virtual void stopService();
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
virtual void addInterface();
|
||||
|
||||
protected slots:
|
||||
virtual void languageChange();
|
||||
virtual void trayActivated(QSystemTrayIcon::ActivationReason how);
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
ScanResults *scanres;
|
||||
Peers *peers;
|
||||
bool networkMayHaveChanged;
|
||||
char *ctrl_iface;
|
||||
EventHistory *eh;
|
||||
struct wpa_ctrl *ctrl_conn;
|
||||
QSocketNotifier *msgNotifier;
|
||||
QTimer *timer;
|
||||
int pingsToStatusUpdate;
|
||||
WpaMsgList msgs;
|
||||
char *ctrl_iface_dir;
|
||||
struct wpa_ctrl *monitor_conn;
|
||||
UserDataRequest *udr;
|
||||
QAction *disconnectAction;
|
||||
QAction *reconnectAction;
|
||||
QAction *eventAction;
|
||||
QAction *scanAction;
|
||||
QAction *statAction;
|
||||
QAction *showAction;
|
||||
QAction *hideAction;
|
||||
QAction *quitAction;
|
||||
QMenu *tray_menu;
|
||||
QSystemTrayIcon *tray_icon;
|
||||
QString wpaStateTranslate(char *state);
|
||||
void createTrayIcon(bool);
|
||||
bool ackTrayIcon;
|
||||
bool startInTray;
|
||||
|
||||
int openCtrlConnection(const char *ifname);
|
||||
|
||||
bool wpsRunning;
|
||||
|
||||
QString bssFromScan;
|
||||
|
||||
void stopWpsRun(bool success);
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
QAction *fileStartServiceAction;
|
||||
QAction *fileStopServiceAction;
|
||||
|
||||
bool serviceRunning();
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
QAction *addInterfaceAction;
|
||||
AddInterface *add_iface;
|
||||
|
||||
bool connectedToService;
|
||||
|
||||
QApplication *app;
|
||||
bool inTray;
|
||||
};
|
||||
|
||||
#endif /* WPAGUI_H */
|
||||
@@ -0,0 +1,524 @@
|
||||
<ui version="4.0" >
|
||||
<class>WpaGui</class>
|
||||
<widget class="QMainWindow" name="WpaGui" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>345</width>
|
||||
<height>330</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>wpa_gui</string>
|
||||
</property>
|
||||
<property name="windowIcon" >
|
||||
<iconset resource="icons.qrc" >
|
||||
<normaloff>:/icons/wpa_gui.svg</normaloff>:/icons/wpa_gui.svg</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget" >
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="adapterLabel" >
|
||||
<property name="text" >
|
||||
<string>Adapter:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QComboBox" name="adapterSelect" />
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="networkLabel" >
|
||||
<property name="text" >
|
||||
<string>Network:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="networkSelect" />
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QTabWidget" name="wpaguiTab" >
|
||||
<property name="currentIndex" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="statusTab" >
|
||||
<attribute name="title" >
|
||||
<string>Current Status</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" colspan="5" >
|
||||
<widget class="QFrame" name="frame3" >
|
||||
<property name="frameShape" >
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="statusLabel" >
|
||||
<property name="text" >
|
||||
<string>Status:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="lastMessageLabel" >
|
||||
<property name="text" >
|
||||
<string>Last message:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="authenticationLabel" >
|
||||
<property name="text" >
|
||||
<string>Authentication:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="encryptionLabel" >
|
||||
<property name="text" >
|
||||
<string>Encryption:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<widget class="QLabel" name="ssidLabel" >
|
||||
<property name="text" >
|
||||
<string>SSID:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QLabel" name="bssidLabel" >
|
||||
<property name="text" >
|
||||
<string>BSSID:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QLabel" name="ipAddressLabel" >
|
||||
<property name="text" >
|
||||
<string>IP address:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLabel" name="textStatus" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3" >
|
||||
<widget class="QLabel" name="textLastMessage" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLabel" name="textAuthentication" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QLabel" name="textEncryption" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" >
|
||||
<widget class="QLabel" name="textSsid" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
<widget class="QLabel" name="textBssid" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" >
|
||||
<widget class="QLabel" name="textIpAddress" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="connectButton" >
|
||||
<property name="text" >
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="disconnectButton" >
|
||||
<property name="text" >
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="scanButton" >
|
||||
<property name="text" >
|
||||
<string>Scan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="networkconfigTab" >
|
||||
<attribute name="title" >
|
||||
<string>Manage Networks</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" colspan="5" >
|
||||
<widget class="QListWidget" name="networkList" >
|
||||
<property name="selectionRectVisible" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="2" row="1" column="0" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>61</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QRadioButton" name="enableRadioButton" >
|
||||
<property name="text" >
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="editNetworkButton" >
|
||||
<property name="text" >
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="removeNetworkButton" >
|
||||
<property name="text" >
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="2" row="1" column="4" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>61</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QRadioButton" name="disableRadioButton" >
|
||||
<property name="text" >
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" >
|
||||
<widget class="QPushButton" name="addNetworkButton" >
|
||||
<property name="text" >
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" >
|
||||
<widget class="QPushButton" name="scanNetworkButton" >
|
||||
<property name="text" >
|
||||
<string>Scan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="wpsTab" >
|
||||
<attribute name="title" >
|
||||
<string>WPS</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="wpsGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string>Status:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3" >
|
||||
<widget class="QLabel" name="wpsStatusText" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2" >
|
||||
<widget class="QPushButton" name="wpsPbcButton" >
|
||||
<property name="text" >
|
||||
<string>PBC - push button</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QPushButton" name="wpsPinButton" >
|
||||
<property name="text" >
|
||||
<string>Generate PIN</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>PIN:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" >
|
||||
<widget class="QLineEdit" name="wpsPinEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2" >
|
||||
<widget class="QPushButton" name="wpsApPinButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Use AP PIN</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" >
|
||||
<widget class="QLabel" name="label_3" >
|
||||
<property name="text" >
|
||||
<string>AP PIN:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" >
|
||||
<widget class="QLineEdit" name="wpsApPinEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="4" >
|
||||
<widget class="QTextEdit" name="wpsInstructions" >
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="MenuBar" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>345</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="fileMenu" >
|
||||
<property name="title" >
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="fileEventHistoryAction" />
|
||||
<addaction name="fileSaveConfigAction" />
|
||||
<addaction name="actionWPS" />
|
||||
<addaction name="actionPeers" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="fileExitAction" />
|
||||
</widget>
|
||||
<widget class="QMenu" name="networkMenu" >
|
||||
<property name="title" >
|
||||
<string>&Network</string>
|
||||
</property>
|
||||
<addaction name="networkAddAction" />
|
||||
<addaction name="networkEditAction" />
|
||||
<addaction name="networkRemoveAction" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="networkEnableAllAction" />
|
||||
<addaction name="networkDisableAllAction" />
|
||||
<addaction name="networkRemoveAllAction" />
|
||||
</widget>
|
||||
<widget class="QMenu" name="helpMenu" >
|
||||
<property name="title" >
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<addaction name="helpContentsAction" />
|
||||
<addaction name="helpIndexAction" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="helpAboutAction" />
|
||||
</widget>
|
||||
<addaction name="fileMenu" />
|
||||
<addaction name="networkMenu" />
|
||||
<addaction name="helpMenu" />
|
||||
</widget>
|
||||
<action name="fileEventHistoryAction" >
|
||||
<property name="text" >
|
||||
<string>Event &History</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="fileSaveConfigAction" >
|
||||
<property name="text" >
|
||||
<string>&Save Configuration</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="fileExitAction" >
|
||||
<property name="text" >
|
||||
<string>E&xit</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkAddAction" >
|
||||
<property name="text" >
|
||||
<string>&Add</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkEditAction" >
|
||||
<property name="text" >
|
||||
<string>&Edit</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkRemoveAction" >
|
||||
<property name="text" >
|
||||
<string>&Remove</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkEnableAllAction" >
|
||||
<property name="text" >
|
||||
<string>E&nable All</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkDisableAllAction" >
|
||||
<property name="text" >
|
||||
<string>&Disable All</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="networkRemoveAllAction" >
|
||||
<property name="text" >
|
||||
<string>Re&move All</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="helpContentsAction" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Contents...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="helpIndexAction" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Index...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="helpAboutAction" >
|
||||
<property name="text" >
|
||||
<string>&About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWPS" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Wi-Fi Protected Setup</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPeers" >
|
||||
<property name="text" >
|
||||
<string>&Peers</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<includes>
|
||||
<include location="global" >qtimer.h</include>
|
||||
<include location="global" >qsocketnotifier.h</include>
|
||||
<include location="local" >wpamsg.h</include>
|
||||
<include location="local" >eventhistory.h</include>
|
||||
<include location="local" >scanresults.h</include>
|
||||
<include location="local" >peers.h</include>
|
||||
</includes>
|
||||
<resources>
|
||||
<include location="icons.qrc" />
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* wpa_gui - WpaMsg class for storing event messages
|
||||
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef WPAMSG_H
|
||||
#define WPAMSG_H
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QLinkedList>
|
||||
|
||||
class WpaMsg {
|
||||
public:
|
||||
WpaMsg(const QString &_msg, int _priority = 2)
|
||||
: msg(_msg), priority(_priority)
|
||||
{
|
||||
timestamp = QDateTime::currentDateTime();
|
||||
}
|
||||
|
||||
QString getMsg() const { return msg; }
|
||||
int getPriority() const { return priority; }
|
||||
QDateTime getTimestamp() const { return timestamp; }
|
||||
|
||||
private:
|
||||
QString msg;
|
||||
int priority;
|
||||
QDateTime timestamp;
|
||||
};
|
||||
|
||||
typedef QLinkedList<WpaMsg> WpaMsgList;
|
||||
|
||||
#endif /* WPAMSG_H */
|
||||
Reference in New Issue
Block a user