Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index 41dfbd8..c1c7e69 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h | |||
@@ -22,51 +22,53 @@ | |||
22 | * | 22 | * |
23 | * You should have received a copy of the GNU Library General Public | 23 | * You should have received a copy of the GNU Library General Public |
24 | * License along with this program; if not, write to the Free | 24 | * License along with this program; if not, write to the Free |
25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef _PPPDATA_H_ | 28 | #ifndef _PPPDATA_H_ |
29 | #define _PPPDATA_H_ | 29 | #define _PPPDATA_H_ |
30 | 30 | ||
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | #include <sys/types.h> | 32 | #include <sys/types.h> |
33 | 33 | ||
34 | #include <qcolor.h> | ||
35 | #include <qmap.h> | ||
34 | #include <qstring.h> | 36 | #include <qstring.h> |
35 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
36 | #include <qcolor.h> | ||
37 | 38 | ||
38 | #include "kpppconfig.h" | 39 | #include "kpppconfig.h" |
39 | 40 | ||
40 | class Config; | 41 | class Config; |
41 | 42 | ||
42 | // string lengths | 43 | // string lengths |
43 | 44 | ||
44 | #define PATH_SIZE 120 | 45 | #define PATH_SIZE 120 |
45 | #define MODEMSTR_SIZE 80 | 46 | #define MODEMSTR_SIZE 80 |
46 | #define ACCNAME_SIZE 50 | 47 | #define ACCNAME_SIZE 50 |
47 | #define PHONENUMBER_SIZE 60 | 48 | #define PHONENUMBER_SIZE 60 |
48 | #define COMMAND_SIZE 255 | 49 | #define COMMAND_SIZE 255 |
49 | #define IPADDR_SIZE 15 | 50 | #define IPADDR_SIZE 15 |
50 | #define DOMAIN_SIZE 50 | 51 | #define DOMAIN_SIZE 50 |
51 | #define TIMEOUT_SIZE 60 | 52 | #define TIMEOUT_SIZE 60 |
52 | 53 | ||
53 | // | 54 | // |
54 | // keys for config file | 55 | // keys for config file |
55 | // | 56 | // |
56 | 57 | ||
57 | // groups | 58 | // groups |
58 | #define GENERAL_GRP "PPP_General" | 59 | #define GENERAL_GRP "PPP_General" |
59 | #define MODEM_GRP "PPP_Modem" | 60 | #define MODEM_GRP "PPP_Modem" |
60 | #define ACCOUNT_GRP "PPP_Account" | 61 | #define ACCOUNT_GRP "PPP_Account" |
62 | #define ACCLIST_GRP "PPP_Accounts_List" | ||
61 | //#define GRAPH_GRP "Graph" | 63 | //#define GRAPH_GRP "Graph" |
62 | //#define WINPOS_GRP "WindowPosition" | 64 | //#define WINPOS_GRP "WindowPosition" |
63 | 65 | ||
64 | // general | 66 | // general |
65 | #define DEFAULTACCOUNT_KEY "DefaultAccount" | 67 | #define DEFAULTACCOUNT_KEY "DefaultAccount" |
66 | #define PPPDVERSION_KEY "pppdVersion" | 68 | #define PPPDVERSION_KEY "pppdVersion" |
67 | #define PPPDTIMEOUT_KEY "pppdTimeout" | 69 | #define PPPDTIMEOUT_KEY "pppdTimeout" |
68 | #define SHOWCLOCK_KEY "ShowClock" | 70 | #define SHOWCLOCK_KEY "ShowClock" |
69 | #define SHOWLOGWIN_KEY "ShowLogWindow" | 71 | #define SHOWLOGWIN_KEY "ShowLogWindow" |
70 | #define AUTOREDIAL_KEY "AutomaticRedial" | 72 | #define AUTOREDIAL_KEY "AutomaticRedial" |
71 | #define DISCONNECT_KEY "DisconnectOnXServerExit" | 73 | #define DISCONNECT_KEY "DisconnectOnXServerExit" |
72 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" | 74 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" |
@@ -131,73 +133,68 @@ class Config; | |||
131 | #define DNS_KEY "DNS" | 133 | #define DNS_KEY "DNS" |
132 | #define AUTODNS_KEY "AutoDNS" | 134 | #define AUTODNS_KEY "AutoDNS" |
133 | #define EXDNSDISABLED_KEY "ExDNSDisabled" | 135 | #define EXDNSDISABLED_KEY "ExDNSDisabled" |
134 | #define SCRIPTCOM_KEY "ScriptCommands" | 136 | #define SCRIPTCOM_KEY "ScriptCommands" |
135 | #define SCRIPTARG_KEY "ScriptArguments" | 137 | #define SCRIPTARG_KEY "ScriptArguments" |
136 | #define PPPDARG_KEY "pppdArguments" | 138 | #define PPPDARG_KEY "pppdArguments" |
137 | #define PPP_DEBUG_OPTION "PPPDebug" | 139 | #define PPP_DEBUG_OPTION "PPPDebug" |
138 | #define ICONIFY_ON_CONNECT_KEY "iconifyOnConnect" | 140 | #define ICONIFY_ON_CONNECT_KEY "iconifyOnConnect" |
139 | #define DOCKING_KEY "DockIntoPanel" | 141 | #define DOCKING_KEY "DockIntoPanel" |
140 | #define TOTALCOSTS_KEY "TotalCosts" | 142 | #define TOTALCOSTS_KEY "TotalCosts" |
141 | #define TOTALBYTES_KEY "TotalBytes" | 143 | #define TOTALBYTES_KEY "TotalBytes" |
142 | 144 | ||
143 | // graph colors | ||
144 | #define GENABLED "Enabled" | ||
145 | #define GCOLOR_BG "Background" | ||
146 | #define GCOLOR_TEXT "Text" | ||
147 | #define GCOLOR_IN "InBytes" | ||
148 | #define GCOLOR_OUT "OutBytes" | ||
149 | |||
150 | // pppd errors | 145 | // pppd errors |
151 | #define E_IF_TIMEOUT 1 | 146 | #define E_IF_TIMEOUT 1 |
152 | #define E_PPPD_DIED 2 | 147 | #define E_PPPD_DIED 2 |
153 | 148 | ||
154 | // window position | 149 | // account list |
155 | #define WINPOS_CONWIN_X "WindowPositionConWinX" | 150 | #define ACCOUNTS_COUNT "Accounts_Count" |
156 | #define WINPOS_CONWIN_Y "WindowPositionConWinY" | 151 | #define ACOUNTS_DEV "Accounts_Modem" |
157 | #define WINPOS_STATWIN_X "WindowPositionStatWinX" | 152 | #define ACOUNTS_ACC "Accounts_Account" |
158 | #define WINPOS_STATWIN_Y "WindowPositionStatWinY" | ||
159 | 153 | ||
160 | class PPPData { | 154 | class PPPData { |
161 | public: | 155 | public: |
162 | PPPData(); | 156 | PPPData(); |
163 | ~PPPData() {}; | 157 | ~PPPData() {}; |
164 | static PPPData* data(); | 158 | static PPPData* data(); |
165 | 159 | ||
166 | enum { NumInitStrings = 2 }; | 160 | enum { NumInitStrings = 2 }; |
167 | 161 | ||
168 | // general functions | 162 | // general functions |
169 | bool open(); | 163 | bool open(); |
170 | void save(); | 164 | void save(); |
171 | void cancel(); | 165 | void cancel(); |
172 | 166 | ||
167 | QMap<QString,QString> getConfiguredInterfaces(); | ||
168 | void setConfiguredInterfaces( QMap<QString,QString> ); | ||
173 | 169 | ||
174 | // function to read/write date to configuration file | 170 | // function to read/write date to configuration file |
175 | QString readConfig(const QString &, const QString &, const QString &); | 171 | QString readConfig(const QString &, const QString &, const QString &); |
176 | int readNumConfig(const QString &, const QString &, int); | 172 | int readNumConfig(const QString &, const QString &, int); |
177 | bool readListConfig(const QString &, const QString &, | 173 | bool readListConfig(const QString &, const QString &, |
178 | QStringList &, char sep = ','); | 174 | QStringList &, char sep = ','); |
179 | void writeConfig(const QString &, const QString &, const QString &); | 175 | void writeConfig(const QString &, const QString &, const QString &); |
180 | void writeConfig(const QString &, const QString &, int); | 176 | void writeConfig(const QString &, const QString &, int); |
181 | void writeListConfig(const QString &, const QString &, | 177 | void writeListConfig(const QString &, const QString &, |
182 | QStringList &, char sep = ','); | 178 | QStringList &, char sep = ','); |
183 | 179 | ||
184 | // return the current account group | 180 | // return the current account group |
185 | QString currentGroup() { return cgroup; } | 181 | QString currentGroup() { return cgroup; } |
186 | QString modemGroup(); | 182 | QString modemGroup(); |
187 | 183 | ||
188 | // functions to set/get general kppp info | 184 | // functions to set/get general kppp info |
189 | QString password() const; | 185 | QString password() const; |
190 | void setPassword(const QString &); | 186 | void setPassword(const QString &); |
191 | 187 | ||
188 | int currentAccountID() { return caccount; }; | ||
192 | const QString defaultAccount(); | 189 | const QString defaultAccount(); |
193 | void setDefaultAccount(const QString &); | 190 | void setDefaultAccount(const QString &); |
194 | 191 | ||
195 | void set_xserver_exit_disconnect(bool set); | 192 | void set_xserver_exit_disconnect(bool set); |
196 | bool get_xserver_exit_disconnect(); | 193 | bool get_xserver_exit_disconnect(); |
197 | 194 | ||
198 | void setPPPDebug(bool set); | 195 | void setPPPDebug(bool set); |
199 | bool getPPPDebug(); | 196 | bool getPPPDebug(); |
200 | 197 | ||
201 | void set_quit_on_disconnect(bool); | 198 | void set_quit_on_disconnect(bool); |
202 | bool quit_on_disconnect(); | 199 | bool quit_on_disconnect(); |
203 | 200 | ||