summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore 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
@@ -50,49 +50,49 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
50{ 50{
51 const int GRIDROWS = 6; 51 const int GRIDROWS = 6;
52 52
53 QGridLayout *tl = new QGridLayout(this, 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:"), this); 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(this); 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");
62 62
63 QWhatsThis::add(connect_label,tmp); 63 QWhatsThis::add(connect_label,tmp);
64 QWhatsThis::add(connectname_l,tmp); 64 QWhatsThis::add(connectname_l,tmp);
65 65
66 66
67 number_label = new QLabel(i18n("Phone number:"), this); 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);
70 70
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(this); 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..."), this); 78 add = new QPushButton(i18n("&Add..."), this);
79 del = new QPushButton(i18n("&Remove"), this); 79 del = new QPushButton(i18n("&Remove"), this);
80 80
81 up = new QPushButton(this); 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(this); 84 down = new QPushButton(this);
85//FIXME: pm = BarIcon("down"); 85//FIXME: pm = BarIcon("down");
86// down->setPixmap(pm); 86// down->setPixmap(pm);
87 lpn1->addWidget(add); 87 lpn1->addWidget(add);
88 lpn1->addWidget(del); 88 lpn1->addWidget(del);
89 lpn1->addStretch(1); 89 lpn1->addStretch(1);
90 lpn1->addWidget(up); 90 lpn1->addWidget(up);
91 lpn1->addWidget(down); 91 lpn1->addWidget(down);
92 connect(add, SIGNAL(clicked()), 92 connect(add, SIGNAL(clicked()),
93 this, SLOT(addNumber())); 93 this, SLOT(addNumber()));
94 connect(del, SIGNAL(clicked()), 94 connect(del, SIGNAL(clicked()),
95 this, SLOT(delNumber())); 95 this, SLOT(delNumber()));
96 connect(up, SIGNAL(clicked()), 96 connect(up, SIGNAL(clicked()),
97 this, SLOT(upNumber())); 97 this, SLOT(upNumber()));
98 connect(down, SIGNAL(clicked()), 98 connect(down, SIGNAL(clicked()),
@@ -805,80 +805,78 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na
805void GatewayWidget::save() { 805void GatewayWidget::save() {
806 PPPData::data()->setGateway(gatewayaddr->text()); 806 PPPData::data()->setGateway(gatewayaddr->text());
807 PPPData::data()->setDefaultroute(defaultroute->isChecked()); 807 PPPData::data()->setDefaultroute(defaultroute->isChecked());
808} 808}
809 809
810 810
811void GatewayWidget::hitGatewaySelect( int i ) { 811void GatewayWidget::hitGatewaySelect( int i ) {
812 if(i == 0) { 812 if(i == 0) {
813 gatewayaddr->setText("0.0.0.0"); 813 gatewayaddr->setText("0.0.0.0");
814 gatewayaddr->setEnabled(false); 814 gatewayaddr->setEnabled(false);
815 gate_label->setEnabled(false); 815 gate_label->setEnabled(false);
816 } 816 }
817 else { 817 else {
818 gatewayaddr->setEnabled(true); 818 gatewayaddr->setEnabled(true);
819 gatewayaddr->setText(""); 819 gatewayaddr->setText("");
820 gate_label->setEnabled(true); 820 gate_label->setEnabled(true);
821 } 821 }
822} 822}
823 823
824 824
825 825
826ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name ) 826ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name )
827 : QWidget(parent, name) 827 : QWidget(parent, name)
828{ 828{
829 QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); 829
830 QVBoxLayout *tl = new QVBoxLayout(this, 0 );
830 se = new ScriptEdit(this); 831 se = new ScriptEdit(this);
831 connect(se, SIGNAL(returnPressed()), SLOT(addButton())); 832 connect(se, SIGNAL(returnPressed()), SLOT(addButton()));
832 tl->addWidget(se); 833 tl->addWidget(se);
833 834
834 // insert equal-sized buttons 835 // insert equal-sized buttons
835 QButtonGroup *bbox = new QButtonGroup(this); 836 QHBoxLayout *hl = new QHBoxLayout( this );
836 add = new QPushButton( bbox, i18n("Add") ); 837 tl->addLayout( hl );
837 bbox->insert(add); 838 add = new QPushButton( i18n("Add"), this );
839 hl->addWidget( add );
838 connect(add, SIGNAL(clicked()), SLOT(addButton())); 840 connect(add, SIGNAL(clicked()), SLOT(addButton()));
839// bbox->addStretch(1); 841 insert = new QPushButton( i18n("Insert"), this );
840 insert = new QPushButton( bbox, i18n("Insert") ); 842 hl->addWidget( insert );
841 bbox->insert(insert);
842 connect(insert, SIGNAL(clicked()), SLOT(insertButton())); 843 connect(insert, SIGNAL(clicked()), SLOT(insertButton()));
843// bbox->addStretch(1); 844 remove = new QPushButton( i18n("Remove"), this );
844 remove = new QPushButton( bbox, i18n("Remove") ); 845 hl->addWidget( remove );
845 bbox->insert(remove);
846 connect(remove, SIGNAL(clicked()), SLOT(removeButton())); 846 connect(remove, SIGNAL(clicked()), SLOT(removeButton()));
847 bbox->layout();
848 tl->addWidget(bbox);
849 847
850 QHBoxLayout *l12 = new QHBoxLayout(0); 848 QHBoxLayout *l12 = new QHBoxLayout(0);
851 tl->addLayout(l12); 849 tl->addLayout(l12);
852 stl = new QListBox(this); 850 stl = new QListBox(this);
853 stl->setVScrollBarMode( QScrollView::AlwaysOff ); 851// stl->setVScrollBarMode( QScrollView::AlwaysOff );
854 connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int))); 852 connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int)));
855 stl->setMinimumSize(QSize(70, 140)); 853// stl->setMinimumSize(QSize(70, 140));
856 854
857 sl = new QListBox(this); 855 sl = new QListBox(this);
858 sl->setVScrollBarMode( QScrollView::AlwaysOff ); 856// sl->setVScrollBarMode( QScrollView::AlwaysOff );
859 connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int))); 857 connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int)));
860 sl->setMinimumSize(QSize(150, 140)); 858// sl->setMinimumSize(QSize(150, 140));
861 859
862 slb = new QScrollBar(this); 860 slb = new QScrollBar(this);
863// slb->setFixedWidth(slb->sizeHint().width()); 861// slb->setFixedWidth(slb->sizeHint().width());
864 connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int))); 862 connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int)));
865 863
866 l12->addWidget(stl, 1); 864 l12->addWidget(stl, 1);
867 l12->addWidget(sl, 3); 865 l12->addWidget(sl, 3);
868 l12->addWidget(slb, 0); 866 l12->addWidget(slb, 0);
869 867
870 //load data from gpppdata 868 //load data from gpppdata
871 if(!isnewaccount) { 869 if(!isnewaccount) {
872 QStringList &comlist = PPPData::data()->scriptType(); 870 QStringList &comlist = PPPData::data()->scriptType();
873 QStringList &arglist = PPPData::data()->script(); 871 QStringList &arglist = PPPData::data()->script();
874 QStringList::Iterator itcom = comlist.begin(); 872 QStringList::Iterator itcom = comlist.begin();
875 QStringList::Iterator itarg = arglist.begin(); 873 QStringList::Iterator itarg = arglist.begin();
876 874
877 for ( ; 875 for ( ;
878 itcom != comlist.end() && itarg != arglist.end(); 876 itcom != comlist.end() && itarg != arglist.end();
879 ++itcom, ++itarg ) 877 ++itcom, ++itarg )
880 { 878 {
881 stl->insertItem(*itcom); 879 stl->insertItem(*itcom);
882 sl->insertItem(*itarg); 880 sl->insertItem(*itarg);
883 } 881 }
884 } 882 }
@@ -1133,61 +1131,67 @@ void ScriptWidget::insertButton() {
1133 adjustScrollBar(); 1131 adjustScrollBar();
1134 se->setText(""); 1132 se->setText("");
1135} 1133}
1136 1134
1137 1135
1138void ScriptWidget::removeButton() { 1136void ScriptWidget::removeButton() {
1139 if(sl->currentItem() >= 0) { 1137 if(sl->currentItem() >= 0) {
1140 int stlc = stl->currentItem(); 1138 int stlc = stl->currentItem();
1141 sl->removeItem(sl->currentItem()); 1139 sl->removeItem(sl->currentItem());
1142 stl->removeItem(stlc); 1140 stl->removeItem(stlc);
1143 adjustScrollBar(); 1141 adjustScrollBar();
1144 insert->setEnabled(sl->currentItem() != -1); 1142 insert->setEnabled(sl->currentItem() != -1);
1145 remove->setEnabled(sl->currentItem() != -1); 1143 remove->setEnabled(sl->currentItem() != -1);
1146 } 1144 }
1147} 1145}
1148 1146
1149 1147
1150 1148
1151///////////////////////////////////////////////////////////////////////////// 1149/////////////////////////////////////////////////////////////////////////////
1152// 1150//
1153// Used to specify a new phone number 1151// Used to specify a new phone number
1154// 1152//
1155///////////////////////////////////////////////////////////////////////////// 1153/////////////////////////////////////////////////////////////////////////////
1156PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) 1154PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1157 : QDialog(parent,"PhoneNumberDialog",true) { 1155 : QDialog(parent,"PhoneNumberDialog",true)
1156{
1158 setCaption( i18n("Add Phone Number") ); 1157 setCaption( i18n("Add Phone Number") );
1159// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
1160 1158
1161 QHBox *hbox = new QHBox(this); 1159
1160 QVBoxLayout *layout = new QVBoxLayout( this );
1161 layout->setSpacing( 3 );
1162 layout->setMargin( 3 );
1163
1164// QHBox *hbox = new QHBox(this);
1162// setMainWidget(hbox); 1165// setMainWidget(hbox);
1163 1166
1164 hbox->setSpacing( 2 );//KDialog::spacingHint()); 1167// hbox->setSpacing( 2 );//KDialog::spacingHint());
1165 1168
1166 new QLabel(i18n("Enter a phone number:"), hbox); 1169 QLabel *label = new QLabel(this, tr("Enter a phone number:"));
1170 layout->addWidget( label );
1167 1171
1168 le = new QLineEdit(hbox); 1172 le = new QLineEdit(this, "lineEdit");
1169// le->setMinimumWidth(125); 1173 layout->addWidget( le );
1170 1174
1171 connect(le, SIGNAL(textChanged(const QString &)), 1175 connect(le, SIGNAL(textChanged(const QString &)),
1172 this, SLOT(textChanged(const QString &))); 1176 this, SLOT(textChanged(const QString &)));
1173 1177
1174 le->setFocus(); 1178 le->setFocus();
1175 textChanged(""); 1179 textChanged("");
1176 1180
1177// enableButtonSeparator(true); 1181
1178} 1182}
1179 1183
1180 1184
1181QString PhoneNumberDialog::phoneNumber() { 1185QString PhoneNumberDialog::phoneNumber() {
1182 QString s = le->text(); 1186 QString s = le->text();
1183 1187
1184 return s; 1188 return s;
1185} 1189}
1186 1190
1187 1191
1188void PhoneNumberDialog::textChanged(const QString &s) { 1192void PhoneNumberDialog::textChanged(const QString &s) {
1189// enableButtonOK(s.length() > 0); 1193// enableButtonOK(s.length() > 0);
1190} 1194}
1191 1195
1192 1196
1193//#include "edit.moc" 1197//#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
@@ -60,61 +60,61 @@ PPPdArguments::PPPdArguments(QWidget *parent, const char *name)
60 connect(argument, SIGNAL(textChanged(const QString &)), 60 connect(argument, SIGNAL(textChanged(const QString &)),
61 this, SLOT(textChanged(const QString &))); 61 this, SLOT(textChanged(const QString &)));
62 62
63 arguments = new QListBox(this); 63 arguments = new QListBox(this);
64 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10); 64 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10);
65 connect(arguments, SIGNAL(highlighted(int)), 65 connect(arguments, SIGNAL(highlighted(int)),
66 this, SLOT(itemSelected(int))); 66 this, SLOT(itemSelected(int)));
67 l1->addWidget(arguments, 1); 67 l1->addWidget(arguments, 1);
68 68
69 add = new QPushButton(i18n("Add"), this); 69 add = new QPushButton(i18n("Add"), this);
70 connect(add, SIGNAL(clicked()), SLOT(addbutton())); 70 connect(add, SIGNAL(clicked()), SLOT(addbutton()));
71 l2->addWidget(add); 71 l2->addWidget(add);
72 l2->addStretch(1); 72 l2->addStretch(1);
73 73
74 remove = new QPushButton(i18n("Remove"), this); 74 remove = new QPushButton(i18n("Remove"), this);
75 connect(remove, SIGNAL(clicked()), SLOT(removebutton())); 75 connect(remove, SIGNAL(clicked()), SLOT(removebutton()));
76 l2->addWidget(remove); 76 l2->addWidget(remove);
77 77
78 defaults = new QPushButton(i18n("Defaults"), this); 78 defaults = new QPushButton(i18n("Defaults"), this);
79 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton())); 79 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton()));
80 l2->addWidget(defaults); 80 l2->addWidget(defaults);
81 81
82 l->addSpacing(5); 82 l->addSpacing(5);
83 83
84 QButtonGroup *bbox = new QButtonGroup(this); 84// QButtonGroup *bbox = new QButtonGroup(this);
85// bbox->addStretch(1); 85// // bbox->addStretch(1);
86 closebtn = new QPushButton( bbox, i18n("OK")); 86// closebtn = new QPushButton( bbox, i18n("OK"));
87 bbox->insert(closebtn); 87// bbox->insert(closebtn);
88 connect(closebtn, SIGNAL(clicked()), SLOT(closebutton())); 88// connect(closebtn, SIGNAL(clicked()), SLOT(closebutton()));
89 QPushButton *cancel = new QPushButton( bbox, i18n("Cancel")); 89// QPushButton *cancel = new QPushButton( bbox, i18n("Cancel"));
90 bbox->insert(cancel); 90// bbox->insert(cancel);
91 connect(cancel, SIGNAL(clicked()), 91// connect(cancel, SIGNAL(clicked()),
92 this, SLOT(reject())); 92 // this, SLOT(reject()));
93 bbox->layout(); 93// bbox->layout();
94 l->addWidget(bbox); 94// l->addWidget(bbox);
95 95
96 setFixedSize(sizeHint()); 96// setFixedSize(sizeHint());
97 97
98 //load info from gpppdata 98 //load info from gpppdata
99 init(); 99 init();
100 100
101 add->setEnabled(false); 101 add->setEnabled(false);
102 remove->setEnabled(false); 102 remove->setEnabled(false);
103 argument->setFocus(); 103 argument->setFocus();
104} 104}
105 105
106 106
107void PPPdArguments::addbutton() { 107void PPPdArguments::addbutton() {
108 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) { 108 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) {
109 arguments->insertItem(argument->text()); 109 arguments->insertItem(argument->text());
110 argument->setText(""); 110 argument->setText("");
111 } 111 }
112} 112}
113 113
114 114
115void PPPdArguments::removebutton() { 115void PPPdArguments::removebutton() {
116 if(arguments->currentItem() >= 0) 116 if(arguments->currentItem() >= 0)
117 arguments->removeItem(arguments->currentItem()); 117 arguments->removeItem(arguments->currentItem());
118} 118}
119 119
120 120