main.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifdef CONFIG_NATIVE_WINDOWS
  15. #include <winsock.h>
  16. #endif /* CONFIG_NATIVE_WINDOWS */
  17. #include <QApplication>
  18. #include "wpagui.h"
  19. int main(int argc, char *argv[])
  20. {
  21. QApplication app(argc, argv);
  22. WpaGui w;
  23. int ret;
  24. #ifdef CONFIG_NATIVE_WINDOWS
  25. WSADATA wsaData;
  26. if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
  27. printf("Could not find a usable WinSock.dll\n");
  28. return -1;
  29. }
  30. #endif /* CONFIG_NATIVE_WINDOWS */
  31. w.show();
  32. app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
  33. ret = app.exec();
  34. #ifdef CONFIG_NATIVE_WINDOWS
  35. WSACleanup();
  36. #endif /* CONFIG_NATIVE_WINDOWS */
  37. return ret;
  38. }