Diffstat (limited to 'noncore/settings/networksettings/ppp/accounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/accounts.cpp | 110 |
1 files changed, 57 insertions, 53 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 | |||
@@ -55,3 +55,3 @@ AccountWidget::AccountWidget( QWidget *parent, const char *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); |
@@ -63,3 +63,3 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
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)), |
@@ -76,5 +76,5 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
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 | ||
@@ -167,6 +167,6 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) | |||
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 | } |
@@ -186,4 +186,4 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
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); |
@@ -195,5 +195,5 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
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{ |
@@ -242,3 +242,3 @@ void AccountWidget::slotListBoxSelect(int idx) { | |||
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 | ||
@@ -247,5 +247,5 @@ void AccountWidget::editaccount() { | |||
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 | } |
@@ -273,3 +273,3 @@ void AccountWidget::newaccount() { | |||
273 | // { | 273 | // { |
274 | // if (gpppdata.newaccount() == -1) | 274 | // if (PPPData::data()->newaccount() == -1) |
275 | // return; | 275 | // return; |
@@ -280,4 +280,4 @@ void AccountWidget::newaccount() { | |||
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; |
@@ -291,9 +291,9 @@ void AccountWidget::newaccount() { | |||
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 | } |
@@ -312,7 +312,7 @@ void AccountWidget::copyaccount() { | |||
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 | } |
@@ -328,3 +328,3 @@ void AccountWidget::deleteaccount() { | |||
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()); |
@@ -332,3 +332,3 @@ void AccountWidget::deleteaccount() { | |||
332 | emit resetaccounts(); | 332 | emit resetaccounts(); |
333 | gpppdata.save(); | 333 | PPPData::data()->save(); |
334 | 334 | ||
@@ -340,32 +340,34 @@ void AccountWidget::deleteaccount() { | |||
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 ); |
@@ -375,2 +377,4 @@ int AccountWidget::doTab(){ | |||
375 | bool ok = false; | 377 | bool ok = false; |
378 | qDebug("AccountWidget::doTab dlg->showMinimized"); | ||
379 | dlg->showMinimized(); | ||
376 | while (!ok){ | 380 | while (!ok){ |