Diffstat (limited to 'noncore/settings/networksettings/ppp/edit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/edit.cpp | 232 |
1 files changed, 116 insertions, 116 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 @@ -40,49 +40,49 @@ //#include <kwin.h> #include "edit.h" #include "pppdata.h" -#include "newwidget.h" +//#include "newwidget.h" #include "iplined.h" #include "auth.h" DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) : QWidget(parent, name) { const int GRIDROWS = 6; - QGridLayout *tl = new QGridLayout(parent, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); + QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); - connect_label = new QLabel(i18n("Connection name:"), parent); + connect_label = new QLabel(i18n("Connection name:"), this); tl->addWidget(connect_label, 0, 0); - connectname_l = new QLineEdit(parent); - connectname_l->setMaxLength(ACCNAME_SIZE); + connectname_l = new QLineEdit(this); +// connectname_l->setMaxLength(ACCNAME_SIZE); tl->addWidget(connectname_l, 0, 1); QString tmp = i18n("Type in a unique name for this connection"); QWhatsThis::add(connect_label,tmp); QWhatsThis::add(connectname_l,tmp); - number_label = new QLabel(i18n("Phone number:"), parent); + number_label = new QLabel(i18n("Phone number:"), this); number_label->setAlignment(AlignTop|AlignLeft); tl->addWidget(number_label, 1, 0); QHBoxLayout *lpn = new QHBoxLayout(5); tl->addLayout(lpn, 1, 1); - numbers = new QListBox(parent); + numbers = new QListBox(this); numbers->setMinimumSize(120, 70); lpn->addWidget(numbers); QVBoxLayout *lpn1 = new QVBoxLayout; lpn->addLayout(lpn1); - add = new QPushButton(i18n("&Add..."), parent); - del = new QPushButton(i18n("&Remove"), parent); + add = new QPushButton(i18n("&Add..."), this); + del = new QPushButton(i18n("&Remove"), this); - up = new QPushButton(parent); + up = new QPushButton(this); //FIXME: QPixmap pm = BarIcon("up"); // up->setPixmap(pm); - down = new QPushButton(parent); + down = new QPushButton(this); //FIXME: pm = BarIcon("down"); // down->setPixmap(pm); lpn1->addWidget(add); lpn1->addWidget(del); @@ -111,12 +111,12 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(number_label,tmp); QWhatsThis::add(numbers,tmp); - auth_l = new QLabel(i18n("Authentication:"), parent); + auth_l = new QLabel(i18n("Authentication:"), this); tl->addWidget(auth_l, 3, 0); - auth = new QComboBox(parent); + auth = new QComboBox(this); auth->insertItem(i18n("Script-based")); auth->insertItem(i18n("PAP")); auth->insertItem(i18n("Terminal-based")); auth->insertItem(i18n("CHAP")); @@ -134,9 +134,9 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(auth_l,tmp); QWhatsThis::add(auth,tmp); - store_password = new QCheckBox(i18n("Store password"), parent); + store_password = new QCheckBox(i18n("Store password"), this); store_password->setChecked(true); tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight); QWhatsThis::add(store_password, i18n("<p>When this is turned on, your ISP password\n" @@ -147,18 +147,18 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) "plain text in the config file, which is\n" "readable only to you. Make sure nobody\n" "gains access to this file!")); - pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), parent); + pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), this); connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); // Set defaults if editing an existing connection if(!isnewaccount) { - connectname_l->setText(gpppdata.accname()); + connectname_l->setText(PPPData::data()->accname()); // insert the phone numbers into the listbox - QString n = gpppdata.phonenumber(); + QString n = PPPData::data()->phonenumber(); QString tmp = ""; uint idx = 0; while(idx != n.length()) { if(n[idx] == ':') { @@ -171,10 +171,10 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) } if(tmp.length() > 0) numbers->insertItem(tmp); - auth->setCurrentItem(gpppdata.authMethod()); - store_password->setChecked(gpppdata.storePassword()); + auth->setCurrentItem(PPPData::data()->authMethod()); + store_password->setChecked(PPPData::data()->storePassword()); } else { // select PAP/CHAP as default auth->setCurrentItem(AUTH_PAPCHAP); } @@ -186,23 +186,23 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) bool DialWidget::save() { //first check to make sure that the account name is unique! if(connectname_l->text().isEmpty() || - !gpppdata.isUniqueAccname(connectname_l->text())) { + !PPPData::data()->isUniqueAccname(connectname_l->text())) { return false; } else { - gpppdata.setAccname(connectname_l->text()); + PPPData::data()->setAccname(connectname_l->text()); QString number = ""; for(uint i = 0; i < numbers->count(); i++) { if(i != 0) number += ":"; number += numbers->text(i); } - gpppdata.setPhonenumber(number); - gpppdata.setAuthMethod(auth->currentItem()); - gpppdata.setStorePassword(store_password->isChecked()); + PPPData::data()->setPhonenumber(number); + PPPData::data()->setAuthMethod(auth->currentItem()); + PPPData::data()->setStorePassword(store_password->isChecked()); return true; } } @@ -274,31 +274,31 @@ void DialWidget::pppdargsbutton() { ///////////////////////////////////////////////////////////////////////////// ExecWidget::ExecWidget(QWidget *parent, bool isnewaccount, const char *name) : QWidget(parent, name) { - QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); + QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); QLabel *l = new QLabel(\ i18n("Here you can select commands to run at certain stages of the\n" "connection. The commands are run with your real user id, so\n" "you cannot run any commands here requiring root permissions\n" "(unless, of course, you are root).\n\n" "Be sure to supply the whole path to the program otherwise\n" - "kppp might be unable to find it."), parent); - l->setMinimumHeight(l->sizeHint().height()); + "kppp might be unable to find it."), this); +// l->setMinimumHeight(l->sizeHint().height()); tl->addWidget(l); tl->addStretch(1); QGridLayout *l1 = new QGridLayout(4, 2, 10); tl->addLayout(l1); l1->setColStretch(0, 0); l1->setColStretch(1, 1); - before_connect_l = new QLabel(i18n("Before connect:"), parent); + before_connect_l = new QLabel(i18n("Before connect:"), this); before_connect_l->setAlignment(AlignVCenter); l1->addWidget(before_connect_l, 0, 0); - before_connect = new QLineEdit(parent); - before_connect->setMaxLength(COMMAND_SIZE); + before_connect = new QLineEdit(this); +// before_connect->setMaxLength(COMMAND_SIZE); l1->addWidget(before_connect, 0, 1); QString tmp = i18n("Allows you to run a program <b>before</b> a connection\n" "is established. It is called immediately before\n" "dialing has begun.\n\n" @@ -307,13 +307,13 @@ i18n("Here you can select commands to run at certain stages of the\n" QWhatsThis::add(before_connect_l,tmp); QWhatsThis::add(before_connect,tmp); - command_label = new QLabel(i18n("Upon connect:"), parent); + command_label = new QLabel(i18n("Upon connect:"), this); command_label->setAlignment(AlignVCenter); l1->addWidget(command_label, 1, 0); - command = new QLineEdit(parent); - command->setMaxLength(COMMAND_SIZE); + command = new QLineEdit(this); +// command->setMaxLength(COMMAND_SIZE); l1->addWidget(command, 1, 1); tmp = i18n("Allows you to run a program <b>after</b> a connection\n" "is established. When your program is called, all\n" "preparations for an Internet connection are finished.\n" @@ -323,13 +323,13 @@ i18n("Here you can select commands to run at certain stages of the\n" QWhatsThis::add(command_label,tmp); QWhatsThis::add(command,tmp); predisconnect_label = new QLabel(i18n("Before disconnect:"), - parent); + this); predisconnect_label->setAlignment(AlignVCenter); l1->addWidget(predisconnect_label, 2, 0); - predisconnect = new QLineEdit(parent); - predisconnect->setMaxLength(COMMAND_SIZE); + predisconnect = new QLineEdit(this); +// predisconnect->setMaxLength(COMMAND_SIZE); l1->addWidget(predisconnect, 2, 1); tmp = i18n("Allows you to run a program <b>before</b> a connection\n" "is closed. The connection will stay open until\n" "the program exits."); @@ -337,14 +337,14 @@ i18n("Here you can select commands to run at certain stages of the\n" QWhatsThis::add(predisconnect_label,tmp); QWhatsThis::add(predisconnect,tmp); discommand_label = new QLabel(i18n("Upon disconnect:"), - parent); + this); discommand_label->setAlignment(AlignVCenter); l1->addWidget(discommand_label, 3, 0); - discommand = new QLineEdit(parent); - discommand->setMaxLength(COMMAND_SIZE); + discommand = new QLineEdit(this); +// discommand->setMaxLength(COMMAND_SIZE); l1->addWidget(discommand, 3, 1); tmp = i18n("Allows you to run a program <b>after</b> a connection\n" "has been closed."); @@ -359,21 +359,21 @@ i18n("Here you can select commands to run at certain stages of the\n" tl->activate(); // Set defaults if editing an existing connection if(!isnewaccount) { - before_connect->setText(gpppdata.command_before_connect()); - command->setText(gpppdata.command_on_connect()); - discommand->setText(gpppdata.command_on_disconnect()); - predisconnect->setText(gpppdata.command_before_disconnect()); + before_connect->setText(PPPData::data()->command_before_connect()); + command->setText(PPPData::data()->command_on_connect()); + discommand->setText(PPPData::data()->command_on_disconnect()); + predisconnect->setText(PPPData::data()->command_before_disconnect()); } } bool ExecWidget::save() { - gpppdata.setCommand_before_connect(before_connect->text()); - gpppdata.setCommand_on_connect(command->text()); - gpppdata.setCommand_before_disconnect(predisconnect->text()); - gpppdata.setCommand_on_disconnect(discommand->text()); + PPPData::data()->setCommand_before_connect(before_connect->text()); + PPPData::data()->setCommand_on_connect(command->text()); + PPPData::data()->setCommand_before_disconnect(predisconnect->text()); + PPPData::data()->setCommand_on_disconnect(discommand->text()); return true; } @@ -385,15 +385,15 @@ bool ExecWidget::save() { ///////////////////////////////////////////////////////////////////////////// IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) : QWidget(parent, name) { - QVBoxLayout *topLayout = new QVBoxLayout(parent); + QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->setSpacing( 3 );//KDialog::spacingHint()); - box = new QVGroupBox(i18n("Configuration"), parent); + box = new QVGroupBox(i18n("Configuration"), this); // box->setInsideSpacing( 1 );//KDialog::spacingHint()); - rb = new QButtonGroup(parent); + rb = new QButtonGroup(this); rb->hide(); connect(rb, SIGNAL(clicked(int)), SLOT(hitIPSelect(int))); @@ -447,10 +447,10 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(sub_label,tmp); QWhatsThis::add(subnetmask_l,tmp); - autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), parent); - autoname->setChecked(gpppdata.autoname()); + autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), this); + autoname->setChecked(PPPData::data()->autoname()); connect(autoname,SIGNAL(toggled(bool)), this,SLOT(autoname_t(bool))); QWhatsThis::add(autoname, @@ -468,17 +468,17 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) topLayout->addStretch(); //load info from gpppdata if(!isnewaccount) { - if(gpppdata.ipaddr() == "0.0.0.0" && - gpppdata.subnetmask() == "0.0.0.0") { + if(PPPData::data()->ipaddr() == "0.0.0.0" && + PPPData::data()->subnetmask() == "0.0.0.0") { dynamicadd_rb->setChecked(true); hitIPSelect(0); - autoname->setChecked(gpppdata.autoname()); + autoname->setChecked(PPPData::data()->autoname()); } else { - ipaddress_l->setText(gpppdata.ipaddr()); - subnetmask_l->setText(gpppdata.subnetmask()); + ipaddress_l->setText(PPPData::data()->ipaddr()); + subnetmask_l->setText(PPPData::data()->subnetmask()); staticadd_rb->setChecked(true); autoname->setChecked(false); } } @@ -509,15 +509,15 @@ void IPWidget::autoname_t(bool on) { void IPWidget::save() { if(dynamicadd_rb->isChecked()) { - gpppdata.setIpaddr("0.0.0.0"); - gpppdata.setSubnetmask("0.0.0.0"); + PPPData::data()->setIpaddr("0.0.0.0"); + PPPData::data()->setSubnetmask("0.0.0.0"); } else { - gpppdata.setIpaddr(ipaddress_l->text()); - gpppdata.setSubnetmask(subnetmask_l->text()); + PPPData::data()->setIpaddr(ipaddress_l->text()); + PPPData::data()->setSubnetmask(subnetmask_l->text()); } - gpppdata.setAutoname(autoname->isChecked()); + PPPData::data()->setAutoname(autoname->isChecked()); } void IPWidget::hitIPSelect( int i ) { @@ -539,16 +539,16 @@ void IPWidget::hitIPSelect( int i ) { DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) : QWidget(parent, name) { - // box = new QGroupBox(parent); - QGridLayout *tl = new QGridLayout(parent, 7, 2, 0 );//, KDialog::spacingHint()); + // box = new QGroupBox(this); + QGridLayout *tl = new QGridLayout(this, 7, 2, 0 );//, KDialog::spacingHint()); - dnsdomain_label = new QLabel(i18n("Domain name:"), parent); + dnsdomain_label = new QLabel(i18n("Domain name:"), this); tl->addWidget(dnsdomain_label, 0, 0); - dnsdomain = new QLineEdit(parent); - dnsdomain->setMaxLength(DOMAIN_SIZE); + dnsdomain = new QLineEdit(this); +// dnsdomain->setMaxLength(DOMAIN_SIZE); tl->addWidget(dnsdomain, 0, 1); QString tmp = i18n("If you enter a domain name here, this domain\n" "name is used for your computer while you are\n" "connected. When the connection is closed, the\n" @@ -560,32 +560,32 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(dnsdomain_label,tmp); QWhatsThis::add(dnsdomain,tmp); - conf_label = new QLabel(i18n("Configuration:"), parent); + conf_label = new QLabel(i18n("Configuration:"), this); tl->addWidget(conf_label, 1, 0); bg = new QButtonGroup("Group", this); connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); bg->hide(); - autodns = new QRadioButton(i18n("Automatic"), parent); + autodns = new QRadioButton(i18n("Automatic"), this); bg->insert(autodns, 0); tl->addWidget(autodns, 1, 1); // no automatic DNS detection for pppd < 2.3.7 - if(!gpppdata.pppdVersionMin(2, 3, 7)) + if(!PPPData::data()->pppdVersionMin(2, 3, 7)) autodns->setEnabled(false); - mandns = new QRadioButton(i18n("Manual"), parent); + mandns = new QRadioButton(i18n("Manual"), this); bg->insert(mandns, 1); tl->addWidget(mandns, 2, 1); - dns_label = new QLabel(i18n("DNS IP address:"), parent); + dns_label = new QLabel(i18n("DNS IP address:"), this); tl->addWidget(dns_label, 3, 0); QHBoxLayout *l2 = new QHBoxLayout; tl->addLayout(l2, 3, 1); - dnsipaddr = new IPLineEdit(parent); + dnsipaddr = new IPLineEdit(this); connect(dnsipaddr, SIGNAL(returnPressed()), SLOT(adddns())); connect(dnsipaddr, SIGNAL(textChanged(const QString &)), SLOT(DNS_Edit_Changed(const QString &))); @@ -603,35 +603,35 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(dnsipaddr, tmp); QHBoxLayout *l1 = new QHBoxLayout; tl->addLayout(l1, 4, 1); - add = new QPushButton(i18n("Add"), parent); + add = new QPushButton(i18n("Add"), this); connect(add, SIGNAL(clicked()), SLOT(adddns())); - int width = add->sizeHint().width(); - width = QMAX(width,60); - add->setMinimumWidth(width); +// int width = add->sizeHint().width(); +// width = QMAX(width,60); +// add->setMinimumWidth(width); l1->addWidget(add); l1->addStretch(1); QWhatsThis::add(add, i18n("Click this button to add the DNS server\n" "specified in the field above. The entry\n" "will then be added to the list below")); - remove = new QPushButton(i18n("Remove"), parent); + remove = new QPushButton(i18n("Remove"), this); connect(remove, SIGNAL(clicked()), SLOT(removedns())); - width = remove->sizeHint().width(); - width = QMAX(width,60); - remove->setMinimumWidth(width); +// width = remove->sizeHint().width(); +// width = QMAX(width,60); +// remove->setMinimumWidth(width); l1->addWidget(remove); QWhatsThis::add(remove, i18n("Click this button to remove the selected DNS\n" "server entry from the list below")); - servers_label = new QLabel(i18n("DNS address list:"), parent); + servers_label = new QLabel(i18n("DNS address list:"), this); servers_label->setAlignment(AlignTop|AlignLeft); tl->addWidget(servers_label, 5, 0); - dnsservers = new QListBox(parent); + dnsservers = new QListBox(this); dnsservers->setMinimumSize(150, 80); connect(dnsservers, SIGNAL(highlighted(int)), SLOT(DNS_Entry_Selected(int))); tl->addWidget(dnsservers, 5, 1); @@ -643,10 +643,10 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) QWhatsThis::add(dnsservers,tmp); exdnsdisabled_toggle = new QCheckBox(i18n( \ "Disable existing DNS servers during connection"), - parent); - exdnsdisabled_toggle->setChecked(gpppdata.exDNSDisabled()); + this); + exdnsdisabled_toggle->setChecked(PPPData::data()->exDNSDisabled()); tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); QWhatsThis::add(exdnsdisabled_toggle, i18n("<p>When this option is selected, all DNS\n" "servers specified in <tt>/etc/resolv.conf</tt> are\n" @@ -660,13 +660,13 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) // restore data if editing if(!isnewaccount) { - dnsservers->insertStringList(gpppdata.dns()); - dnsdomain->setText(gpppdata.domain()); + dnsservers->insertStringList(PPPData::data()->dns()); + dnsdomain->setText(PPPData::data()->domain()); } - int mode = gpppdata.autoDNS() ? 0 : 1; + int mode = PPPData::data()->autoDNS() ? 0 : 1; bg->setButton(mode); DNS_Mode_Selected(mode); tl->activate(); @@ -694,22 +694,22 @@ void DNSWidget::DNS_Mode_Selected(int mode) { dnsservers->triggerUpdate(false); } void DNSWidget::save() { - gpppdata.setAutoDNS(bg->id(bg->selected()) == 0); + PPPData::data()->setAutoDNS(bg->id(bg->selected()) == 0); QStringList serverlist; for(uint i=0; i < dnsservers->count(); i++) serverlist.append(dnsservers->text(i)); - gpppdata.setDns(serverlist); + PPPData::data()->setDns(serverlist); // strip leading dot QString s(dnsdomain->text()); if(s.left(1) == ".") - gpppdata.setDomain(s.mid(1)); + PPPData::data()->setDomain(s.mid(1)); else - gpppdata.setDomain(dnsdomain->text()); + PPPData::data()->setDomain(dnsdomain->text()); - gpppdata.setExDNSDisabled(exdnsdisabled_toggle->isChecked()); + PPPData::data()->setExDNSDisabled(exdnsdisabled_toggle->isChecked()); } void DNSWidget::adddns() { @@ -734,15 +734,15 @@ void DNSWidget::removedns() { // GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *name ) : QWidget(parent, name) { - QVBoxLayout *topLayout = new QVBoxLayout(parent); + QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->setSpacing( 2 );//KDialog::spacingHint()); - box = new QVGroupBox(i18n("Configuration"), parent); + box = new QVGroupBox(i18n("Configuration"), this); // box->setInsideSpacing( 2 );//KDialog::spacingHint()); - rb = new QButtonGroup(parent); + rb = new QButtonGroup(this); rb->hide(); connect(rb, SIGNAL(clicked(int)), SLOT(hitGatewaySelect(int))); defaultgateway = new QRadioButton(box); @@ -770,9 +770,9 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na gate_label = new QLabel(i18n("Gateway IP address:"), gateBox); gatewayaddr = new IPLineEdit(gateBox); defaultroute = new QCheckBox(i18n("Assign the default route to this gateway"), - parent); + this); QWhatsThis::add(defaultroute, i18n("If this option is enabled, all packets not\n" "going to the local net are routed through\n" "the PPP connection.\n" @@ -784,17 +784,17 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na topLayout->addStretch(); //load info from gpppdata if(!isnewaccount) { - if(gpppdata.gateway() == "0.0.0.0") { + if(PPPData::data()->gateway() == "0.0.0.0") { defaultgateway->setChecked(true); hitGatewaySelect(0); } else { - gatewayaddr->setText(gpppdata.gateway()); + gatewayaddr->setText(PPPData::data()->gateway()); staticgateway->setChecked(true); } - defaultroute->setChecked(gpppdata.defaultroute()); + defaultroute->setChecked(PPPData::data()->defaultroute()); } else { defaultgateway->setChecked(true); hitGatewaySelect(0); @@ -802,10 +802,10 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na } } void GatewayWidget::save() { - gpppdata.setGateway(gatewayaddr->text()); - gpppdata.setDefaultroute(defaultroute->isChecked()); + PPPData::data()->setGateway(gatewayaddr->text()); + PPPData::data()->setDefaultroute(defaultroute->isChecked()); } void GatewayWidget::hitGatewaySelect( int i ) { @@ -825,15 +825,15 @@ void GatewayWidget::hitGatewaySelect( int i ) { ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name ) : QWidget(parent, name) { - QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); - se = new ScriptEdit(parent); + QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); + se = new ScriptEdit(this); connect(se, SIGNAL(returnPressed()), SLOT(addButton())); tl->addWidget(se); // insert equal-sized buttons - QButtonGroup *bbox = new QButtonGroup(parent); + QButtonGroup *bbox = new QButtonGroup(this); add = new QPushButton( bbox, i18n("Add") ); bbox->insert(add); connect(add, SIGNAL(clicked()), SLOT(addButton())); // bbox->addStretch(1); @@ -848,30 +848,30 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name tl->addWidget(bbox); QHBoxLayout *l12 = new QHBoxLayout(0); tl->addLayout(l12); - stl = new QListBox(parent); + stl = new QListBox(this); stl->setVScrollBarMode( QScrollView::AlwaysOff ); connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int))); stl->setMinimumSize(QSize(70, 140)); - sl = new QListBox(parent); + sl = new QListBox(this); sl->setVScrollBarMode( QScrollView::AlwaysOff ); connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int))); sl->setMinimumSize(QSize(150, 140)); - slb = new QScrollBar(parent); - slb->setFixedWidth(slb->sizeHint().width()); + slb = new QScrollBar(this); +// slb->setFixedWidth(slb->sizeHint().width()); connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int))); l12->addWidget(stl, 1); l12->addWidget(sl, 3); l12->addWidget(slb, 0); //load data from gpppdata if(!isnewaccount) { - QStringList &comlist = gpppdata.scriptType(); - QStringList &arglist = gpppdata.script(); + QStringList &comlist = PPPData::data()->scriptType(); + QStringList &arglist = PPPData::data()->script(); QStringList::Iterator itcom = comlist.begin(); QStringList::Iterator itarg = arglist.begin(); for ( ; @@ -915,10 +915,10 @@ void ScriptWidget::save() { for(uint i=0; i < sl->count(); i++) { typelist.append(stl->text(i)); arglist.append(sl->text(i)); } - gpppdata.setScriptType(typelist); - gpppdata.setScript(arglist); + PPPData::data()->setScriptType(typelist); + PPPData::data()->setScript(arglist); } @@ -1153,9 +1153,9 @@ void ScriptWidget::removeButton() { // Used to specify a new phone number // ///////////////////////////////////////////////////////////////////////////// PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) - : QDialog(parent, 0, true ) { + : QDialog(parent,"PhoneNumberDialog",true) { setCaption( i18n("Add Phone Number") ); // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); QHBox *hbox = new QHBox(this); @@ -1164,10 +1164,10 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) hbox->setSpacing( 2 );//KDialog::spacingHint()); new QLabel(i18n("Enter a phone number:"), hbox); - le = newLineEdit(14, hbox); - le->setMinimumWidth(125); + le = new QLineEdit(hbox); +// le->setMinimumWidth(125); connect(le, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); |