summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/general.cpp
Side-by-side diff
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
@@ -30,37 +30,37 @@
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <qspinbox.h>
#include <qwhatsthis.h>
// #include <qgroupbox.h>
#include "general.h"
-//#include "version.h"
+#include "interfaceppp.h"
//#include "miniterm.h"
#include "modeminfo.h"
#include "modemcmds.h"
#include "devices.h"
#include "pppdata.h"
//#include <klocale.h>
#define i18n QObject::tr
-ModemWidget::ModemWidget( QWidget *parent, const char *name)
- : QWidget(parent, name)
+ModemWidget::ModemWidget( InterfacePPP *ifppp, QWidget *parent, const char *name )
+ : QWidget(parent, name), _ifaceppp(ifppp)
{
int k;
QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint());
QLabel *label1;
label1 = new QLabel(i18n("Modem de&vice:"), this);
tl->addWidget(label1, 0, 0);
modemdevice = new QComboBox(false, this);
label1->setBuddy(modemdevice);
@@ -163,195 +163,198 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
tmp = i18n("Specifies the speed your modem and the serial\n"
"port talk to each other. You should begin with\n"
"the default of 38400 bits/sec. If everything\n"
"works you can try to increase this value, but to\n"
"no more than 115200 bits/sec (unless you know\n"
"that your serial port supports higher speeds).");
QWhatsThis::add(baud_label,tmp);
QWhatsThis::add(baud_c,tmp);
for(int i=0; i <= enter->count()-1; i++) {
- if(PPPData::data()->enter() == enter->text(i))
+ if(_ifaceppp->data()->enter() == enter->text(i))
enter->setCurrentItem(i);
}
tl->addRowSpacing(4, 10);
//Modem Lock File
modemlockfile = new QCheckBox(i18n("&Use lock file"), this);
- modemlockfile->setChecked(PPPData::data()->modemLockFile());
+ modemlockfile->setChecked(_ifaceppp->data()->modemLockFile());
connect(modemlockfile, SIGNAL(toggled(bool)),
SLOT(modemlockfilechanged(bool)));
tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1);
// l12->addStretch(1);
QWhatsThis::add(modemlockfile,
i18n("<p>To prevent other programs from accessing the\n"
"modem while a connection is established, a\n"
"file can be created to indicate that the modem\n"
"is in use. On Linux an example file would be\n"
"<tt>/var/lock/LCK..ttyS1</tt>\n"
"Here you can select whether this locking will\n"
"be done.\n"
"\n"
"<b>Default</b>: On"));
// Modem Timeout Line Edit Box
QHBoxLayout *timeoutLayout = new QHBoxLayout( this );
QLabel *timeoutlabel = new QLabel( tr("Modem timeout:") ,this, "timeout" );
modemtimeout = new QSpinBox( 1, 120, 1, this, "modemTimeout" );
-// modemtimeout = new KIntNumInput(PPPData::data()->modemTimeout(), this);
+// modemtimeout = new KIntNumInput(_pppdata->modemTimeout(), this);
// modemtimeout->setLabel(i18n("Modem &timeout:"));
// modemtimeout->setRange(1, 120, 1);
modemtimeout->setSuffix(i18n(" sec"));
+ modemtimeout->setValue( _ifaceppp->data()->modemTimeout() );
connect(modemtimeout, SIGNAL(valueChanged(int)),
SLOT(modemtimeoutchanged(int)));
timeoutLayout->addWidget(timeoutlabel);
timeoutLayout->addWidget(modemtimeout);
tl->addMultiCellLayout(timeoutLayout, 6, 6, 0, 1);
QWhatsThis::add(modemtimeout,
i18n("This specifies how long <i>kppp</i> waits for a\n"
"<i>CONNECT</i> response from your modem. The\n"
"recommended value is 30 seconds."));
//set stuff from gpppdata
for(int i=0; i <= enter->count()-1; i++) {
- if(PPPData::data()->enter() == enter->text(i))
+ if(_ifaceppp->data()->enter() == enter->text(i))
enter->setCurrentItem(i);
}
for(int i=0; i <= modemdevice->count()-1; i++) {
- if(PPPData::data()->modemDevice() == modemdevice->text(i))
+ if(_ifaceppp->data()->modemDevice() == modemdevice->text(i))
modemdevice->setCurrentItem(i);
}
for(int i=0; i <= flowcontrol->count()-1; i++) {
- if(PPPData::data()->flowcontrol() == flowcontrol->text(i))
+ if(_ifaceppp->data()->flowcontrol() == flowcontrol->text(i))
flowcontrol->setCurrentItem(i);
}
//set the modem speed
for(int i=0; i < baud_c->count(); i++)
- if(baud_c->text(i) == PPPData::data()->speed())
+ if(baud_c->text(i) == _ifaceppp->data()->speed())
baud_c->setCurrentItem(i);
tl->setRowStretch(7, 1);
}
void ModemWidget::speed_selection(int) {
- PPPData::data()->setSpeed(baud_c->text(baud_c->currentItem()));
+ _ifaceppp->data()->setSpeed(baud_c->text(baud_c->currentItem()));
}
void ModemWidget::setenter(int ) {
- PPPData::data()->setEnter(enter->text(enter->currentItem()));
+ _ifaceppp->data()->setEnter(enter->text(enter->currentItem()));
}
void ModemWidget::setmodemdc(int i) {
- PPPData::data()->setModemDevice(modemdevice->text(i));
+ _ifaceppp->data()->setModemDevice(modemdevice->text(i));
}
void ModemWidget::setflowcontrol(int i) {
- PPPData::data()->setFlowcontrol(flowcontrol->text(i));
+ _ifaceppp->data()->setFlowcontrol(flowcontrol->text(i));
}
void ModemWidget::modemlockfilechanged(bool set) {
- PPPData::data()->setModemLockFile(set);
+ _ifaceppp->data()->setModemLockFile(set);
}
void ModemWidget::modemtimeoutchanged(int n) {
- PPPData::data()->setModemTimeout(n);
+ _ifaceppp->data()->setModemTimeout(n);
}
-ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
- : QWidget(parent, name)
+ModemWidget2::ModemWidget2( InterfacePPP* ifp, QWidget *parent,
+ const char *name)
+ : QWidget(parent, name), _ifaceppp(ifp)
{
QVBoxLayout *l1 = new QVBoxLayout(this, 0 );//, KDialog::spacingHint());
waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this);
- waitfordt->setChecked(PPPData::data()->waitForDialTone());
+ waitfordt->setChecked(_ifaceppp->data()->waitForDialTone());
connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool)));
l1->addWidget(waitfordt);
QWhatsThis::add(waitfordt,
i18n("<p>Normally the modem waits for a dial tone\n"
"from your phone line, indicating that it can\n"
"start to dial a number. If your modem does not\n"
"recognize this sound, or your local phone system\n"
"does not emit such a tone, uncheck this option\n"
"\n"
"<b>Default:</b>: On"));
QHBoxLayout *waitLayout = new QHBoxLayout( this );
QLabel *waitLabel = new QLabel( tr("Busy wait:"), this, "busyWait" );
busywait = new QSpinBox( 0, 300, 5, this, "busyWait" );
-// busywait = new KIntNumInput(PPPData::data()->busyWait(), this);
+// busywait = new KIntNumInput(_pppdata->busyWait(), this);
// busywait->setLabel(i18n("B&usy wait:"));
// busywait->setRange(0, 300, 5, true);
busywait->setSuffix(i18n(" sec"));
connect(busywait, SIGNAL(valueChanged(int)), SLOT(busywaitchanged(int)));
waitLayout->addWidget(waitLabel);
waitLayout->addWidget(busywait);
l1->addLayout( waitLayout );
QWhatsThis::add(busywait,
i18n("Specifies the number of seconds to wait before\n"
"redial if all dialed numbers are busy. This is\n"
"necessary because some modems get stuck if the\n"
"same number is busy too often.\n"
"\n"
"The default is 0 seconds, you should not change\n"
"this unless you need to."));
l1->addSpacing(10);
QHBoxLayout *hbl = new QHBoxLayout;
hbl->setSpacing(2);//KDialog::spacingHint());
QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this);
hbl->addWidget(volumeLabel);
- volume = new QSlider(0, 2, 1, PPPData::data()->volume(), QSlider::Horizontal, this);
+ volume = new QSlider(0, 2, 1, _ifaceppp->data()->volume(),
+ QSlider::Horizontal, this);
volumeLabel->setBuddy(volume);
volume->setTickmarks(QSlider::Below);
hbl->addWidget(volume);
l1->addLayout(hbl);
connect(volume, SIGNAL(valueChanged(int)),
this, SLOT(volumeChanged(int)));
QString tmp = i18n("Most modems have a speaker which makes\n"
"a lot of noise when dialing. Here you can\n"
"either turn this completely off or select a\n"
"lower volume.\n"
"\n"
"If this does not work for your modem,\n"
"you must modify the modem volume command.");
QWhatsThis::add(volumeLabel,tmp);
QWhatsThis::add(volume, tmp);
l1->addSpacing(20);
#if 0
chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this);
- chkbox1->setChecked(PPPData::data()->UseCDLine());
+ chkbox1->setChecked(_ifaceppp->data()->UseCDLine());
connect(chkbox1,SIGNAL(toggled(bool)),
this,SLOT(use_cdline_toggled(bool)));
l12->addWidget(chkbox1);
l12->addStretch(1);
l1->addStretch(1);
QWhatsThis::add(chkbox1,
i18n("This controls how <i>kppp</i> detects that the modem\n"
"is not responding. Unless you are having\n"
"problems with this, do not modify this setting.\n"
"\n"
"<b>Default</b>: Off"));
#endif
@@ -390,49 +393,49 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
l1->addStretch(1);
connect(modemcmds, SIGNAL(clicked()),
SLOT(modemcmdsbutton()));
connect(modeminfo_button, SIGNAL(clicked()),
SLOT(query_modem()));
// connect(terminal_button, SIGNAL(clicked()),
// SLOT(terminal()));
}
void ModemWidget2::modemcmdsbutton() {
- ModemCommands mc(this);
+ ModemCommands mc(_ifaceppp->data(), this);
mc.showMaximized();
mc.exec();
}
void ModemWidget2::query_modem() {
- ModemTransfer mt(this);
+ ModemTransfer mt(_ifaceppp->modem(), this);
mt.exec();
}
// void ModemWidget2::terminal() {
// MiniTerm terminal(NULL,NULL);
// terminal.exec();
// }
#if 0
void ModemWidget2::use_cdline_toggled(bool on) {
- PPPData::data()->setUseCDLine(on);
+ _ifaceppp->data()->setUseCDLine(on);
}
#endif
void ModemWidget2::waitfordtchanged(bool b) {
- PPPData::data()->setWaitForDialTone((int)b);
+ _ifaceppp->data()->setWaitForDialTone((int)b);
}
void ModemWidget2::busywaitchanged(int n) {
- PPPData::data()->setbusyWait(n);
+ _ifaceppp->data()->setbusyWait(n);
}
void ModemWidget2::volumeChanged(int v) {
- PPPData::data()->setVolume(v);
+ _ifaceppp->data()->setVolume(v);
}