Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.h | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index e286b70..57ce2fd 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h @@ -34,53 +34,53 @@ #include <qstring.h> #include <qstringlist.h> #include <qcolor.h> #include "kpppconfig.h" class Config; // string lengths #define PATH_SIZE 120 #define MODEMSTR_SIZE 80 #define ACCNAME_SIZE 50 #define PHONENUMBER_SIZE 60 #define COMMAND_SIZE 255 #define IPADDR_SIZE 15 #define DOMAIN_SIZE 50 #define TIMEOUT_SIZE 60 // // keys for config file // // groups -#define GENERAL_GRP "General" -#define MODEM_GRP "Modem" -#define ACCOUNT_GRP "Account" -#define GRAPH_GRP "Graph" -#define WINPOS_GRP "WindowPosition" +#define GENERAL_GRP "PPP_General" +#define MODEM_GRP "PPP_Modem" +#define ACCOUNT_GRP "PPP_Account" +//#define GRAPH_GRP "Graph" +//#define WINPOS_GRP "WindowPosition" // general #define DEFAULTACCOUNT_KEY "DefaultAccount" #define PPPDVERSION_KEY "pppdVersion" #define PPPDTIMEOUT_KEY "pppdTimeout" #define SHOWCLOCK_KEY "ShowClock" #define SHOWLOGWIN_KEY "ShowLogWindow" #define AUTOREDIAL_KEY "AutomaticRedial" #define DISCONNECT_KEY "DisconnectOnXServerExit" #define QUITONDISCONNECT_KEY "QuitOnDisconnect" #define NUMACCOUNTS_KEY "NumberOfAccounts" #define ID_KEY "ID" // modem #define MODEMDEV_KEY "Device" #define LOCKFILE_KEY "UseLockFile" #define FLOWCONTROL_KEY "FlowControl" #define SPEED_KEY "Speed" #define TIMEOUT_KEY "Timeout" #define TONEDURATION_KEY "ToneDuration" #define BUSYWAIT_KEY "BusyWait" #define INITSTR_KEY "InitString" #define INITRESP_KEY "InitResponse" #define PREINITDELAY_KEY "PreInitDelay" @@ -140,56 +140,57 @@ class Config; #define TOTALCOSTS_KEY "TotalCosts" #define TOTALBYTES_KEY "TotalBytes" // graph colors #define GENABLED "Enabled" #define GCOLOR_BG "Background" #define GCOLOR_TEXT "Text" #define GCOLOR_IN "InBytes" #define GCOLOR_OUT "OutBytes" // pppd errors #define E_IF_TIMEOUT 1 #define E_PPPD_DIED 2 // window position #define WINPOS_CONWIN_X "WindowPositionConWinX" #define WINPOS_CONWIN_Y "WindowPositionConWinY" #define WINPOS_STATWIN_X "WindowPositionStatWinX" #define WINPOS_STATWIN_Y "WindowPositionStatWinY" class PPPData { public: PPPData(); ~PPPData() {}; + static PPPData* data(); enum { NumInitStrings = 2 }; // general functions bool open(); void save(); void cancel(); - int access() const; // read/write access +// int access() const; // read/write access // function to read/write date to configuration file QString readConfig(const QString &, const QString &, const QString &); int readNumConfig(const QString &, const QString &, int); bool readListConfig(const QString &, const QString &, QStringList &, char sep = ','); void writeConfig(const QString &, const QString &, const QString &); void writeConfig(const QString &, const QString &, int); void writeListConfig(const QString &, const QString &, QStringList &, char sep = ','); // return the current account group QString currentGroup() { return cgroup; } // functions to set/get general kppp info QString password() const; void setPassword(const QString &); const QString defaultAccount(); void setDefaultAccount(const QString &); void set_xserver_exit_disconnect(bool set); bool get_xserver_exit_disconnect(); @@ -405,61 +406,62 @@ public: QStringList &script(); void setScript(QStringList &); QStringList &pppdArgument(); void setpppdArgumentDefaults(); void setpppdArgument(QStringList &); //functions to change/set the child pppd process info bool pppdRunning() const; void setpppdRunning(bool set); int pppdError() const; void setpppdError(int err); // functions to set/query the accounting info const QString accountingFile(); void setAccountingFile(const QString &); const QString totalCosts(); void setTotalCosts(const QString &); int totalBytes(); void setTotalBytes(int); - // graphing widget - void setGraphingOptions(bool enabled, - QColor bg, - QColor text, - QColor in, - QColor out); - void graphingOptions(bool &enabled, - QColor &bg, - QColor &text, - QColor &in, - QColor &out); - bool graphingEnabled(); - - // window positions - void winPosConWin(int &, int &); - void setWinPosConWin(int, int); - void winPosStatWin(int &, int &); - void setWinPosStatWin(int, int); +// // graphing widget +// void setGraphingOptions(bool enabled, +// QColor bg, +// QColor text, +// QColor in, +// QColor out); +// void graphingOptions(bool &enabled, +// QColor &bg, +// QColor &text, +// QColor &in, +// QColor &out); +// bool graphingEnabled(); + +// // window positions +// void winPosConWin(int &, int &); +// void setWinPosConWin(int, int); +// void winPosStatWin(int &, int &); +// void setWinPosStatWin(int, int); private: + + static PPPData *_data; + QString passwd; - Config* config; // configuration object + static Config* config; // configuration object int highcount; // index of highest account int caccount; // index of the current account QString cgroup; // name of current config group pid_t suidprocessid; // process ID of setuid child bool pppdisrunning; // pppd process // daemon int pppderror; // error encounterd running pppd int pppdVer, pppdMod, pppdPatch; // pppd version QStringList phonelist; }; -extern PPPData gpppdata; - #endif |