summaryrefslogtreecommitdiff
path: root/noncore
authortille <tille>2003-06-02 15:12:10 (UTC)
committer tille <tille>2003-06-02 15:12:10 (UTC)
commit2d9798f244078089a0305d26509e288bb4a4190e (patch) (unidiff)
treefd1932ca218382dc607ee21dd754693e30ef74e9 /noncore
parent6f49eaa7cf9589bf1f3f4277dc6dbd4d35cb0462 (diff)
downloadopie-2d9798f244078089a0305d26509e288bb4a4190e.zip
opie-2d9798f244078089a0305d26509e288bb4a4190e.tar.gz
opie-2d9798f244078089a0305d26509e288bb4a4190e.tar.bz2
impl remove item
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/TODO2
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp5
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp11
3 files changed, 9 insertions, 9 deletions
diff --git a/noncore/settings/networksettings/ppp/TODO b/noncore/settings/networksettings/ppp/TODO
index 529d236..5635438 100644
--- a/noncore/settings/networksettings/ppp/TODO
+++ b/noncore/settings/networksettings/ppp/TODO
@@ -1,7 +1,7 @@
1- add possibility to input username and password ;) 1- add possibility to input username and password ;)
2- impl. PPPData::copyaccount & PPPData::deleteAccount 2- impl. PPPData::copyaccount & PPPData::deleteAccount
3- update modem attribute inputs when modem has changed 3- update modem attribute inputs when modem has changed
4- fix layout of edit account, i.e. get it shown maximised 4- fix layout of edit account, i.e. get it shown maximised
5- popup configure modem with the correct account prselected 5- popup configure modem with the correct account prselected
6 not quite shure why it does not work... IMHO it should work 6 not quite shure why it does not work... IMHO it should work
7- remove interfaces 7
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp
index 517dd8b..23db409 100644
--- a/noncore/settings/networksettings/ppp/pppdata.cpp
+++ b/noncore/settings/networksettings/ppp/pppdata.cpp
@@ -1200,96 +1200,99 @@ void PPPData::setpppdArgumentDefaults() {
1200 // QColor &text, 1200 // QColor &text,
1201 // QColor &in, 1201 // QColor &in,
1202 // QColor &out) 1202 // QColor &out)
1203// { 1203// {
1204// QColor c; 1204// QColor c;
1205 1205
1206// if(config) { 1206// if(config) {
1207// config->setGroup(GRAPH_GRP); 1207// config->setGroup(GRAPH_GRP);
1208// enable = config->readBoolEntry(GENABLED, true); 1208// enable = config->readBoolEntry(GENABLED, true);
1209// bg = Qt::white; 1209// bg = Qt::white;
1210// //bg = config->readColorEntry(GCOLOR_BG, &c); 1210// //bg = config->readColorEntry(GCOLOR_BG, &c);
1211// text = Qt::black; 1211// text = Qt::black;
1212// //text = config->readColorEntry(GCOLOR_TEXT, &c); 1212// //text = config->readColorEntry(GCOLOR_TEXT, &c);
1213// in = Qt::blue; 1213// in = Qt::blue;
1214// //in = config->readColorEntry(GCOLOR_IN, &c); 1214// //in = config->readColorEntry(GCOLOR_IN, &c);
1215// out = Qt::red; 1215// out = Qt::red;
1216// //out = config->readColorEntry(GCOLOR_OUT, &c); 1216// //out = config->readColorEntry(GCOLOR_OUT, &c);
1217// } 1217// }
1218// } 1218// }
1219 1219
1220 1220
1221// bool PPPData::graphingEnabled() { 1221// bool PPPData::graphingEnabled() {
1222// return (bool) readNumConfig(GRAPH_GRP, GENABLED, true); 1222// return (bool) readNumConfig(GRAPH_GRP, GENABLED, true);
1223// } 1223// }
1224 1224
1225 1225
1226 1226
1227// 1227//
1228//functions to change/set the child pppd process info 1228//functions to change/set the child pppd process info
1229// 1229//
1230bool PPPData::pppdRunning() const { 1230bool PPPData::pppdRunning() const {
1231 return pppdisrunning; 1231 return pppdisrunning;
1232} 1232}
1233 1233
1234void PPPData::setpppdRunning(bool set) { 1234void PPPData::setpppdRunning(bool set) {
1235 pppdisrunning = set; 1235 pppdisrunning = set;
1236} 1236}
1237 1237
1238int PPPData::pppdError() const { 1238int PPPData::pppdError() const {
1239 return pppderror; 1239 return pppderror;
1240} 1240}
1241 1241
1242void PPPData::setpppdError(int err) { 1242void PPPData::setpppdError(int err) {
1243 pppderror = err; 1243 pppderror = err;
1244} 1244}
1245 1245
1246QString PPPData::modemGroup() 1246QString PPPData::modemGroup()
1247{ 1247{
1248 if (modemDeviceGroup<0)qFatal("wrong modem %i",modemDeviceGroup); 1248 if (modemDeviceGroup<0){
1249 qDebug("wrong modem %i\n using 0",modemDeviceGroup);
1250 modemDeviceGroup = 0; //FIXME!
1251 }
1249 return QString("%1_%1").arg(MODEM_GRP).arg(modemDeviceGroup); 1252 return QString("%1_%1").arg(MODEM_GRP).arg(modemDeviceGroup);
1250} 1253}
1251 1254
1252 1255
1253QMap<QString,QString> PPPData::getConfiguredInterfaces() 1256QMap<QString,QString> PPPData::getConfiguredInterfaces()
1254{ 1257{
1255 QMap<QString,QString> ifaces; 1258 QMap<QString,QString> ifaces;
1256 Config config = PPPData::config(); 1259 Config config = PPPData::config();
1257 config.setGroup(ACCLIST_GRP); 1260 config.setGroup(ACCLIST_GRP);
1258 int count = config.readNumEntry( ACCOUNTS_COUNT, -1 ); 1261 int count = config.readNumEntry( ACCOUNTS_COUNT, -1 );
1259 QString accGrp, dev, acc; 1262 QString accGrp, dev, acc;
1260 for (int i = 0; i < count; i++){ 1263 for (int i = 0; i < count; i++){
1261 accGrp = QString("%1_%1").arg(ACCLIST_GRP).arg(i); 1264 accGrp = QString("%1_%1").arg(ACCLIST_GRP).arg(i);
1262 config.setGroup(accGrp); 1265 config.setGroup(accGrp);
1263 dev = config.readEntry( ACOUNTS_DEV, "error" ); 1266 dev = config.readEntry( ACOUNTS_DEV, "error" );
1264 acc = config.readEntry( ACOUNTS_ACC, "error" ); 1267 acc = config.readEntry( ACOUNTS_ACC, "error" );
1265 ifaces.insert( dev, acc ); 1268 ifaces.insert( dev, acc );
1266 } 1269 }
1267 1270
1268 return ifaces; 1271 return ifaces;
1269} 1272}
1270 1273
1271void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces ) 1274void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces )
1272{ 1275{
1273 QMap<QString,QString>::Iterator it; 1276 QMap<QString,QString>::Iterator it;
1274 int i = 0; 1277 int i = 0;
1275 Config cfg = config(); 1278 Config cfg = config();
1276 for( it = ifaces.begin(); it != ifaces.end(); ++it, ++i ){ 1279 for( it = ifaces.begin(); it != ifaces.end(); ++it, ++i ){
1277 cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i)); 1280 cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i));
1278 cfg.writeEntry( ACOUNTS_DEV, it.key() ); 1281 cfg.writeEntry( ACOUNTS_DEV, it.key() );
1279 cfg.writeEntry( ACOUNTS_ACC, it.data() ); 1282 cfg.writeEntry( ACOUNTS_ACC, it.data() );
1280 } 1283 }
1281 cfg.setGroup( ACCLIST_GRP ); 1284 cfg.setGroup( ACCLIST_GRP );
1282 cfg.writeEntry( ACCOUNTS_COUNT, i ); 1285 cfg.writeEntry( ACCOUNTS_COUNT, i );
1283 1286
1284} 1287}
1285 1288
1286/** 1289/**
1287 * pppd's getword() function knows about escape characters. 1290 * pppd's getword() function knows about escape characters.
1288 * If we write the username and password to the secrets file 1291 * If we write the username and password to the secrets file
1289 * we'll therefore have to escape back slashes. 1292 * we'll therefore have to escape back slashes.
1290 */ 1293 */
1291QString PPPData::encodeWord(const QString &s) { 1294QString PPPData::encodeWord(const QString &s) {
1292 QString r = s; 1295 QString r = s;
1293 r.replace(QRegExp("\\"), "\\\\"); 1296 r.replace(QRegExp("\\"), "\\\\");
1294 return r; 1297 return r;
1295} 1298}
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index 95df068..8c401a9 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -60,83 +60,80 @@ QString PPPModule::getPixmapName(Interface* ){
60bool PPPModule::isOwner(Interface *i){ 60bool PPPModule::isOwner(Interface *i){
61 return list.find( i ) != -1; 61 return list.find( i ) != -1;
62} 62}
63 63
64/** 64/**
65 * Create, and return the WLANConfigure Module 65 * Create, and return the WLANConfigure Module
66 * @return QWidget* pointer to this modules configure. 66 * @return QWidget* pointer to this modules configure.
67 */ 67 */
68QWidget *PPPModule::configure(Interface *i){ 68QWidget *PPPModule::configure(Interface *i){
69 qDebug("return ModemWidget"); 69 qDebug("return ModemWidget");
70 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, 70 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
71 0, "PPPConfig", false, 71 0, "PPPConfig", false,
72 Qt::WDestructiveClose ); 72 Qt::WDestructiveClose );
73 return pppconfig; 73 return pppconfig;
74} 74}
75 75
76/** 76/**
77 * Create, and return the Information Module 77 * Create, and return the Information Module
78 * @return QWidget* pointer to this modules info. 78 * @return QWidget* pointer to this modules info.
79 */ 79 */
80QWidget *PPPModule::information(Interface *i){ 80QWidget *PPPModule::information(Interface *i){
81 // We don't have any advanced pppd information widget yet :-D 81 // We don't have any advanced pppd information widget yet :-D
82 // TODO ^ 82 // TODO ^
83 qDebug("return PPPModule::information"); 83 qDebug("return PPPModule::information");
84// InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); 84// InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i);
85 InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); 85 InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i );
86 return information; 86 return information;
87} 87}
88 88
89/** 89/**
90 * Get all active (up or down) interfaces 90 * Get all active (up or down) interfaces
91 * @return QList<Interface> A list of interfaces that exsist that havn't 91 * @return QList<Interface> A list of interfaces that exsist that havn't
92 * been called by isOwner() 92 * been called by isOwner()
93 */ 93 */
94QList<Interface> PPPModule::getInterfaces(){ 94QList<Interface> PPPModule::getInterfaces(){
95 // List all of the files in the peer directory 95 // List all of the files in the peer directory
96 qDebug("PPPModule::getInterfaces"); 96 qDebug("PPPModule::getInterfaces");
97 return list; 97 return list;
98} 98}
99 99
100/** 100/**
101 * Attempt to add a new interface as defined by name 101 * Attempt to add a new interface as defined by name
102 * @param name the name of the type of interface that should be created given 102 * @param name the name of the type of interface that should be created given
103 * by possibleNewInterfaces(); 103 * by possibleNewInterfaces();
104 * @return Interface* NULL if it was unable to be created. 104 * @return Interface* NULL if it was unable to be created.
105 */ 105 */
106Interface *PPPModule::addNewInterface(const QString &newInterface){ 106Interface *PPPModule::addNewInterface(const QString &newInterface){
107 107
108 qDebug("try to add iface %s",newInterface.latin1());
109
110 InterfacePPP *ifaceppp; 108 InterfacePPP *ifaceppp;
111 Interface *iface; 109 Interface *iface;
112 ifaceppp = new InterfacePPP(); 110 ifaceppp = new InterfacePPP();
113 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true); 111 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true);
114 imp.showMaximized(); 112 imp.showMaximized();
115 if(imp.exec() == QDialog::Accepted ){ 113 if(imp.exec() == QDialog::Accepted ){
114 iface = (InterfacePPP*) ifaceppp;
116 iface->setModuleOwner( this ); 115 iface->setModuleOwner( this );
117 iface = ifaceppp;
118 list.append( iface ); 116 list.append( iface );
119 return iface; 117 return iface;
120 }else { 118 }else {
121 delete iface; 119 delete ifaceppp;
122 iface = NULL; 120 iface = NULL;
123 } 121 }
124 return iface; 122 return iface;
125} 123}
126 124
127/** 125/**
128 * Attempts to remove the interface, doesn't delete i 126 * Attempts to remove the interface, doesn't delete i
129 * @return bool true if successfull, false otherwise. 127 * @return bool true if successfull, false otherwise.
130 */ 128 */
131bool PPPModule::remove(Interface*){ 129bool PPPModule::remove(Interface *i){
132 // Can't remove a hardware device, you can stop it though. 130 return list.remove(i);
133 return false;
134} 131}
135 132
136void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) 133void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
137{ 134{
138 newIfaces.insert(QObject::tr("PPP") , 135 newIfaces.insert(QObject::tr("PPP") ,
139 QObject::tr("generic ppp device")); 136 QObject::tr("generic ppp device"));
140} 137}
141 138
142 139