Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.h | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index 6e1379d..d1cbeb5 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h | |||
@@ -61,24 +61,28 @@ class Config; | |||
61 | #define ACCOUNT_GRP "PPP_Account" | 61 | #define ACCOUNT_GRP "PPP_Account" |
62 | #define ACCLIST_GRP "PPP_Accounts_List" | 62 | #define ACCLIST_GRP "PPP_Accounts_List" |
63 | //#define GRAPH_GRP "Graph" | 63 | //#define GRAPH_GRP "Graph" |
64 | //#define WINPOS_GRP "WindowPosition" | 64 | //#define WINPOS_GRP "WindowPosition" |
65 | 65 | ||
66 | // general | 66 | // general |
67 | #define ACCOUNT_LIST "AccountList" | ||
68 | #define DEVICE_LIST "DeviceList" | ||
67 | #define DEFAULTACCOUNT_KEY "DefaultAccount" | 69 | #define DEFAULTACCOUNT_KEY "DefaultAccount" |
68 | #define PPPDVERSION_KEY "pppdVersion" | 70 | #define PPPDVERSION_KEY "pppdVersion" |
69 | #define PPPDTIMEOUT_KEY "pppdTimeout" | 71 | #define PPPDTIMEOUT_KEY "pppdTimeout" |
70 | #define SHOWCLOCK_KEY "ShowClock" | 72 | #define SHOWCLOCK_KEY "ShowClock" |
71 | #define SHOWLOGWIN_KEY "ShowLogWindow" | 73 | #define SHOWLOGWIN_KEY "ShowLogWindow" |
72 | #define AUTOREDIAL_KEY "AutomaticRedial" | 74 | #define AUTOREDIAL_KEY "AutomaticRedial" |
73 | #define DISCONNECT_KEY "DisconnectOnXServerExit" | 75 | #define DISCONNECT_KEY "DisconnectOnXServerExit" |
74 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" | 76 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" |
75 | #define NUMACCOUNTS_KEY "NumberOfAccounts" | 77 | #define NUMACCOUNTS_KEY "HighcountAccounts" |
78 | #define NUMDEVICES_KEY "HighcountDevices" | ||
76 | #define ID_KEY "ID" | 79 | #define ID_KEY "ID" |
77 | 80 | ||
78 | // modem | 81 | // modem |
82 | #define MODEMNAME_KEY "Modem_Name" | ||
79 | #define MODEMDEV_KEY "Device" | 83 | #define MODEMDEV_KEY "Device" |
80 | #define LOCKFILE_KEY "UseLockFile" | 84 | #define LOCKFILE_KEY "UseLockFile" |
81 | #define FLOWCONTROL_KEY "FlowControl" | 85 | #define FLOWCONTROL_KEY "FlowControl" |
82 | #define SPEED_KEY "Speed" | 86 | #define SPEED_KEY "Speed" |
83 | #define TIMEOUT_KEY "Timeout" | 87 | #define TIMEOUT_KEY "Timeout" |
84 | #define TONEDURATION_KEY "ToneDuration" | 88 | #define TONEDURATION_KEY "ToneDuration" |
@@ -148,23 +152,29 @@ class Config; | |||
148 | 152 | ||
149 | // account list | 153 | // account list |
150 | #define ACCOUNTS_COUNT "Accounts_Count" | 154 | #define ACCOUNTS_COUNT "Accounts_Count" |
151 | #define ACOUNTS_DEV "Accounts_Modem" | 155 | #define ACOUNTS_DEV "Accounts_Modem" |
152 | #define ACOUNTS_ACC "Accounts_Account" | 156 | #define ACOUNTS_ACC "Accounts_Account" |
153 | 157 | ||
158 | #define DEVICESNAMES_LIST "DevicesNames_List" | ||
159 | #define DEVICES_LIST "Devices_List" | ||
160 | #define DEVICES_LIST_SEP ',' | ||
161 | |||
154 | class PPPData { | 162 | class PPPData { |
155 | public: | 163 | public: |
156 | PPPData(); | 164 | PPPData(); |
157 | ~PPPData() {}; | 165 | ~PPPData() {}; |
158 | 166 | ||
159 | enum { NumInitStrings = 2 }; | 167 | enum { NumInitStrings = 2 }; |
160 | 168 | ||
161 | // general functions | 169 | // general functions |
162 | void save(); | 170 | void save(); |
163 | void cancel(); | 171 | void cancel(); |
164 | 172 | ||
173 | QStringList getAccountList(); | ||
174 | |||
165 | static QMap<QString,QString> getConfiguredInterfaces(); | 175 | static QMap<QString,QString> getConfiguredInterfaces(); |
166 | static void setConfiguredInterfaces( QMap<QString,QString> ); | 176 | static void setConfiguredInterfaces( QMap<QString,QString> ); |
167 | 177 | ||
168 | // function to read/write date to configuration file | 178 | // function to read/write date to configuration file |
169 | static Config config(); | 179 | static Config config(); |
170 | QString readConfig(const QString &, const QString &, const QString &); | 180 | QString readConfig(const QString &, const QString &, const QString &); |
@@ -181,13 +191,13 @@ public: | |||
181 | QString modemGroup(); | 191 | QString modemGroup(); |
182 | 192 | ||
183 | // functions to set/get general kppp info | 193 | // functions to set/get general kppp info |
184 | QString password(); | 194 | QString password(); |
185 | void setPassword(const QString &); | 195 | void setPassword(const QString &); |
186 | 196 | ||
187 | int currentAccountID() { return caccount; }; | 197 | // int currentAccountID() { return caccount; }; |
188 | const QString defaultAccount(); | 198 | const QString defaultAccount(); |
189 | void setDefaultAccount(const QString &); | 199 | void setDefaultAccount(const QString &); |
190 | 200 | ||
191 | void set_xserver_exit_disconnect(bool set); | 201 | void set_xserver_exit_disconnect(bool set); |
192 | bool get_xserver_exit_disconnect(); | 202 | bool get_xserver_exit_disconnect(); |
193 | 203 | ||
@@ -233,12 +243,16 @@ public: | |||
233 | void setModemEscapeStr(const QString &); | 243 | void setModemEscapeStr(const QString &); |
234 | const QString modemEscapeStr(); | 244 | const QString modemEscapeStr(); |
235 | 245 | ||
236 | void setModemEscapeResp(const QString &); | 246 | void setModemEscapeResp(const QString &); |
237 | const QString modemEscapeResp(); | 247 | const QString modemEscapeResp(); |
238 | 248 | ||
249 | // const QString modemName(); | ||
250 | // bool setModemName(const QString &); | ||
251 | // bool changeModemName(const QString &); | ||
252 | |||
239 | const QString modemDevice(); | 253 | const QString modemDevice(); |
240 | bool setModemDevice(const QString &); | 254 | bool setModemDevice(const QString &); |
241 | 255 | ||
242 | const QString flowcontrol(); | 256 | const QString flowcontrol(); |
243 | void setFlowcontrol(const QString &); | 257 | void setFlowcontrol(const QString &); |
244 | 258 | ||
@@ -310,20 +324,21 @@ public: | |||
310 | QString volumeHigh(); | 324 | QString volumeHigh(); |
311 | void setVolumeHigh(const QString &); | 325 | void setVolumeHigh(const QString &); |
312 | 326 | ||
313 | // functions to set/get account information | 327 | // functions to set/get account information |
314 | int count() const; | 328 | int count() const; |
315 | bool setAccount(const QString &); | 329 | bool setAccount(const QString &); |
316 | bool setAccountbyIndex(int); | 330 | // bool setAccountbyIndex(int); |
317 | 331 | ||
318 | bool isUniqueAccname(const QString &); | 332 | bool isUniqueAccname(const QString &); |
333 | bool isUniqueDevname(const QString &); | ||
319 | 334 | ||
320 | bool deleteAccount(); | 335 | bool deleteAccount(); |
321 | bool deleteAccount(const QString &); | 336 | bool deleteAccount(const QString &); |
322 | int newaccount(); | 337 | int newaccount(); |
323 | int copyaccount(int i); | 338 | int copyaccount(const QString&); |
324 | 339 | ||
325 | const QString accname(); | 340 | const QString accname(); |
326 | void setAccname(const QString &); | 341 | void setAccname(const QString &); |
327 | 342 | ||
328 | QStringList &phonenumbers(); | 343 | QStringList &phonenumbers(); |
329 | const QString phonenumber(); | 344 | const QString phonenumber(); |
@@ -406,31 +421,45 @@ public: | |||
406 | bool pppdRunning() const; | 421 | bool pppdRunning() const; |
407 | void setpppdRunning(bool set); | 422 | void setpppdRunning(bool set); |
408 | 423 | ||
409 | int pppdError() const; | 424 | int pppdError() const; |
410 | void setpppdError(int err); | 425 | void setpppdError(int err); |
411 | 426 | ||
427 | QStringList getDevicesList(); | ||
412 | 428 | ||
413 | static QString encodeWord(const QString &s); | 429 | static QString encodeWord(const QString &s); |
414 | 430 | ||
431 | const QString devname(); | ||
432 | void setDevname(const QString &); | ||
433 | bool setDevice(const QString& ); | ||
434 | bool deleteDevice(); | ||
435 | bool deleteDevice(const QString &); | ||
436 | int newdevice(); | ||
437 | int copydevice(const QString&); | ||
438 | QStringList getDevicesNamesList(); | ||
439 | |||
415 | private: | 440 | private: |
416 | 441 | ||
417 | //static PPPData *_data; | 442 | //static PPPData *_data; |
418 | int modemDeviceGroup; | 443 | // int modemDeviceGroup; |
419 | QString passwd; | 444 | QString passwd; |
420 | // static Config* config; // configuration object | 445 | QString _modemName; |
421 | int highcount; // index of highest account | 446 | int highcount; // index of highest account |
422 | int caccount; // index of the current account | 447 | int highcountdev; // index of highest device |
448 | // int caccount; // index of the current account | ||
423 | QString cgroup; // name of current config group | 449 | QString cgroup; // name of current config group |
424 | pid_t suidprocessid; // process ID of setuid child | 450 | pid_t suidprocessid; // process ID of setuid child |
425 | bool pppdisrunning; // pppd process | 451 | bool pppdisrunning; // pppd process |
426 | // daemon | 452 | // daemon |
427 | int pppderror; // error encounterd running pppd | 453 | int pppderror; // error encounterd running pppd |
428 | int pppdVer, pppdMod, pppdPatch; // pppd version | 454 | int pppdVer, pppdMod, pppdPatch; // pppd version |
429 | 455 | ||
456 | |||
430 | QStringList phonelist; | 457 | QStringList phonelist; |
458 | QStringList accountList; | ||
459 | QStringList deviceList; | ||
431 | QMap<QString,QString> stringEntries; | 460 | QMap<QString,QString> stringEntries; |
432 | QMap<QString,int> intEntries; | 461 | QMap<QString,int> intEntries; |
433 | QMap<QString,QStringList> listEntries; | 462 | QMap<QString,QStringList> listEntries; |
434 | QMap<QString,QChar> sepEntries; | 463 | QMap<QString,QChar> sepEntries; |
435 | 464 | ||
436 | }; | 465 | }; |