Esempio n. 1
0
void WpaGui::editListedNetwork()
{
	if (networkList->currentRow() < 0) {
		QMessageBox::information(this, tr("Select A Network"),
					 tr("Select a network from the list to"
					    " edit it.\n"));
		return;
	}
	QString sel(networkList->currentItem()->text());
	editNetwork(sel);
}
Esempio n. 2
0
void WpaGui::editSelectedNetwork()
{
	if (networkSelect->count() < 1) {
		QMessageBox::information(
			this, tr("No Networks"),
			tr("There are no networks to edit.\n"));
		return;
	}
	QString sel(networkSelect->currentText());
	editNetwork(sel);
}
Esempio n. 3
0
WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags)
	: QMainWindow(parent)
{
	setupUi(this);

	(void) statusBar();

	connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex()));
	connect(helpContentsAction, SIGNAL(activated()), this,
		SLOT(helpContents()));
	connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
	connect(fileExitAction, SIGNAL(activated()), this, SLOT(close()));
	connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect()));
	connect(scanButton, SIGNAL(clicked()), this, SLOT(scan()));
	connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB()));
	connect(fileEventHistoryAction, SIGNAL(activated()), this,
		SLOT(eventHistory()));
	connect(networkSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectNetwork(const QString&)));
	connect(fileEdit_networkAction, SIGNAL(activated()), this,
		SLOT(editNetwork()));
	connect(fileAdd_NetworkAction, SIGNAL(activated()), this,
		SLOT(addNetwork()));
	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
		SLOT(selectAdapter(const QString&)));

	eh = NULL;
	scanres = NULL;
	udr = NULL;
	ctrl_iface = NULL;
	ctrl_conn = NULL;
	monitor_conn = NULL;
	msgNotifier = NULL;
	ctrl_iface_dir = strdup("/var/run/wpa_supplicant");

	parse_argv();

	textStatus->setText("connecting to wpa_supplicant");
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), SLOT(ping()));
	timer->start(1000, FALSE);

	if (openCtrlConnection(ctrl_iface) < 0) {
		printf("Failed to open control connection to "
		       "wpa_supplicant.\n");
	}

	updateStatus();
	networkMayHaveChanged = true;
	updateNetworks();
}