author | tille <tille> | 2003-05-24 16:12:02 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-24 16:12:02 (UTC) |
commit | cc1aa3e178dff65854913bd5667579fc33ce707d (patch) (unidiff) | |
tree | d37d7fd8fb3b9832c0825b015af862f2cc62f473 /noncore/settings | |
parent | 5667ded1d4583cfb79b2ddfd7aaae0e58ed6d552 (diff) | |
download | opie-cc1aa3e178dff65854913bd5667579fc33ce707d.zip opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.gz opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.bz2 |
saves config (still in the kppp way)
17 files changed, 615 insertions, 642 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp index d902517..19db9ef 100644 --- a/noncore/settings/networksettings/ppp/accounts.cpp +++ b/noncore/settings/networksettings/ppp/accounts.cpp | |||
@@ -54,5 +54,5 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
54 | : QWidget( parent, name ) | 54 | : QWidget( parent, name ) |
55 | { | 55 | { |
56 | int min = 0; | 56 | // int min = 0; |
57 | QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); | 57 | QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); |
58 | 58 | ||
@@ -62,5 +62,5 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
62 | 62 | ||
63 | accountlist_l = new QListBox(this); | 63 | accountlist_l = new QListBox(this); |
64 | accountlist_l->setMinimumSize(160, 128); | 64 | // accountlist_l->setMinimumSize(160, 128); |
65 | connect(accountlist_l, SIGNAL(highlighted(int)), | 65 | connect(accountlist_l, SIGNAL(highlighted(int)), |
66 | this, SLOT(slotListBoxSelect(int))); | 66 | this, SLOT(slotListBoxSelect(int))); |
@@ -75,7 +75,7 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
75 | QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account")); | 75 | QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account")); |
76 | 76 | ||
77 | min = edit_b->sizeHint().width(); | 77 | // min = edit_b->sizeHint().width(); |
78 | min = QMAX(70,min); | 78 | // min = QMAX(70,min); |
79 | edit_b->setMinimumWidth(min); | 79 | // edit_b->setMinimumWidth(min); |
80 | 80 | ||
81 | l1->addWidget(edit_b); | 81 | l1->addWidget(edit_b); |
@@ -166,8 +166,8 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
166 | 166 | ||
167 | //load up account list from gppdata to the list box | 167 | //load up account list from gppdata to the list box |
168 | if(gpppdata.count() > 0) { | 168 | if(PPPData::data()->count() > 0) { |
169 | for(int i=0; i <= gpppdata.count()-1; i++) { | 169 | for(int i=0; i <= PPPData::data()->count()-1; i++) { |
170 | gpppdata.setAccountbyIndex(i); | 170 | PPPData::data()->setAccountbyIndex(i); |
171 | accountlist_l->insertItem(gpppdata.accname()); | 171 | accountlist_l->insertItem(PPPData::data()->accname()); |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -185,6 +185,6 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
185 | copy_b->setEnabled((bool)(idx != -1)); | 185 | copy_b->setEnabled((bool)(idx != -1)); |
186 | if(idx!=-1) { | 186 | if(idx!=-1) { |
187 | QString account = gpppdata.accname(); | 187 | QString account = PPPData::data()->accname(); |
188 | gpppdata.setAccountbyIndex(accountlist_l->currentItem()); | 188 | PPPData::data()->setAccountbyIndex(accountlist_l->currentItem()); |
189 | // reset->setEnabled(TRUE); | 189 | // reset->setEnabled(TRUE); |
190 | // costlabel->setEnabled(TRUE); | 190 | // costlabel->setEnabled(TRUE); |
@@ -194,7 +194,7 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
194 | // vollabel->setEnabled(TRUE); | 194 | // vollabel->setEnabled(TRUE); |
195 | // voledit->setEnabled(TRUE); | 195 | // voledit->setEnabled(TRUE); |
196 | int bytes = gpppdata.totalBytes(); | 196 | // int bytes = PPPData::data()->totalBytes(); |
197 | // voledit->setText(prettyPrintVolume(bytes)); | 197 | // voledit->setText(prettyPrintVolume(bytes)); |
198 | gpppdata.setAccount(account); | 198 | PPPData::data()->setAccount(account); |
199 | } else{ | 199 | } else{ |
200 | // reset->setEnabled(FALSE); | 200 | // reset->setEnabled(FALSE); |
@@ -241,12 +241,12 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
241 | 241 | ||
242 | void AccountWidget::editaccount() { | 242 | void AccountWidget::editaccount() { |
243 | gpppdata.setAccount(accountlist_l->text(accountlist_l->currentItem())); | 243 | PPPData::data()->setAccount(accountlist_l->text(accountlist_l->currentItem())); |
244 | 244 | ||
245 | int result = doTab(); | 245 | int result = doTab(); |
246 | 246 | ||
247 | if(result == QDialog::Accepted) { | 247 | if(result == QDialog::Accepted) { |
248 | accountlist_l->changeItem(gpppdata.accname(),accountlist_l->currentItem()); | 248 | accountlist_l->changeItem(PPPData::data()->accname(),accountlist_l->currentItem()); |
249 | // emit resetaccounts(); | 249 | // emit resetaccounts(); |
250 | gpppdata.save(); | 250 | PPPData::data()->save(); |
251 | } | 251 | } |
252 | } | 252 | } |
@@ -272,5 +272,5 @@ void AccountWidget::newaccount() { | |||
272 | // case QMessageBox::Yes: | 272 | // case QMessageBox::Yes: |
273 | // { | 273 | // { |
274 | // if (gpppdata.newaccount() == -1) | 274 | // if (PPPData::data()->newaccount() == -1) |
275 | // return; | 275 | // return; |
276 | // // ProviderDB pdb(this); | 276 | // // ProviderDB pdb(this); |
@@ -279,6 +279,6 @@ void AccountWidget::newaccount() { | |||
279 | // } | 279 | // } |
280 | // case QMessageBox::No: | 280 | // case QMessageBox::No: |
281 | if (gpppdata.newaccount() == -1){ | 281 | if (PPPData::data()->newaccount() == -1){ |
282 | qDebug("gpppdata.newaccount() == -1"); | 282 | qDebug("PPPData::data()->newaccount() == -1"); |
283 | return; | 283 | return; |
284 | } | 284 | } |
@@ -290,11 +290,11 @@ void AccountWidget::newaccount() { | |||
290 | 290 | ||
291 | if(result == QDialog::Accepted) { | 291 | if(result == QDialog::Accepted) { |
292 | accountlist_l->insertItem(gpppdata.accname()); | 292 | accountlist_l->insertItem(PPPData::data()->accname()); |
293 | accountlist_l->setSelected(accountlist_l->findItem(gpppdata.accname()), | 293 | accountlist_l->setSelected(accountlist_l->findItem(PPPData::data()->accname()), |
294 | true); | 294 | true); |
295 | // emit resetaccounts(); | 295 | // emit resetaccounts(); |
296 | gpppdata.save(); | 296 | PPPData::data()->save(); |
297 | } else | 297 | } else |
298 | gpppdata.deleteAccount(); | 298 | PPPData::data()->deleteAccount(); |
299 | } | 299 | } |
300 | 300 | ||
@@ -311,9 +311,9 @@ void AccountWidget::copyaccount() { | |||
311 | } | 311 | } |
312 | 312 | ||
313 | gpppdata.copyaccount(accountlist_l->currentItem()); | 313 | PPPData::data()->copyaccount(accountlist_l->currentItem()); |
314 | 314 | ||
315 | accountlist_l->insertItem(gpppdata.accname()); | 315 | accountlist_l->insertItem(PPPData::data()->accname()); |
316 | // emit resetaccounts(); | 316 | // emit resetaccounts(); |
317 | gpppdata.save(); | 317 | PPPData::data()->save(); |
318 | } | 318 | } |
319 | 319 | ||
@@ -327,9 +327,9 @@ void AccountWidget::deleteaccount() { | |||
327 | return; | 327 | return; |
328 | 328 | ||
329 | if(gpppdata.deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) | 329 | if(PPPData::data()->deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) |
330 | accountlist_l->removeItem(accountlist_l->currentItem()); | 330 | accountlist_l->removeItem(accountlist_l->currentItem()); |
331 | 331 | ||
332 | emit resetaccounts(); | 332 | emit resetaccounts(); |
333 | gpppdata.save(); | 333 | PPPData::data()->save(); |
334 | 334 | ||
335 | slotListBoxSelect(accountlist_l->currentItem()); | 335 | slotListBoxSelect(accountlist_l->currentItem()); |
@@ -339,34 +339,36 @@ void AccountWidget::deleteaccount() { | |||
339 | 339 | ||
340 | int AccountWidget::doTab(){ | 340 | int AccountWidget::doTab(){ |
341 | QDialog *dlg = new QDialog( this ); | 341 | QDialog *dlg = new QDialog( this, "newAccount", true ); |
342 | tabWindow = new QTabWidget( dlg ); | 342 | QVBoxLayout *layout = new QVBoxLayout( dlg ); |
343 | // tabWindow = new KDialogBase( KDialogBase::Tabbed, QString::null, | 343 | layout->setSpacing( 0 ); |
344 | // KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, | 344 | layout->setMargin( 1 ); |
345 | // 0, 0, true); | 345 | |
346 | // KWin::setIcons(tabWindow->winId(), kapp->icon(), kapp->miniIcon()); | 346 | tabWindow = new QTabWidget( dlg, "tabWindow" ); |
347 | layout->addWidget( tabWindow ); | ||
348 | |||
347 | bool isnewaccount; | 349 | bool isnewaccount; |
348 | 350 | ||
349 | if(gpppdata.accname().isEmpty()) { | 351 | if(PPPData::data()->accname().isEmpty()) { |
350 | tabWindow->setCaption(i18n("New Account")); | 352 | dlg->setCaption(i18n("New Account")); |
351 | isnewaccount = true; | 353 | isnewaccount = true; |
352 | } else { | 354 | } else { |
353 | QString tit = i18n("Edit Account: "); | 355 | QString tit = i18n("Edit Account: "); |
354 | tit += gpppdata.accname(); | 356 | tit += PPPData::data()->accname(); |
355 | tabWindow->setCaption(tit); | 357 | dlg->setCaption(tit); |
356 | isnewaccount = false; | 358 | isnewaccount = false; |
357 | } | 359 | } |
358 | 360 | ||
359 | dial_w = new DialWidget( tabWindow ); | 361 | dial_w = new DialWidget( tabWindow, isnewaccount, "Dial Setup"); |
360 | tabWindow->addTab( dial_w, i18n("Dial") );//, i18n("Dial Setup")), isnewaccount); | 362 | tabWindow->addTab( dial_w, i18n("Dial") ); |
361 | ip_w = new IPWidget( tabWindow ); | 363 | ip_w = new IPWidget( tabWindow, isnewaccount, i18n("IP Setup")); |
362 | tabWindow->addTab( ip_w, i18n("IP") );//, i18n("IP Setup")), isnewaccount); | 364 | tabWindow->addTab( ip_w, i18n("IP") ); |
363 | gateway_w = new GatewayWidget( tabWindow ); | 365 | gateway_w = new GatewayWidget( tabWindow, isnewaccount, i18n("Gateway Setup")); |
364 | tabWindow->addTab( gateway_w, i18n("Gateway") );//, i18n("Gateway Setup")), isnewaccount); | 366 | tabWindow->addTab( gateway_w, i18n("Gateway") ); |
365 | dns_w = new DNSWidget( tabWindow ); | 367 | dns_w = new DNSWidget( tabWindow, isnewaccount, i18n("DNS Servers") ); |
366 | tabWindow->addTab( dns_w, i18n("DNS") );//, i18n("DNS Servers")), isnewaccount); | 368 | tabWindow->addTab( dns_w, i18n("DNS") ); |
367 | script_w = new ScriptWidget( tabWindow ); | 369 | script_w = new ScriptWidget( tabWindow, isnewaccount, i18n("Edit Login Script")); |
368 | tabWindow->addTab( script_w, i18n("Login Script") ); //, i18n("Edit Login Script")), isnewaccount); | 370 | tabWindow->addTab( script_w, i18n("Login Script") ); |
369 | ExecWidget *exec_w = new ExecWidget( tabWindow ); | 371 | ExecWidget *exec_w = new ExecWidget( tabWindow, isnewaccount, i18n("Execute Programs")); |
370 | tabWindow->addTab( exec_w, i18n("Execute") );//, i18n("Execute Programs")), isnewaccount); | 372 | tabWindow->addTab( exec_w, i18n("Execute") ); |
371 | // acct = new AccountingSelector( tabWindow, isnewaccount ); | 373 | // acct = new AccountingSelector( tabWindow, isnewaccount ); |
372 | // tabWindow->addTab( acct, i18n("Accounting")); | 374 | // tabWindow->addTab( acct, i18n("Accounting")); |
@@ -374,4 +376,6 @@ int AccountWidget::doTab(){ | |||
374 | int result = 0; | 376 | int result = 0; |
375 | bool ok = false; | 377 | bool ok = false; |
378 | qDebug("AccountWidget::doTab dlg->showMinimized"); | ||
379 | dlg->showMinimized(); | ||
376 | while (!ok){ | 380 | while (!ok){ |
377 | 381 | ||
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp index b7e229e..a3eda9d 100644 --- a/noncore/settings/networksettings/ppp/connect.cpp +++ b/noncore/settings/networksettings/ppp/connect.cpp | |||
@@ -180,5 +180,5 @@ void ConnectWidget::preinit() { | |||
180 | 180 | ||
181 | void ConnectWidget::init() { | 181 | void ConnectWidget::init() { |
182 | gpppdata.setpppdError(0); | 182 | PPPData::data()->setpppdError(0); |
183 | inittimer->stop(); | 183 | inittimer->stop(); |
184 | vmain = 0; | 184 | vmain = 0; |
@@ -197,10 +197,10 @@ void ConnectWidget::init() { | |||
197 | p_kppp->con_speed = ""; | 197 | p_kppp->con_speed = ""; |
198 | 198 | ||
199 | // p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || gpppdata.quit_on_disconnect()); | 199 | // p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || PPPData::data()->quit_on_disconnect()); |
200 | 200 | ||
201 | comlist = &gpppdata.scriptType(); | 201 | comlist = &PPPData::data()->scriptType(); |
202 | arglist = &gpppdata.script(); | 202 | arglist = &PPPData::data()->script(); |
203 | 203 | ||
204 | QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); | 204 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); |
205 | setCaption(tit); | 205 | setCaption(tit); |
206 | 206 | ||
@@ -208,5 +208,5 @@ void ConnectWidget::init() { | |||
208 | 208 | ||
209 | // run the "before-connect" command | 209 | // run the "before-connect" command |
210 | if (!gpppdata.command_before_connect().isEmpty()) { | 210 | if (!PPPData::data()->command_before_connect().isEmpty()) { |
211 | messg->setText(i18n("Running pre-startup command...")); | 211 | messg->setText(i18n("Running pre-startup command...")); |
212 | emit debugMessage(i18n("Running pre-startup command...")); | 212 | emit debugMessage(i18n("Running pre-startup command...")); |
@@ -214,5 +214,5 @@ void ConnectWidget::init() { | |||
214 | qApp->processEvents(); | 214 | qApp->processEvents(); |
215 | QApplication::flushX(); | 215 | QApplication::flushX(); |
216 | pid_t id = execute_command(gpppdata.command_before_connect()); | 216 | pid_t id = execute_command(PPPData::data()->command_before_connect()); |
217 | // int i, status; | 217 | // int i, status; |
218 | 218 | ||
@@ -251,5 +251,5 @@ void ConnectWidget::init() { | |||
251 | 251 | ||
252 | // if we are stuck anywhere we will time out | 252 | // if we are stuck anywhere we will time out |
253 | timeout_timer->start(gpppdata.modemTimeout()*1000); | 253 | timeout_timer->start(PPPData::data()->modemTimeout()*1000); |
254 | 254 | ||
255 | // this timer will run the script etc. | 255 | // this timer will run the script etc. |
@@ -285,16 +285,16 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
285 | } | 285 | } |
286 | 286 | ||
287 | QString initStr = gpppdata.modemInitStr(substate); | 287 | QString initStr = PPPData::data()->modemInitStr(substate); |
288 | if (!initStr.isEmpty()) { | 288 | if (!initStr.isEmpty()) { |
289 | // send a carriage return and then wait a bit so that the modem will | 289 | // send a carriage return and then wait a bit so that the modem will |
290 | // let us issue commands. | 290 | // let us issue commands. |
291 | if(gpppdata.modemPreInitDelay() > 0) { | 291 | if(PPPData::data()->modemPreInitDelay() > 0) { |
292 | usleep(gpppdata.modemPreInitDelay() * 5000); | 292 | usleep(PPPData::data()->modemPreInitDelay() * 5000); |
293 | writeline(""); | 293 | writeline(""); |
294 | usleep(gpppdata.modemPreInitDelay() * 5000); | 294 | usleep(PPPData::data()->modemPreInitDelay() * 5000); |
295 | } | 295 | } |
296 | setExpect(gpppdata.modemInitResp()); | 296 | setExpect(PPPData::data()->modemInitResp()); |
297 | writeline(initStr); | 297 | writeline(initStr); |
298 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec | 298 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec |
299 | } | 299 | } |
300 | 300 | ||
@@ -307,5 +307,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
307 | * a "Modem Query" | 307 | * a "Modem Query" |
308 | */ | 308 | */ |
309 | if (MODEM_TONEDURATION != gpppdata.modemToneDuration()) | 309 | if (MODEM_TONEDURATION != PPPData::data()->modemToneDuration()) |
310 | vmain = 5; | 310 | vmain = 5; |
311 | else | 311 | else |
@@ -317,9 +317,9 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
317 | if (vmain == 5) { | 317 | if (vmain == 5) { |
318 | if(!expecting) { | 318 | if(!expecting) { |
319 | QString sToneDuration = "ATS11=" + QString::number(gpppdata.modemToneDuration()); | 319 | QString sToneDuration = "ATS11=" + QString::number(PPPData::data()->modemToneDuration()); |
320 | QString msg = i18n("Setting ") + sToneDuration; | 320 | QString msg = i18n("Setting ") + sToneDuration; |
321 | messg->setText(msg); | 321 | messg->setText(msg); |
322 | emit debugMessage(msg); | 322 | emit debugMessage(msg); |
323 | setExpect(gpppdata.modemInitResp()); | 323 | setExpect(PPPData::data()->modemInitResp()); |
324 | writeline(sToneDuration); | 324 | writeline(sToneDuration); |
325 | } | 325 | } |
@@ -337,5 +337,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
337 | substate = -1; | 337 | substate = -1; |
338 | // skip setting the volume if command is empty | 338 | // skip setting the volume if command is empty |
339 | if(gpppdata.volumeInitString().isEmpty()) { | 339 | if(PPPData::data()->volumeInitString().isEmpty()) { |
340 | vmain = 4; | 340 | vmain = 4; |
341 | return; | 341 | return; |
@@ -344,9 +344,9 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
344 | emit debugMessage(i18n("Setting speaker volume...")); | 344 | emit debugMessage(i18n("Setting speaker volume...")); |
345 | 345 | ||
346 | setExpect(gpppdata.modemInitResp()); | 346 | setExpect(PPPData::data()->modemInitResp()); |
347 | QString vol("AT"); | 347 | QString vol("AT"); |
348 | vol += gpppdata.volumeInitString(); | 348 | vol += PPPData::data()->volumeInitString(); |
349 | writeline(vol); | 349 | writeline(vol); |
350 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec | 350 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec |
351 | vmain = 4; | 351 | vmain = 4; |
352 | return; | 352 | return; |
@@ -356,10 +356,10 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
356 | if(vmain == 4) { | 356 | if(vmain == 4) { |
357 | if(!expecting) { | 357 | if(!expecting) { |
358 | if(!gpppdata.waitForDialTone()) { | 358 | if(!PPPData::data()->waitForDialTone()) { |
359 | QString msg = i18n("Turning off dial tone waiting..."); | 359 | QString msg = i18n("Turning off dial tone waiting..."); |
360 | messg->setText(msg); | 360 | messg->setText(msg); |
361 | emit debugMessage(msg); | 361 | emit debugMessage(msg); |
362 | setExpect(gpppdata.modemInitResp()); | 362 | setExpect(PPPData::data()->modemInitResp()); |
363 | writeline(gpppdata.modemNoDialToneDetectionStr()); | 363 | writeline(PPPData::data()->modemNoDialToneDetectionStr()); |
364 | } | 364 | } |
365 | vmain = 1; | 365 | vmain = 1; |
@@ -373,8 +373,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
373 | 373 | ||
374 | timeout_timer->stop(); | 374 | timeout_timer->stop(); |
375 | timeout_timer->start(gpppdata.modemTimeout()*1000); | 375 | timeout_timer->start(PPPData::data()->modemTimeout()*1000); |
376 | 376 | ||
377 | QStringList &plist = gpppdata.phonenumbers(); | 377 | QStringList &plist = PPPData::data()->phonenumbers(); |
378 | QString bmarg= gpppdata.dialPrefix(); | 378 | QString bmarg= PPPData::data()->dialPrefix(); |
379 | bmarg += *plist.at(dialnumber); | 379 | bmarg += *plist.at(dialnumber); |
380 | QString bm = i18n("Dialing %1").arg(bmarg); | 380 | QString bm = i18n("Dialing %1").arg(bmarg); |
@@ -382,6 +382,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
382 | emit debugMessage(bm); | 382 | emit debugMessage(bm); |
383 | 383 | ||
384 | QString pn = gpppdata.modemDialStr(); | 384 | QString pn = PPPData::data()->modemDialStr(); |
385 | pn += gpppdata.dialPrefix(); | 385 | pn += PPPData::data()->dialPrefix(); |
386 | pn += *plist.at(dialnumber); | 386 | pn += *plist.at(dialnumber); |
387 | if(++dialnumber >= plist.count()) | 387 | if(++dialnumber >= plist.count()) |
@@ -389,5 +389,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
389 | writeline(pn); | 389 | writeline(pn); |
390 | 390 | ||
391 | setExpect(gpppdata.modemConnectResp()); | 391 | setExpect(PPPData::data()->modemConnectResp()); |
392 | vmain = 100; | 392 | vmain = 100; |
393 | return; | 393 | return; |
@@ -399,5 +399,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
399 | if(vmain == 100) { | 399 | if(vmain == 100) { |
400 | if(!expecting) { | 400 | if(!expecting) { |
401 | myreadbuffer = gpppdata.modemConnectResp(); | 401 | myreadbuffer = PPPData::data()->modemConnectResp(); |
402 | setExpect("\n"); | 402 | setExpect("\n"); |
403 | vmain = 101; | 403 | vmain = 101; |
@@ -405,7 +405,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
405 | } | 405 | } |
406 | 406 | ||
407 | if(readbuffer.contains(gpppdata.modemBusyResp())) { | 407 | if(readbuffer.contains(PPPData::data()->modemBusyResp())) { |
408 | timeout_timer->stop(); | 408 | timeout_timer->stop(); |
409 | timeout_timer->start(gpppdata.modemTimeout()*1000); | 409 | timeout_timer->start(PPPData::data()->modemTimeout()*1000); |
410 | 410 | ||
411 | messg->setText(i18n("Line busy. Hanging up...")); | 411 | messg->setText(i18n("Line busy. Hanging up...")); |
@@ -413,6 +413,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
413 | Modem::modem->hangup(); | 413 | Modem::modem->hangup(); |
414 | 414 | ||
415 | if(gpppdata.busyWait() > 0) { | 415 | if(PPPData::data()->busyWait() > 0) { |
416 | QString bm = i18n("Line busy. Waiting: %1 seconds").arg(gpppdata.busyWait()); | 416 | QString bm = i18n("Line busy. Waiting: %1 seconds").arg(PPPData::data()->busyWait()); |
417 | messg->setText(bm); | 417 | messg->setText(bm); |
418 | emit debugMessage(bm); | 418 | emit debugMessage(bm); |
@@ -420,5 +420,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
420 | pausing = true; | 420 | pausing = true; |
421 | 421 | ||
422 | pausetimer->start(gpppdata.busyWait()*1000, true); | 422 | pausetimer->start(PPPData::data()->busyWait()*1000, true); |
423 | timeout_timer->stop(); | 423 | timeout_timer->stop(); |
424 | } | 424 | } |
@@ -430,5 +430,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
430 | } | 430 | } |
431 | 431 | ||
432 | if(readbuffer.contains(gpppdata.modemNoDialtoneResp())) { | 432 | if(readbuffer.contains(PPPData::data()->modemNoDialtoneResp())) { |
433 | timeout_timer->stop(); | 433 | timeout_timer->stop(); |
434 | 434 | ||
@@ -439,5 +439,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
439 | } | 439 | } |
440 | 440 | ||
441 | if(readbuffer.contains(gpppdata.modemNoCarrierResp())) { | 441 | if(readbuffer.contains(PPPData::data()->modemNoCarrierResp())) { |
442 | timeout_timer->stop(); | 442 | timeout_timer->stop(); |
443 | 443 | ||
@@ -458,5 +458,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
458 | 458 | ||
459 | vmain = 2; | 459 | vmain = 2; |
460 | scriptTimeout=gpppdata.modemTimeout()*1000; | 460 | scriptTimeout=PPPData::data()->modemTimeout()*1000; |
461 | return; | 461 | return; |
462 | } | 462 | } |
@@ -495,8 +495,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
495 | 495 | ||
496 | if (scriptArgument.lower() == "password") { | 496 | if (scriptArgument.lower() == "password") { |
497 | gpppdata.setPassword(scanvar); | 497 | PPPData::data()->setPassword(scanvar); |
498 | p_kppp->setPW_Edit(scanvar); | 498 | p_kppp->setPW_Edit(scanvar); |
499 | if(gpppdata.storePassword()) | 499 | if(PPPData::data()->storePassword()) |
500 | gpppdata.setStoredPassword(scanvar); | 500 | PPPData::data()->setStoredPassword(scanvar); |
501 | firstrunPW = true; | 501 | firstrunPW = true; |
502 | } | 502 | } |
@@ -514,6 +514,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
514 | QRegExp re1("%USERNAME%"); | 514 | QRegExp re1("%USERNAME%"); |
515 | QRegExp re2("%PASSWORD%"); | 515 | QRegExp re2("%PASSWORD%"); |
516 | arg = arg.replace(re1, gpppdata.storedUsername()); | 516 | arg = arg.replace(re1, PPPData::data()->storedUsername()); |
517 | arg = arg.replace(re2, gpppdata.storedPassword()); | 517 | arg = arg.replace(re2, PPPData::data()->storedPassword()); |
518 | 518 | ||
519 | if (scriptCommand == "Send") | 519 | if (scriptCommand == "Send") |
@@ -579,6 +579,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
579 | emit debugMessage(i18n("Hangup")); | 579 | emit debugMessage(i18n("Hangup")); |
580 | 580 | ||
581 | writeline(gpppdata.modemHangupStr()); | 581 | writeline(PPPData::data()->modemHangupStr()); |
582 | setExpect(gpppdata.modemHangupResp()); | 582 | setExpect(PPPData::data()->modemHangupResp()); |
583 | 583 | ||
584 | scriptindex++; | 584 | scriptindex++; |
@@ -593,5 +593,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
593 | emit debugMessage(i18n("Answer")); | 593 | emit debugMessage(i18n("Answer")); |
594 | 594 | ||
595 | setExpect(gpppdata.modemRingResp()); | 595 | setExpect(PPPData::data()->modemRingResp()); |
596 | vmain = 150; | 596 | vmain = 150; |
597 | return; | 597 | return; |
@@ -603,5 +603,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
603 | emit debugMessage(bm); | 603 | emit debugMessage(bm); |
604 | 604 | ||
605 | QString idstring = gpppdata.storedUsername(); | 605 | QString idstring = PPPData::data()->storedUsername(); |
606 | 606 | ||
607 | if(!idstring.isEmpty() && firstrunID) { | 607 | if(!idstring.isEmpty() && firstrunID) { |
@@ -639,5 +639,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
639 | emit debugMessage(bm); | 639 | emit debugMessage(bm); |
640 | 640 | ||
641 | QString pwstring = gpppdata.password(); | 641 | QString pwstring = PPPData::data()->password(); |
642 | 642 | ||
643 | if(!pwstring.isEmpty() && firstrunPW) { | 643 | if(!pwstring.isEmpty() && firstrunPW) { |
@@ -786,6 +786,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
786 | if(vmain == 150) { | 786 | if(vmain == 150) { |
787 | if(!expecting) { | 787 | if(!expecting) { |
788 | writeline(gpppdata.modemAnswerStr()); | 788 | writeline(PPPData::data()->modemAnswerStr()); |
789 | setExpect(gpppdata.modemAnswerResp()); | 789 | setExpect(PPPData::data()->modemAnswerResp()); |
790 | 790 | ||
791 | vmain = 2; | 791 | vmain = 2; |
@@ -815,5 +815,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
815 | Modem::modem->stop(); | 815 | Modem::modem->stop(); |
816 | 816 | ||
817 | if(gpppdata.authMethod() == AUTH_TERMINAL) { | 817 | if(PPPData::data()->authMethod() == AUTH_TERMINAL) { |
818 | // if (termwindow) { | 818 | // if (termwindow) { |
819 | // delete termwindow; | 819 | // delete termwindow; |
@@ -836,6 +836,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
836 | killTimer( main_timer_ID ); | 836 | killTimer( main_timer_ID ); |
837 | 837 | ||
838 | if_timeout_timer->start(gpppdata.pppdTimeout()*1000); | 838 | if_timeout_timer->start(PPPData::data()->pppdTimeout()*1000); |
839 | qDebug( "started if timeout timer with %i", gpppdata.pppdTimeout()*1000); | 839 | qDebug( "started if timeout timer with %i", PPPData::data()->pppdTimeout()*1000); |
840 | 840 | ||
841 | // find out PPP interface and notify the stats module | 841 | // find out PPP interface and notify the stats module |
@@ -850,5 +850,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
850 | 850 | ||
851 | if(result) { | 851 | if(result) { |
852 | if(!gpppdata.autoDNS()) | 852 | if(!PPPData::data()->autoDNS()) |
853 | adddns(); | 853 | adddns(); |
854 | 854 | ||
@@ -1064,5 +1064,5 @@ void ConnectWidget::if_waiting_timed_out() { | |||
1064 | qDebug("if_waiting_timed_out()"); | 1064 | qDebug("if_waiting_timed_out()"); |
1065 | 1065 | ||
1066 | gpppdata.setpppdError(E_IF_TIMEOUT); | 1066 | PPPData::data()->setpppdError(E_IF_TIMEOUT); |
1067 | 1067 | ||
1068 | // let's kill the stuck pppd | 1068 | // let's kill the stuck pppd |
@@ -1089,5 +1089,5 @@ void ConnectWidget::if_waiting_slot() { | |||
1089 | // if(!stats->ifIsUp()) { | 1089 | // if(!stats->ifIsUp()) { |
1090 | 1090 | ||
1091 | // if(gpppdata.pppdError() != 0) { | 1091 | // if(PPPData::data()->pppdError() != 0) { |
1092 | // // we are here if pppd died immediately after starting it. | 1092 | // // we are here if pppd died immediately after starting it. |
1093 | // pppdDied(); | 1093 | // pppdDied(); |
@@ -1106,5 +1106,5 @@ void ConnectWidget::if_waiting_slot() { | |||
1106 | usleep(200000); | 1106 | usleep(200000); |
1107 | 1107 | ||
1108 | if(gpppdata.autoDNS()) | 1108 | if(PPPData::data()->autoDNS()) |
1109 | addpeerdns(); | 1109 | addpeerdns(); |
1110 | 1110 | ||
@@ -1115,10 +1115,10 @@ void ConnectWidget::if_waiting_slot() { | |||
1115 | auto_hostname(); | 1115 | auto_hostname(); |
1116 | 1116 | ||
1117 | if(!gpppdata.command_on_connect().isEmpty()) { | 1117 | if(!PPPData::data()->command_on_connect().isEmpty()) { |
1118 | messg->setText(i18n("Running startup command...")); | 1118 | messg->setText(i18n("Running startup command...")); |
1119 | 1119 | ||
1120 | // make sure that we don't get any async errors | 1120 | // make sure that we don't get any async errors |
1121 | qApp->flushX(); | 1121 | qApp->flushX(); |
1122 | execute_command(gpppdata.command_on_connect()); | 1122 | execute_command(PPPData::data()->command_on_connect()); |
1123 | messg->setText(i18n("Done")); | 1123 | messg->setText(i18n("Done")); |
1124 | } | 1124 | } |
@@ -1142,5 +1142,5 @@ void ConnectWidget::if_waiting_slot() { | |||
1142 | // p_kppp->con_win->accounting(false); | 1142 | // p_kppp->con_win->accounting(false); |
1143 | 1143 | ||
1144 | if (gpppdata.get_dock_into_panel()) { | 1144 | if (PPPData::data()->get_dock_into_panel()) { |
1145 | // DockWidget::dock_widget->show(); | 1145 | // DockWidget::dock_widget->show(); |
1146 | // DockWidget::dock_widget->take_stats(); | 1146 | // DockWidget::dock_widget->take_stats(); |
@@ -1150,5 +1150,5 @@ void ConnectWidget::if_waiting_slot() { | |||
1150 | // p_kppp->con_win->show(); | 1150 | // p_kppp->con_win->show(); |
1151 | 1151 | ||
1152 | if(gpppdata.get_iconify_on_connect()) { | 1152 | if(PPPData::data()->get_iconify_on_connect()) { |
1153 | // p_kppp->con_win->showMinimized(); | 1153 | // p_kppp->con_win->showMinimized(); |
1154 | } | 1154 | } |
@@ -1169,15 +1169,15 @@ bool ConnectWidget::execppp() { | |||
1169 | // which is the serial port we connected stdin/stdout to in opener.cpp. | 1169 | // which is the serial port we connected stdin/stdout to in opener.cpp. |
1170 | // command += " "; | 1170 | // command += " "; |
1171 | // command += gpppdata.modemDevice(); | 1171 | // command += PPPData::data()->modemDevice(); |
1172 | 1172 | ||
1173 | command += " " + gpppdata.speed(); | 1173 | command += " " + PPPData::data()->speed(); |
1174 | 1174 | ||
1175 | command += " -detach"; | 1175 | command += " -detach"; |
1176 | 1176 | ||
1177 | if(gpppdata.ipaddr() != "0.0.0.0" || | 1177 | if(PPPData::data()->ipaddr() != "0.0.0.0" || |
1178 | gpppdata.gateway() != "0.0.0.0") { | 1178 | PPPData::data()->gateway() != "0.0.0.0") { |
1179 | if(gpppdata.ipaddr() != "0.0.0.0") { | 1179 | if(PPPData::data()->ipaddr() != "0.0.0.0") { |
1180 | command += " "; | 1180 | command += " "; |
1181 | command += gpppdata.ipaddr(); | 1181 | command += PPPData::data()->ipaddr(); |
1182 | command += ":"; | 1182 | command += ":"; |
1183 | } | 1183 | } |
@@ -1187,13 +1187,13 @@ bool ConnectWidget::execppp() { | |||
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | if(gpppdata.gateway() != "0.0.0.0") | 1189 | if(PPPData::data()->gateway() != "0.0.0.0") |
1190 | command += gpppdata.gateway(); | 1190 | command += PPPData::data()->gateway(); |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | if(gpppdata.subnetmask() != "0.0.0.0") | 1193 | if(PPPData::data()->subnetmask() != "0.0.0.0") |
1194 | command += " netmask " + gpppdata.subnetmask(); | 1194 | command += " netmask " + PPPData::data()->subnetmask(); |
1195 | 1195 | ||
1196 | if(gpppdata.flowcontrol() != "None") { | 1196 | if(PPPData::data()->flowcontrol() != "None") { |
1197 | if(gpppdata.flowcontrol() == "CRTSCTS") | 1197 | if(PPPData::data()->flowcontrol() == "CRTSCTS") |
1198 | command += " crtscts"; | 1198 | command += " crtscts"; |
1199 | else | 1199 | else |
@@ -1201,11 +1201,11 @@ bool ConnectWidget::execppp() { | |||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | if(gpppdata.defaultroute()) | 1203 | if(PPPData::data()->defaultroute()) |
1204 | command += " defaultroute"; | 1204 | command += " defaultroute"; |
1205 | 1205 | ||
1206 | if(gpppdata.autoDNS()) | 1206 | if(PPPData::data()->autoDNS()) |
1207 | command += " usepeerdns"; | 1207 | command += " usepeerdns"; |
1208 | 1208 | ||
1209 | QStringList &arglist = gpppdata.pppdArgument(); | 1209 | QStringList &arglist = PPPData::data()->pppdArgument(); |
1210 | for ( QStringList::Iterator it = arglist.begin(); | 1210 | for ( QStringList::Iterator it = arglist.begin(); |
1211 | it != arglist.end(); | 1211 | it != arglist.end(); |
@@ -1216,23 +1216,23 @@ bool ConnectWidget::execppp() { | |||
1216 | 1216 | ||
1217 | // PAP settings | 1217 | // PAP settings |
1218 | if(gpppdata.authMethod() == AUTH_PAP) { | 1218 | if(PPPData::data()->authMethod() == AUTH_PAP) { |
1219 | command += " -chap user "; | 1219 | command += " -chap user "; |
1220 | command = command + "\"" + gpppdata.storedUsername() + "\""; | 1220 | command = command + "\"" + PPPData::data()->storedUsername() + "\""; |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | // CHAP settings | 1223 | // CHAP settings |
1224 | if(gpppdata.authMethod() == AUTH_CHAP) { | 1224 | if(PPPData::data()->authMethod() == AUTH_CHAP) { |
1225 | command += " -pap user "; | 1225 | command += " -pap user "; |
1226 | command = command + "\"" + gpppdata.storedUsername() + "\""; | 1226 | command = command + "\"" + PPPData::data()->storedUsername() + "\""; |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | // PAP/CHAP settings | 1229 | // PAP/CHAP settings |
1230 | if(gpppdata.authMethod() == AUTH_PAPCHAP) { | 1230 | if(PPPData::data()->authMethod() == AUTH_PAPCHAP) { |
1231 | command += " user "; | 1231 | command += " user "; |
1232 | command = command + "\"" + gpppdata.storedUsername() + "\""; | 1232 | command = command + "\"" + PPPData::data()->storedUsername() + "\""; |
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | // check for debug | 1235 | // check for debug |
1236 | if(gpppdata.getPPPDebug()) | 1236 | if(PPPData::data()->getPPPDebug()) |
1237 | command += " debug"; | 1237 | command += " debug"; |
1238 | 1238 | ||
@@ -1278,6 +1278,6 @@ void auto_hostname() { | |||
1278 | old_hostname=tmp_str; // copy to QString | 1278 | old_hostname=tmp_str; // copy to QString |
1279 | 1279 | ||
1280 | // if (!p_kppp->stats->local_ip_address.isEmpty() && gpppdata.autoname()) { | 1280 | // if (!p_kppp->stats->local_ip_address.isEmpty() && PPPData::data()->autoname()) { |
1281 | if ( gpppdata.autoname()) { | 1281 | if ( PPPData::data()->autoname()) { |
1282 | // local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii()); | 1282 | // local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii()); |
1283 | hostname_entry=gethostbyaddr((const char *)&local_ip,sizeof(in_addr),AF_INET); | 1283 | hostname_entry=gethostbyaddr((const char *)&local_ip,sizeof(in_addr),AF_INET); |
@@ -1333,5 +1333,5 @@ void add_domain(const QString &domain) { | |||
1333 | ( resolv[j].contains("nameserver") | 1333 | ( resolv[j].contains("nameserver") |
1334 | && !resolv[j].contains("#kppp temp entry") | 1334 | && !resolv[j].contains("#kppp temp entry") |
1335 | && gpppdata.exDNSDisabled())) | 1335 | && PPPData::data()->exDNSDisabled())) |
1336 | && !resolv[j].contains("#entry disabled by kppp")) { | 1336 | && !resolv[j].contains("#entry disabled by kppp")) { |
1337 | QCString tmp = "# " + resolv[j].local8Bit() + | 1337 | QCString tmp = "# " + resolv[j].local8Bit() + |
@@ -1356,5 +1356,5 @@ void adddns() | |||
1356 | 1356 | ||
1357 | if ((fd = Modem::modem->openResolv(O_WRONLY|O_APPEND)) >= 0) { | 1357 | if ((fd = Modem::modem->openResolv(O_WRONLY|O_APPEND)) >= 0) { |
1358 | QStringList &dnslist = gpppdata.dns(); | 1358 | QStringList &dnslist = PPPData::data()->dns(); |
1359 | for ( QStringList::Iterator it = dnslist.begin(); | 1359 | for ( QStringList::Iterator it = dnslist.begin(); |
1360 | it != dnslist.end(); | 1360 | it != dnslist.end(); |
@@ -1367,5 +1367,5 @@ void adddns() | |||
1367 | close(fd); | 1367 | close(fd); |
1368 | } | 1368 | } |
1369 | add_domain(gpppdata.domain()); | 1369 | add_domain(PPPData::data()->domain()); |
1370 | } | 1370 | } |
1371 | 1371 | ||
@@ -1388,5 +1388,5 @@ void addpeerdns() { | |||
1388 | close(fd); | 1388 | close(fd); |
1389 | } | 1389 | } |
1390 | add_domain(gpppdata.domain()); | 1390 | add_domain(PPPData::data()->domain()); |
1391 | } | 1391 | } |
1392 | 1392 | ||
diff --git a/noncore/settings/networksettings/ppp/conwindow.cpp b/noncore/settings/networksettings/ppp/conwindow.cpp index d6b3fbe..ad89005 100644 --- a/noncore/settings/networksettings/ppp/conwindow.cpp +++ b/noncore/settings/networksettings/ppp/conwindow.cpp | |||
@@ -76,7 +76,7 @@ ConWindow::ConWindow(QWidget *parent, const char *name, QDialog *mainwidget ) | |||
76 | 76 | ||
77 | // read window position from config file | 77 | // read window position from config file |
78 | int p_x, p_y; | 78 | // int p_x, p_y; |
79 | gpppdata.winPosConWin(p_x, p_y); | 79 | // PPPData::data()->winPosConWin(p_x, p_y); |
80 | setGeometry(p_x, p_y, 320, 110); | 80 | // setGeometry(p_x, p_y, 320, 110); |
81 | } | 81 | } |
82 | 82 | ||
@@ -89,5 +89,5 @@ bool ConWindow::event(QEvent *e) { | |||
89 | if (e->type() == QEvent::Hide) | 89 | if (e->type() == QEvent::Hide) |
90 | { | 90 | { |
91 | gpppdata.setWinPosConWin(x(), y()); | 91 | // PPPData::data()->setWinPosConWin(x(), y()); |
92 | return true; | 92 | return true; |
93 | } | 93 | } |
@@ -119,5 +119,5 @@ void ConWindow::accounting(bool on) { | |||
119 | // cache accounting settings | 119 | // cache accounting settings |
120 | accountingEnabled = on; | 120 | accountingEnabled = on; |
121 | volumeAccountingEnabled = gpppdata.VolAcctEnabled(); | 121 | volumeAccountingEnabled = PPPData::data()->VolAcctEnabled(); |
122 | 122 | ||
123 | // delete old layout | 123 | // delete old layout |
@@ -134,5 +134,5 @@ void ConWindow::accounting(bool on) { | |||
134 | 134 | ||
135 | int vol_lines = 0; | 135 | int vol_lines = 0; |
136 | if(gpppdata.VolAcctEnabled()) | 136 | if(PPPData::data()->VolAcctEnabled()) |
137 | vol_lines = 1; | 137 | vol_lines = 1; |
138 | 138 | ||
@@ -240,7 +240,7 @@ void ConWindow::startClock() { | |||
240 | QString title ; | 240 | QString title ; |
241 | 241 | ||
242 | title = gpppdata.accname(); | 242 | title = PPPData::data()->accname(); |
243 | 243 | ||
244 | if(gpppdata.get_show_clock_on_caption()){ | 244 | if(PPPData::data()->get_show_clock_on_caption()){ |
245 | title += " 00:00" ; | 245 | title += " 00:00" ; |
246 | } | 246 | } |
@@ -266,5 +266,5 @@ void ConWindow::timeclick() { | |||
266 | "Connected at: %2\n" | 266 | "Connected at: %2\n" |
267 | "Time connected: %3") | 267 | "Time connected: %3") |
268 | .arg(gpppdata.accname()).arg(info2->text()) | 268 | .arg(PPPData::data()->accname()).arg(info2->text()) |
269 | .arg(time_string2); | 269 | .arg(time_string2); |
270 | 270 | ||
@@ -276,5 +276,5 @@ void ConWindow::timeclick() { | |||
276 | 276 | ||
277 | volinfo->setEnabled(TRUE); | 277 | volinfo->setEnabled(TRUE); |
278 | int bytes = gpppdata.totalBytes(); | 278 | int bytes = PPPData::data()->totalBytes(); |
279 | volinfo->setText(prettyPrintVolume(bytes)); | 279 | volinfo->setText(prettyPrintVolume(bytes)); |
280 | } | 280 | } |
@@ -306,5 +306,5 @@ void ConWindow::timeclick() { | |||
306 | time_string2.sprintf("%02d:%02d:%02d",hours,minutes,seconds); | 306 | time_string2.sprintf("%02d:%02d:%02d",hours,minutes,seconds); |
307 | 307 | ||
308 | caption_string = gpppdata.accname(); | 308 | caption_string = PPPData::data()->accname(); |
309 | caption_string += " "; | 309 | caption_string += " "; |
310 | caption_string += time_string; | 310 | caption_string += time_string; |
@@ -313,5 +313,5 @@ void ConWindow::timeclick() { | |||
313 | timelabel2->setText(time_string2); | 313 | timelabel2->setText(time_string2); |
314 | 314 | ||
315 | if(gpppdata.get_show_clock_on_caption() && (seconds == 1)){ | 315 | if(PPPData::data()->get_show_clock_on_caption() && (seconds == 1)){ |
316 | // we update the Caption only once per minute not every second | 316 | // we update the Caption only once per minute not every second |
317 | // otherwise I get a flickering icon | 317 | // otherwise I get a flickering icon |
@@ -329,5 +329,5 @@ void ConWindow::closeEvent( QCloseEvent *e ){ | |||
329 | e->ignore(); | 329 | e->ignore(); |
330 | 330 | ||
331 | if(gpppdata.get_dock_into_panel()) | 331 | if(PPPData::data()->get_dock_into_panel()) |
332 | dock(); | 332 | dock(); |
333 | } | 333 | } |
diff --git a/noncore/settings/networksettings/ppp/debug.cpp b/noncore/settings/networksettings/ppp/debug.cpp index 8652931..447ccf2 100644 --- a/noncore/settings/networksettings/ppp/debug.cpp +++ b/noncore/settings/networksettings/ppp/debug.cpp | |||
@@ -134,5 +134,5 @@ void DebugWidget::toggleVisibility() { | |||
134 | 134 | ||
135 | bool showlog = isVisible(); | 135 | bool showlog = isVisible(); |
136 | gpppdata.set_show_log_window(showlog); | 136 | PPPData::data()->set_show_log_window(showlog); |
137 | } | 137 | } |
138 | 138 | ||
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp index 961047b..6132b80 100644 --- a/noncore/settings/networksettings/ppp/edit.cpp +++ b/noncore/settings/networksettings/ppp/edit.cpp | |||
@@ -42,5 +42,5 @@ | |||
42 | #include "edit.h" | 42 | #include "edit.h" |
43 | #include "pppdata.h" | 43 | #include "pppdata.h" |
44 | #include "newwidget.h" | 44 | //#include "newwidget.h" |
45 | #include "iplined.h" | 45 | #include "iplined.h" |
46 | #include "auth.h" | 46 | #include "auth.h" |
@@ -51,11 +51,11 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
51 | const int GRIDROWS = 6; | 51 | const int GRIDROWS = 6; |
52 | 52 | ||
53 | QGridLayout *tl = new QGridLayout(parent, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); | 53 | QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); |
54 | 54 | ||
55 | connect_label = new QLabel(i18n("Connection name:"), parent); | 55 | connect_label = new QLabel(i18n("Connection name:"), this); |
56 | tl->addWidget(connect_label, 0, 0); | 56 | tl->addWidget(connect_label, 0, 0); |
57 | 57 | ||
58 | connectname_l = new QLineEdit(parent); | 58 | connectname_l = new QLineEdit(this); |
59 | connectname_l->setMaxLength(ACCNAME_SIZE); | 59 | // connectname_l->setMaxLength(ACCNAME_SIZE); |
60 | tl->addWidget(connectname_l, 0, 1); | 60 | tl->addWidget(connectname_l, 0, 1); |
61 | QString tmp = i18n("Type in a unique name for this connection"); | 61 | QString tmp = i18n("Type in a unique name for this connection"); |
@@ -65,5 +65,5 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
65 | 65 | ||
66 | 66 | ||
67 | number_label = new QLabel(i18n("Phone number:"), parent); | 67 | number_label = new QLabel(i18n("Phone number:"), this); |
68 | number_label->setAlignment(AlignTop|AlignLeft); | 68 | number_label->setAlignment(AlignTop|AlignLeft); |
69 | tl->addWidget(number_label, 1, 0); | 69 | tl->addWidget(number_label, 1, 0); |
@@ -71,16 +71,16 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
71 | QHBoxLayout *lpn = new QHBoxLayout(5); | 71 | QHBoxLayout *lpn = new QHBoxLayout(5); |
72 | tl->addLayout(lpn, 1, 1); | 72 | tl->addLayout(lpn, 1, 1); |
73 | numbers = new QListBox(parent); | 73 | numbers = new QListBox(this); |
74 | numbers->setMinimumSize(120, 70); | 74 | numbers->setMinimumSize(120, 70); |
75 | lpn->addWidget(numbers); | 75 | lpn->addWidget(numbers); |
76 | QVBoxLayout *lpn1 = new QVBoxLayout; | 76 | QVBoxLayout *lpn1 = new QVBoxLayout; |
77 | lpn->addLayout(lpn1); | 77 | lpn->addLayout(lpn1); |
78 | add = new QPushButton(i18n("&Add..."), parent); | 78 | add = new QPushButton(i18n("&Add..."), this); |
79 | del = new QPushButton(i18n("&Remove"), parent); | 79 | del = new QPushButton(i18n("&Remove"), this); |
80 | 80 | ||
81 | up = new QPushButton(parent); | 81 | up = new QPushButton(this); |
82 | //FIXME: QPixmap pm = BarIcon("up"); | 82 | //FIXME: QPixmap pm = BarIcon("up"); |
83 | // up->setPixmap(pm); | 83 | // up->setPixmap(pm); |
84 | down = new QPushButton(parent); | 84 | down = new QPushButton(this); |
85 | //FIXME: pm = BarIcon("down"); | 85 | //FIXME: pm = BarIcon("down"); |
86 | // down->setPixmap(pm); | 86 | // down->setPixmap(pm); |
@@ -113,8 +113,8 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
113 | QWhatsThis::add(numbers,tmp); | 113 | QWhatsThis::add(numbers,tmp); |
114 | 114 | ||
115 | auth_l = new QLabel(i18n("Authentication:"), parent); | 115 | auth_l = new QLabel(i18n("Authentication:"), this); |
116 | tl->addWidget(auth_l, 3, 0); | 116 | tl->addWidget(auth_l, 3, 0); |
117 | 117 | ||
118 | auth = new QComboBox(parent); | 118 | auth = new QComboBox(this); |
119 | auth->insertItem(i18n("Script-based")); | 119 | auth->insertItem(i18n("Script-based")); |
120 | auth->insertItem(i18n("PAP")); | 120 | auth->insertItem(i18n("PAP")); |
@@ -136,5 +136,5 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
136 | QWhatsThis::add(auth,tmp); | 136 | QWhatsThis::add(auth,tmp); |
137 | 137 | ||
138 | store_password = new QCheckBox(i18n("Store password"), parent); | 138 | store_password = new QCheckBox(i18n("Store password"), this); |
139 | store_password->setChecked(true); | 139 | store_password->setChecked(true); |
140 | tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight); | 140 | tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight); |
@@ -149,5 +149,5 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
149 | "gains access to this file!")); | 149 | "gains access to this file!")); |
150 | 150 | ||
151 | pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), parent); | 151 | pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), this); |
152 | connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); | 152 | connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); |
153 | tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); | 153 | tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); |
@@ -155,8 +155,8 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
155 | // Set defaults if editing an existing connection | 155 | // Set defaults if editing an existing connection |
156 | if(!isnewaccount) { | 156 | if(!isnewaccount) { |
157 | connectname_l->setText(gpppdata.accname()); | 157 | connectname_l->setText(PPPData::data()->accname()); |
158 | 158 | ||
159 | // insert the phone numbers into the listbox | 159 | // insert the phone numbers into the listbox |
160 | QString n = gpppdata.phonenumber(); | 160 | QString n = PPPData::data()->phonenumber(); |
161 | QString tmp = ""; | 161 | QString tmp = ""; |
162 | uint idx = 0; | 162 | uint idx = 0; |
@@ -173,6 +173,6 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
173 | numbers->insertItem(tmp); | 173 | numbers->insertItem(tmp); |
174 | 174 | ||
175 | auth->setCurrentItem(gpppdata.authMethod()); | 175 | auth->setCurrentItem(PPPData::data()->authMethod()); |
176 | store_password->setChecked(gpppdata.storePassword()); | 176 | store_password->setChecked(PPPData::data()->storePassword()); |
177 | } else { | 177 | } else { |
178 | // select PAP/CHAP as default | 178 | // select PAP/CHAP as default |
@@ -188,8 +188,8 @@ bool DialWidget::save() { | |||
188 | //first check to make sure that the account name is unique! | 188 | //first check to make sure that the account name is unique! |
189 | if(connectname_l->text().isEmpty() || | 189 | if(connectname_l->text().isEmpty() || |
190 | !gpppdata.isUniqueAccname(connectname_l->text())) { | 190 | !PPPData::data()->isUniqueAccname(connectname_l->text())) { |
191 | return false; | 191 | return false; |
192 | } else { | 192 | } else { |
193 | gpppdata.setAccname(connectname_l->text()); | 193 | PPPData::data()->setAccname(connectname_l->text()); |
194 | 194 | ||
195 | QString number = ""; | 195 | QString number = ""; |
@@ -200,7 +200,7 @@ bool DialWidget::save() { | |||
200 | } | 200 | } |
201 | 201 | ||
202 | gpppdata.setPhonenumber(number); | 202 | PPPData::data()->setPhonenumber(number); |
203 | gpppdata.setAuthMethod(auth->currentItem()); | 203 | PPPData::data()->setAuthMethod(auth->currentItem()); |
204 | gpppdata.setStorePassword(store_password->isChecked()); | 204 | PPPData::data()->setStorePassword(store_password->isChecked()); |
205 | return true; | 205 | return true; |
206 | } | 206 | } |
@@ -223,9 +223,9 @@ void DialWidget::selectionChanged(int) { | |||
223 | 223 | ||
224 | void DialWidget::addNumber() { | 224 | void DialWidget::addNumber() { |
225 | PhoneNumberDialog dlg(this); | 225 | PhoneNumberDialog dlg(this); |
226 | if(dlg.exec()) { | 226 | if(dlg.exec()) { |
227 | numbers->insertItem(dlg.phoneNumber()); | 227 | numbers->insertItem(dlg.phoneNumber()); |
228 | numbersChanged(); | 228 | numbersChanged(); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
@@ -276,5 +276,5 @@ ExecWidget::ExecWidget(QWidget *parent, bool isnewaccount, const char *name) : | |||
276 | QWidget(parent, name) | 276 | QWidget(parent, name) |
277 | { | 277 | { |
278 | QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); | 278 | QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); |
279 | 279 | ||
280 | QLabel *l = new QLabel(\ | 280 | QLabel *l = new QLabel(\ |
@@ -284,6 +284,6 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
284 | "(unless, of course, you are root).\n\n" | 284 | "(unless, of course, you are root).\n\n" |
285 | "Be sure to supply the whole path to the program otherwise\n" | 285 | "Be sure to supply the whole path to the program otherwise\n" |
286 | "kppp might be unable to find it."), parent); | 286 | "kppp might be unable to find it."), this); |
287 | l->setMinimumHeight(l->sizeHint().height()); | 287 | // l->setMinimumHeight(l->sizeHint().height()); |
288 | tl->addWidget(l); | 288 | tl->addWidget(l); |
289 | tl->addStretch(1); | 289 | tl->addStretch(1); |
@@ -294,9 +294,9 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
294 | l1->setColStretch(1, 1); | 294 | l1->setColStretch(1, 1); |
295 | 295 | ||
296 | before_connect_l = new QLabel(i18n("Before connect:"), parent); | 296 | before_connect_l = new QLabel(i18n("Before connect:"), this); |
297 | before_connect_l->setAlignment(AlignVCenter); | 297 | before_connect_l->setAlignment(AlignVCenter); |
298 | l1->addWidget(before_connect_l, 0, 0); | 298 | l1->addWidget(before_connect_l, 0, 0); |
299 | before_connect = new QLineEdit(parent); | 299 | before_connect = new QLineEdit(this); |
300 | before_connect->setMaxLength(COMMAND_SIZE); | 300 | // before_connect->setMaxLength(COMMAND_SIZE); |
301 | l1->addWidget(before_connect, 0, 1); | 301 | l1->addWidget(before_connect, 0, 1); |
302 | QString tmp = i18n("Allows you to run a program <b>before</b> a connection\n" | 302 | QString tmp = i18n("Allows you to run a program <b>before</b> a connection\n" |
@@ -309,9 +309,9 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
309 | QWhatsThis::add(before_connect,tmp); | 309 | QWhatsThis::add(before_connect,tmp); |
310 | 310 | ||
311 | command_label = new QLabel(i18n("Upon connect:"), parent); | 311 | command_label = new QLabel(i18n("Upon connect:"), this); |
312 | command_label->setAlignment(AlignVCenter); | 312 | command_label->setAlignment(AlignVCenter); |
313 | l1->addWidget(command_label, 1, 0); | 313 | l1->addWidget(command_label, 1, 0); |
314 | command = new QLineEdit(parent); | 314 | command = new QLineEdit(this); |
315 | command->setMaxLength(COMMAND_SIZE); | 315 | // command->setMaxLength(COMMAND_SIZE); |
316 | l1->addWidget(command, 1, 1); | 316 | l1->addWidget(command, 1, 1); |
317 | tmp = i18n("Allows you to run a program <b>after</b> a connection\n" | 317 | tmp = i18n("Allows you to run a program <b>after</b> a connection\n" |
@@ -325,9 +325,9 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
325 | 325 | ||
326 | predisconnect_label = new QLabel(i18n("Before disconnect:"), | 326 | predisconnect_label = new QLabel(i18n("Before disconnect:"), |
327 | parent); | 327 | this); |
328 | predisconnect_label->setAlignment(AlignVCenter); | 328 | predisconnect_label->setAlignment(AlignVCenter); |
329 | l1->addWidget(predisconnect_label, 2, 0); | 329 | l1->addWidget(predisconnect_label, 2, 0); |
330 | predisconnect = new QLineEdit(parent); | 330 | predisconnect = new QLineEdit(this); |
331 | predisconnect->setMaxLength(COMMAND_SIZE); | 331 | // predisconnect->setMaxLength(COMMAND_SIZE); |
332 | l1->addWidget(predisconnect, 2, 1); | 332 | l1->addWidget(predisconnect, 2, 1); |
333 | tmp = i18n("Allows you to run a program <b>before</b> a connection\n" | 333 | tmp = i18n("Allows you to run a program <b>before</b> a connection\n" |
@@ -339,10 +339,10 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
339 | 339 | ||
340 | discommand_label = new QLabel(i18n("Upon disconnect:"), | 340 | discommand_label = new QLabel(i18n("Upon disconnect:"), |
341 | parent); | 341 | this); |
342 | discommand_label->setAlignment(AlignVCenter); | 342 | discommand_label->setAlignment(AlignVCenter); |
343 | l1->addWidget(discommand_label, 3, 0); | 343 | l1->addWidget(discommand_label, 3, 0); |
344 | 344 | ||
345 | discommand = new QLineEdit(parent); | 345 | discommand = new QLineEdit(this); |
346 | discommand->setMaxLength(COMMAND_SIZE); | 346 | // discommand->setMaxLength(COMMAND_SIZE); |
347 | l1->addWidget(discommand, 3, 1); | 347 | l1->addWidget(discommand, 3, 1); |
348 | tmp = i18n("Allows you to run a program <b>after</b> a connection\n" | 348 | tmp = i18n("Allows you to run a program <b>after</b> a connection\n" |
@@ -361,8 +361,8 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
361 | // Set defaults if editing an existing connection | 361 | // Set defaults if editing an existing connection |
362 | if(!isnewaccount) { | 362 | if(!isnewaccount) { |
363 | before_connect->setText(gpppdata.command_before_connect()); | 363 | before_connect->setText(PPPData::data()->command_before_connect()); |
364 | command->setText(gpppdata.command_on_connect()); | 364 | command->setText(PPPData::data()->command_on_connect()); |
365 | discommand->setText(gpppdata.command_on_disconnect()); | 365 | discommand->setText(PPPData::data()->command_on_disconnect()); |
366 | predisconnect->setText(gpppdata.command_before_disconnect()); | 366 | predisconnect->setText(PPPData::data()->command_before_disconnect()); |
367 | } | 367 | } |
368 | } | 368 | } |
@@ -370,8 +370,8 @@ i18n("Here you can select commands to run at certain stages of the\n" | |||
370 | 370 | ||
371 | bool ExecWidget::save() { | 371 | bool ExecWidget::save() { |
372 | gpppdata.setCommand_before_connect(before_connect->text()); | 372 | PPPData::data()->setCommand_before_connect(before_connect->text()); |
373 | gpppdata.setCommand_on_connect(command->text()); | 373 | PPPData::data()->setCommand_on_connect(command->text()); |
374 | gpppdata.setCommand_before_disconnect(predisconnect->text()); | 374 | PPPData::data()->setCommand_before_disconnect(predisconnect->text()); |
375 | gpppdata.setCommand_on_disconnect(discommand->text()); | 375 | PPPData::data()->setCommand_on_disconnect(discommand->text()); |
376 | return true; | 376 | return true; |
377 | } | 377 | } |
@@ -387,11 +387,11 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
387 | : QWidget(parent, name) | 387 | : QWidget(parent, name) |
388 | { | 388 | { |
389 | QVBoxLayout *topLayout = new QVBoxLayout(parent); | 389 | QVBoxLayout *topLayout = new QVBoxLayout(this); |
390 | topLayout->setSpacing( 3 );//KDialog::spacingHint()); | 390 | topLayout->setSpacing( 3 );//KDialog::spacingHint()); |
391 | 391 | ||
392 | box = new QVGroupBox(i18n("Configuration"), parent); | 392 | box = new QVGroupBox(i18n("Configuration"), this); |
393 | // box->setInsideSpacing( 1 );//KDialog::spacingHint()); | 393 | // box->setInsideSpacing( 1 );//KDialog::spacingHint()); |
394 | 394 | ||
395 | rb = new QButtonGroup(parent); | 395 | rb = new QButtonGroup(this); |
396 | rb->hide(); | 396 | rb->hide(); |
397 | connect(rb, SIGNAL(clicked(int)), | 397 | connect(rb, SIGNAL(clicked(int)), |
@@ -449,6 +449,6 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
449 | QWhatsThis::add(subnetmask_l,tmp); | 449 | QWhatsThis::add(subnetmask_l,tmp); |
450 | 450 | ||
451 | autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), parent); | 451 | autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), this); |
452 | autoname->setChecked(gpppdata.autoname()); | 452 | autoname->setChecked(PPPData::data()->autoname()); |
453 | connect(autoname,SIGNAL(toggled(bool)), | 453 | connect(autoname,SIGNAL(toggled(bool)), |
454 | this,SLOT(autoname_t(bool))); | 454 | this,SLOT(autoname_t(bool))); |
@@ -470,13 +470,13 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
470 | //load info from gpppdata | 470 | //load info from gpppdata |
471 | if(!isnewaccount) { | 471 | if(!isnewaccount) { |
472 | if(gpppdata.ipaddr() == "0.0.0.0" && | 472 | if(PPPData::data()->ipaddr() == "0.0.0.0" && |
473 | gpppdata.subnetmask() == "0.0.0.0") { | 473 | PPPData::data()->subnetmask() == "0.0.0.0") { |
474 | dynamicadd_rb->setChecked(true); | 474 | dynamicadd_rb->setChecked(true); |
475 | hitIPSelect(0); | 475 | hitIPSelect(0); |
476 | autoname->setChecked(gpppdata.autoname()); | 476 | autoname->setChecked(PPPData::data()->autoname()); |
477 | } | 477 | } |
478 | else { | 478 | else { |
479 | ipaddress_l->setText(gpppdata.ipaddr()); | 479 | ipaddress_l->setText(PPPData::data()->ipaddr()); |
480 | subnetmask_l->setText(gpppdata.subnetmask()); | 480 | subnetmask_l->setText(PPPData::data()->subnetmask()); |
481 | staticadd_rb->setChecked(true); | 481 | staticadd_rb->setChecked(true); |
482 | autoname->setChecked(false); | 482 | autoname->setChecked(false); |
@@ -511,11 +511,11 @@ void IPWidget::autoname_t(bool on) { | |||
511 | void IPWidget::save() { | 511 | void IPWidget::save() { |
512 | if(dynamicadd_rb->isChecked()) { | 512 | if(dynamicadd_rb->isChecked()) { |
513 | gpppdata.setIpaddr("0.0.0.0"); | 513 | PPPData::data()->setIpaddr("0.0.0.0"); |
514 | gpppdata.setSubnetmask("0.0.0.0"); | 514 | PPPData::data()->setSubnetmask("0.0.0.0"); |
515 | } else { | 515 | } else { |
516 | gpppdata.setIpaddr(ipaddress_l->text()); | 516 | PPPData::data()->setIpaddr(ipaddress_l->text()); |
517 | gpppdata.setSubnetmask(subnetmask_l->text()); | 517 | PPPData::data()->setSubnetmask(subnetmask_l->text()); |
518 | } | 518 | } |
519 | gpppdata.setAutoname(autoname->isChecked()); | 519 | PPPData::data()->setAutoname(autoname->isChecked()); |
520 | } | 520 | } |
521 | 521 | ||
@@ -541,12 +541,12 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
541 | : QWidget(parent, name) | 541 | : QWidget(parent, name) |
542 | { | 542 | { |
543 | // box = new QGroupBox(parent); | 543 | // box = new QGroupBox(this); |
544 | QGridLayout *tl = new QGridLayout(parent, 7, 2, 0 );//, KDialog::spacingHint()); | 544 | QGridLayout *tl = new QGridLayout(this, 7, 2, 0 );//, KDialog::spacingHint()); |
545 | 545 | ||
546 | dnsdomain_label = new QLabel(i18n("Domain name:"), parent); | 546 | dnsdomain_label = new QLabel(i18n("Domain name:"), this); |
547 | tl->addWidget(dnsdomain_label, 0, 0); | 547 | tl->addWidget(dnsdomain_label, 0, 0); |
548 | 548 | ||
549 | dnsdomain = new QLineEdit(parent); | 549 | dnsdomain = new QLineEdit(this); |
550 | dnsdomain->setMaxLength(DOMAIN_SIZE); | 550 | // dnsdomain->setMaxLength(DOMAIN_SIZE); |
551 | tl->addWidget(dnsdomain, 0, 1); | 551 | tl->addWidget(dnsdomain, 0, 1); |
552 | QString tmp = i18n("If you enter a domain name here, this domain\n" | 552 | QString tmp = i18n("If you enter a domain name here, this domain\n" |
@@ -562,5 +562,5 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
562 | QWhatsThis::add(dnsdomain,tmp); | 562 | QWhatsThis::add(dnsdomain,tmp); |
563 | 563 | ||
564 | conf_label = new QLabel(i18n("Configuration:"), parent); | 564 | conf_label = new QLabel(i18n("Configuration:"), this); |
565 | tl->addWidget(conf_label, 1, 0); | 565 | tl->addWidget(conf_label, 1, 0); |
566 | 566 | ||
@@ -569,21 +569,21 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
569 | bg->hide(); | 569 | bg->hide(); |
570 | 570 | ||
571 | autodns = new QRadioButton(i18n("Automatic"), parent); | 571 | autodns = new QRadioButton(i18n("Automatic"), this); |
572 | bg->insert(autodns, 0); | 572 | bg->insert(autodns, 0); |
573 | tl->addWidget(autodns, 1, 1); | 573 | tl->addWidget(autodns, 1, 1); |
574 | // no automatic DNS detection for pppd < 2.3.7 | 574 | // no automatic DNS detection for pppd < 2.3.7 |
575 | if(!gpppdata.pppdVersionMin(2, 3, 7)) | 575 | if(!PPPData::data()->pppdVersionMin(2, 3, 7)) |
576 | autodns->setEnabled(false); | 576 | autodns->setEnabled(false); |
577 | 577 | ||
578 | mandns = new QRadioButton(i18n("Manual"), parent); | 578 | mandns = new QRadioButton(i18n("Manual"), this); |
579 | bg->insert(mandns, 1); | 579 | bg->insert(mandns, 1); |
580 | tl->addWidget(mandns, 2, 1); | 580 | tl->addWidget(mandns, 2, 1); |
581 | 581 | ||
582 | dns_label = new QLabel(i18n("DNS IP address:"), parent); | 582 | dns_label = new QLabel(i18n("DNS IP address:"), this); |
583 | tl->addWidget(dns_label, 3, 0); | 583 | tl->addWidget(dns_label, 3, 0); |
584 | 584 | ||
585 | QHBoxLayout *l2 = new QHBoxLayout; | 585 | QHBoxLayout *l2 = new QHBoxLayout; |
586 | tl->addLayout(l2, 3, 1); | 586 | tl->addLayout(l2, 3, 1); |
587 | dnsipaddr = new IPLineEdit(parent); | 587 | dnsipaddr = new IPLineEdit(this); |
588 | connect(dnsipaddr, SIGNAL(returnPressed()), | 588 | connect(dnsipaddr, SIGNAL(returnPressed()), |
589 | SLOT(adddns())); | 589 | SLOT(adddns())); |
@@ -605,9 +605,9 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
605 | QHBoxLayout *l1 = new QHBoxLayout; | 605 | QHBoxLayout *l1 = new QHBoxLayout; |
606 | tl->addLayout(l1, 4, 1); | 606 | tl->addLayout(l1, 4, 1); |
607 | add = new QPushButton(i18n("Add"), parent); | 607 | add = new QPushButton(i18n("Add"), this); |
608 | connect(add, SIGNAL(clicked()), SLOT(adddns())); | 608 | connect(add, SIGNAL(clicked()), SLOT(adddns())); |
609 | int width = add->sizeHint().width(); | 609 | // int width = add->sizeHint().width(); |
610 | width = QMAX(width,60); | 610 | // width = QMAX(width,60); |
611 | add->setMinimumWidth(width); | 611 | // add->setMinimumWidth(width); |
612 | l1->addWidget(add); | 612 | l1->addWidget(add); |
613 | l1->addStretch(1); | 613 | l1->addStretch(1); |
@@ -617,9 +617,9 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
617 | "will then be added to the list below")); | 617 | "will then be added to the list below")); |
618 | 618 | ||
619 | remove = new QPushButton(i18n("Remove"), parent); | 619 | remove = new QPushButton(i18n("Remove"), this); |
620 | connect(remove, SIGNAL(clicked()), SLOT(removedns())); | 620 | connect(remove, SIGNAL(clicked()), SLOT(removedns())); |
621 | width = remove->sizeHint().width(); | 621 | // width = remove->sizeHint().width(); |
622 | width = QMAX(width,60); | 622 | // width = QMAX(width,60); |
623 | remove->setMinimumWidth(width); | 623 | // remove->setMinimumWidth(width); |
624 | l1->addWidget(remove); | 624 | l1->addWidget(remove); |
625 | QWhatsThis::add(remove, | 625 | QWhatsThis::add(remove, |
@@ -627,9 +627,9 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
627 | "server entry from the list below")); | 627 | "server entry from the list below")); |
628 | 628 | ||
629 | servers_label = new QLabel(i18n("DNS address list:"), parent); | 629 | servers_label = new QLabel(i18n("DNS address list:"), this); |
630 | servers_label->setAlignment(AlignTop|AlignLeft); | 630 | servers_label->setAlignment(AlignTop|AlignLeft); |
631 | tl->addWidget(servers_label, 5, 0); | 631 | tl->addWidget(servers_label, 5, 0); |
632 | 632 | ||
633 | dnsservers = new QListBox(parent); | 633 | dnsservers = new QListBox(this); |
634 | dnsservers->setMinimumSize(150, 80); | 634 | dnsservers->setMinimumSize(150, 80); |
635 | connect(dnsservers, SIGNAL(highlighted(int)), | 635 | connect(dnsservers, SIGNAL(highlighted(int)), |
@@ -645,6 +645,6 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
645 | exdnsdisabled_toggle = new QCheckBox(i18n( \ | 645 | exdnsdisabled_toggle = new QCheckBox(i18n( \ |
646 | "Disable existing DNS servers during connection"), | 646 | "Disable existing DNS servers during connection"), |
647 | parent); | 647 | this); |
648 | exdnsdisabled_toggle->setChecked(gpppdata.exDNSDisabled()); | 648 | exdnsdisabled_toggle->setChecked(PPPData::data()->exDNSDisabled()); |
649 | tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); | 649 | tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); |
650 | QWhatsThis::add(exdnsdisabled_toggle, | 650 | QWhatsThis::add(exdnsdisabled_toggle, |
@@ -662,9 +662,9 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) | |||
662 | // restore data if editing | 662 | // restore data if editing |
663 | if(!isnewaccount) { | 663 | if(!isnewaccount) { |
664 | dnsservers->insertStringList(gpppdata.dns()); | 664 | dnsservers->insertStringList(PPPData::data()->dns()); |
665 | dnsdomain->setText(gpppdata.domain()); | 665 | dnsdomain->setText(PPPData::data()->domain()); |
666 | } | 666 | } |
667 | 667 | ||
668 | int mode = gpppdata.autoDNS() ? 0 : 1; | 668 | int mode = PPPData::data()->autoDNS() ? 0 : 1; |
669 | bg->setButton(mode); | 669 | bg->setButton(mode); |
670 | DNS_Mode_Selected(mode); | 670 | DNS_Mode_Selected(mode); |
@@ -696,18 +696,18 @@ void DNSWidget::DNS_Mode_Selected(int mode) { | |||
696 | 696 | ||
697 | void DNSWidget::save() { | 697 | void DNSWidget::save() { |
698 | gpppdata.setAutoDNS(bg->id(bg->selected()) == 0); | 698 | PPPData::data()->setAutoDNS(bg->id(bg->selected()) == 0); |
699 | QStringList serverlist; | 699 | QStringList serverlist; |
700 | for(uint i=0; i < dnsservers->count(); i++) | 700 | for(uint i=0; i < dnsservers->count(); i++) |
701 | serverlist.append(dnsservers->text(i)); | 701 | serverlist.append(dnsservers->text(i)); |
702 | gpppdata.setDns(serverlist); | 702 | PPPData::data()->setDns(serverlist); |
703 | 703 | ||
704 | // strip leading dot | 704 | // strip leading dot |
705 | QString s(dnsdomain->text()); | 705 | QString s(dnsdomain->text()); |
706 | if(s.left(1) == ".") | 706 | if(s.left(1) == ".") |
707 | gpppdata.setDomain(s.mid(1)); | 707 | PPPData::data()->setDomain(s.mid(1)); |
708 | else | 708 | else |
709 | gpppdata.setDomain(dnsdomain->text()); | 709 | PPPData::data()->setDomain(dnsdomain->text()); |
710 | 710 | ||
711 | gpppdata.setExDNSDisabled(exdnsdisabled_toggle->isChecked()); | 711 | PPPData::data()->setExDNSDisabled(exdnsdisabled_toggle->isChecked()); |
712 | } | 712 | } |
713 | 713 | ||
@@ -736,11 +736,11 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na | |||
736 | : QWidget(parent, name) | 736 | : QWidget(parent, name) |
737 | { | 737 | { |
738 | QVBoxLayout *topLayout = new QVBoxLayout(parent); | 738 | QVBoxLayout *topLayout = new QVBoxLayout(this); |
739 | topLayout->setSpacing( 2 );//KDialog::spacingHint()); | 739 | topLayout->setSpacing( 2 );//KDialog::spacingHint()); |
740 | 740 | ||
741 | box = new QVGroupBox(i18n("Configuration"), parent); | 741 | box = new QVGroupBox(i18n("Configuration"), this); |
742 | // box->setInsideSpacing( 2 );//KDialog::spacingHint()); | 742 | // box->setInsideSpacing( 2 );//KDialog::spacingHint()); |
743 | 743 | ||
744 | rb = new QButtonGroup(parent); | 744 | rb = new QButtonGroup(this); |
745 | rb->hide(); | 745 | rb->hide(); |
746 | connect(rb, SIGNAL(clicked(int)), SLOT(hitGatewaySelect(int))); | 746 | connect(rb, SIGNAL(clicked(int)), SLOT(hitGatewaySelect(int))); |
@@ -772,5 +772,5 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na | |||
772 | 772 | ||
773 | defaultroute = new QCheckBox(i18n("Assign the default route to this gateway"), | 773 | defaultroute = new QCheckBox(i18n("Assign the default route to this gateway"), |
774 | parent); | 774 | this); |
775 | QWhatsThis::add(defaultroute, | 775 | QWhatsThis::add(defaultroute, |
776 | i18n("If this option is enabled, all packets not\n" | 776 | i18n("If this option is enabled, all packets not\n" |
@@ -786,13 +786,13 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na | |||
786 | //load info from gpppdata | 786 | //load info from gpppdata |
787 | if(!isnewaccount) { | 787 | if(!isnewaccount) { |
788 | if(gpppdata.gateway() == "0.0.0.0") { | 788 | if(PPPData::data()->gateway() == "0.0.0.0") { |
789 | defaultgateway->setChecked(true); | 789 | defaultgateway->setChecked(true); |
790 | hitGatewaySelect(0); | 790 | hitGatewaySelect(0); |
791 | } | 791 | } |
792 | else { | 792 | else { |
793 | gatewayaddr->setText(gpppdata.gateway()); | 793 | gatewayaddr->setText(PPPData::data()->gateway()); |
794 | staticgateway->setChecked(true); | 794 | staticgateway->setChecked(true); |
795 | } | 795 | } |
796 | defaultroute->setChecked(gpppdata.defaultroute()); | 796 | defaultroute->setChecked(PPPData::data()->defaultroute()); |
797 | } | 797 | } |
798 | else { | 798 | else { |
@@ -804,6 +804,6 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na | |||
804 | 804 | ||
805 | void GatewayWidget::save() { | 805 | void GatewayWidget::save() { |
806 | gpppdata.setGateway(gatewayaddr->text()); | 806 | PPPData::data()->setGateway(gatewayaddr->text()); |
807 | gpppdata.setDefaultroute(defaultroute->isChecked()); | 807 | PPPData::data()->setDefaultroute(defaultroute->isChecked()); |
808 | } | 808 | } |
809 | 809 | ||
@@ -827,11 +827,11 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name | |||
827 | : QWidget(parent, name) | 827 | : QWidget(parent, name) |
828 | { | 828 | { |
829 | QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); | 829 | QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); |
830 | se = new ScriptEdit(parent); | 830 | se = new ScriptEdit(this); |
831 | connect(se, SIGNAL(returnPressed()), SLOT(addButton())); | 831 | connect(se, SIGNAL(returnPressed()), SLOT(addButton())); |
832 | tl->addWidget(se); | 832 | tl->addWidget(se); |
833 | 833 | ||
834 | // insert equal-sized buttons | 834 | // insert equal-sized buttons |
835 | QButtonGroup *bbox = new QButtonGroup(parent); | 835 | QButtonGroup *bbox = new QButtonGroup(this); |
836 | add = new QPushButton( bbox, i18n("Add") ); | 836 | add = new QPushButton( bbox, i18n("Add") ); |
837 | bbox->insert(add); | 837 | bbox->insert(add); |
@@ -850,16 +850,16 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name | |||
850 | QHBoxLayout *l12 = new QHBoxLayout(0); | 850 | QHBoxLayout *l12 = new QHBoxLayout(0); |
851 | tl->addLayout(l12); | 851 | tl->addLayout(l12); |
852 | stl = new QListBox(parent); | 852 | stl = new QListBox(this); |
853 | stl->setVScrollBarMode( QScrollView::AlwaysOff ); | 853 | stl->setVScrollBarMode( QScrollView::AlwaysOff ); |
854 | connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int))); | 854 | connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int))); |
855 | stl->setMinimumSize(QSize(70, 140)); | 855 | stl->setMinimumSize(QSize(70, 140)); |
856 | 856 | ||
857 | sl = new QListBox(parent); | 857 | sl = new QListBox(this); |
858 | sl->setVScrollBarMode( QScrollView::AlwaysOff ); | 858 | sl->setVScrollBarMode( QScrollView::AlwaysOff ); |
859 | connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int))); | 859 | connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int))); |
860 | sl->setMinimumSize(QSize(150, 140)); | 860 | sl->setMinimumSize(QSize(150, 140)); |
861 | 861 | ||
862 | slb = new QScrollBar(parent); | 862 | slb = new QScrollBar(this); |
863 | slb->setFixedWidth(slb->sizeHint().width()); | 863 | // slb->setFixedWidth(slb->sizeHint().width()); |
864 | connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int))); | 864 | connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int))); |
865 | 865 | ||
@@ -870,6 +870,6 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name | |||
870 | //load data from gpppdata | 870 | //load data from gpppdata |
871 | if(!isnewaccount) { | 871 | if(!isnewaccount) { |
872 | QStringList &comlist = gpppdata.scriptType(); | 872 | QStringList &comlist = PPPData::data()->scriptType(); |
873 | QStringList &arglist = gpppdata.script(); | 873 | QStringList &arglist = PPPData::data()->script(); |
874 | QStringList::Iterator itcom = comlist.begin(); | 874 | QStringList::Iterator itcom = comlist.begin(); |
875 | QStringList::Iterator itarg = arglist.begin(); | 875 | QStringList::Iterator itarg = arglist.begin(); |
@@ -917,6 +917,6 @@ void ScriptWidget::save() { | |||
917 | arglist.append(sl->text(i)); | 917 | arglist.append(sl->text(i)); |
918 | } | 918 | } |
919 | gpppdata.setScriptType(typelist); | 919 | PPPData::data()->setScriptType(typelist); |
920 | gpppdata.setScript(arglist); | 920 | PPPData::data()->setScript(arglist); |
921 | } | 921 | } |
922 | 922 | ||
@@ -1155,5 +1155,5 @@ void ScriptWidget::removeButton() { | |||
1155 | ///////////////////////////////////////////////////////////////////////////// | 1155 | ///////////////////////////////////////////////////////////////////////////// |
1156 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | 1156 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) |
1157 | : QDialog(parent, 0, true ) { | 1157 | : QDialog(parent,"PhoneNumberDialog",true) { |
1158 | setCaption( i18n("Add Phone Number") ); | 1158 | setCaption( i18n("Add Phone Number") ); |
1159 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); | 1159 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); |
@@ -1166,6 +1166,6 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | |||
1166 | new QLabel(i18n("Enter a phone number:"), hbox); | 1166 | new QLabel(i18n("Enter a phone number:"), hbox); |
1167 | 1167 | ||
1168 | le = newLineEdit(14, hbox); | 1168 | le = new QLineEdit(hbox); |
1169 | le->setMinimumWidth(125); | 1169 | // le->setMinimumWidth(125); |
1170 | 1170 | ||
1171 | connect(le, SIGNAL(textChanged(const QString &)), | 1171 | connect(le, SIGNAL(textChanged(const QString &)), |
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp index f803628..a02ee35 100644 --- a/noncore/settings/networksettings/ppp/general.cpp +++ b/noncore/settings/networksettings/ppp/general.cpp | |||
@@ -165,5 +165,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
165 | 165 | ||
166 | for(int i=0; i <= enter->count()-1; i++) { | 166 | for(int i=0; i <= enter->count()-1; i++) { |
167 | if(gpppdata.enter() == enter->text(i)) | 167 | if(PPPData::data()->enter() == enter->text(i)) |
168 | enter->setCurrentItem(i); | 168 | enter->setCurrentItem(i); |
169 | } | 169 | } |
@@ -174,5 +174,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
174 | modemlockfile = new QCheckBox(i18n("&Use lock file"), this); | 174 | modemlockfile = new QCheckBox(i18n("&Use lock file"), this); |
175 | 175 | ||
176 | modemlockfile->setChecked(gpppdata.modemLockFile()); | 176 | modemlockfile->setChecked(PPPData::data()->modemLockFile()); |
177 | connect(modemlockfile, SIGNAL(toggled(bool)), | 177 | connect(modemlockfile, SIGNAL(toggled(bool)), |
178 | SLOT(modemlockfilechanged(bool))); | 178 | SLOT(modemlockfilechanged(bool))); |
@@ -192,5 +192,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
192 | // Modem Timeout Line Edit Box | 192 | // Modem Timeout Line Edit Box |
193 | 193 | ||
194 | modemtimeout = new KIntNumInput(gpppdata.modemTimeout(), this); | 194 | modemtimeout = new KIntNumInput(PPPData::data()->modemTimeout(), this); |
195 | modemtimeout->setLabel(i18n("Modem &timeout:")); | 195 | modemtimeout->setLabel(i18n("Modem &timeout:")); |
196 | modemtimeout->setRange(1, 120, 1); | 196 | modemtimeout->setRange(1, 120, 1); |
@@ -207,15 +207,15 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
207 | //set stuff from gpppdata | 207 | //set stuff from gpppdata |
208 | for(int i=0; i <= enter->count()-1; i++) { | 208 | for(int i=0; i <= enter->count()-1; i++) { |
209 | if(gpppdata.enter() == enter->text(i)) | 209 | if(PPPData::data()->enter() == enter->text(i)) |
210 | enter->setCurrentItem(i); | 210 | enter->setCurrentItem(i); |
211 | } | 211 | } |
212 | 212 | ||
213 | for(int i=0; i <= modemdevice->count()-1; i++) { | 213 | for(int i=0; i <= modemdevice->count()-1; i++) { |
214 | if(gpppdata.modemDevice() == modemdevice->text(i)) | 214 | if(PPPData::data()->modemDevice() == modemdevice->text(i)) |
215 | modemdevice->setCurrentItem(i); | 215 | modemdevice->setCurrentItem(i); |
216 | } | 216 | } |
217 | 217 | ||
218 | for(int i=0; i <= flowcontrol->count()-1; i++) { | 218 | for(int i=0; i <= flowcontrol->count()-1; i++) { |
219 | if(gpppdata.flowcontrol() == flowcontrol->text(i)) | 219 | if(PPPData::data()->flowcontrol() == flowcontrol->text(i)) |
220 | flowcontrol->setCurrentItem(i); | 220 | flowcontrol->setCurrentItem(i); |
221 | } | 221 | } |
@@ -223,5 +223,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
223 | //set the modem speed | 223 | //set the modem speed |
224 | for(int i=0; i < baud_c->count(); i++) | 224 | for(int i=0; i < baud_c->count(); i++) |
225 | if(baud_c->text(i) == gpppdata.speed()) | 225 | if(baud_c->text(i) == PPPData::data()->speed()) |
226 | baud_c->setCurrentItem(i); | 226 | baud_c->setCurrentItem(i); |
227 | 227 | ||
@@ -231,30 +231,30 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
231 | 231 | ||
232 | void ModemWidget::speed_selection(int) { | 232 | void ModemWidget::speed_selection(int) { |
233 | gpppdata.setSpeed(baud_c->text(baud_c->currentItem())); | 233 | PPPData::data()->setSpeed(baud_c->text(baud_c->currentItem())); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | void ModemWidget::setenter(int ) { | 237 | void ModemWidget::setenter(int ) { |
238 | gpppdata.setEnter(enter->text(enter->currentItem())); | 238 | PPPData::data()->setEnter(enter->text(enter->currentItem())); |
239 | } | 239 | } |
240 | 240 | ||
241 | 241 | ||
242 | void ModemWidget::setmodemdc(int i) { | 242 | void ModemWidget::setmodemdc(int i) { |
243 | gpppdata.setModemDevice(modemdevice->text(i)); | 243 | PPPData::data()->setModemDevice(modemdevice->text(i)); |
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | void ModemWidget::setflowcontrol(int i) { | 247 | void ModemWidget::setflowcontrol(int i) { |
248 | gpppdata.setFlowcontrol(flowcontrol->text(i)); | 248 | PPPData::data()->setFlowcontrol(flowcontrol->text(i)); |
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | void ModemWidget::modemlockfilechanged(bool set) { | 252 | void ModemWidget::modemlockfilechanged(bool set) { |
253 | gpppdata.setModemLockFile(set); | 253 | PPPData::data()->setModemLockFile(set); |
254 | } | 254 | } |
255 | 255 | ||
256 | 256 | ||
257 | void ModemWidget::modemtimeoutchanged(int n) { | 257 | void ModemWidget::modemtimeoutchanged(int n) { |
258 | gpppdata.setModemTimeout(n); | 258 | PPPData::data()->setModemTimeout(n); |
259 | } | 259 | } |
260 | 260 | ||
@@ -267,5 +267,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
267 | 267 | ||
268 | waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); | 268 | waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); |
269 | waitfordt->setChecked(gpppdata.waitForDialTone()); | 269 | waitfordt->setChecked(PPPData::data()->waitForDialTone()); |
270 | connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); | 270 | connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); |
271 | l1->addWidget(waitfordt); | 271 | l1->addWidget(waitfordt); |
@@ -279,5 +279,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
279 | "<b>Default:</b>: On")); | 279 | "<b>Default:</b>: On")); |
280 | 280 | ||
281 | busywait = new KIntNumInput(gpppdata.busyWait(), this); | 281 | busywait = new KIntNumInput(PPPData::data()->busyWait(), this); |
282 | busywait->setLabel(i18n("B&usy wait:")); | 282 | busywait->setLabel(i18n("B&usy wait:")); |
283 | busywait->setRange(0, 300, 5, true); | 283 | busywait->setRange(0, 300, 5, true); |
@@ -302,5 +302,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
302 | QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); | 302 | QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); |
303 | hbl->addWidget(volumeLabel); | 303 | hbl->addWidget(volumeLabel); |
304 | volume = new QSlider(0, 2, 1, gpppdata.volume(), QSlider::Horizontal, this); | 304 | volume = new QSlider(0, 2, 1, PPPData::data()->volume(), QSlider::Horizontal, this); |
305 | volumeLabel->setBuddy(volume); | 305 | volumeLabel->setBuddy(volume); |
306 | volume->setTickmarks(QSlider::Below); | 306 | volume->setTickmarks(QSlider::Below); |
@@ -326,5 +326,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
326 | #if 0 | 326 | #if 0 |
327 | chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); | 327 | chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); |
328 | chkbox1->setChecked(gpppdata.UseCDLine()); | 328 | chkbox1->setChecked(PPPData::data()->UseCDLine()); |
329 | connect(chkbox1,SIGNAL(toggled(bool)), | 329 | connect(chkbox1,SIGNAL(toggled(bool)), |
330 | this,SLOT(use_cdline_toggled(bool))); | 330 | this,SLOT(use_cdline_toggled(bool))); |
@@ -403,19 +403,19 @@ void ModemWidget2::query_modem() { | |||
403 | #if 0 | 403 | #if 0 |
404 | void ModemWidget2::use_cdline_toggled(bool on) { | 404 | void ModemWidget2::use_cdline_toggled(bool on) { |
405 | gpppdata.setUseCDLine(on); | 405 | PPPData::data()->setUseCDLine(on); |
406 | } | 406 | } |
407 | #endif | 407 | #endif |
408 | 408 | ||
409 | void ModemWidget2::waitfordtchanged(bool b) { | 409 | void ModemWidget2::waitfordtchanged(bool b) { |
410 | gpppdata.setWaitForDialTone((int)b); | 410 | PPPData::data()->setWaitForDialTone((int)b); |
411 | } | 411 | } |
412 | 412 | ||
413 | void ModemWidget2::busywaitchanged(int n) { | 413 | void ModemWidget2::busywaitchanged(int n) { |
414 | gpppdata.setbusyWait(n); | 414 | PPPData::data()->setbusyWait(n); |
415 | } | 415 | } |
416 | 416 | ||
417 | 417 | ||
418 | void ModemWidget2::volumeChanged(int v) { | 418 | void ModemWidget2::volumeChanged(int v) { |
419 | gpppdata.setVolume(v); | 419 | PPPData::data()->setVolume(v); |
420 | } | 420 | } |
421 | 421 | ||
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index 2f9feda..8d70cd4 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -159,5 +159,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
159 | // connect(log, SIGNAL(toggled(bool)), | 159 | // connect(log, SIGNAL(toggled(bool)), |
160 | // this, SLOT(log_window_toggled(bool))); | 160 | // this, SLOT(log_window_toggled(bool))); |
161 | // log->setChecked(gpppdata.get_show_log_window()); | 161 | // log->setChecked(PPPData::data()->get_show_log_window()); |
162 | // l3->addWidget(log); | 162 | // l3->addWidget(log); |
163 | 163 | ||
@@ -192,5 +192,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
192 | 192 | ||
193 | 193 | ||
194 | // if(gpppdata.access() != KConfig::ReadWrite) | 194 | // if(PPPData::data()->access() != KConfig::ReadWrite) |
195 | // setup_b->setEnabled(false); | 195 | // setup_b->setEnabled(false); |
196 | 196 | ||
@@ -292,5 +292,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
292 | 292 | ||
293 | // if(m_bCmdlAccount){ | 293 | // if(m_bCmdlAccount){ |
294 | // bool result = gpppdata.setAccount(m_strCmdlAccount); | 294 | // bool result = PPPData::data()->setAccount(m_strCmdlAccount); |
295 | // if (!result){ | 295 | // if (!result){ |
296 | // QString string; | 296 | // QString string; |
@@ -364,5 +364,5 @@ void KPPPWidget::enterPressedInPW() { | |||
364 | // triggered by the session manager | 364 | // triggered by the session manager |
365 | void KPPPWidget::saveMyself() { | 365 | void KPPPWidget::saveMyself() { |
366 | gpppdata.save(); | 366 | PPPData::data()->save(); |
367 | } | 367 | } |
368 | 368 | ||
@@ -373,5 +373,5 @@ void KPPPWidget::shutDown() { | |||
373 | 373 | ||
374 | void KPPPWidget::log_window_toggled(bool on) { | 374 | void KPPPWidget::log_window_toggled(bool on) { |
375 | gpppdata.set_show_log_window(on); | 375 | PPPData::data()->set_show_log_window(on); |
376 | } | 376 | } |
377 | 377 | ||
@@ -382,5 +382,5 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
382 | // connectto_c->clear(); | 382 | // connectto_c->clear(); |
383 | 383 | ||
384 | // int count = gpppdata.count(); | 384 | // int count = PPPData::data()->count(); |
385 | 385 | ||
386 | // // enable/disable controls | 386 | // // enable/disable controls |
@@ -393,25 +393,25 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
393 | // //load the accounts | 393 | // //load the accounts |
394 | // for(int i=0; i < count; i++) { | 394 | // for(int i=0; i < count; i++) { |
395 | // gpppdata.setAccountbyIndex(i); | 395 | // PPPData::data()->setAccountbyIndex(i); |
396 | // connectto_c->insertItem(gpppdata.accname()); | 396 | // connectto_c->insertItem(PPPData::data()->accname()); |
397 | // } | 397 | // } |
398 | 398 | ||
399 | // //set the default account | 399 | // //set the default account |
400 | // if(!gpppdata.defaultAccount().isEmpty()) { | 400 | // if(!PPPData::data()->defaultAccount().isEmpty()) { |
401 | // for(int i=0; i < count; i++) | 401 | // for(int i=0; i < count; i++) |
402 | // if(gpppdata.defaultAccount() == connectto_c->text(i)) { | 402 | // if(PPPData::data()->defaultAccount() == connectto_c->text(i)) { |
403 | // connectto_c->setCurrentItem(i); | 403 | // connectto_c->setCurrentItem(i); |
404 | // gpppdata.setAccountbyIndex(i); | 404 | // PPPData::data()->setAccountbyIndex(i); |
405 | 405 | ||
406 | // ID_Edit->setText(gpppdata.storedUsername()); | 406 | // ID_Edit->setText(PPPData::data()->storedUsername()); |
407 | // PW_Edit->setText(gpppdata.storedPassword()); | 407 | // PW_Edit->setText(PPPData::data()->storedPassword()); |
408 | // } | 408 | // } |
409 | // } | 409 | // } |
410 | // else | 410 | // else |
411 | // if(count > 0) { | 411 | // if(count > 0) { |
412 | // gpppdata.setDefaultAccount(connectto_c->text(0)); | 412 | // PPPData::data()->setDefaultAccount(connectto_c->text(0)); |
413 | // gpppdata.save(); | 413 | // PPPData::data()->save(); |
414 | // ID_Edit->setText(gpppdata.storedUsername()); | 414 | // ID_Edit->setText(PPPData::data()->storedUsername()); |
415 | // PW_Edit->setText(gpppdata.storedPassword()); | 415 | // PW_Edit->setText(PPPData::data()->storedPassword()); |
416 | // } | 416 | // } |
417 | 417 | ||
@@ -435,5 +435,5 @@ void KPPPWidget::interruptConnection() { | |||
435 | 435 | ||
436 | // disconnect if online | 436 | // disconnect if online |
437 | if (gpppdata.pppdRunning()) | 437 | if (PPPData::data()->pppdRunning()) |
438 | emit disconnect(); | 438 | emit disconnect(); |
439 | } | 439 | } |
@@ -446,5 +446,5 @@ void KPPPWidget::sigPPPDDied() { | |||
446 | // in the followin line to make sure that we don't raise a false alarm | 446 | // in the followin line to make sure that we don't raise a false alarm |
447 | // such as would be the case when the log file viewer exits. | 447 | // such as would be the case when the log file viewer exits. |
448 | if(gpppdata.pppdRunning() || gpppdata.pppdError()) { | 448 | if(PPPData::data()->pppdRunning() || PPPData::data()->pppdError()) { |
449 | qDebug( "It was pppd that died" ); | 449 | qDebug( "It was pppd that died" ); |
450 | 450 | ||
@@ -458,9 +458,9 @@ void KPPPWidget::sigPPPDDied() { | |||
458 | Modem::modem->removeSecret(AUTH_CHAP); | 458 | Modem::modem->removeSecret(AUTH_CHAP); |
459 | 459 | ||
460 | gpppdata.setpppdRunning(false); | 460 | PPPData::data()->setpppdRunning(false); |
461 | 461 | ||
462 | qDebug( "Executing command on disconnect since pppd has died." ); | 462 | qDebug( "Executing command on disconnect since pppd has died." ); |
463 | QApplication::flushX(); | 463 | QApplication::flushX(); |
464 | execute_command(gpppdata.command_on_disconnect()); | 464 | execute_command(PPPData::data()->command_on_disconnect()); |
465 | 465 | ||
466 | // stopAccounting(); | 466 | // stopAccounting(); |
@@ -470,11 +470,11 @@ void KPPPWidget::sigPPPDDied() { | |||
470 | // DockWidget::dock_widget->hide(); | 470 | // DockWidget::dock_widget->hide(); |
471 | 471 | ||
472 | if(!gpppdata.pppdError()) | 472 | if(!PPPData::data()->pppdError()) |
473 | gpppdata.setpppdError(E_PPPD_DIED); | 473 | PPPData::data()->setpppdError(E_PPPD_DIED); |
474 | removedns(); | 474 | removedns(); |
475 | Modem::modem->unlockdevice(); | 475 | Modem::modem->unlockdevice(); |
476 | // con->pppdDied(); | 476 | // con->pppdDied(); |
477 | 477 | ||
478 | if(!gpppdata.automatic_redial()) { | 478 | if(!PPPData::data()->automatic_redial()) { |
479 | quit_b->setFocus(); | 479 | quit_b->setFocus(); |
480 | show(); | 480 | show(); |
@@ -484,8 +484,8 @@ void KPPPWidget::sigPPPDDied() { | |||
484 | // con->hide(); | 484 | // con->hide(); |
485 | 485 | ||
486 | gpppdata.setpppdRunning(false); | 486 | PPPData::data()->setpppdRunning(false); |
487 | // // not in a signal handler !!! KNotifyClient::beep(); | 487 | // // not in a signal handler !!! KNotifyClient::beep(); |
488 | QString msg; | 488 | QString msg; |
489 | if (gpppdata.pppdError() == E_IF_TIMEOUT) | 489 | if (PPPData::data()->pppdError() == E_IF_TIMEOUT) |
490 | msg = i18n("Timeout expired while waiting for the PPP interface " | 490 | msg = i18n("Timeout expired while waiting for the PPP interface " |
491 | "to come up!"); | 491 | "to come up!"); |
@@ -508,20 +508,20 @@ void KPPPWidget::sigPPPDDied() { | |||
508 | qDebug( "Trying to reconnect... " ); | 508 | qDebug( "Trying to reconnect... " ); |
509 | 509 | ||
510 | if(gpppdata.authMethod() == AUTH_PAP || | 510 | if(PPPData::data()->authMethod() == AUTH_PAP || |
511 | gpppdata.authMethod() == AUTH_CHAP || | 511 | PPPData::data()->authMethod() == AUTH_CHAP || |
512 | gpppdata.authMethod() == AUTH_PAPCHAP) | 512 | PPPData::data()->authMethod() == AUTH_PAPCHAP) |
513 | Modem::modem->setSecret(gpppdata.authMethod(), | 513 | Modem::modem->setSecret(PPPData::data()->authMethod(), |
514 | encodeWord(gpppdata.storedUsername()), | 514 | encodeWord(PPPData::data()->storedUsername()), |
515 | encodeWord(gpppdata.password())); | 515 | encodeWord(PPPData::data()->password())); |
516 | 516 | ||
517 | // con_win->hide(); | 517 | // con_win->hide(); |
518 | // con_win->stopClock(); | 518 | // con_win->stopClock(); |
519 | //stopAccounting(); | 519 | //stopAccounting(); |
520 | gpppdata.setpppdRunning(false); | 520 | PPPData::data()->setpppdRunning(false); |
521 | // not in a signal handler !!!KNotifyClient::beep(); | 521 | // not in a signal handler !!!KNotifyClient::beep(); |
522 | emit cmdl_start(); | 522 | emit cmdl_start(); |
523 | } | 523 | } |
524 | } | 524 | } |
525 | gpppdata.setpppdError(0); | 525 | PPPData::data()->setpppdError(0); |
526 | } | 526 | } |
527 | } | 527 | } |
@@ -544,8 +544,8 @@ void KPPPWidget::sigPPPDDied() { | |||
544 | 544 | ||
545 | void KPPPWidget::newdefaultaccount(int i) { | 545 | void KPPPWidget::newdefaultaccount(int i) { |
546 | gpppdata.setDefaultAccount(connectto_c->text(i)); | 546 | PPPData::data()->setDefaultAccount(connectto_c->text(i)); |
547 | gpppdata.save(); | 547 | PPPData::data()->save(); |
548 | ID_Edit->setText(gpppdata.storedUsername()); | 548 | ID_Edit->setText(PPPData::data()->storedUsername()); |
549 | PW_Edit->setText(gpppdata.storedPassword()); | 549 | PW_Edit->setText(PPPData::data()->storedPassword()); |
550 | } | 550 | } |
551 | 551 | ||
@@ -557,8 +557,8 @@ void KPPPWidget::beginConnect() { | |||
557 | // (exeption: an account given by a command line argument) | 557 | // (exeption: an account given by a command line argument) |
558 | // if(!m_bCmdlAccount) { | 558 | // if(!m_bCmdlAccount) { |
559 | // gpppdata.setAccount(connectto_c->currentText()); | 559 | // PPPData::data()->setAccount(connectto_c->currentText()); |
560 | // gpppdata.setPassword(PW_Edit->text()); | 560 | // PPPData::data()->setPassword(PW_Edit->text()); |
561 | // } else { | 561 | // } else { |
562 | gpppdata.setPassword(gpppdata.storedPassword()); | 562 | PPPData::data()->setPassword(PPPData::data()->storedPassword()); |
563 | // } | 563 | // } |
564 | 564 | ||
@@ -578,5 +578,5 @@ void KPPPWidget::beginConnect() { | |||
578 | "Please make sure that you have given kppp " | 578 | "Please make sure that you have given kppp " |
579 | "setuid permission and that " | 579 | "setuid permission and that " |
580 | "pppd is executable.").arg(gpppdata.pppdPath()); | 580 | "pppd is executable.").arg(PPPData::data()->pppdPath()); |
581 | KMessageBox::error(this, string); | 581 | KMessageBox::error(this, string); |
582 | return; | 582 | return; |
@@ -585,5 +585,5 @@ void KPPPWidget::beginConnect() { | |||
585 | #endif | 585 | #endif |
586 | 586 | ||
587 | QFileInfo info2(gpppdata.modemDevice()); | 587 | QFileInfo info2(PPPData::data()->modemDevice()); |
588 | 588 | ||
589 | if(!info2.exists()){ | 589 | if(!info2.exists()){ |
@@ -593,5 +593,5 @@ void KPPPWidget::beginConnect() { | |||
593 | "and/or adjust the location of the modem device on " | 593 | "and/or adjust the location of the modem device on " |
594 | "the modem tab of " | 594 | "the modem tab of " |
595 | "the setup dialog.").arg(gpppdata.modemDevice()); | 595 | "the setup dialog.").arg(PPPData::data()->modemDevice()); |
596 | QMessageBox::warning(this, "error", string); | 596 | QMessageBox::warning(this, "error", string); |
597 | return; | 597 | return; |
@@ -600,7 +600,7 @@ void KPPPWidget::beginConnect() { | |||
600 | // if this is a PAP or CHAP account, ensure that username is | 600 | // if this is a PAP or CHAP account, ensure that username is |
601 | // supplied | 601 | // supplied |
602 | if(gpppdata.authMethod() == AUTH_PAP || | 602 | if(PPPData::data()->authMethod() == AUTH_PAP || |
603 | gpppdata.authMethod() == AUTH_CHAP || | 603 | PPPData::data()->authMethod() == AUTH_CHAP || |
604 | gpppdata.authMethod() == AUTH_PAPCHAP ) { | 604 | PPPData::data()->authMethod() == AUTH_PAPCHAP ) { |
605 | if(ID_Edit->text().isEmpty()) { | 605 | if(ID_Edit->text().isEmpty()) { |
606 | QMessageBox::warning(this,"error", | 606 | QMessageBox::warning(this,"error", |
@@ -611,7 +611,7 @@ void KPPPWidget::beginConnect() { | |||
611 | return; | 611 | return; |
612 | } else { | 612 | } else { |
613 | if(!Modem::modem->setSecret(gpppdata.authMethod(), | 613 | if(!Modem::modem->setSecret(PPPData::data()->authMethod(), |
614 | encodeWord(gpppdata.storedUsername()), | 614 | encodeWord(PPPData::data()->storedUsername()), |
615 | encodeWord(gpppdata.password()))) { | 615 | encodeWord(PPPData::data()->password()))) { |
616 | QString s; | 616 | QString s; |
617 | s = i18n("Cannot create PAP/CHAP authentication\n" | 617 | s = i18n("Cannot create PAP/CHAP authentication\n" |
@@ -623,5 +623,5 @@ void KPPPWidget::beginConnect() { | |||
623 | } | 623 | } |
624 | 624 | ||
625 | if (gpppdata.phonenumber().isEmpty()) { | 625 | if (PPPData::data()->phonenumber().isEmpty()) { |
626 | QString s = i18n("You must specify a telephone number!"); | 626 | QString s = i18n("You must specify a telephone number!"); |
627 | QMessageBox::warning(this, "error", s); | 627 | QMessageBox::warning(this, "error", s); |
@@ -631,10 +631,10 @@ void KPPPWidget::beginConnect() { | |||
631 | this->hide(); | 631 | this->hide(); |
632 | 632 | ||
633 | QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); | 633 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); |
634 | // con->setCaption(tit); | 634 | // con->setCaption(tit); |
635 | 635 | ||
636 | // con->show(); | 636 | // con->show(); |
637 | 637 | ||
638 | bool show_debug = gpppdata.get_show_log_window(); | 638 | bool show_debug = PPPData::data()->get_show_log_window(); |
639 | // con->debug->setOn(show_debug);// toggle button | 639 | // con->debug->setOn(show_debug);// toggle button |
640 | debugwindow->clear(); | 640 | debugwindow->clear(); |
@@ -651,5 +651,5 @@ void KPPPWidget::beginConnect() { | |||
651 | 651 | ||
652 | void KPPPWidget::disconnect() { | 652 | void KPPPWidget::disconnect() { |
653 | if (!gpppdata.command_before_disconnect().isEmpty()) { | 653 | if (!PPPData::data()->command_before_disconnect().isEmpty()) { |
654 | // con_win->hide(); | 654 | // con_win->hide(); |
655 | // con->show(); | 655 | // con->show(); |
@@ -660,5 +660,5 @@ void KPPPWidget::disconnect() { | |||
660 | QApplication::flushX(); | 660 | QApplication::flushX(); |
661 | // pid_t id = | 661 | // pid_t id = |
662 | execute_command(gpppdata.command_before_disconnect()); | 662 | execute_command(PPPData::data()->command_before_disconnect()); |
663 | // int i, status; | 663 | // int i, status; |
664 | 664 | ||
@@ -678,5 +678,5 @@ void KPPPWidget::disconnect() { | |||
678 | 678 | ||
679 | QApplication::flushX(); | 679 | QApplication::flushX(); |
680 | execute_command(gpppdata.command_on_disconnect()); | 680 | execute_command(PPPData::data()->command_on_disconnect()); |
681 | 681 | ||
682 | Modem::modem->removeSecret(AUTH_PAP); | 682 | Modem::modem->removeSecret(AUTH_PAP); |
@@ -708,5 +708,5 @@ void KPPPWidget::disconnect() { | |||
708 | 708 | ||
709 | void KPPPWidget::quitbutton() { | 709 | void KPPPWidget::quitbutton() { |
710 | if(gpppdata.pppdRunning()) { | 710 | if(PPPData::data()->pppdRunning()) { |
711 | int ok = QMessageBox::warning(this, | 711 | int ok = QMessageBox::warning(this, |
712 | i18n("Exiting kPPP will close your PPP Session."), | 712 | i18n("Exiting kPPP will close your PPP Session."), |
@@ -715,13 +715,13 @@ void KPPPWidget::quitbutton() { | |||
715 | Modem::modem->killPPPDaemon(); | 715 | Modem::modem->killPPPDaemon(); |
716 | QApplication::flushX(); | 716 | QApplication::flushX(); |
717 | execute_command(gpppdata.command_on_disconnect()); | 717 | execute_command(PPPData::data()->command_on_disconnect()); |
718 | removedns(); | 718 | removedns(); |
719 | Modem::modem->unlockdevice(); | 719 | Modem::modem->unlockdevice(); |
720 | } | 720 | } |
721 | } else { | 721 | } else { |
722 | if (!gpppdata.accname().isEmpty() && !gpppdata.storePassword()) | 722 | if (!PPPData::data()->accname().isEmpty() && !PPPData::data()->storePassword()) |
723 | gpppdata.setStoredPassword(""); | 723 | PPPData::data()->setStoredPassword(""); |
724 | } | 724 | } |
725 | gpppdata.save(); | 725 | PPPData::data()->save(); |
726 | qApp->quit(); | 726 | qApp->quit(); |
727 | } | 727 | } |
@@ -737,11 +737,11 @@ void KPPPWidget::quitbutton() { | |||
737 | // stats->totalbytes = 0; | 737 | // stats->totalbytes = 0; |
738 | 738 | ||
739 | // kdDebug() << "AcctEnabled: " << gpppdata.AcctEnabled() << endl; | 739 | // kdDebug() << "AcctEnabled: " << PPPData::data()->AcctEnabled() << endl; |
740 | 740 | ||
741 | // // load the ruleset | 741 | // // load the ruleset |
742 | // if(!gpppdata.AcctEnabled()) | 742 | // if(!PPPData::data()->AcctEnabled()) |
743 | // return; | 743 | // return; |
744 | 744 | ||
745 | // QString d = AccountingBase::getAccountingFile(gpppdata.accountingFile()); | 745 | // QString d = AccountingBase::getAccountingFile(PPPData::data()->accountingFile()); |
746 | // // if(::access(d.data(), X_OK) != 0) | 746 | // // if(::access(d.data(), X_OK) != 0) |
747 | // acct = new Accounting(this, stats); | 747 | // acct = new Accounting(this, stats); |
@@ -753,7 +753,7 @@ void KPPPWidget::quitbutton() { | |||
753 | // con_win, SLOT(slotAccounting(QString, QString))); | 753 | // con_win, SLOT(slotAccounting(QString, QString))); |
754 | 754 | ||
755 | // // if(!acct->loadRuleSet(gpppdata.accountingFile())) { | 755 | // // if(!acct->loadRuleSet(PPPData::data()->accountingFile())) { |
756 | // // QString s= i18n("Can not load the accounting " | 756 | // // QString s= i18n("Can not load the accounting " |
757 | // // "ruleset \"%1\"!").arg(gpppdata.accountingFile()); | 757 | // // "ruleset \"%1\"!").arg(PPPData::data()->accountingFile()); |
758 | 758 | ||
759 | // // starting the messagebox with a timer will prevent us | 759 | // // starting the messagebox with a timer will prevent us |
@@ -770,7 +770,7 @@ void KPPPWidget::quitbutton() { | |||
770 | // // store volume accounting | 770 | // // store volume accounting |
771 | // // if(stats->totalbytes != 0) | 771 | // // if(stats->totalbytes != 0) |
772 | // // gpppdata.setTotalBytes(stats->totalbytes); | 772 | // // PPPData::data()->setTotalBytes(stats->totalbytes); |
773 | 773 | ||
774 | // if(!gpppdata.AcctEnabled()) | 774 | // if(!PPPData::data()->AcctEnabled()) |
775 | // return; | 775 | // return; |
776 | 776 | ||
@@ -793,5 +793,5 @@ void KPPPWidget::quitbutton() { | |||
793 | void KPPPWidget::usernameChanged(const QString &) { | 793 | void KPPPWidget::usernameChanged(const QString &) { |
794 | // store username for later use | 794 | // store username for later use |
795 | gpppdata.setStoredUsername(ID_Edit->text()); | 795 | PPPData::data()->setStoredUsername(ID_Edit->text()); |
796 | } | 796 | } |
797 | 797 | ||
@@ -799,8 +799,8 @@ void KPPPWidget::usernameChanged(const QString &) { | |||
799 | void KPPPWidget::passwordChanged(const QString &) { | 799 | void KPPPWidget::passwordChanged(const QString &) { |
800 | // store the password if so requested | 800 | // store the password if so requested |
801 | if(gpppdata.storePassword()) | 801 | if(PPPData::data()->storePassword()) |
802 | gpppdata.setStoredPassword(PW_Edit->text()); | 802 | PPPData::data()->setStoredPassword(PW_Edit->text()); |
803 | else | 803 | else |
804 | gpppdata.setStoredPassword(""); | 804 | PPPData::data()->setStoredPassword(""); |
805 | } | 805 | } |
806 | 806 | ||
@@ -842,5 +842,5 @@ void KPPPWidget::showNews() { | |||
842 | */ | 842 | */ |
843 | #define QUICKHELP_HINT "Hint_QuickHelp" | 843 | #define QUICKHELP_HINT "Hint_QuickHelp" |
844 | if(gpppdata.readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { | 844 | if(PPPData::data()->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { |
845 | QDialog dlg(0, 0, true); | 845 | QDialog dlg(0, 0, true); |
846 | dlg.setCaption(i18n("Recent Changes in KPPP")); | 846 | dlg.setCaption(i18n("Recent Changes in KPPP")); |
@@ -894,6 +894,6 @@ void KPPPWidget::showNews() { | |||
894 | dlg.exec(); | 894 | dlg.exec(); |
895 | if(cb->isChecked()) { | 895 | if(cb->isChecked()) { |
896 | gpppdata.writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); | 896 | PPPData::data()->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); |
897 | gpppdata.save(); | 897 | PPPData::data()->save(); |
898 | } | 898 | } |
899 | } | 899 | } |
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp index a2f77c5..cd5d21c 100644 --- a/noncore/settings/networksettings/ppp/modem.cpp +++ b/noncore/settings/networksettings/ppp/modem.cpp | |||
@@ -102,5 +102,5 @@ speed_t Modem::modemspeed() { | |||
102 | // to set the modem. The constants here should all be ifdef'd because | 102 | // to set the modem. The constants here should all be ifdef'd because |
103 | // other systems may not have them | 103 | // other systems may not have them |
104 | int i = gpppdata.speed().toInt()/100; | 104 | int i = PPPData::data()->speed().toInt()/100; |
105 | 105 | ||
106 | switch(i) { | 106 | switch(i) { |
@@ -152,5 +152,5 @@ bool Modem::opentty() { | |||
152 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { | 152 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { |
153 | close(modemfd); | 153 | close(modemfd); |
154 | // device = "/dev/modem";//deviceByIndex(request.modem.deviceNum); | 154 | device = PPPData::data()->modemDevice(); |
155 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { | 155 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { |
156 | qDebug("error opening modem device !"); | 156 | qDebug("error opening modem device !"); |
@@ -162,5 +162,5 @@ bool Modem::opentty() { | |||
162 | 162 | ||
163 | #if 0 | 163 | #if 0 |
164 | if(gpppdata.UseCDLine()) { | 164 | if(PPPData::data()->UseCDLine()) { |
165 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { | 165 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { |
166 | errmsg = i18n("Unable to detect state of CD line."); | 166 | errmsg = i18n("Unable to detect state of CD line."); |
@@ -210,6 +210,6 @@ bool Modem::opentty() { | |||
210 | 210 | ||
211 | 211 | ||
212 | if(gpppdata.flowcontrol() != "None") { | 212 | if(PPPData::data()->flowcontrol() != "None") { |
213 | if(gpppdata.flowcontrol() == "CRTSCTS") { | 213 | if(PPPData::data()->flowcontrol() == "CRTSCTS") { |
214 | tty.c_cflag |= CRTSCTS; | 214 | tty.c_cflag |= CRTSCTS; |
215 | } | 215 | } |
@@ -340,5 +340,5 @@ bool Modem::writeLine(const char *buf) { | |||
340 | memcpy(b, buf, len); | 340 | memcpy(b, buf, len); |
341 | // different modems seem to need different line terminations | 341 | // different modems seem to need different line terminations |
342 | QString term = gpppdata.enter(); | 342 | QString term = PPPData::data()->enter(); |
343 | if(term == "LF") | 343 | if(term == "LF") |
344 | b[len++]='\n'; | 344 | b[len++]='\n'; |
@@ -380,7 +380,7 @@ bool Modem::hangup() { | |||
380 | 380 | ||
381 | // Then hangup command | 381 | // Then hangup command |
382 | writeLine(gpppdata.modemHangupStr().local8Bit()); | 382 | writeLine(PPPData::data()->modemHangupStr().local8Bit()); |
383 | 383 | ||
384 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec | 384 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec |
385 | 385 | ||
386 | #ifndef DEBUG_WO_DIALING | 386 | #ifndef DEBUG_WO_DIALING |
@@ -418,5 +418,5 @@ bool Modem::hangup() { | |||
418 | #endif | 418 | #endif |
419 | 419 | ||
420 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 secs | 420 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 secs |
421 | 421 | ||
422 | cfsetospeed(&temptty, modemspeed()); | 422 | cfsetospeed(&temptty, modemspeed()); |
@@ -441,9 +441,9 @@ void Modem::escape_to_command_mode() { | |||
441 | 441 | ||
442 | // +3 because quiet time must be greater than guard time. | 442 | // +3 because quiet time must be greater than guard time. |
443 | usleep((gpppdata.modemEscapeGuardTime()+3)*20000); | 443 | usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); |
444 | QCString tmp = gpppdata.modemEscapeStr().local8Bit(); | 444 | QCString tmp = PPPData::data()->modemEscapeStr().local8Bit(); |
445 | write(modemfd, tmp.data(), tmp.length()); | 445 | write(modemfd, tmp.data(), tmp.length()); |
446 | tcflush(modemfd, TCIOFLUSH); | 446 | tcflush(modemfd, TCIOFLUSH); |
447 | usleep((gpppdata.modemEscapeGuardTime()+3)*20000); | 447 | usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); |
448 | 448 | ||
449 | data_mode = false; | 449 | data_mode = false; |
@@ -561,5 +561,5 @@ int Modem::lockdevice() { | |||
561 | char newlock[80]=""; // safe | 561 | char newlock[80]=""; // safe |
562 | 562 | ||
563 | if(!gpppdata.modemLockFile()) { | 563 | if(!PPPData::data()->modemLockFile()) { |
564 | qDebug("The user doesn't want a lockfile."); | 564 | qDebug("The user doesn't want a lockfile."); |
565 | return 0; | 565 | return 0; |
@@ -570,5 +570,5 @@ int Modem::lockdevice() { | |||
570 | 570 | ||
571 | QString lockfile = LOCK_DIR"/LCK.."; | 571 | QString lockfile = LOCK_DIR"/LCK.."; |
572 | lockfile += gpppdata.modemDevice().mid(5); // append everything after /dev/ | 572 | lockfile += PPPData::data()->modemDevice().mid(5); // append everything after /dev/ |
573 | 573 | ||
574 | if(access(QFile::encodeName(lockfile), F_OK) == 0) { | 574 | if(access(QFile::encodeName(lockfile), F_OK) == 0) { |
@@ -601,5 +601,5 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { | |||
601 | } | 601 | } |
602 | 602 | ||
603 | fd = openLockfile(gpppdata.modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); | 603 | fd = openLockfile(PPPData::data()->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); |
604 | if(fd >= 0) { | 604 | if(fd >= 0) { |
605 | sprintf(newlock,"%010d\n", getpid()); | 605 | sprintf(newlock,"%010d\n", getpid()); |
diff --git a/noncore/settings/networksettings/ppp/modemcmds.cpp b/noncore/settings/networksettings/ppp/modemcmds.cpp index 766ba0f..65032e8 100644 --- a/noncore/settings/networksettings/ppp/modemcmds.cpp +++ b/noncore/settings/networksettings/ppp/modemcmds.cpp | |||
@@ -45,7 +45,4 @@ ModemCommands::ModemCommands(QWidget *parent, const char *name) | |||
45 | { | 45 | { |
46 | setCaption(i18n("Edit Modem Commands")); | 46 | setCaption(i18n("Edit Modem Commands")); |
47 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); | ||
48 | QWidget *dummyWidget = new QWidget(this); | ||
49 | // setMainWidget(dummyWidget); | ||
50 | 47 | ||
51 | const int GRIDROWS = 22; | 48 | const int GRIDROWS = 22; |
@@ -244,71 +241,71 @@ ModemCommands::ModemCommands(QWidget *parent, const char *name) | |||
244 | 241 | ||
245 | //set stuff from gpppdata | 242 | //set stuff from gpppdata |
246 | preinitslider->setValue(gpppdata.modemPreInitDelay()); | 243 | preinitslider->setValue(PPPData::data()->modemPreInitDelay()); |
247 | lpreinitslider->setNum(gpppdata.modemPreInitDelay()); | 244 | lpreinitslider->setNum(PPPData::data()->modemPreInitDelay()); |
248 | for(int i = 0; i < PPPData::NumInitStrings; i++) | 245 | for(int i = 0; i < PPPData::NumInitStrings; i++) |
249 | initstr[i]->setText(gpppdata.modemInitStr(i)); | 246 | initstr[i]->setText(PPPData::data()->modemInitStr(i)); |
250 | initslider->setValue(gpppdata.modemInitDelay()); | 247 | initslider->setValue(PPPData::data()->modemInitDelay()); |
251 | linitslider->setNum(gpppdata.modemInitDelay()); | 248 | linitslider->setNum(PPPData::data()->modemInitDelay()); |
252 | initresp->setText(gpppdata.modemInitResp()); | 249 | initresp->setText(PPPData::data()->modemInitResp()); |
253 | 250 | ||
254 | durationslider->setValue(gpppdata.modemToneDuration()); | 251 | durationslider->setValue(PPPData::data()->modemToneDuration()); |
255 | ldurationslider->setNum(gpppdata.modemToneDuration()); | 252 | ldurationslider->setNum(PPPData::data()->modemToneDuration()); |
256 | 253 | ||
257 | nodetectdialtone->setText(gpppdata.modemNoDialToneDetectionStr()); | 254 | nodetectdialtone->setText(PPPData::data()->modemNoDialToneDetectionStr()); |
258 | dialstr->setText(gpppdata.modemDialStr()); | 255 | dialstr->setText(PPPData::data()->modemDialStr()); |
259 | connectresp->setText(gpppdata.modemConnectResp()); | 256 | connectresp->setText(PPPData::data()->modemConnectResp()); |
260 | busyresp->setText(gpppdata.modemBusyResp()); | 257 | busyresp->setText(PPPData::data()->modemBusyResp()); |
261 | nocarrierresp->setText(gpppdata.modemNoCarrierResp()); | 258 | nocarrierresp->setText(PPPData::data()->modemNoCarrierResp()); |
262 | nodialtoneresp->setText(gpppdata.modemNoDialtoneResp()); | 259 | nodialtoneresp->setText(PPPData::data()->modemNoDialtoneResp()); |
263 | 260 | ||
264 | escapestr->setText(gpppdata.modemEscapeStr()); | 261 | escapestr->setText(PPPData::data()->modemEscapeStr()); |
265 | escaperesp->setText(gpppdata.modemEscapeResp()); | 262 | escaperesp->setText(PPPData::data()->modemEscapeResp()); |
266 | 263 | ||
267 | hangupstr->setText(gpppdata.modemHangupStr()); | 264 | hangupstr->setText(PPPData::data()->modemHangupStr()); |
268 | hangupresp->setText(gpppdata.modemHangupResp()); | 265 | hangupresp->setText(PPPData::data()->modemHangupResp()); |
269 | 266 | ||
270 | answerstr->setText(gpppdata.modemAnswerStr()); | 267 | answerstr->setText(PPPData::data()->modemAnswerStr()); |
271 | ringresp->setText(gpppdata.modemRingResp()); | 268 | ringresp->setText(PPPData::data()->modemRingResp()); |
272 | answerresp->setText(gpppdata.modemAnswerResp()); | 269 | answerresp->setText(PPPData::data()->modemAnswerResp()); |
273 | 270 | ||
274 | slider->setValue(gpppdata.modemEscapeGuardTime()); | 271 | slider->setValue(PPPData::data()->modemEscapeGuardTime()); |
275 | lslider->setNum(gpppdata.modemEscapeGuardTime()); | 272 | lslider->setNum(PPPData::data()->modemEscapeGuardTime()); |
276 | 273 | ||
277 | volume_off->setText(gpppdata.volumeOff()); | 274 | volume_off->setText(PPPData::data()->volumeOff()); |
278 | volume_medium->setText(gpppdata.volumeMedium()); | 275 | volume_medium->setText(PPPData::data()->volumeMedium()); |
279 | volume_high->setText(gpppdata.volumeHigh()); | 276 | volume_high->setText(PPPData::data()->volumeHigh()); |
280 | } | 277 | } |
281 | 278 | ||
282 | 279 | ||
283 | void ModemCommands::slotOk() { | 280 | void ModemCommands::slotOk() { |
284 | gpppdata.setModemPreInitDelay(lpreinitslider->text().toInt()); | 281 | PPPData::data()->setModemPreInitDelay(lpreinitslider->text().toInt()); |
285 | for(int i = 0; i < PPPData::NumInitStrings; i++) | 282 | for(int i = 0; i < PPPData::NumInitStrings; i++) |
286 | gpppdata.setModemInitStr(i, initstr[i]->text()); | 283 | PPPData::data()->setModemInitStr(i, initstr[i]->text()); |
287 | gpppdata.setModemInitResp(initresp->text()); | 284 | PPPData::data()->setModemInitResp(initresp->text()); |
288 | gpppdata.setModemInitDelay(linitslider->text().toInt()); | 285 | PPPData::data()->setModemInitDelay(linitslider->text().toInt()); |
289 | 286 | ||
290 | gpppdata.setModemToneDuration(ldurationslider->text().toInt()); | 287 | PPPData::data()->setModemToneDuration(ldurationslider->text().toInt()); |
291 | gpppdata.setModemNoDialToneDetectionStr(nodetectdialtone->text()); | 288 | PPPData::data()->setModemNoDialToneDetectionStr(nodetectdialtone->text()); |
292 | gpppdata.setModemDialStr(dialstr->text()); | 289 | PPPData::data()->setModemDialStr(dialstr->text()); |
293 | gpppdata.setModemConnectResp(connectresp->text()); | 290 | PPPData::data()->setModemConnectResp(connectresp->text()); |
294 | gpppdata.setModemBusyResp(busyresp->text()); | 291 | PPPData::data()->setModemBusyResp(busyresp->text()); |
295 | gpppdata.setModemNoCarrierResp(nocarrierresp->text()); | 292 | PPPData::data()->setModemNoCarrierResp(nocarrierresp->text()); |
296 | gpppdata.setModemNoDialtoneResp(nodialtoneresp->text()); | 293 | PPPData::data()->setModemNoDialtoneResp(nodialtoneresp->text()); |
297 | 294 | ||
298 | gpppdata.setModemEscapeStr(escapestr->text()); | 295 | PPPData::data()->setModemEscapeStr(escapestr->text()); |
299 | gpppdata.setModemEscapeResp(escaperesp->text()); | 296 | PPPData::data()->setModemEscapeResp(escaperesp->text()); |
300 | gpppdata.setModemEscapeGuardTime(lslider->text().toInt()); | 297 | PPPData::data()->setModemEscapeGuardTime(lslider->text().toInt()); |
301 | gpppdata.setModemHangupStr(hangupstr->text()); | 298 | PPPData::data()->setModemHangupStr(hangupstr->text()); |
302 | gpppdata.setModemHangupResp(hangupresp->text()); | 299 | PPPData::data()->setModemHangupResp(hangupresp->text()); |
303 | 300 | ||
304 | gpppdata.setModemAnswerStr(answerstr->text()); | 301 | PPPData::data()->setModemAnswerStr(answerstr->text()); |
305 | gpppdata.setModemRingResp(ringresp->text()); | 302 | PPPData::data()->setModemRingResp(ringresp->text()); |
306 | gpppdata.setModemAnswerResp(answerresp->text()); | 303 | PPPData::data()->setModemAnswerResp(answerresp->text()); |
307 | 304 | ||
308 | gpppdata.setVolumeHigh(volume_high->text()); | 305 | PPPData::data()->setVolumeHigh(volume_high->text()); |
309 | gpppdata.setVolumeMedium(volume_medium->text()); | 306 | PPPData::data()->setVolumeMedium(volume_medium->text()); |
310 | gpppdata.setVolumeOff(volume_off->text()); | 307 | PPPData::data()->setVolumeOff(volume_off->text()); |
311 | 308 | ||
312 | gpppdata.save(); | 309 | PPPData::data()->save(); |
313 | accept(); | 310 | accept(); |
314 | } | 311 | } |
diff --git a/noncore/settings/networksettings/ppp/newwidget.cpp b/noncore/settings/networksettings/ppp/newwidget.cpp deleted file mode 100644 index d2182fb..0000000 --- a/noncore/settings/networksettings/ppp/newwidget.cpp +++ b/dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | ///////////////////////////////////////////////////////////////////////////// | ||
2 | // | ||
3 | // functions generating layout-aware widgets | ||
4 | // | ||
5 | ///////////////////////////////////////////////////////////////////////////// | ||
6 | |||
7 | #include "newwidget.h" | ||
8 | |||
9 | QLineEdit *newLineEdit(int visiblewidth, QWidget *parent) { | ||
10 | QLineEdit *l = new QLineEdit(parent); | ||
11 | if(visiblewidth == 0) | ||
12 | l->setMinimumWidth(l->sizeHint().width()); | ||
13 | else | ||
14 | l->setFixedWidth(l->fontMetrics().width('H') * visiblewidth); | ||
15 | |||
16 | return l; | ||
17 | } | ||
diff --git a/noncore/settings/networksettings/ppp/newwidget.h b/noncore/settings/networksettings/ppp/newwidget.h deleted file mode 100644 index 52f2ec7..0000000 --- a/noncore/settings/networksettings/ppp/newwidget.h +++ b/dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | ///////////////////////////////////////////////////////////////////////////// | ||
2 | // | ||
3 | // functions generating layout-aware widgets | ||
4 | // | ||
5 | ///////////////////////////////////////////////////////////////////////////// | ||
6 | |||
7 | #ifndef __NEWWIDGET__H__ | ||
8 | #define __NEWWIDGET__H__ | ||
9 | |||
10 | #include <qwidget.h> | ||
11 | #include <qlineedit.h> | ||
12 | |||
13 | #define L_FIXEDW 1 | ||
14 | #define L_FIXEDH 2 | ||
15 | #define L_FIXED (L_FIXEDW | L_FIXEDH) | ||
16 | |||
17 | QLineEdit *newLineEdit(int visiblewidth, QWidget *parent); | ||
18 | |||
19 | #endif | ||
diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro index a456427..ebfc713 100644 --- a/noncore/settings/networksettings/ppp/ppp.pro +++ b/noncore/settings/networksettings/ppp/ppp.pro | |||
@@ -5,6 +5,6 @@ TEMPLATE = lib | |||
5 | CONFIG += qt warn_on debug | 5 | CONFIG += qt warn_on debug |
6 | DESTDIR = $(OPIEDIR)/plugins/networksettings | 6 | DESTDIR = $(OPIEDIR)/plugins/networksettings |
7 | HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h debug.h accounts.h connect.h edit.h scriptedit.h pppdargs.h newwidget.h iplined.h pwentry.h pppconfig.h | 7 | HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h debug.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h |
8 | SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp debug.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp newwidget.cpp iplined.cpp pwentry.cpp pppconfig.cpp | 8 | SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp debug.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp |
9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ | 9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ |
10 | DEPENDPATH+= $(OPIEDIR)/include | 10 | DEPENDPATH+= $(OPIEDIR)/include |
diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp index 7b2b21b..c0f1fef 100644 --- a/noncore/settings/networksettings/ppp/pppconfig.cpp +++ b/noncore/settings/networksettings/ppp/pppconfig.cpp | |||
@@ -51,5 +51,5 @@ PPPConfigWidget::~PPPConfigWidget() | |||
51 | void PPPConfigWidget::accept() | 51 | void PPPConfigWidget::accept() |
52 | { | 52 | { |
53 | gpppdata.save(); | 53 | PPPData::data()->save(); |
54 | QDialog::accept(); | 54 | QDialog::accept(); |
55 | } | 55 | } |
@@ -58,5 +58,5 @@ void PPPConfigWidget::accept() | |||
58 | void PPPConfigWidget::reject() | 58 | void PPPConfigWidget::reject() |
59 | { | 59 | { |
60 | gpppdata.cancel(); | 60 | PPPData::data()->cancel(); |
61 | QDialog::reject(); | 61 | QDialog::reject(); |
62 | } | 62 | } |
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp index 04d0dd0..b7fca3f 100644 --- a/noncore/settings/networksettings/ppp/pppdargs.cpp +++ b/noncore/settings/networksettings/ppp/pppdargs.cpp | |||
@@ -122,12 +122,12 @@ void PPPdArguments::defaultsbutton() { | |||
122 | // all of this is a hack | 122 | // all of this is a hack |
123 | // save current list | 123 | // save current list |
124 | QStringList arglist(gpppdata.pppdArgument()); | 124 | QStringList arglist(PPPData::data()->pppdArgument()); |
125 | 125 | ||
126 | // get defaults | 126 | // get defaults |
127 | gpppdata.setpppdArgumentDefaults(); | 127 | PPPData::data()->setpppdArgumentDefaults(); |
128 | init(); | 128 | init(); |
129 | 129 | ||
130 | // restore old list | 130 | // restore old list |
131 | gpppdata.setpppdArgument(arglist); | 131 | PPPData::data()->setpppdArgument(arglist); |
132 | } | 132 | } |
133 | 133 | ||
@@ -137,5 +137,5 @@ void PPPdArguments::closebutton() { | |||
137 | for(uint i=0; i < arguments->count(); i++) | 137 | for(uint i=0; i < arguments->count(); i++) |
138 | arglist.append(arguments->text(i)); | 138 | arglist.append(arguments->text(i)); |
139 | gpppdata.setpppdArgument(arglist); | 139 | PPPData::data()->setpppdArgument(arglist); |
140 | 140 | ||
141 | done(0); | 141 | done(0); |
@@ -147,5 +147,5 @@ void PPPdArguments::init() { | |||
147 | arguments->removeItem(0); | 147 | arguments->removeItem(0); |
148 | 148 | ||
149 | QStringList &arglist = gpppdata.pppdArgument(); | 149 | QStringList &arglist = PPPData::data()->pppdArgument(); |
150 | for ( QStringList::Iterator it = arglist.begin(); | 150 | for ( QStringList::Iterator it = arglist.begin(); |
151 | it != arglist.end(); | 151 | it != arglist.end(); |
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp index f2386fc..646facd 100644 --- a/noncore/settings/networksettings/ppp/pppdata.cpp +++ b/noncore/settings/networksettings/ppp/pppdata.cpp | |||
@@ -39,9 +39,22 @@ | |||
39 | #include <assert.h> | 39 | #include <assert.h> |
40 | 40 | ||
41 | PPPData gpppdata; | 41 | PPPData *PPPData::_data = 0; |
42 | Config *PPPData::config = 0; | ||
42 | 43 | ||
44 | PPPData* PPPData::data() | ||
45 | { | ||
46 | if (!_data){ | ||
47 | qDebug("PPPData::data() creates new Instance"); | ||
48 | _data = new PPPData(); | ||
49 | } | ||
50 | if (!_data->config){ | ||
51 | qDebug("PPPData::data() opens conffile"); | ||
52 | _data->open(); | ||
53 | } | ||
54 | return _data; | ||
55 | } | ||
43 | 56 | ||
44 | PPPData::PPPData() | 57 | PPPData::PPPData() |
45 | : config(0L), | 58 | : //config(0L), |
46 | highcount(-1), // start out with no entries | 59 | highcount(-1), // start out with no entries |
47 | caccount(-1), // set the current account index also | 60 | caccount(-1), // set the current account index also |
@@ -57,23 +70,7 @@ PPPData::PPPData() | |||
57 | // | 70 | // |
58 | bool PPPData::open() { | 71 | bool PPPData::open() { |
59 | 72 | qDebug("opening configfile NetworkSetupPPP"); | |
60 | config = new Config("NetworkSetup"); | 73 | if (config) return true; |
61 | /* | 74 | config = new Config("NetworkSetupPPP"); |
62 | config = kapp->config(); | ||
63 | |||
64 | if (config->getConfigState() == KConfig::NoAccess) { | ||
65 | KMessageBox::error(0L, | ||
66 | i18n("The application-specific config file could not " | ||
67 | "be opened in either read-write or read-only mode.\n" | ||
68 | "The superuser might have to change its ownership " | ||
69 | "by issuing the following command in your home directory:\n" | ||
70 | "chown {YourUsername} .kde/share/config/kppprc"), | ||
71 | kapp->name()); | ||
72 | return false; | ||
73 | } | ||
74 | |||
75 | // don't expand shell variables | ||
76 | config->setDollarExpansion(false); | ||
77 | */ | ||
78 | 75 | ||
79 | highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1; | 76 | highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1; |
@@ -105,5 +102,11 @@ void PPPData::save() { | |||
105 | if (config) { | 102 | if (config) { |
106 | writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); | 103 | writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); |
107 | // config->sync(); | 104 | delete config; |
105 | config = 0; | ||
106 | qDebug("worte confi NetworkSetupPPP"); | ||
107 | } | ||
108 | if (_data){ | ||
109 | delete _data; | ||
110 | _data = 0; | ||
108 | } | 111 | } |
109 | 112 | ||
@@ -124,9 +127,9 @@ void PPPData::cancel() { | |||
124 | 127 | ||
125 | 128 | ||
126 | // currently differentiates between READWRITE and NONE only | 129 | // // currently differentiates between READWRITE and NONE only |
127 | int PPPData::access() const { | 130 | // int PPPData::access() const { |
128 | 131 | ||
129 | return 0;//config->getConfigState(); | 132 | // return 1;//config->getConfigState(); |
130 | } | 133 | // } |
131 | 134 | ||
132 | 135 | ||
@@ -135,4 +138,5 @@ QString PPPData::readConfig(const QString &group, const QString &key, | |||
135 | const QString &defvalue = "") | 138 | const QString &defvalue = "") |
136 | { | 139 | { |
140 | // qDebug("PPPData::readConfig key >%s< group >%s<",key.latin1(), group.latin1()); | ||
137 | if (config) { | 141 | if (config) { |
138 | config->setGroup(group); | 142 | config->setGroup(group); |
@@ -719,12 +723,12 @@ bool PPPData::isUniqueAccname(const QString &n) { | |||
719 | 723 | ||
720 | bool PPPData::deleteAccount() { | 724 | bool PPPData::deleteAccount() { |
721 | if(caccount < 0) | 725 | //FIXME: |
722 | return false; | 726 | // if(caccount < 0) |
727 | return false; | ||
723 | 728 | ||
724 | // QMap <QString, QString> map; | 729 | // QMap <QString, QString> map; |
725 | // QMap <QString, QString>::Iterator it; | 730 | // QMap <QString, QString>::Iterator it; |
726 | 731 | ||
727 | // set all entries of the current account to "" | 732 | // // set all entries of the current account to "" |
728 | // tille: do not handle the accounts here... (?) | ||
729 | // map = config->entryMap(cgroup); | 733 | // map = config->entryMap(cgroup); |
730 | // it = map.begin(); | 734 | // it = map.begin(); |
@@ -757,11 +761,11 @@ bool PPPData::deleteAccount() { | |||
757 | // } | 761 | // } |
758 | 762 | ||
759 | highcount--; | 763 | // highcount--; |
760 | if(caccount > highcount) | 764 | // if(caccount > highcount) |
761 | caccount = highcount; | 765 | // caccount = highcount; |
762 | 766 | ||
763 | setAccountbyIndex(caccount); | 767 | // setAccountbyIndex(caccount); |
764 | 768 | ||
765 | return true; | 769 | // return true; |
766 | } | 770 | } |
767 | 771 | ||
@@ -779,6 +783,7 @@ bool PPPData::deleteAccount(const QString &aname) { | |||
779 | int PPPData::newaccount() { | 783 | int PPPData::newaccount() { |
780 | 784 | ||
781 | if(!config || highcount >= MAX_ACCOUNTS) | 785 | qDebug("PPPData::newaccount highcount %i/%i",highcount,MAX_ACCOUNTS); |
782 | return -1; | 786 | if(!config) open(); |
787 | if (highcount >= MAX_ACCOUNTS) return -1; | ||
783 | 788 | ||
784 | highcount++; | 789 | highcount++; |
@@ -786,5 +791,5 @@ int PPPData::newaccount() { | |||
786 | 791 | ||
787 | setpppdArgumentDefaults(); | 792 | setpppdArgumentDefaults(); |
788 | 793 | qDebug("PPPData::newaccount -> %i",caccount); | |
789 | return caccount; | 794 | return caccount; |
790 | } | 795 | } |
@@ -792,24 +797,24 @@ int PPPData::newaccount() { | |||
792 | int PPPData::copyaccount(int i) { | 797 | int PPPData::copyaccount(int i) { |
793 | 798 | ||
794 | if(highcount >= MAX_ACCOUNTS) | 799 | // if(highcount >= MAX_ACCOUNTS) |
795 | return -1; | 800 | return -1; |
796 | 801 | ||
797 | setAccountbyIndex(i); | 802 | // setAccountbyIndex(i); |
798 | 803 | ||
799 | // QMap <QString, QString> map = config->entryMap(cgroup); | 804 | // QMap <QString, QString> map = config->entryMap(cgroup); |
800 | // QMap <QString, QString>::ConstIterator it = map.begin(); | 805 | // QMap <QString, QString>::ConstIterator it = map.begin(); |
801 | 806 | ||
802 | QString newname = i18n("%1_copy").arg(accname()); | 807 | // QString newname = i18n("%1_copy").arg(accname()); |
803 | 808 | ||
804 | newaccount(); | 809 | // newaccount(); |
805 | 810 | ||
806 | // while (it != map.end()) { | 811 | // while (it != map.end()) { |
807 | // config->writeEntry(it.key(), *it); | 812 | // config->writeEntry(it.key(), *it); |
808 | // it++; | 813 | // it++; |
809 | // } | 814 | // } |
810 | 815 | ||
811 | setAccname(newname); | 816 | // setAccname(newname); |
812 | 817 | ||
813 | return caccount; | 818 | // return caccount; |
814 | } | 819 | } |
815 | 820 | ||
@@ -830,5 +835,5 @@ void PPPData::setAccname(const QString &n) { | |||
830 | 835 | ||
831 | 836 | ||
832 | #define SEPARATOR_CHAR ':' | 837 | #define SEPARATOR_CHAR '&' |
833 | QStringList &PPPData::phonenumbers() { | 838 | QStringList &PPPData::phonenumbers() { |
834 | 839 | ||
@@ -1012,5 +1017,5 @@ void PPPData::setDefaultroute(bool set) { | |||
1012 | bool PPPData::autoDNS() { | 1017 | bool PPPData::autoDNS() { |
1013 | bool set = (bool) readNumConfig(cgroup, AUTODNS_KEY, true); | 1018 | bool set = (bool) readNumConfig(cgroup, AUTODNS_KEY, true); |
1014 | return (set && gpppdata.pppdVersionMin(2, 3, 7)); | 1019 | return (set && PPPData::data()->pppdVersionMin(2, 3, 7)); |
1015 | } | 1020 | } |
1016 | 1021 | ||
@@ -1140,47 +1145,47 @@ void PPPData::setpppdArgumentDefaults() { | |||
1140 | 1145 | ||
1141 | 1146 | ||
1142 | // graphing widget | 1147 | // // graphing widget |
1143 | void PPPData::setGraphingOptions(bool enable, | 1148 | // void PPPData::setGraphingOptions(bool enable, |
1144 | QColor bg, | 1149 | // QColor bg, |
1145 | QColor text, | 1150 | // QColor text, |
1146 | QColor in, | 1151 | // QColor in, |
1147 | QColor out) | 1152 | // QColor out) |
1148 | { | 1153 | // { |
1149 | if(config) { | 1154 | // if(config) { |
1150 | config->setGroup(GRAPH_GRP); | 1155 | // config->setGroup(GRAPH_GRP); |
1151 | config->writeEntry(GENABLED, enable); | 1156 | // config->writeEntry(GENABLED, enable); |
1152 | // config->writeEntry(GCOLOR_BG, bg); | 1157 | // // config->writeEntry(GCOLOR_BG, bg); |
1153 | // config->writeEntry(GCOLOR_TEXT, text); | 1158 | // // config->writeEntry(GCOLOR_TEXT, text); |
1154 | // config->writeEntry(GCOLOR_IN, in); | 1159 | // // config->writeEntry(GCOLOR_IN, in); |
1155 | // config->writeEntry(GCOLOR_OUT, out); | 1160 | // // config->writeEntry(GCOLOR_OUT, out); |
1156 | } | 1161 | // } |
1157 | } | 1162 | // } |
1158 | 1163 | ||
1159 | void PPPData::graphingOptions(bool &enable, | 1164 | // void PPPData::graphingOptions(bool &enable, |
1160 | QColor &bg, | 1165 | // QColor &bg, |
1161 | QColor &text, | 1166 | // QColor &text, |
1162 | QColor &in, | 1167 | // QColor &in, |
1163 | QColor &out) | 1168 | // QColor &out) |
1164 | { | 1169 | // { |
1165 | QColor c; | 1170 | // QColor c; |
1166 | 1171 | ||
1167 | if(config) { | 1172 | // if(config) { |
1168 | config->setGroup(GRAPH_GRP); | 1173 | // config->setGroup(GRAPH_GRP); |
1169 | enable = config->readBoolEntry(GENABLED, true); | 1174 | // enable = config->readBoolEntry(GENABLED, true); |
1170 | bg = Qt::white; | 1175 | // bg = Qt::white; |
1171 | //bg = config->readColorEntry(GCOLOR_BG, &c); | 1176 | // //bg = config->readColorEntry(GCOLOR_BG, &c); |
1172 | text = Qt::black; | 1177 | // text = Qt::black; |
1173 | //text = config->readColorEntry(GCOLOR_TEXT, &c); | 1178 | // //text = config->readColorEntry(GCOLOR_TEXT, &c); |
1174 | in = Qt::blue; | 1179 | // in = Qt::blue; |
1175 | //in = config->readColorEntry(GCOLOR_IN, &c); | 1180 | // //in = config->readColorEntry(GCOLOR_IN, &c); |
1176 | out = Qt::red; | 1181 | // out = Qt::red; |
1177 | //out = config->readColorEntry(GCOLOR_OUT, &c); | 1182 | // //out = config->readColorEntry(GCOLOR_OUT, &c); |
1178 | } | 1183 | // } |
1179 | } | 1184 | // } |
1180 | 1185 | ||
1181 | 1186 | ||
1182 | bool PPPData::graphingEnabled() { | 1187 | // bool PPPData::graphingEnabled() { |
1183 | return (bool) readNumConfig(GRAPH_GRP, GENABLED, true); | 1188 | // return (bool) readNumConfig(GRAPH_GRP, GENABLED, true); |
1184 | } | 1189 | // } |
1185 | 1190 | ||
1186 | 1191 | ||
@@ -1206,24 +1211,24 @@ void PPPData::setpppdError(int err) { | |||
1206 | 1211 | ||
1207 | 1212 | ||
1208 | // | 1213 | // // |
1209 | // window position | 1214 | // // window position |
1210 | // | 1215 | // // |
1211 | void PPPData::winPosConWin(int& p_x, int& p_y) { | 1216 | // void PPPData::winPosConWin(int& p_x, int& p_y) { |
1212 | p_x = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_X, QApplication::desktop()->width()/2-160); | 1217 | // p_x = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_X, QApplication::desktop()->width()/2-160); |
1213 | p_y = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_Y, QApplication::desktop()->height()/2-55); | 1218 | // p_y = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_Y, QApplication::desktop()->height()/2-55); |
1214 | } | 1219 | // } |
1215 | 1220 | ||
1216 | void PPPData::setWinPosConWin(int p_x, int p_y) { | 1221 | // void PPPData::setWinPosConWin(int p_x, int p_y) { |
1217 | writeConfig(WINPOS_GRP, WINPOS_CONWIN_X, p_x); | 1222 | // writeConfig(WINPOS_GRP, WINPOS_CONWIN_X, p_x); |
1218 | writeConfig(WINPOS_GRP, WINPOS_CONWIN_Y, p_y); | 1223 | // writeConfig(WINPOS_GRP, WINPOS_CONWIN_Y, p_y); |
1219 | } | 1224 | // } |
1220 | 1225 | ||
1221 | void PPPData::winPosStatWin(int& p_x, int& p_y) { | 1226 | // void PPPData::winPosStatWin(int& p_x, int& p_y) { |
1222 | p_x = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_X, QApplication::desktop()->width()/2-160); | 1227 | // p_x = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_X, QApplication::desktop()->width()/2-160); |
1223 | p_y = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_Y, QApplication::desktop()->height()/2-55); | 1228 | // p_y = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_Y, QApplication::desktop()->height()/2-55); |
1224 | } | 1229 | // } |
1225 | 1230 | ||
1226 | void PPPData::setWinPosStatWin(int p_x, int p_y) { | 1231 | // void PPPData::setWinPosStatWin(int p_x, int p_y) { |
1227 | writeConfig(WINPOS_GRP, WINPOS_STATWIN_X, p_x); | 1232 | // writeConfig(WINPOS_GRP, WINPOS_STATWIN_X, p_x); |
1228 | writeConfig(WINPOS_GRP, WINPOS_STATWIN_Y, p_y); | 1233 | // writeConfig(WINPOS_GRP, WINPOS_STATWIN_Y, p_y); |
1229 | } | 1234 | // } |
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 | |||
@@ -56,9 +56,9 @@ class Config; | |||
56 | 56 | ||
57 | // groups | 57 | // groups |
58 | #define GENERAL_GRP "General" | 58 | #define GENERAL_GRP "PPP_General" |
59 | #define MODEM_GRP "Modem" | 59 | #define MODEM_GRP "PPP_Modem" |
60 | #define ACCOUNT_GRP "Account" | 60 | #define ACCOUNT_GRP "PPP_Account" |
61 | #define GRAPH_GRP "Graph" | 61 | //#define GRAPH_GRP "Graph" |
62 | #define WINPOS_GRP "WindowPosition" | 62 | //#define WINPOS_GRP "WindowPosition" |
63 | 63 | ||
64 | // general | 64 | // general |
@@ -162,4 +162,5 @@ public: | |||
162 | PPPData(); | 162 | PPPData(); |
163 | ~PPPData() {}; | 163 | ~PPPData() {}; |
164 | static PPPData* data(); | ||
164 | 165 | ||
165 | enum { NumInitStrings = 2 }; | 166 | enum { NumInitStrings = 2 }; |
@@ -169,5 +170,5 @@ public: | |||
169 | void save(); | 170 | void save(); |
170 | void cancel(); | 171 | void cancel(); |
171 | int access() const; // read/write access | 172 | // int access() const; // read/write access |
172 | 173 | ||
173 | // function to read/write date to configuration file | 174 | // function to read/write date to configuration file |
@@ -427,39 +428,40 @@ public: | |||
427 | void setTotalBytes(int); | 428 | void setTotalBytes(int); |
428 | 429 | ||
429 | // graphing widget | 430 | // // graphing widget |
430 | void setGraphingOptions(bool enabled, | 431 | // void setGraphingOptions(bool enabled, |
431 | QColor bg, | 432 | // QColor bg, |
432 | QColor text, | 433 | // QColor text, |
433 | QColor in, | 434 | // QColor in, |
434 | QColor out); | 435 | // QColor out); |
435 | void graphingOptions(bool &enabled, | 436 | // void graphingOptions(bool &enabled, |
436 | QColor &bg, | 437 | // QColor &bg, |
437 | QColor &text, | 438 | // QColor &text, |
438 | QColor &in, | 439 | // QColor &in, |
439 | QColor &out); | 440 | // QColor &out); |
440 | bool graphingEnabled(); | 441 | // bool graphingEnabled(); |
441 | 442 | ||
442 | // window positions | 443 | // // window positions |
443 | void winPosConWin(int &, int &); | 444 | // void winPosConWin(int &, int &); |
444 | void setWinPosConWin(int, int); | 445 | // void setWinPosConWin(int, int); |
445 | void winPosStatWin(int &, int &); | 446 | // void winPosStatWin(int &, int &); |
446 | void setWinPosStatWin(int, int); | 447 | // void setWinPosStatWin(int, int); |
447 | 448 | ||
448 | private: | 449 | private: |
449 | QString passwd; | ||
450 | Config* config; // configuration object | ||
451 | int highcount; // index of highest account | ||
452 | int caccount; // index of the current account | ||
453 | QString cgroup; // name of current config group | ||
454 | pid_t suidprocessid; // process ID of setuid child | ||
455 | bool pppdisrunning; // pppd process | ||
456 | // daemon | ||
457 | int pppderror; // error encounterd running pppd | ||
458 | int pppdVer, pppdMod, pppdPatch; // pppd version | ||
459 | |||
460 | QStringList phonelist; | ||
461 | }; | ||
462 | 450 | ||
463 | extern PPPData gpppdata; | 451 | static PPPData *_data; |
452 | |||
453 | QString passwd; | ||
454 | static Config* config; // configuration object | ||
455 | int highcount; // index of highest account | ||
456 | int caccount; // index of the current account | ||
457 | QString cgroup; // name of current config group | ||
458 | pid_t suidprocessid; // process ID of setuid child | ||
459 | bool pppdisrunning; // pppd process | ||
460 | // daemon | ||
461 | int pppderror; // error encounterd running pppd | ||
462 | int pppdVer, pppdMod, pppdPatch; // pppd version | ||
463 | |||
464 | QStringList phonelist; | ||
465 | }; | ||
464 | 466 | ||
465 | #endif | 467 | #endif |
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index d6ca88a..da17e26 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "pppconfig.h" | 1 | #include "pppconfig.h" |
2 | #include "pppmodule.h" | 2 | #include "pppmodule.h" |
3 | //#include "pppimp.h" | 3 | #include "pppdata.h" |
4 | #include "kpppwidget.h" | 4 | #include "kpppwidget.h" |
5 | #include "interfaceinformationimp.h" | 5 | #include "interfaceinformationimp.h" |
@@ -99,4 +99,5 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){ | |||
99 | qDebug("ACCEPTED"); | 99 | qDebug("ACCEPTED"); |
100 | return new Interface( 0, newInterface ); | 100 | return new Interface( 0, newInterface ); |
101 | PPPData::data()->save(); | ||
101 | } | 102 | } |
102 | return NULL; | 103 | return NULL; |