]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/wpa_supplicant/wpa_gui-qt4/main.cpp
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / wpa_supplicant / wpa_gui-qt4 / main.cpp
1 /*
2  * wpa_gui - Application startup
3  * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #ifdef CONFIG_NATIVE_WINDOWS
16 #include <winsock.h>
17 #endif /* CONFIG_NATIVE_WINDOWS */
18 #include <QApplication>
19 #include "wpagui.h"
20
21 int main(int argc, char *argv[])
22 {
23         QApplication app(argc, argv);
24         WpaGui w;
25         int ret;
26
27 #ifdef CONFIG_NATIVE_WINDOWS
28         WSADATA wsaData;
29         if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
30                 printf("Could not find a usable WinSock.dll\n");
31                 return -1;
32         }
33 #endif /* CONFIG_NATIVE_WINDOWS */
34
35         w.show();
36         app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
37         ret = app.exec();
38
39 #ifdef CONFIG_NATIVE_WINDOWS
40         WSACleanup();
41 #endif /* CONFIG_NATIVE_WINDOWS */
42
43         return ret;
44 }