Diffstat (limited to 'noncore/settings/networksettings/ppp/general.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/general.cpp | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp index 98e035b..f735e49 100644 --- a/noncore/settings/networksettings/ppp/general.cpp +++ b/noncore/settings/networksettings/ppp/general.cpp | |||
@@ -40,5 +40,5 @@ | |||
40 | 40 | ||
41 | #include "general.h" | 41 | #include "general.h" |
42 | //#include "version.h" | 42 | #include "interfaceppp.h" |
43 | //#include "miniterm.h" | 43 | //#include "miniterm.h" |
44 | #include "modeminfo.h" | 44 | #include "modeminfo.h" |
@@ -51,6 +51,6 @@ | |||
51 | 51 | ||
52 | 52 | ||
53 | ModemWidget::ModemWidget( QWidget *parent, const char *name) | 53 | ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name ) |
54 | : QWidget(parent, name) | 54 | : QWidget(parent, name), _ifaceppp(ifppp) |
55 | { | 55 | { |
56 | int k; | 56 | int k; |
@@ -173,5 +173,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
173 | 173 | ||
174 | for(int i=0; i <= enter->count()-1; i++) { | 174 | for(int i=0; i <= enter->count()-1; i++) { |
175 | if(PPPData::data()->enter() == enter->text(i)) | 175 | if(_ifaceppp->data()->enter() == enter->text(i)) |
176 | enter->setCurrentItem(i); | 176 | enter->setCurrentItem(i); |
177 | } | 177 | } |
@@ -182,5 +182,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
182 | modemlockfile = new QCheckBox(i18n("&Use lock file"), this); | 182 | modemlockfile = new QCheckBox(i18n("&Use lock file"), this); |
183 | 183 | ||
184 | modemlockfile->setChecked(PPPData::data()->modemLockFile()); | 184 | modemlockfile->setChecked(_ifaceppp->data()->modemLockFile()); |
185 | connect(modemlockfile, SIGNAL(toggled(bool)), | 185 | connect(modemlockfile, SIGNAL(toggled(bool)), |
186 | SLOT(modemlockfilechanged(bool))); | 186 | SLOT(modemlockfilechanged(bool))); |
@@ -202,8 +202,9 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
202 | QLabel *timeoutlabel = new QLabel( tr("Modem timeout:") ,this, "timeout" ); | 202 | QLabel *timeoutlabel = new QLabel( tr("Modem timeout:") ,this, "timeout" ); |
203 | modemtimeout = new QSpinBox( 1, 120, 1, this, "modemTimeout" ); | 203 | modemtimeout = new QSpinBox( 1, 120, 1, this, "modemTimeout" ); |
204 | // modemtimeout = new KIntNumInput(PPPData::data()->modemTimeout(), this); | 204 | // modemtimeout = new KIntNumInput(_pppdata->modemTimeout(), this); |
205 | // modemtimeout->setLabel(i18n("Modem &timeout:")); | 205 | // modemtimeout->setLabel(i18n("Modem &timeout:")); |
206 | // modemtimeout->setRange(1, 120, 1); | 206 | // modemtimeout->setRange(1, 120, 1); |
207 | modemtimeout->setSuffix(i18n(" sec")); | 207 | modemtimeout->setSuffix(i18n(" sec")); |
208 | modemtimeout->setValue( _ifaceppp->data()->modemTimeout() ); | ||
208 | connect(modemtimeout, SIGNAL(valueChanged(int)), | 209 | connect(modemtimeout, SIGNAL(valueChanged(int)), |
209 | SLOT(modemtimeoutchanged(int))); | 210 | SLOT(modemtimeoutchanged(int))); |
@@ -219,15 +220,15 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
219 | //set stuff from gpppdata | 220 | //set stuff from gpppdata |
220 | for(int i=0; i <= enter->count()-1; i++) { | 221 | for(int i=0; i <= enter->count()-1; i++) { |
221 | if(PPPData::data()->enter() == enter->text(i)) | 222 | if(_ifaceppp->data()->enter() == enter->text(i)) |
222 | enter->setCurrentItem(i); | 223 | enter->setCurrentItem(i); |
223 | } | 224 | } |
224 | 225 | ||
225 | for(int i=0; i <= modemdevice->count()-1; i++) { | 226 | for(int i=0; i <= modemdevice->count()-1; i++) { |
226 | if(PPPData::data()->modemDevice() == modemdevice->text(i)) | 227 | if(_ifaceppp->data()->modemDevice() == modemdevice->text(i)) |
227 | modemdevice->setCurrentItem(i); | 228 | modemdevice->setCurrentItem(i); |
228 | } | 229 | } |
229 | 230 | ||
230 | for(int i=0; i <= flowcontrol->count()-1; i++) { | 231 | for(int i=0; i <= flowcontrol->count()-1; i++) { |
231 | if(PPPData::data()->flowcontrol() == flowcontrol->text(i)) | 232 | if(_ifaceppp->data()->flowcontrol() == flowcontrol->text(i)) |
232 | flowcontrol->setCurrentItem(i); | 233 | flowcontrol->setCurrentItem(i); |
233 | } | 234 | } |
@@ -235,5 +236,5 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
235 | //set the modem speed | 236 | //set the modem speed |
236 | for(int i=0; i < baud_c->count(); i++) | 237 | for(int i=0; i < baud_c->count(); i++) |
237 | if(baud_c->text(i) == PPPData::data()->speed()) | 238 | if(baud_c->text(i) == _ifaceppp->data()->speed()) |
238 | baud_c->setCurrentItem(i); | 239 | baud_c->setCurrentItem(i); |
239 | 240 | ||
@@ -243,35 +244,36 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name) | |||
243 | 244 | ||
244 | void ModemWidget::speed_selection(int) { | 245 | void ModemWidget::speed_selection(int) { |
245 | PPPData::data()->setSpeed(baud_c->text(baud_c->currentItem())); | 246 | _ifaceppp->data()->setSpeed(baud_c->text(baud_c->currentItem())); |
246 | } | 247 | } |
247 | 248 | ||
248 | 249 | ||
249 | void ModemWidget::setenter(int ) { | 250 | void ModemWidget::setenter(int ) { |
250 | PPPData::data()->setEnter(enter->text(enter->currentItem())); | 251 | _ifaceppp->data()->setEnter(enter->text(enter->currentItem())); |
251 | } | 252 | } |
252 | 253 | ||
253 | 254 | ||
254 | void ModemWidget::setmodemdc(int i) { | 255 | void ModemWidget::setmodemdc(int i) { |
255 | PPPData::data()->setModemDevice(modemdevice->text(i)); | 256 | _ifaceppp->data()->setModemDevice(modemdevice->text(i)); |
256 | } | 257 | } |
257 | 258 | ||
258 | 259 | ||
259 | void ModemWidget::setflowcontrol(int i) { | 260 | void ModemWidget::setflowcontrol(int i) { |
260 | PPPData::data()->setFlowcontrol(flowcontrol->text(i)); | 261 | _ifaceppp->data()->setFlowcontrol(flowcontrol->text(i)); |
261 | } | 262 | } |
262 | 263 | ||
263 | 264 | ||
264 | void ModemWidget::modemlockfilechanged(bool set) { | 265 | void ModemWidget::modemlockfilechanged(bool set) { |
265 | PPPData::data()->setModemLockFile(set); | 266 | _ifaceppp->data()->setModemLockFile(set); |
266 | } | 267 | } |
267 | 268 | ||
268 | 269 | ||
269 | void ModemWidget::modemtimeoutchanged(int n) { | 270 | void ModemWidget::modemtimeoutchanged(int n) { |
270 | PPPData::data()->setModemTimeout(n); | 271 | _ifaceppp->data()->setModemTimeout(n); |
271 | } | 272 | } |
272 | 273 | ||
273 | 274 | ||
274 | ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | 275 | ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent, |
275 | : QWidget(parent, name) | 276 | const char *name) |
277 | : QWidget(parent, name), _ifaceppp(ifp) | ||
276 | { | 278 | { |
277 | QVBoxLayout *l1 = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); | 279 | QVBoxLayout *l1 = new QVBoxLayout(this, 0 );//, KDialog::spacingHint()); |
@@ -279,5 +281,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
279 | 281 | ||
280 | waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); | 282 | waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); |
281 | waitfordt->setChecked(PPPData::data()->waitForDialTone()); | 283 | waitfordt->setChecked(_ifaceppp->data()->waitForDialTone()); |
282 | connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); | 284 | connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); |
283 | l1->addWidget(waitfordt); | 285 | l1->addWidget(waitfordt); |
@@ -294,5 +296,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
294 | QLabel *waitLabel = new QLabel( tr("Busy wait:"), this, "busyWait" ); | 296 | QLabel *waitLabel = new QLabel( tr("Busy wait:"), this, "busyWait" ); |
295 | busywait = new QSpinBox( 0, 300, 5, this, "busyWait" ); | 297 | busywait = new QSpinBox( 0, 300, 5, this, "busyWait" ); |
296 | // busywait = new KIntNumInput(PPPData::data()->busyWait(), this); | 298 | // busywait = new KIntNumInput(_pppdata->busyWait(), this); |
297 | // busywait->setLabel(i18n("B&usy wait:")); | 299 | // busywait->setLabel(i18n("B&usy wait:")); |
298 | // busywait->setRange(0, 300, 5, true); | 300 | // busywait->setRange(0, 300, 5, true); |
@@ -319,5 +321,6 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
319 | QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); | 321 | QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); |
320 | hbl->addWidget(volumeLabel); | 322 | hbl->addWidget(volumeLabel); |
321 | volume = new QSlider(0, 2, 1, PPPData::data()->volume(), QSlider::Horizontal, this); | 323 | volume = new QSlider(0, 2, 1, _ifaceppp->data()->volume(), |
324 | QSlider::Horizontal, this); | ||
322 | volumeLabel->setBuddy(volume); | 325 | volumeLabel->setBuddy(volume); |
323 | volume->setTickmarks(QSlider::Below); | 326 | volume->setTickmarks(QSlider::Below); |
@@ -343,5 +346,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
343 | #if 0 | 346 | #if 0 |
344 | chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); | 347 | chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); |
345 | chkbox1->setChecked(PPPData::data()->UseCDLine()); | 348 | chkbox1->setChecked(_ifaceppp->data()->UseCDLine()); |
346 | connect(chkbox1,SIGNAL(toggled(bool)), | 349 | connect(chkbox1,SIGNAL(toggled(bool)), |
347 | this,SLOT(use_cdline_toggled(bool))); | 350 | this,SLOT(use_cdline_toggled(bool))); |
@@ -400,5 +403,5 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name) | |||
400 | 403 | ||
401 | void ModemWidget2::modemcmdsbutton() { | 404 | void ModemWidget2::modemcmdsbutton() { |
402 | ModemCommands mc(this); | 405 | ModemCommands mc(_ifaceppp->data(), this); |
403 | mc.showMaximized(); | 406 | mc.showMaximized(); |
404 | mc.exec(); | 407 | mc.exec(); |
@@ -407,5 +410,5 @@ void ModemWidget2::modemcmdsbutton() { | |||
407 | 410 | ||
408 | void ModemWidget2::query_modem() { | 411 | void ModemWidget2::query_modem() { |
409 | ModemTransfer mt(this); | 412 | ModemTransfer mt(_ifaceppp->modem(), this); |
410 | mt.exec(); | 413 | mt.exec(); |
411 | } | 414 | } |
@@ -420,19 +423,19 @@ void ModemWidget2::query_modem() { | |||
420 | #if 0 | 423 | #if 0 |
421 | void ModemWidget2::use_cdline_toggled(bool on) { | 424 | void ModemWidget2::use_cdline_toggled(bool on) { |
422 | PPPData::data()->setUseCDLine(on); | 425 | _ifaceppp->data()->setUseCDLine(on); |
423 | } | 426 | } |
424 | #endif | 427 | #endif |
425 | 428 | ||
426 | void ModemWidget2::waitfordtchanged(bool b) { | 429 | void ModemWidget2::waitfordtchanged(bool b) { |
427 | PPPData::data()->setWaitForDialTone((int)b); | 430 | _ifaceppp->data()->setWaitForDialTone((int)b); |
428 | } | 431 | } |
429 | 432 | ||
430 | void ModemWidget2::busywaitchanged(int n) { | 433 | void ModemWidget2::busywaitchanged(int n) { |
431 | PPPData::data()->setbusyWait(n); | 434 | _ifaceppp->data()->setbusyWait(n); |
432 | } | 435 | } |
433 | 436 | ||
434 | 437 | ||
435 | void ModemWidget2::volumeChanged(int v) { | 438 | void ModemWidget2::volumeChanged(int v) { |
436 | PPPData::data()->setVolume(v); | 439 | _ifaceppp->data()->setVolume(v); |
437 | } | 440 | } |
438 | 441 | ||