Diffstat (limited to 'noncore/settings/networksettings/ppp/edit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/edit.cpp | 8 |
1 files changed, 4 insertions, 4 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 | |||
@@ -479,194 +479,194 @@ void IPWidget::autoname_t(bool on) | |||
479 | "problems with the X-server and applications " | 479 | "problems with the X-server and applications " |
480 | "while kppp is connected. Don't use it until " | 480 | "while kppp is connected. Don't use it until " |
481 | "you know what you are doing!\n" | 481 | "you know what you are doing!\n" |
482 | "For more information take a look at the " | 482 | "For more information take a look at the " |
483 | "handbook (or help) in the section \"Frequently " | 483 | "handbook (or help) in the section \"Frequently " |
484 | "asked questions\"."), | 484 | "asked questions\"."), |
485 | tr("Warning")); | 485 | tr("Warning")); |
486 | was_warned = true; | 486 | was_warned = true; |
487 | } | 487 | } |
488 | } | 488 | } |
489 | 489 | ||
490 | 490 | ||
491 | void IPWidget::save() | 491 | void IPWidget::save() |
492 | { | 492 | { |
493 | if(dynamicadd_rb->isChecked()) | 493 | if(dynamicadd_rb->isChecked()) |
494 | { | 494 | { |
495 | _pppdata->setIpaddr("0.0.0.0"); | 495 | _pppdata->setIpaddr("0.0.0.0"); |
496 | _pppdata->setSubnetmask("0.0.0.0"); | 496 | _pppdata->setSubnetmask("0.0.0.0"); |
497 | } | 497 | } |
498 | else | 498 | else |
499 | { | 499 | { |
500 | _pppdata->setIpaddr(ipaddress_l->text()); | 500 | _pppdata->setIpaddr(ipaddress_l->text()); |
501 | _pppdata->setSubnetmask(subnetmask_l->text()); | 501 | _pppdata->setSubnetmask(subnetmask_l->text()); |
502 | } | 502 | } |
503 | _pppdata->setAutoname(autoname->isChecked()); | 503 | _pppdata->setAutoname(autoname->isChecked()); |
504 | } | 504 | } |
505 | 505 | ||
506 | 506 | ||
507 | void IPWidget::hitIPSelect( int i ) | 507 | void IPWidget::hitIPSelect( int i ) |
508 | { | 508 | { |
509 | if(i == 0) | 509 | if(i == 0) |
510 | { | 510 | { |
511 | ipaddress_label->setEnabled(false); | 511 | ipaddress_label->setEnabled(false); |
512 | sub_label->setEnabled(false); | 512 | sub_label->setEnabled(false); |
513 | ipaddress_l->setEnabled(false); | 513 | ipaddress_l->setEnabled(false); |
514 | subnetmask_l->setEnabled(false); | 514 | subnetmask_l->setEnabled(false); |
515 | } | 515 | } |
516 | else | 516 | else |
517 | { | 517 | { |
518 | ipaddress_label->setEnabled(true); | 518 | ipaddress_label->setEnabled(true); |
519 | sub_label->setEnabled(true); | 519 | sub_label->setEnabled(true); |
520 | ipaddress_l->setEnabled(true); | 520 | ipaddress_l->setEnabled(true); |
521 | subnetmask_l->setEnabled(true); | 521 | subnetmask_l->setEnabled(true); |
522 | } | 522 | } |
523 | } | 523 | } |
524 | 524 | ||
525 | 525 | ||
526 | 526 | ||
527 | DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char *name ) | 527 | DNSWidget::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); |
625 | // exdnsdisabled_toggle = new QCheckBox(tr("Disable existing DNS servers during connection"), this); | 625 | // exdnsdisabled_toggle = new QCheckBox(tr("Disable existing DNS servers during connection"), this); |
626 | exdnsdisabled_toggle->setChecked(_pppdata->exDNSDisabled()); | 626 | exdnsdisabled_toggle->setChecked(_pppdata->exDNSDisabled()); |
627 | tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); | 627 | tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); |
628 | QWhatsThis::add(exdnsdisabled_toggle, | 628 | QWhatsThis::add(exdnsdisabled_toggle, |
629 | tr("<p>When this option is selected, all DNS\n" | 629 | tr("<p>When this option is selected, all DNS\n" |
630 | "servers specified in <tt>/etc/resolv.conf</tt> are\n" | 630 | "servers specified in <tt>/etc/resolv.conf</tt> are\n" |
631 | "temporary disabled while the dialup connection\n" | 631 | "temporary disabled while the dialup connection\n" |
632 | "is established. After the connection is\n" | 632 | "is established. After the connection is\n" |
633 | "closed, the servers will be re-enabled\n" | 633 | "closed, the servers will be re-enabled\n" |
634 | "\n" | 634 | "\n" |
635 | "Typically, there is no reason to use this\n" | 635 | "Typically, there is no reason to use this\n" |
636 | "option, but it may become useful under \n" | 636 | "option, but it may become useful under \n" |
637 | "some circumstances.")); | 637 | "some circumstances.")); |
638 | 638 | ||
639 | 639 | ||
640 | // restore data if editing | 640 | // restore data if editing |
641 | if(!isnewaccount) | 641 | if(!isnewaccount) |
642 | { | 642 | { |
643 | dnsservers->insertStringList(_pppdata->dns()); | 643 | dnsservers->insertStringList(_pppdata->dns()); |
644 | dnsdomain->setText(_pppdata->domain()); | 644 | dnsdomain->setText(_pppdata->domain()); |
645 | } | 645 | } |
646 | 646 | ||
647 | int mode = _pppdata->autoDNS() ? 0 : 1; | 647 | int mode = _pppdata->autoDNS() ? 0 : 1; |
648 | bg->setButton(mode); | 648 | bg->setButton(mode); |
649 | DNS_Mode_Selected(mode); | 649 | DNS_Mode_Selected(mode); |
650 | 650 | ||
651 | tl->activate(); | 651 | tl->activate(); |
652 | } | 652 | } |
653 | 653 | ||
654 | void DNSWidget::DNS_Edit_Changed(const QString &text) | 654 | void DNSWidget::DNS_Edit_Changed(const QString &text) |
655 | { | 655 | { |
656 | QRegExp r("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); | 656 | QRegExp r("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); |
657 | add->setEnabled(text.find(r) != -1); | 657 | add->setEnabled(text.find(r) != -1); |
658 | } | 658 | } |
659 | 659 | ||
660 | void DNSWidget::DNS_Entry_Selected(int) | 660 | void DNSWidget::DNS_Entry_Selected(int) |
661 | { | 661 | { |
662 | remove->setEnabled(true); | 662 | remove->setEnabled(true); |
663 | } | 663 | } |
664 | 664 | ||
665 | void DNSWidget::DNS_Mode_Selected(int mode) | 665 | void DNSWidget::DNS_Mode_Selected(int mode) |
666 | { | 666 | { |
667 | bool on = (mode == 1); | 667 | bool on = (mode == 1); |
668 | dns_label->setEnabled(on); | 668 | dns_label->setEnabled(on); |
669 | servers_label->setEnabled(on); | 669 | servers_label->setEnabled(on); |
670 | dnsipaddr->setText(""); | 670 | dnsipaddr->setText(""); |
671 | dnsipaddr->setEnabled(on); | 671 | dnsipaddr->setEnabled(on); |
672 | add->setEnabled(false); | 672 | add->setEnabled(false); |
@@ -1091,121 +1091,121 @@ void ScriptWidget::insertButton() | |||
1091 | break; | 1091 | break; |
1092 | 1092 | ||
1093 | case ScriptEdit::Timeout: | 1093 | case ScriptEdit::Timeout: |
1094 | stl->insertItem("Timeout", stl->currentItem()); | 1094 | stl->insertItem("Timeout", stl->currentItem()); |
1095 | sl->insertItem(se->text(), sl->currentItem()); | 1095 | sl->insertItem(se->text(), sl->currentItem()); |
1096 | break; | 1096 | break; |
1097 | 1097 | ||
1098 | case ScriptEdit::Password: | 1098 | case ScriptEdit::Password: |
1099 | stl->insertItem("Password", stl->currentItem()); | 1099 | stl->insertItem("Password", stl->currentItem()); |
1100 | sl->insertItem(se->text(), sl->currentItem()); | 1100 | sl->insertItem(se->text(), sl->currentItem()); |
1101 | break; | 1101 | break; |
1102 | 1102 | ||
1103 | case ScriptEdit::ID: | 1103 | case ScriptEdit::ID: |
1104 | stl->insertItem("ID", stl->currentItem()); | 1104 | stl->insertItem("ID", stl->currentItem()); |
1105 | sl->insertItem(se->text(), sl->currentItem()); | 1105 | sl->insertItem(se->text(), sl->currentItem()); |
1106 | break; | 1106 | break; |
1107 | 1107 | ||
1108 | case ScriptEdit::Prompt: | 1108 | case ScriptEdit::Prompt: |
1109 | stl->insertItem("Prompt", stl->currentItem()); | 1109 | stl->insertItem("Prompt", stl->currentItem()); |
1110 | sl->insertItem(se->text(), sl->currentItem()); | 1110 | sl->insertItem(se->text(), sl->currentItem()); |
1111 | break; | 1111 | break; |
1112 | 1112 | ||
1113 | case ScriptEdit::PWPrompt: | 1113 | case ScriptEdit::PWPrompt: |
1114 | stl->insertItem("PWPrompt", stl->currentItem()); | 1114 | stl->insertItem("PWPrompt", stl->currentItem()); |
1115 | sl->insertItem(se->text(), sl->currentItem()); | 1115 | sl->insertItem(se->text(), sl->currentItem()); |
1116 | break; | 1116 | break; |
1117 | 1117 | ||
1118 | case ScriptEdit::LoopStart: | 1118 | case ScriptEdit::LoopStart: |
1119 | stl->insertItem("LoopStart", stl->currentItem()); | 1119 | stl->insertItem("LoopStart", stl->currentItem()); |
1120 | sl->insertItem(se->text(), sl->currentItem()); | 1120 | sl->insertItem(se->text(), sl->currentItem()); |
1121 | break; | 1121 | break; |
1122 | 1122 | ||
1123 | case ScriptEdit::LoopEnd: | 1123 | case ScriptEdit::LoopEnd: |
1124 | stl->insertItem("LoopEnd", stl->currentItem()); | 1124 | stl->insertItem("LoopEnd", stl->currentItem()); |
1125 | sl->insertItem(se->text(), sl->currentItem()); | 1125 | sl->insertItem(se->text(), sl->currentItem()); |
1126 | break; | 1126 | break; |
1127 | 1127 | ||
1128 | case ScriptEdit::Scan: | 1128 | case ScriptEdit::Scan: |
1129 | stl->insertItem("Scan", stl->currentItem()); | 1129 | stl->insertItem("Scan", stl->currentItem()); |
1130 | sl->insertItem(se->text(), sl->currentItem()); | 1130 | sl->insertItem(se->text(), sl->currentItem()); |
1131 | break; | 1131 | break; |
1132 | 1132 | ||
1133 | case ScriptEdit::Save: | 1133 | case ScriptEdit::Save: |
1134 | stl->insertItem("Save", stl->currentItem()); | 1134 | stl->insertItem("Save", stl->currentItem()); |
1135 | sl->insertItem(se->text(), sl->currentItem()); | 1135 | sl->insertItem(se->text(), sl->currentItem()); |
1136 | break; | 1136 | break; |
1137 | 1137 | ||
1138 | default: | 1138 | default: |
1139 | break; | 1139 | break; |
1140 | } | 1140 | } |
1141 | adjustScrollBar(); | 1141 | adjustScrollBar(); |
1142 | se->setText(""); | 1142 | se->setText(""); |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | 1145 | ||
1146 | void ScriptWidget::removeButton() | 1146 | void 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 | ///////////////////////////////////////////////////////////////////////////// |
1166 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | 1166 | PhoneNumberDialog::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 | ||
1197 | QString PhoneNumberDialog::phoneNumber() | 1197 | QString 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 | ||
1205 | void PhoneNumberDialog::textChanged(const QString &s) | 1205 | void 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" |