2 * wpa_gui - WpaGui class
3 * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #include <QSystemTrayIcon>
20 #include "ui_wpagui.h"
21 #include "addinterface.h"
23 class UserDataRequest
;
26 class WpaGui
: public QMainWindow
, public Ui::WpaGui
31 WpaGui(QApplication
*app
, QWidget
*parent
= 0, const char *name
= 0,
35 virtual int ctrlRequest(const char *cmd
, char *buf
, size_t *buflen
);
36 virtual void triggerUpdate();
37 virtual void editNetwork(const QString
&sel
);
38 virtual void removeNetwork(const QString
&sel
);
39 virtual void enableNetwork(const QString
&sel
);
40 virtual void disableNetwork(const QString
&sel
);
41 virtual int getNetworkDisabled(const QString
&sel
);
42 void setBssFromScan(const QString
&bssid
);
43 #ifndef QT_NO_SESSIONMANAGER
48 virtual void parse_argv();
49 virtual void updateStatus();
50 virtual void updateNetworks();
51 virtual void helpIndex();
52 virtual void helpContents();
53 virtual void helpAbout();
54 virtual void disconnect();
56 virtual void eventHistory();
58 virtual void processMsg(char *msg
);
59 virtual void processCtrlReq(const char *req
);
60 virtual void receiveMsgs();
61 virtual void connectB();
62 virtual void selectNetwork(const QString
&sel
);
63 virtual void editSelectedNetwork();
64 virtual void editListedNetwork();
65 virtual void removeSelectedNetwork();
66 virtual void removeListedNetwork();
67 virtual void addNetwork();
68 virtual void enableAllNetworks();
69 virtual void disableAllNetworks();
70 virtual void removeAllNetworks();
71 virtual void saveConfig();
72 virtual void selectAdapter(const QString
&sel
);
73 virtual void updateNetworkDisabledStatus();
74 virtual void enableListedNetwork(bool);
75 virtual void disableListedNetwork(bool);
76 virtual void showTrayMessage(QSystemTrayIcon::MessageIcon type
,
77 int sec
, const QString
&msg
);
78 virtual void showTrayStatus();
79 virtual void wpsDialog();
80 virtual void peersDialog();
81 virtual void tabChanged(int index
);
82 virtual void wpsPbc();
83 virtual void wpsGeneratePin();
84 virtual void wpsApPinChanged(const QString
&text
);
85 virtual void wpsApPin();
86 #ifdef CONFIG_NATIVE_WINDOWS
87 virtual void startService();
88 virtual void stopService();
89 #endif /* CONFIG_NATIVE_WINDOWS */
90 virtual void addInterface();
93 virtual void languageChange();
94 virtual void trayActivated(QSystemTrayIcon::ActivationReason how
);
95 virtual void closeEvent(QCloseEvent
*event
);
100 bool networkMayHaveChanged
;
103 struct wpa_ctrl
*ctrl_conn
;
104 QSocketNotifier
*msgNotifier
;
106 int pingsToStatusUpdate
;
108 char *ctrl_iface_dir
;
109 struct wpa_ctrl
*monitor_conn
;
110 UserDataRequest
*udr
;
111 QAction
*disconnectAction
;
112 QAction
*reconnectAction
;
113 QAction
*eventAction
;
120 QSystemTrayIcon
*tray_icon
;
121 QString
wpaStateTranslate(char *state
);
122 void createTrayIcon(bool);
126 int openCtrlConnection(const char *ifname
);
132 void stopWpsRun(bool success
);
134 #ifdef CONFIG_NATIVE_WINDOWS
135 QAction
*fileStartServiceAction
;
136 QAction
*fileStopServiceAction
;
138 bool serviceRunning();
139 #endif /* CONFIG_NATIVE_WINDOWS */
141 QAction
*addInterfaceAction
;
142 AddInterface
*add_iface
;
144 bool connectedToService
;
150 #endif /* WPAGUI_H */