summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/general.cpp
Unidiff
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
@@ -36,25 +36,25 @@
36#include <qspinbox.h> 36#include <qspinbox.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38 38
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"
46#include "devices.h" 46#include "devices.h"
47#include "pppdata.h" 47#include "pppdata.h"
48//#include <klocale.h> 48//#include <klocale.h>
49#define i18n QObject::tr 49#define i18n QObject::tr
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
58 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint()); 58 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint());
59 59
60 QLabel *label1; 60 QLabel *label1;
@@ -169,22 +169,22 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
169 "that your serial port supports higher speeds)."); 169 "that your serial port supports higher speeds).");
170 170
171 QWhatsThis::add(baud_label,tmp); 171 QWhatsThis::add(baud_label,tmp);
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
179 tl->addRowSpacing(4, 10); 179 tl->addRowSpacing(4, 10);
180 180
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);
188 // l12->addStretch(1); 188 // l12->addStretch(1);
189 QWhatsThis::add(modemlockfile, 189 QWhatsThis::add(modemlockfile,
190 i18n("<p>To prevent other programs from accessing the\n" 190 i18n("<p>To prevent other programs from accessing the\n"
@@ -198,16 +198,17 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
198 "<b>Default</b>: On")); 198 "<b>Default</b>: On"));
199 199
200 // Modem Timeout Line Edit Box 200 // Modem Timeout Line Edit Box
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);
211 timeoutLayout->addWidget(modemtimeout); 212 timeoutLayout->addWidget(modemtimeout);
212 tl->addMultiCellLayout(timeoutLayout, 6, 6, 0, 1); 213 tl->addMultiCellLayout(timeoutLayout, 6, 6, 0, 1);
213 214
@@ -215,73 +216,74 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
215 i18n("This specifies how long <i>kppp</i> waits for a\n" 216 i18n("This specifies how long <i>kppp</i> waits for a\n"
216 "<i>CONNECT</i> response from your modem. The\n" 217 "<i>CONNECT</i> response from your modem. The\n"
217 "recommended value is 30 seconds.")); 218 "recommended value is 30 seconds."));
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);
241} 242}
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,
285 i18n("<p>Normally the modem waits for a dial tone\n" 287 i18n("<p>Normally the modem waits for a dial tone\n"
286 "from your phone line, indicating that it can\n" 288 "from your phone line, indicating that it can\n"
287 "start to dial a number. If your modem does not\n" 289 "start to dial a number. If your modem does not\n"
@@ -290,13 +292,13 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
290 "\n" 292 "\n"
291 "<b>Default:</b>: On")); 293 "<b>Default:</b>: On"));
292 294
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"));
300 connect(busywait, SIGNAL(valueChanged(int)), SLOT(busywaitchanged(int))); 302 connect(busywait, SIGNAL(valueChanged(int)), SLOT(busywaitchanged(int)));
301 waitLayout->addWidget(waitLabel); 303 waitLayout->addWidget(waitLabel);
302 waitLayout->addWidget(busywait); 304 waitLayout->addWidget(busywait);
@@ -315,13 +317,14 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
315 317
316 QHBoxLayout *hbl = new QHBoxLayout; 318 QHBoxLayout *hbl = new QHBoxLayout;
317 hbl->setSpacing(2);//KDialog::spacingHint()); 319 hbl->setSpacing(2);//KDialog::spacingHint());
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);
325 328
326 l1->addLayout(hbl); 329 l1->addLayout(hbl);
327 330
@@ -339,13 +342,13 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
339 QWhatsThis::add(volume, tmp); 342 QWhatsThis::add(volume, tmp);
340 343
341 l1->addSpacing(20); 344 l1->addSpacing(20);
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);
349 l12->addStretch(1); 352 l12->addStretch(1);
350 l1->addStretch(1); 353 l1->addStretch(1);
351 QWhatsThis::add(chkbox1, 354 QWhatsThis::add(chkbox1,
@@ -396,43 +399,43 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
396// connect(terminal_button, SIGNAL(clicked()), 399// connect(terminal_button, SIGNAL(clicked()),
397 // SLOT(terminal())); 400 // SLOT(terminal()));
398} 401}
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
413 416
414// void ModemWidget2::terminal() { 417// void ModemWidget2::terminal() {
415// MiniTerm terminal(NULL,NULL); 418// MiniTerm terminal(NULL,NULL);
416// terminal.exec(); 419// terminal.exec();
417// } 420// }
418 421
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