summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp54
-rw-r--r--noncore/settings/networksettings/ppp/pppdargs.cpp26
2 files changed, 42 insertions, 38 deletions
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 6132b80..eee643d 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -58,33 +58,33 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
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:"), 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(this);
- numbers->setMinimumSize(120, 70);
+// numbers->setMinimumSize(120, 70);
lpn->addWidget(numbers);
QVBoxLayout *lpn1 = new QVBoxLayout;
lpn->addLayout(lpn1);
add = new QPushButton(i18n("&Add..."), this);
del = new QPushButton(i18n("&Remove"), this);
up = new QPushButton(this);
//FIXME: QPixmap pm = BarIcon("up");
// up->setPixmap(pm);
down = new QPushButton(this);
//FIXME: pm = BarIcon("down");
// down->setPixmap(pm);
lpn1->addWidget(add);
lpn1->addWidget(del);
lpn1->addStretch(1);
lpn1->addWidget(up);
@@ -813,64 +813,62 @@ void GatewayWidget::hitGatewaySelect( int i ) {
gatewayaddr->setText("0.0.0.0");
gatewayaddr->setEnabled(false);
gate_label->setEnabled(false);
}
else {
gatewayaddr->setEnabled(true);
gatewayaddr->setText("");
gate_label->setEnabled(true);
}
}
ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name )
: QWidget(parent, name)
{
- QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint());
+
+ QVBoxLayout *tl = new QVBoxLayout(this, 0 );
se = new ScriptEdit(this);
connect(se, SIGNAL(returnPressed()), SLOT(addButton()));
tl->addWidget(se);
// insert equal-sized buttons
- QButtonGroup *bbox = new QButtonGroup(this);
- add = new QPushButton( bbox, i18n("Add") );
- bbox->insert(add);
+ QHBoxLayout *hl = new QHBoxLayout( this );
+ tl->addLayout( hl );
+ add = new QPushButton( i18n("Add"), this );
+ hl->addWidget( add );
connect(add, SIGNAL(clicked()), SLOT(addButton()));
-// bbox->addStretch(1);
- insert = new QPushButton( bbox, i18n("Insert") );
- bbox->insert(insert);
+ insert = new QPushButton( i18n("Insert"), this );
+ hl->addWidget( insert );
connect(insert, SIGNAL(clicked()), SLOT(insertButton()));
-// bbox->addStretch(1);
- remove = new QPushButton( bbox, i18n("Remove") );
- bbox->insert(remove);
+ remove = new QPushButton( i18n("Remove"), this );
+ hl->addWidget( remove );
connect(remove, SIGNAL(clicked()), SLOT(removeButton()));
- bbox->layout();
- tl->addWidget(bbox);
QHBoxLayout *l12 = new QHBoxLayout(0);
tl->addLayout(l12);
stl = new QListBox(this);
- stl->setVScrollBarMode( QScrollView::AlwaysOff );
+// stl->setVScrollBarMode( QScrollView::AlwaysOff );
connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int)));
- stl->setMinimumSize(QSize(70, 140));
+// stl->setMinimumSize(QSize(70, 140));
sl = new QListBox(this);
- sl->setVScrollBarMode( QScrollView::AlwaysOff );
+// sl->setVScrollBarMode( QScrollView::AlwaysOff );
connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int)));
- sl->setMinimumSize(QSize(150, 140));
+// sl->setMinimumSize(QSize(150, 140));
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 = PPPData::data()->scriptType();
QStringList &arglist = PPPData::data()->script();
QStringList::Iterator itcom = comlist.begin();
QStringList::Iterator itarg = arglist.begin();
@@ -1141,53 +1139,59 @@ void ScriptWidget::removeButton() {
sl->removeItem(sl->currentItem());
stl->removeItem(stlc);
adjustScrollBar();
insert->setEnabled(sl->currentItem() != -1);
remove->setEnabled(sl->currentItem() != -1);
}
}
/////////////////////////////////////////////////////////////////////////////
//
// Used to specify a new phone number
//
/////////////////////////////////////////////////////////////////////////////
PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
- : QDialog(parent,"PhoneNumberDialog",true) {
+ : QDialog(parent,"PhoneNumberDialog",true)
+{
setCaption( i18n("Add Phone Number") );
-// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
- QHBox *hbox = new QHBox(this);
+
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->setSpacing( 3 );
+ layout->setMargin( 3 );
+
+// QHBox *hbox = new QHBox(this);
// setMainWidget(hbox);
- hbox->setSpacing( 2 );//KDialog::spacingHint());
+// hbox->setSpacing( 2 );//KDialog::spacingHint());
- new QLabel(i18n("Enter a phone number:"), hbox);
+ QLabel *label = new QLabel(this, tr("Enter a phone number:"));
+ layout->addWidget( label );
- le = new QLineEdit(hbox);
-// le->setMinimumWidth(125);
+ le = new QLineEdit(this, "lineEdit");
+ layout->addWidget( le );
connect(le, SIGNAL(textChanged(const QString &)),
this, SLOT(textChanged(const QString &)));
le->setFocus();
textChanged("");
-// enableButtonSeparator(true);
+
}
QString PhoneNumberDialog::phoneNumber() {
QString s = le->text();
return s;
}
void PhoneNumberDialog::textChanged(const QString &s) {
// enableButtonOK(s.length() > 0);
}
//#include "edit.moc"
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp
index b7fca3f..4039939 100644
--- a/noncore/settings/networksettings/ppp/pppdargs.cpp
+++ b/noncore/settings/networksettings/ppp/pppdargs.cpp
@@ -68,45 +68,45 @@ PPPdArguments::PPPdArguments(QWidget *parent, const char *name)
add = new QPushButton(i18n("Add"), this);
connect(add, SIGNAL(clicked()), SLOT(addbutton()));
l2->addWidget(add);
l2->addStretch(1);
remove = new QPushButton(i18n("Remove"), this);
connect(remove, SIGNAL(clicked()), SLOT(removebutton()));
l2->addWidget(remove);
defaults = new QPushButton(i18n("Defaults"), this);
connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton()));
l2->addWidget(defaults);
l->addSpacing(5);
- QButtonGroup *bbox = new QButtonGroup(this);
-// bbox->addStretch(1);
- closebtn = new QPushButton( bbox, i18n("OK"));
- bbox->insert(closebtn);
- connect(closebtn, SIGNAL(clicked()), SLOT(closebutton()));
- QPushButton *cancel = new QPushButton( bbox, i18n("Cancel"));
- bbox->insert(cancel);
- connect(cancel, SIGNAL(clicked()),
- this, SLOT(reject()));
- bbox->layout();
- l->addWidget(bbox);
-
- setFixedSize(sizeHint());
+// QButtonGroup *bbox = new QButtonGroup(this);
+// // bbox->addStretch(1);
+// closebtn = new QPushButton( bbox, i18n("OK"));
+// bbox->insert(closebtn);
+// connect(closebtn, SIGNAL(clicked()), SLOT(closebutton()));
+// QPushButton *cancel = new QPushButton( bbox, i18n("Cancel"));
+// bbox->insert(cancel);
+// connect(cancel, SIGNAL(clicked()),
+// this, SLOT(reject()));
+// bbox->layout();
+// l->addWidget(bbox);
+
+// setFixedSize(sizeHint());
//load info from gpppdata
init();
add->setEnabled(false);
remove->setEnabled(false);
argument->setFocus();
}
void PPPdArguments::addbutton() {
if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) {
arguments->insertItem(argument->text());
argument->setText("");
}
}