author | tille <tille> | 2003-05-25 18:19:04 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-25 18:19:04 (UTC) |
commit | 2ec401058a04c15d2725c94d38226d0ac4505496 (patch) (unidiff) | |
tree | bbe34da6b452cb01f31e5a08acf114c8c9641c32 /noncore/settings/networksettings/ppp/pppdata.cpp | |
parent | 7e1dce1560e45ef7fad91a8da2d0d96c1b166df9 (diff) | |
download | opie-2ec401058a04c15d2725c94d38226d0ac4505496.zip opie-2ec401058a04c15d2725c94d38226d0ac4505496.tar.gz opie-2ec401058a04c15d2725c94d38226d0ac4505496.tar.bz2 |
saves configured interfaces now
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.cpp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp index 109e3b7..3f1675c 100644 --- a/noncore/settings/networksettings/ppp/pppdata.cpp +++ b/noncore/settings/networksettings/ppp/pppdata.cpp | |||
@@ -55,13 +55,12 @@ PPPData* PPPData::data() | |||
55 | } | 55 | } |
56 | 56 | ||
57 | PPPData::PPPData() | 57 | PPPData::PPPData() |
58 | : //config(0L), | 58 | : modemDeviceGroup(-1), |
59 | highcount(-1), // start out with no entries | 59 | highcount(-1), // start out with no entries |
60 | caccount(-1), // set the current account index also | 60 | caccount(-1), // set the current account index also |
61 | suidprocessid(-1), // process ID of setuid child | 61 | suidprocessid(-1), // process ID of setuid child |
62 | pppdisrunning(false), | 62 | pppdisrunning(false), |
63 | pppderror(0), | 63 | pppderror(0) |
64 | modemDeviceGroup(-1) | ||
65 | { | 64 | { |
66 | } | 65 | } |
67 | 66 | ||
@@ -329,7 +328,6 @@ const QString PPPData::modemDevice() { | |||
329 | 328 | ||
330 | 329 | ||
331 | bool PPPData::setModemDevice(const QString &n) { | 330 | bool PPPData::setModemDevice(const QString &n) { |
332 | //FIXME: change modem group | ||
333 | bool ret = false; | 331 | bool ret = false; |
334 | for (int i = 0; devices[i]; i++) | 332 | for (int i = 0; devices[i]; i++) |
335 | if (devices[i] == n){ | 333 | if (devices[i] == n){ |
@@ -804,7 +802,7 @@ int PPPData::newaccount() { | |||
804 | } | 802 | } |
805 | 803 | ||
806 | int PPPData::copyaccount(int i) { | 804 | int PPPData::copyaccount(int i) { |
807 | 805 | // FIXME | |
808 | // if(highcount >= MAX_ACCOUNTS) | 806 | // if(highcount >= MAX_ACCOUNTS) |
809 | return -1; | 807 | return -1; |
810 | 808 | ||
@@ -1221,28 +1219,34 @@ void PPPData::setpppdError(int err) { | |||
1221 | QString PPPData::modemGroup() | 1219 | QString PPPData::modemGroup() |
1222 | { | 1220 | { |
1223 | if (modemDeviceGroup<0)qFatal("wrong modem %i",modemDeviceGroup); | 1221 | if (modemDeviceGroup<0)qFatal("wrong modem %i",modemDeviceGroup); |
1224 | return QString("MODEM_GRP_%1").arg(modemDeviceGroup); | 1222 | return QString("%1_%1").arg(MODEM_GRP).arg(modemDeviceGroup); |
1225 | } | 1223 | } |
1226 | 1224 | ||
1227 | // // | ||
1228 | // // window position | ||
1229 | // // | ||
1230 | // void PPPData::winPosConWin(int& p_x, int& p_y) { | ||
1231 | // p_x = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_X, QApplication::desktop()->width()/2-160); | ||
1232 | // p_y = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_Y, QApplication::desktop()->height()/2-55); | ||
1233 | // } | ||
1234 | 1225 | ||
1235 | // void PPPData::setWinPosConWin(int p_x, int p_y) { | 1226 | QMap<QString,QString> PPPData::getConfiguredInterfaces() |
1236 | // writeConfig(WINPOS_GRP, WINPOS_CONWIN_X, p_x); | 1227 | { |
1237 | // writeConfig(WINPOS_GRP, WINPOS_CONWIN_Y, p_y); | 1228 | QMap<QString,QString> ifaces; |
1238 | // } | 1229 | int count = readNumConfig( ACCLIST_GRP, ACCOUNTS_COUNT, -1 ); |
1230 | QString accGrp; | ||
1231 | for (int i = 0; i < count; i++){ | ||
1232 | accGrp = QString("%1_%1").arg(ACCLIST_GRP).arg(i); | ||
1233 | ifaces.insert( readConfig( accGrp, ACOUNTS_DEV, "error" ), | ||
1234 | readConfig( accGrp, ACOUNTS_ACC, "error" ) ); | ||
1235 | } | ||
1239 | 1236 | ||
1240 | // void PPPData::winPosStatWin(int& p_x, int& p_y) { | 1237 | return ifaces; |
1241 | // p_x = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_X, QApplication::desktop()->width()/2-160); | 1238 | } |
1242 | // p_y = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_Y, QApplication::desktop()->height()/2-55); | ||
1243 | // } | ||
1244 | 1239 | ||
1245 | // void PPPData::setWinPosStatWin(int p_x, int p_y) { | 1240 | void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces ) |
1246 | // writeConfig(WINPOS_GRP, WINPOS_STATWIN_X, p_x); | 1241 | { |
1247 | // writeConfig(WINPOS_GRP, WINPOS_STATWIN_Y, p_y); | 1242 | QMap<QString,QString>::Iterator it; |
1248 | // } | 1243 | QString accGrp; |
1244 | int i = 0; | ||
1245 | for( it = ifaces.begin(); it != ifaces.end(); ++it, ++i ){ | ||
1246 | accGrp = QString("%1_%1").arg(ACCLIST_GRP).arg(i); | ||
1247 | writeConfig( accGrp, ACOUNTS_DEV, it.key() ); | ||
1248 | writeConfig( accGrp, ACOUNTS_ACC, it.data() ); | ||
1249 | } | ||
1250 | writeConfig( ACCLIST_GRP, ACCOUNTS_COUNT, i ); | ||
1251 | |||
1252 | } | ||