summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp8
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp12
-rw-r--r--noncore/settings/networksettings/ppp/pppdargs.cpp4
4 files changed, 14 insertions, 14 deletions
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 7d21605..3b2393c 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -527,98 +527,98 @@ void IPWidget::hitIPSelect( int i )
527DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char *name ) 527DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char *name )
528 : QWidget(parent, name), _pppdata(pd) 528 : QWidget(parent, name), _pppdata(pd)
529{ 529{
530 QGridLayout *tl = new QGridLayout(this, 7, 2, 0 ); 530 QGridLayout *tl = new QGridLayout(this, 7, 2, 0 );
531 531
532 dnsdomain_label = new QLabel(tr("Domain name:"), this); 532 dnsdomain_label = new QLabel(tr("Domain name:"), this);
533 tl->addWidget(dnsdomain_label, 0, 0); 533 tl->addWidget(dnsdomain_label, 0, 0);
534 534
535 dnsdomain = new QLineEdit(this); 535 dnsdomain = new QLineEdit(this);
536 536
537 tl->addWidget(dnsdomain, 0, 1); 537 tl->addWidget(dnsdomain, 0, 1);
538 QString tmp = tr("If you enter a domain name here, this domain\n" 538 QString tmp = tr("If you enter a domain name here, this domain\n"
539 "name is used for your computer while you are\n" 539 "name is used for your computer while you are\n"
540 "connected. When the connection is closed, the\n" 540 "connected. When the connection is closed, the\n"
541 "original domain name of your computer is\n" 541 "original domain name of your computer is\n"
542 "restored.\n" 542 "restored.\n"
543 "\n" 543 "\n"
544 "If you leave this field blank, no changes are\n" 544 "If you leave this field blank, no changes are\n"
545 "made to the domain name."); 545 "made to the domain name.");
546 546
547 QWhatsThis::add(dnsdomain_label,tmp); 547 QWhatsThis::add(dnsdomain_label,tmp);
548 QWhatsThis::add(dnsdomain,tmp); 548 QWhatsThis::add(dnsdomain,tmp);
549 549
550 conf_label = new QLabel(tr("Configuration:"), this); 550 conf_label = new QLabel(tr("Configuration:"), this);
551 tl->addWidget(conf_label, 1, 0); 551 tl->addWidget(conf_label, 1, 0);
552 552
553 bg = new QButtonGroup("Group", this); 553 bg = new QButtonGroup("Group", this);
554 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); 554 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int)));
555 bg->hide(); 555 bg->hide();
556 556
557 autodns = new QRadioButton(tr("Automatic"), this); 557 autodns = new QRadioButton(tr("Automatic"), this);
558 bg->insert(autodns, 0); 558 bg->insert(autodns, 0);
559 tl->addWidget(autodns, 1, 1); 559 tl->addWidget(autodns, 1, 1);
560 if(!_pppdata->pppdVersionMin(2, 3, 7)) 560 if(!_pppdata->pppdVersionMin(2, 3, 7))
561 autodns->setEnabled(false); 561 autodns->setEnabled(false);
562 562
563 mandns = new QRadioButton(tr("Manual"), this); 563 mandns = new QRadioButton(tr("Manual"), this);
564 bg->insert(mandns, 1); 564 bg->insert(mandns, 1);
565 tl->addWidget(mandns, 2, 1); 565 tl->addWidget(mandns, 2, 1);
566 566
567 dns_label = new QLabel(tr("DNS IP address:"), this); 567 dns_label = new QLabel(tr("DNS IP address:"), this);
568 tl->addWidget(dns_label, 3, 0); 568 tl->addWidget(dns_label, 3, 0);
569 569
570 QHBoxLayout *l2 = new QHBoxLayout; 570 QHBoxLayout *l2 = new QHBoxLayout;
571 tl->addLayout(l2, 3, 1); 571 tl->addLayout(l2, 3, 1);
572 dnsipaddr = new IPLineEdit(this); 572 dnsipaddr = new IPLineEdit(this);
573 connect(dnsipaddr, SIGNAL(returnPressed()), 573 connect(dnsipaddr, SIGNAL(returnPressed()),
574 SLOT(adddns())); 574 SLOT(adddns()));
575 connect(dnsipaddr, SIGNAL(textChanged(const QString &)), 575 connect(dnsipaddr, SIGNAL(textChanged(const QString&)),
576 SLOT(DNS_Edit_Changed(const QString &))); 576 SLOT(DNS_Edit_Changed(const QString&)));
577 l2->addWidget(dnsipaddr, 1); 577 l2->addWidget(dnsipaddr, 1);
578 l2->addStretch(1); 578 l2->addStretch(1);
579 tmp = tr("<p>Allows you to specify a new DNS server to be\n" 579 tmp = tr("<p>Allows you to specify a new DNS server to be\n"
580 "used while you are connected. When the\n" 580 "used while you are connected. When the\n"
581 "connection is closed, this DNS entry will be\n" 581 "connection is closed, this DNS entry will be\n"
582 "removed again.\n" 582 "removed again.\n"
583 "\n" 583 "\n"
584 "To add a DNS server, type in the IP address of\n" 584 "To add a DNS server, type in the IP address of\n"
585 "the DNS server here and click on <b>Add</b>"); 585 "the DNS server here and click on <b>Add</b>");
586 586
587 QWhatsThis::add(dns_label, tmp); 587 QWhatsThis::add(dns_label, tmp);
588 QWhatsThis::add(dnsipaddr, tmp); 588 QWhatsThis::add(dnsipaddr, tmp);
589 589
590 QHBoxLayout *l1 = new QHBoxLayout; 590 QHBoxLayout *l1 = new QHBoxLayout;
591 tl->addLayout(l1, 4, 1); 591 tl->addLayout(l1, 4, 1);
592 add = new QPushButton(tr("Add"), this); 592 add = new QPushButton(tr("Add"), this);
593 connect(add, SIGNAL(clicked()), SLOT(adddns())); 593 connect(add, SIGNAL(clicked()), SLOT(adddns()));
594 l1->addWidget(add); 594 l1->addWidget(add);
595 // l1->addStretch(1); 595 // l1->addStretch(1);
596 QWhatsThis::add(add, 596 QWhatsThis::add(add,
597 tr("Click this button to add the DNS server\n" 597 tr("Click this button to add the DNS server\n"
598 "specified in the field above. The entry\n" 598 "specified in the field above. The entry\n"
599 "will then be added to the list below")); 599 "will then be added to the list below"));
600 600
601 remove = new QPushButton(tr("Remove"), this); 601 remove = new QPushButton(tr("Remove"), this);
602 connect(remove, SIGNAL(clicked()), SLOT(removedns())); 602 connect(remove, SIGNAL(clicked()), SLOT(removedns()));
603 l1->addWidget(remove); 603 l1->addWidget(remove);
604 QWhatsThis::add(remove, 604 QWhatsThis::add(remove,
605 tr("Click this button to remove the selected DNS\n" 605 tr("Click this button to remove the selected DNS\n"
606 "server entry from the list below")); 606 "server entry from the list below"));
607 607
608 servers_label = new QLabel(tr("DNS address list:"), this); 608 servers_label = new QLabel(tr("DNS address list:"), this);
609 servers_label->setAlignment(AlignTop|AlignLeft); 609 servers_label->setAlignment(AlignTop|AlignLeft);
610 tl->addWidget(servers_label, 5, 0); 610 tl->addWidget(servers_label, 5, 0);
611 611
612 dnsservers = new QListBox(this); 612 dnsservers = new QListBox(this);
613 dnsservers->setMinimumSize(150, 80); 613 dnsservers->setMinimumSize(150, 80);
614 connect(dnsservers, SIGNAL(highlighted(int)), 614 connect(dnsservers, SIGNAL(highlighted(int)),
615 SLOT(DNS_Entry_Selected(int))); 615 SLOT(DNS_Entry_Selected(int)));
616 tl->addWidget(dnsservers, 5, 1); 616 tl->addWidget(dnsservers, 5, 1);
617 tmp = tr("<p>This shows all defined DNS servers to use\n" 617 tmp = tr("<p>This shows all defined DNS servers to use\n"
618 "while you are connected. Use the <b>Add</b> and\n" 618 "while you are connected. Use the <b>Add</b> and\n"
619 "<b>Remove</b> buttons to modify the list"); 619 "<b>Remove</b> buttons to modify the list");
620 620
621 QWhatsThis::add(servers_label,tmp); 621 QWhatsThis::add(servers_label,tmp);
622 QWhatsThis::add(dnsservers,tmp); 622 QWhatsThis::add(dnsservers,tmp);
623 623
624 exdnsdisabled_toggle = new QCheckBox(tr("Disable DNS servers during connection"), this); 624 exdnsdisabled_toggle = new QCheckBox(tr("Disable DNS servers during connection"), this);
@@ -1139,73 +1139,73 @@ void ScriptWidget::insertButton()
1139 break; 1139 break;
1140 } 1140 }
1141 adjustScrollBar(); 1141 adjustScrollBar();
1142 se->setText(""); 1142 se->setText("");
1143} 1143}
1144 1144
1145 1145
1146void ScriptWidget::removeButton() 1146void ScriptWidget::removeButton()
1147{ 1147{
1148 if(sl->currentItem() >= 0) 1148 if(sl->currentItem() >= 0)
1149 { 1149 {
1150 int stlc = stl->currentItem(); 1150 int stlc = stl->currentItem();
1151 sl->removeItem(sl->currentItem()); 1151 sl->removeItem(sl->currentItem());
1152 stl->removeItem(stlc); 1152 stl->removeItem(stlc);
1153 adjustScrollBar(); 1153 adjustScrollBar();
1154 insert->setEnabled(sl->currentItem() != -1); 1154 insert->setEnabled(sl->currentItem() != -1);
1155 remove->setEnabled(sl->currentItem() != -1); 1155 remove->setEnabled(sl->currentItem() != -1);
1156 } 1156 }
1157} 1157}
1158 1158
1159 1159
1160 1160
1161///////////////////////////////////////////////////////////////////////////// 1161/////////////////////////////////////////////////////////////////////////////
1162// 1162//
1163// Used to specify a new phone number 1163// Used to specify a new phone number
1164// 1164//
1165///////////////////////////////////////////////////////////////////////////// 1165/////////////////////////////////////////////////////////////////////////////
1166PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) 1166PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1167 : QDialog(parent,"PhoneNumberDialog",true) 1167 : QDialog(parent,"PhoneNumberDialog",true)
1168{ 1168{
1169 setCaption( tr("Add Phone Number") ); 1169 setCaption( tr("Add Phone Number") );
1170 1170
1171 1171
1172 QVBoxLayout *layout = new QVBoxLayout( this ); 1172 QVBoxLayout *layout = new QVBoxLayout( this );
1173 layout->setSpacing( 3 ); 1173 layout->setSpacing( 3 );
1174 layout->setMargin( 3 ); 1174 layout->setMargin( 3 );
1175 1175
1176 // QHBox *hbox = new QHBox(this); 1176 // QHBox *hbox = new QHBox(this);
1177 // setMainWidget(hbox); 1177 // setMainWidget(hbox);
1178 1178
1179 // hbox->setSpacing( 2 );//KDialog::spacingHint()); 1179 // hbox->setSpacing( 2 );//KDialog::spacingHint());
1180 1180
1181 QLabel *label = new QLabel(this, tr("Enter a phone number:")); 1181 QLabel *label = new QLabel(this, tr("Enter a phone number:"));
1182 layout->addWidget( label ); 1182 layout->addWidget( label );
1183 1183
1184 le = new QLineEdit(this, "lineEdit"); 1184 le = new QLineEdit(this, "lineEdit");
1185 layout->addWidget( le ); 1185 layout->addWidget( le );
1186 1186
1187 connect(le, SIGNAL(textChanged(const QString &)), 1187 connect(le, SIGNAL(textChanged(const QString&)),
1188 this, SLOT(textChanged(const QString &))); 1188 this, SLOT(textChanged(const QString&)));
1189 1189
1190 le->setFocus(); 1190 le->setFocus();
1191 textChanged(""); 1191 textChanged("");
1192 1192
1193 1193
1194} 1194}
1195 1195
1196 1196
1197QString PhoneNumberDialog::phoneNumber() 1197QString PhoneNumberDialog::phoneNumber()
1198{ 1198{
1199 QString s = le->text(); 1199 QString s = le->text();
1200 1200
1201 return s; 1201 return s;
1202} 1202}
1203 1203
1204 1204
1205void PhoneNumberDialog::textChanged(const QString &s) 1205void PhoneNumberDialog::textChanged(const QString &s)
1206{ 1206{
1207 // enableButtonOK(s.length() > 0); 1207 // enableButtonOK(s.length() > 0);
1208} 1208}
1209 1209
1210 1210
1211//#include "edit.moc" 1211//#include "edit.moc"
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index ff1b11b..81dab38 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -39,98 +39,98 @@
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qlabel.h> 40#include <qlabel.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qpushbutton.h> 42#include <qpushbutton.h>
43#include <qslider.h> 43#include <qslider.h>
44#include <qspinbox.h> 44#include <qspinbox.h>
45#include <qwhatsthis.h> 45#include <qwhatsthis.h>
46 46
47/* STD */ 47/* STD */
48#include <termios.h> 48#include <termios.h>
49#include <string.h> 49#include <string.h>
50 50
51 51
52ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) 52ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
53 : QWidget(parent, name), _pppdata(pd) 53 : QWidget(parent, name), _pppdata(pd)
54{ 54{
55 int k; 55 int k;
56 56
57 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint()); 57 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint());
58 58
59 QLabel *label1; 59 QLabel *label1;
60 60
61 label1 = new QLabel(tr("Modem &name:"), this); 61 label1 = new QLabel(tr("Modem &name:"), this);
62 tl->addWidget(label1, 0, 0); 62 tl->addWidget(label1, 0, 0);
63 63
64 modemname = new QLineEdit(this, "modemName"); 64 modemname = new QLineEdit(this, "modemName");
65 modemname->setText( _pppdata->devname() ); 65 modemname->setText( _pppdata->devname() );
66 label1->setBuddy(modemname); 66 label1->setBuddy(modemname);
67 tl->addWidget(modemname, 0, 1); 67 tl->addWidget(modemname, 0, 1);
68 68
69 label1 = new QLabel(tr("Modem de&vice:"), this); 69 label1 = new QLabel(tr("Modem de&vice:"), this);
70 tl->addWidget(label1, 1, 0); 70 tl->addWidget(label1, 1, 0);
71 71
72 modemdevice = new QComboBox(false, this); 72 modemdevice = new QComboBox(false, this);
73 modemdevice->setEditable( true ); 73 modemdevice->setEditable( true );
74 modemdevice->setDuplicatesEnabled ( false ); 74 modemdevice->setDuplicatesEnabled ( false );
75 modemdevice->setInsertionPolicy( QComboBox::AtTop ); 75 modemdevice->setInsertionPolicy( QComboBox::AtTop );
76 label1->setBuddy(modemdevice); 76 label1->setBuddy(modemdevice);
77 77
78 Config cfg("NetworkSetupPPP"); 78 Config cfg("NetworkSetupPPP");
79 cfg.setGroup("Devices_General"); 79 cfg.setGroup("Devices_General");
80 QStringList devs = cfg.readListEntry("devices",','); 80 QStringList devs = cfg.readListEntry("devices",',');
81 if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0"; 81 if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0";
82 modemdevice->insertStringList( devs ); 82 modemdevice->insertStringList( devs );
83 tl->addWidget(modemdevice, 1, 1); 83 tl->addWidget(modemdevice, 1, 1);
84 84
85 // connect(modemdevice, SIGNAL(activated(int)), 85 // connect(modemdevice, SIGNAL(activated(int)),
86 // SLOT(setmodemdc(int))); 86 // SLOT(setmodemdc(int)));
87 // connect(modemdevice, SIGNAL(textChanged( const QString & ) ), 87 // connect(modemdevice, SIGNAL(textChanged(const QString&) ),
88 // SLOT( setmodemdc( const QString &) ) ); 88 // SLOT( setmodemdc(const QString&) ) );
89 89
90 QString tmp = tr("This specifies the serial port your modem is attached \n" 90 QString tmp = tr("This specifies the serial port your modem is attached \n"
91 "to. On Linux/x86, typically this is either /dev/ttyS0 \n" 91 "to. On Linux/x86, typically this is either /dev/ttyS0 \n"
92 "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n" 92 "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n"
93 "\n" 93 "\n"
94 "If you have an internal ISDN card with AT command\n" 94 "If you have an internal ISDN card with AT command\n"
95 "emulation (most cards under Linux support this), you\n" 95 "emulation (most cards under Linux support this), you\n"
96 "should select one of the /dev/ttyIx devices."); 96 "should select one of the /dev/ttyIx devices.");
97 97
98 QWhatsThis::add(label1,tmp); 98 QWhatsThis::add(label1,tmp);
99 QWhatsThis::add(modemdevice,tmp); 99 QWhatsThis::add(modemdevice,tmp);
100 100
101 101
102 label1 = new QLabel(tr("&Flow control:"), this); 102 label1 = new QLabel(tr("&Flow control:"), this);
103 tl->addWidget(label1, 2, 0); 103 tl->addWidget(label1, 2, 0);
104 104
105 flowcontrol = new QComboBox(false, this); 105 flowcontrol = new QComboBox(false, this);
106 label1->setBuddy(flowcontrol); 106 label1->setBuddy(flowcontrol);
107 flowcontrol->insertItem(tr("Hardware [CRTSCTS]")); 107 flowcontrol->insertItem(tr("Hardware [CRTSCTS]"));
108 flowcontrol->insertItem(tr("Software [XON/XOFF]")); 108 flowcontrol->insertItem(tr("Software [XON/XOFF]"));
109 flowcontrol->insertItem(tr("None")); 109 flowcontrol->insertItem(tr("None"));
110 tl->addWidget(flowcontrol, 2, 1); 110 tl->addWidget(flowcontrol, 2, 1);
111 // connect(flowcontrol, SIGNAL(activated(int)), 111 // connect(flowcontrol, SIGNAL(activated(int)),
112 // SLOT(setflowcontrol(int))); 112 // SLOT(setflowcontrol(int)));
113 113
114 tmp = tr("<p>Specifies how the serial port and modem\n" 114 tmp = tr("<p>Specifies how the serial port and modem\n"
115 "communicate. You should not change this unless\n" 115 "communicate. You should not change this unless\n"
116 "you know what you are doing.\n" 116 "you know what you are doing.\n"
117 "\n" 117 "\n"
118 "<b>Default</b>: CRTSCTS"); 118 "<b>Default</b>: CRTSCTS");
119 119
120 QWhatsThis::add(label1,tmp); 120 QWhatsThis::add(label1,tmp);
121 QWhatsThis::add(flowcontrol,tmp); 121 QWhatsThis::add(flowcontrol,tmp);
122 122
123 QLabel *labelenter = new QLabel(tr("&Line termination:"), this); 123 QLabel *labelenter = new QLabel(tr("&Line termination:"), this);
124 tl->addWidget(labelenter, 3, 0); 124 tl->addWidget(labelenter, 3, 0);
125 125
126 enter = new QComboBox(false, this); 126 enter = new QComboBox(false, this);
127 labelenter->setBuddy(enter); 127 labelenter->setBuddy(enter);
128 enter->insertItem("CR"); 128 enter->insertItem("CR");
129 enter->insertItem("LF"); 129 enter->insertItem("LF");
130 enter->insertItem("CR/LF"); 130 enter->insertItem("CR/LF");
131 tl->addWidget(enter, 3, 1); 131 tl->addWidget(enter, 3, 1);
132 // connect(enter, SIGNAL(activated(int)), SLOT(setenter(int))); 132 // connect(enter, SIGNAL(activated(int)), SLOT(setenter(int)));
133 tmp = tr("<p>Specifies how AT commands are sent to your\n" 133 tmp = tr("<p>Specifies how AT commands are sent to your\n"
134 "modem. Most modems will work fine with the\n" 134 "modem. Most modems will work fine with the\n"
135 "default <i>CR/LF</i>. If your modem does not react\n" 135 "default <i>CR/LF</i>. If your modem does not react\n"
136 "to the init string, you should try different\n" 136 "to the init string, you should try different\n"
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index e466358..e21bbc7 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -351,101 +351,101 @@ void KPPPWidget::shutDown() {
351 interruptConnection(); 351 interruptConnection();
352 saveMyself(); 352 saveMyself();
353} 353}
354 354
355void KPPPWidget::log_window_toggled(bool on) { 355void KPPPWidget::log_window_toggled(bool on) {
356 _pppdata->set_show_log_window(on); 356 _pppdata->set_show_log_window(on);
357} 357}
358 358
359 359
360 360
361 361
362// void KPPPWidget::resetaccounts() { 362// void KPPPWidget::resetaccounts() {
363// connectto_c->clear(); 363// connectto_c->clear();
364 364
365// int count = _pppdata->count(); 365// int count = _pppdata->count();
366 366
367// // enable/disable controls 367// // enable/disable controls
368// connectto_c->setEnabled(count > 0); 368// connectto_c->setEnabled(count > 0);
369// connect_b->setEnabled(count > 0); 369// connect_b->setEnabled(count > 0);
370// log->setEnabled(count > 0); 370// log->setEnabled(count > 0);
371// ID_Edit->setEnabled(count > 0); 371// ID_Edit->setEnabled(count > 0);
372// PW_Edit->setEnabled(count > 0); 372// PW_Edit->setEnabled(count > 0);
373 373
374// //load the accounts 374// //load the accounts
375// for(int i=0; i < count; i++) { 375// for(int i=0; i < count; i++) {
376// _pppdata->setAccountbyIndex(i); 376// _pppdata->setAccountbyIndex(i);
377// connectto_c->insertItem(_pppdata->accname()); 377// connectto_c->insertItem(_pppdata->accname());
378// } 378// }
379 379
380// //set the default account 380// //set the default account
381// if(!_pppdata->defaultAccount().isEmpty()) { 381// if(!_pppdata->defaultAccount().isEmpty()) {
382// for(int i=0; i < count; i++) 382// for(int i=0; i < count; i++)
383// if(_pppdata->defaultAccount() == connectto_c->text(i)) { 383// if(_pppdata->defaultAccount() == connectto_c->text(i)) {
384 // connectto_c->setCurrentItem(i); 384 // connectto_c->setCurrentItem(i);
385 // _pppdata->setAccountbyIndex(i); 385 // _pppdata->setAccountbyIndex(i);
386 386
387 // ID_Edit->setText(_pppdata->storedUsername()); 387 // ID_Edit->setText(_pppdata->storedUsername());
388 // PW_Edit->setText(_pppdata->storedPassword()); 388 // PW_Edit->setText(_pppdata->storedPassword());
389// } 389// }
390// } 390// }
391// else 391// else
392// if(count > 0) { 392// if(count > 0) {
393// _pppdata->setDefaultAccount(connectto_c->text(0)); 393// _pppdata->setDefaultAccount(connectto_c->text(0));
394// _pppdata->save(); 394// _pppdata->save();
395 // ID_Edit->setText(_pppdata->storedUsername()); 395 // ID_Edit->setText(_pppdata->storedUsername());
396 // PW_Edit->setText(_pppdata->storedPassword()); 396 // PW_Edit->setText(_pppdata->storedPassword());
397// } 397// }
398 398
399// connect(ID_Edit, SIGNAL(textChanged(const QString &)), 399// connect(ID_Edit, SIGNAL(textChanged(const QString&)),
400 // this, SLOT(usernameChanged(const QString &))); 400 // this, SLOT(usernameChanged(const QString&)));
401 401
402// connect(PW_Edit, SIGNAL(textChanged(const QString &)), 402// connect(PW_Edit, SIGNAL(textChanged(const QString&)),
403 // this, SLOT(passwordChanged(const QString &))); 403 // this, SLOT(passwordChanged(const QString&)));
404 404
405// if (ID_Edit->text().isEmpty()) 405// if (ID_Edit->text().isEmpty())
406// ID_Edit->setFocus(); 406// ID_Edit->setFocus();
407// else if (PW_Edit->text().isEmpty()) 407// else if (PW_Edit->text().isEmpty())
408// PW_Edit->setFocus(); 408// PW_Edit->setFocus();
409// } 409// }
410 410
411 411
412void KPPPWidget::interruptConnection() { 412void KPPPWidget::interruptConnection() {
413 // interrupt dial up 413 // interrupt dial up
414// 414//
415 415
416 if (con->isVisible()) 416 if (con->isVisible())
417 emit con->cancelbutton(); 417 emit con->cancelbutton();
418 418
419 // disconnect if online 419 // disconnect if online
420 if (_pppdata->pppdRunning()) 420 if (_pppdata->pppdRunning())
421 emit disconnect(); 421 emit disconnect();
422} 422}
423 423
424 424
425void KPPPWidget::sigPPPDDied() { 425void KPPPWidget::sigPPPDDied() {
426 qDebug( "Received a SIGUSR1" ); 426 qDebug( "Received a SIGUSR1" );
427 427
428 // if we are not connected pppdpid is -1 so have have to check for that 428 // if we are not connected pppdpid is -1 so have have to check for that
429 // in the followin line to make sure that we don't raise a false alarm 429 // in the followin line to make sure that we don't raise a false alarm
430 // such as would be the case when the log file viewer exits. 430 // such as would be the case when the log file viewer exits.
431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) { 431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) {
432 qDebug( "It was pppd that died" ); 432 qDebug( "It was pppd that died" );
433 433
434 // when we killpppd() on Cancel in ConnectWidget 434 // when we killpppd() on Cancel in ConnectWidget
435 // we set pppid to -1 so we won't 435 // we set pppid to -1 so we won't
436 // enter this block 436 // enter this block
437 437
438 // just to be sure 438 // just to be sure
439 439
440 Modem::modem->removeSecret(AUTH_PAP); 440 Modem::modem->removeSecret(AUTH_PAP);
441 Modem::modem->removeSecret(AUTH_CHAP); 441 Modem::modem->removeSecret(AUTH_CHAP);
442 442
443 _pppdata->setpppdRunning(false); 443 _pppdata->setpppdRunning(false);
444 444
445 qDebug( "Executing command on disconnect since pppd has died." ); 445 qDebug( "Executing command on disconnect since pppd has died." );
446 QApplication::flushX(); 446 QApplication::flushX();
447 execute_command(_pppdata->command_on_disconnect()); 447 execute_command(_pppdata->command_on_disconnect());
448 448
449// stopAccounting(); 449// stopAccounting();
450 450
451 con_win->stopClock(); 451 con_win->stopClock();
@@ -676,98 +676,98 @@ void KPPPWidget::disconnect() {
676// void KPPPWidget::helpbutton() { 676// void KPPPWidget::helpbutton() {
677// kapp->invokeHelp(); 677// kapp->invokeHelp();
678// } 678// }
679 679
680 680
681void KPPPWidget::quitbutton() { 681void KPPPWidget::quitbutton() {
682 if(_pppdata->pppdRunning()) { 682 if(_pppdata->pppdRunning()) {
683 int ok = QMessageBox::warning(this, 683 int ok = QMessageBox::warning(this,
684 QObject::tr("Exiting kPPP will close your PPP Session."), 684 QObject::tr("Exiting kPPP will close your PPP Session."),
685 QObject::tr("Quit kPPP?")); 685 QObject::tr("Quit kPPP?"));
686 if(ok == QMessageBox::Yes) { 686 if(ok == QMessageBox::Yes) {
687 Modem::modem->killPPPDaemon(); 687 Modem::modem->killPPPDaemon();
688 QApplication::flushX(); 688 QApplication::flushX();
689 execute_command(_pppdata->command_on_disconnect()); 689 execute_command(_pppdata->command_on_disconnect());
690 removedns(); 690 removedns();
691 Modem::modem->unlockdevice(); 691 Modem::modem->unlockdevice();
692 } 692 }
693 } else { 693 } else {
694 if (!_pppdata->accname().isEmpty() && !_pppdata->storePassword()) 694 if (!_pppdata->accname().isEmpty() && !_pppdata->storePassword())
695 _pppdata->setStoredPassword(""); 695 _pppdata->setStoredPassword("");
696 } 696 }
697 _pppdata->save(); 697 _pppdata->save();
698 qApp->quit(); 698 qApp->quit();
699} 699}
700 700
701 701
702// void KPPPWidget::rulesetLoadError() { 702// void KPPPWidget::rulesetLoadError() {
703// QMessageBox::warning(this,"error", ruleset_load_errmsg); 703// QMessageBox::warning(this,"error", ruleset_load_errmsg);
704// } 704// }
705 705
706 706
707// void KPPPWidget::startAccounting() { 707// void KPPPWidget::startAccounting() {
708// // volume accounting 708// // volume accounting
709// stats->totalbytes = 0; 709// stats->totalbytes = 0;
710 710
711// kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl; 711// kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl;
712 712
713// // load the ruleset 713// // load the ruleset
714// if(!_pppdata->AcctEnabled()) 714// if(!_pppdata->AcctEnabled())
715// return; 715// return;
716 716
717// QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile()); 717// QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile());
718// // if(::access(d.data(), X_OK) != 0) 718// // if(::access(d.data(), X_OK) != 0)
719// acct = new Accounting(this, stats); 719// acct = new Accounting(this, stats);
720// // else 720// // else
721// // acct = new ExecutableAccounting(this); 721// // acct = new ExecutableAccounting(this);
722 722
723// // connect to the accounting object 723// // connect to the accounting object
724// connect(acct, SIGNAL(changed(QString, QString)), 724// connect(acct, SIGNAL(changed(QString,QString)),
725 // con_win, SLOT(slotAccounting(QString, QString))); 725 // con_win, SLOT(slotAccounting(QString,QString)));
726 726
727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) { 727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) {
728// // QString s= QObject::tr("Can not load the accounting " 728// // QString s= QObject::tr("Can not load the accounting "
729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); 729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile());
730 730
731// // starting the messagebox with a timer will prevent us 731// // starting the messagebox with a timer will prevent us
732// // from blocking the calling function ConnectWidget::timerEvent 732// // from blocking the calling function ConnectWidget::timerEvent
733// ruleset_load_errmsg = s; 733// ruleset_load_errmsg = s;
734// QTimer::singleShot(0, this, SLOT(rulesetLoadError())); 734// QTimer::singleShot(0, this, SLOT(rulesetLoadError()));
735// return; 735// return;
736// } 736// }
737// //else 737// //else
738// // acct->slotStart(); 738// // acct->slotStart();
739// } 739// }
740 740
741// void KPPPWidget::stopAccounting() { 741// void KPPPWidget::stopAccounting() {
742// // store volume accounting 742// // store volume accounting
743// // if(stats->totalbytes != 0) 743// // if(stats->totalbytes != 0)
744// // _pppdata->setTotalBytes(stats->totalbytes); 744// // _pppdata->setTotalBytes(stats->totalbytes);
745 745
746// if(!_pppdata->AcctEnabled()) 746// if(!_pppdata->AcctEnabled())
747// return; 747// return;
748 748
749// // if(acct != 0) { 749// // if(acct != 0) {
750// // acct->slotStop(); 750// // acct->slotStop();
751// // delete acct; 751// // delete acct;
752// // acct = 0; 752// // acct = 0;
753// // } 753// // }
754// } 754// }
755 755
756 756
757// void KPPPWidget::showStats() { 757// void KPPPWidget::showStats() {
758// if(statdlg) { 758// if(statdlg) {
759// statdlg->show(); 759// statdlg->show();
760// statdlg->raise(); 760// statdlg->raise();
761// } 761// }
762// } 762// }
763 763
764 764
765void KPPPWidget::usernameChanged(const QString &) { 765void KPPPWidget::usernameChanged(const QString &) {
766 // store username for later use 766 // store username for later use
767 _pppdata->setStoredUsername(ID_Edit->text()); 767 _pppdata->setStoredUsername(ID_Edit->text());
768} 768}
769 769
770 770
771void KPPPWidget::passwordChanged(const QString &) { 771void KPPPWidget::passwordChanged(const QString &) {
772 // store the password if so requested 772 // store the password if so requested
773 if(_pppdata->storePassword()) 773 if(_pppdata->storePassword())
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp
index 66a4d82..d6d8d88 100644
--- a/noncore/settings/networksettings/ppp/pppdargs.cpp
+++ b/noncore/settings/networksettings/ppp/pppdargs.cpp
@@ -10,98 +10,98 @@
10 * Copyright (C) 1997 Jay Painter 10 * Copyright (C) 1997 Jay Painter
11 * 11 *
12 * 12 *
13 * This library is free software; you can redistribute it and/or 13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public 14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either 15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version. 16 * version 2 of the License, or (at your option) any later version.
17 * 17 *
18 * This library is distributed in the hope that it will be useful, 18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details. 21 * Library General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU Library General Public 23 * You should have received a copy of the GNU Library General Public
24 * License along with this program; if not, write to the Free 24 * License along with this program; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */ 26 */
27 27
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qapplication.h> 30#include <qapplication.h>
31#include "pppdargs.h" 31#include "pppdargs.h"
32#include "pppdata.h" 32#include "pppdata.h"
33 33
34 34
35PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name) 35PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name)
36 : QDialog(parent, name, TRUE), _pppdata(pd) 36 : QDialog(parent, name, TRUE), _pppdata(pd)
37{ 37{
38 setCaption(tr("Customize pppd Arguments")); 38 setCaption(tr("Customize pppd Arguments"));
39// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 39// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
40 QVBoxLayout *l = new QVBoxLayout(this, 10, 10); 40 QVBoxLayout *l = new QVBoxLayout(this, 10, 10);
41 QHBoxLayout *tl = new QHBoxLayout(10); 41 QHBoxLayout *tl = new QHBoxLayout(10);
42 l->addLayout(tl); 42 l->addLayout(tl);
43 QVBoxLayout *l1 = new QVBoxLayout(); 43 QVBoxLayout *l1 = new QVBoxLayout();
44 QVBoxLayout *l2 = new QVBoxLayout(); 44 QVBoxLayout *l2 = new QVBoxLayout();
45 tl->addLayout(l1, 1); 45 tl->addLayout(l1, 1);
46 tl->addLayout(l2, 0); 46 tl->addLayout(l2, 0);
47 47
48 QHBoxLayout *l11 = new QHBoxLayout(10); 48 QHBoxLayout *l11 = new QHBoxLayout(10);
49 l1->addLayout(l11); 49 l1->addLayout(l11);
50 50
51 argument_label = new QLabel(tr("Argument:"), this); 51 argument_label = new QLabel(tr("Argument:"), this);
52 l11->addWidget(argument_label); 52 l11->addWidget(argument_label);
53 53
54 argument = new QLineEdit(this); 54 argument = new QLineEdit(this);
55 connect(argument, SIGNAL(returnPressed()), 55 connect(argument, SIGNAL(returnPressed()),
56 SLOT(addbutton())); 56 SLOT(addbutton()));
57 l11->addWidget(argument); 57 l11->addWidget(argument);
58 connect(argument, SIGNAL(textChanged(const QString &)), 58 connect(argument, SIGNAL(textChanged(const QString&)),
59 this, SLOT(textChanged(const QString &))); 59 this, SLOT(textChanged(const QString&)));
60 60
61 arguments = new QListBox(this); 61 arguments = new QListBox(this);
62 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10); 62 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10);
63 connect(arguments, SIGNAL(highlighted(int)), 63 connect(arguments, SIGNAL(highlighted(int)),
64 this, SLOT(itemSelected(int))); 64 this, SLOT(itemSelected(int)));
65 l1->addWidget(arguments, 1); 65 l1->addWidget(arguments, 1);
66 66
67 add = new QPushButton(tr("Add"), this); 67 add = new QPushButton(tr("Add"), this);
68 connect(add, SIGNAL(clicked()), SLOT(addbutton())); 68 connect(add, SIGNAL(clicked()), SLOT(addbutton()));
69 l2->addWidget(add); 69 l2->addWidget(add);
70 l2->addStretch(1); 70 l2->addStretch(1);
71 71
72 remove = new QPushButton(tr("Remove"), this); 72 remove = new QPushButton(tr("Remove"), this);
73 connect(remove, SIGNAL(clicked()), SLOT(removebutton())); 73 connect(remove, SIGNAL(clicked()), SLOT(removebutton()));
74 l2->addWidget(remove); 74 l2->addWidget(remove);
75 75
76 defaults = new QPushButton(tr("Defaults"), this); 76 defaults = new QPushButton(tr("Defaults"), this);
77 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton())); 77 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton()));
78 l2->addWidget(defaults); 78 l2->addWidget(defaults);
79 79
80 l->addSpacing(5); 80 l->addSpacing(5);
81 81
82 82
83 //load info from gpppdata 83 //load info from gpppdata
84 init(); 84 init();
85 85
86 add->setEnabled(false); 86 add->setEnabled(false);
87 remove->setEnabled(false); 87 remove->setEnabled(false);
88 argument->setFocus(); 88 argument->setFocus();
89} 89}
90 90
91 91
92void PPPdArguments::addbutton() { 92void PPPdArguments::addbutton() {
93 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) { 93 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) {
94 arguments->insertItem(argument->text()); 94 arguments->insertItem(argument->text());
95 argument->setText(""); 95 argument->setText("");
96 } 96 }
97} 97}
98 98
99 99
100void PPPdArguments::removebutton() { 100void PPPdArguments::removebutton() {
101 if(arguments->currentItem() >= 0) 101 if(arguments->currentItem() >= 0)
102 arguments->removeItem(arguments->currentItem()); 102 arguments->removeItem(arguments->currentItem());
103} 103}
104 104
105 105
106void PPPdArguments::defaultsbutton() { 106void PPPdArguments::defaultsbutton() {
107 // all of this is a hack 107 // all of this is a hack