summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/general.cpp
authortille <tille>2003-05-30 15:06:17 (UTC)
committer tille <tille>2003-05-30 15:06:17 (UTC)
commit8699d02f6c152afed9490e7e7a4315044261e6e8 (patch) (unidiff)
treed2ee2ba401c7a9db0e33beaf0617a1456fe01d50 /noncore/settings/networksettings/ppp/general.cpp
parentd8cec07fe5e54a68afe4feca574f9f4d2433e0c1 (diff)
downloadopie-8699d02f6c152afed9490e7e7a4315044261e6e8.zip
opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.gz
opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.bz2
modem and pppdata is now member of interfaceppp
Diffstat (limited to 'noncore/settings/networksettings/ppp/general.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp59
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
@@ -39,7 +39,7 @@
39// #include <qgroupbox.h> 39// #include <qgroupbox.h>
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"
45#include "modemcmds.h" 45#include "modemcmds.h"
@@ -50,8 +50,8 @@
50 50
51 51
52 52
53ModemWidget::ModemWidget( QWidget *parent, const char *name) 53ModemWidget::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;
57 57
@@ -172,7 +172,7 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
172 QWhatsThis::add(baud_c,tmp); 172 QWhatsThis::add(baud_c,tmp);
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 }
178 178
@@ -181,7 +181,7 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
181 //Modem Lock File 181 //Modem Lock File
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)));
187 tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1); 187 tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1);
@@ -201,10 +201,11 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
201 QHBoxLayout *timeoutLayout = new QHBoxLayout( this ); 201 QHBoxLayout *timeoutLayout = new QHBoxLayout( this );
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)));
210 timeoutLayout->addWidget(timeoutlabel); 211 timeoutLayout->addWidget(timeoutlabel);
@@ -218,23 +219,23 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
218 219
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 }
234 235
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
240 tl->setRowStretch(7, 1); 241 tl->setRowStretch(7, 1);
@@ -242,43 +243,44 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
242 243
243 244
244void ModemWidget::speed_selection(int) { 245void 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
249void ModemWidget::setenter(int ) { 250void 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
254void ModemWidget::setmodemdc(int i) { 255void ModemWidget::setmodemdc(int i) {
255 PPPData::data()->setModemDevice(modemdevice->text(i)); 256 _ifaceppp->data()->setModemDevice(modemdevice->text(i));
256} 257}
257 258
258 259
259void ModemWidget::setflowcontrol(int i) { 260void ModemWidget::setflowcontrol(int i) {
260 PPPData::data()->setFlowcontrol(flowcontrol->text(i)); 261 _ifaceppp->data()->setFlowcontrol(flowcontrol->text(i));
261} 262}
262 263
263 264
264void ModemWidget::modemlockfilechanged(bool set) { 265void ModemWidget::modemlockfilechanged(bool set) {
265 PPPData::data()->setModemLockFile(set); 266 _ifaceppp->data()->setModemLockFile(set);
266} 267}
267 268
268 269
269void ModemWidget::modemtimeoutchanged(int n) { 270void ModemWidget::modemtimeoutchanged(int n) {
270 PPPData::data()->setModemTimeout(n); 271 _ifaceppp->data()->setModemTimeout(n);
271} 272}
272 273
273 274
274ModemWidget2::ModemWidget2( QWidget *parent, const char *name) 275ModemWidget2::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());
278 280
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);
284 QWhatsThis::add(waitfordt, 286 QWhatsThis::add(waitfordt,
@@ -293,7 +295,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
293 QHBoxLayout *waitLayout = new QHBoxLayout( this ); 295 QHBoxLayout *waitLayout = new QHBoxLayout( this );
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);
299 busywait->setSuffix(i18n(" sec")); 301 busywait->setSuffix(i18n(" sec"));
@@ -318,7 +320,8 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
318 320
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);
324 hbl->addWidget(volume); 327 hbl->addWidget(volume);
@@ -342,7 +345,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
342 345
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)));
348 l12->addWidget(chkbox1); 351 l12->addWidget(chkbox1);
@@ -399,14 +402,14 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
399 402
400 403
401void ModemWidget2::modemcmdsbutton() { 404void ModemWidget2::modemcmdsbutton() {
402 ModemCommands mc(this); 405 ModemCommands mc(_ifaceppp->data(), this);
403 mc.showMaximized(); 406 mc.showMaximized();
404 mc.exec(); 407 mc.exec();
405} 408}
406 409
407 410
408void ModemWidget2::query_modem() { 411void ModemWidget2::query_modem() {
409 ModemTransfer mt(this); 412 ModemTransfer mt(_ifaceppp->modem(), this);
410 mt.exec(); 413 mt.exec();
411} 414}
412 415
@@ -419,20 +422,20 @@ void ModemWidget2::query_modem() {
419 422
420#if 0 423#if 0
421void ModemWidget2::use_cdline_toggled(bool on) { 424void ModemWidget2::use_cdline_toggled(bool on) {
422 PPPData::data()->setUseCDLine(on); 425 _ifaceppp->data()->setUseCDLine(on);
423} 426}
424#endif 427#endif
425 428
426void ModemWidget2::waitfordtchanged(bool b) { 429void ModemWidget2::waitfordtchanged(bool b) {
427 PPPData::data()->setWaitForDialTone((int)b); 430 _ifaceppp->data()->setWaitForDialTone((int)b);
428} 431}
429 432
430void ModemWidget2::busywaitchanged(int n) { 433void ModemWidget2::busywaitchanged(int n) {
431 PPPData::data()->setbusyWait(n); 434 _ifaceppp->data()->setbusyWait(n);
432} 435}
433 436
434 437
435void ModemWidget2::volumeChanged(int v) { 438void ModemWidget2::volumeChanged(int v) {
436 PPPData::data()->setVolume(v); 439 _ifaceppp->data()->setVolume(v);
437} 440}
438 441