Diffstat (limited to 'noncore/settings/networksettings/ppp/edit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/edit.cpp | 242 |
1 files changed, 121 insertions, 121 deletions
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 &)), |