Diffstat (limited to 'noncore/settings/networksettings/ppp/general.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/general.cpp | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp index 5e2a04f..9457173 100644 --- a/noncore/settings/networksettings/ppp/general.cpp +++ b/noncore/settings/networksettings/ppp/general.cpp @@ -189,23 +189,16 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) "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->enter() == enter->text(i)) - enter->setCurrentItem(i); - } - tl->addRowSpacing(5, 10); //Modem Lock File modemlockfile = new QCheckBox(tr("&Use lock file"), this); - modemlockfile->setChecked(_pppdata->modemLockFile()); // connect(modemlockfile, SIGNAL(toggled(bool)), // SLOT(modemlockfilechanged(bool))); tl->addMultiCellWidget(modemlockfile, 6, 6, 0, 1); // l12->addStretch(1); QWhatsThis::add(modemlockfile, @@ -237,30 +230,21 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) QWhatsThis::add(modemtimeout, tr("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->enter() == enter->text(i)) - enter->setCurrentItem(i); - } + enter->setCurrentItem( static_cast<int>(_pppdata->enter()) ); + flowcontrol->setCurrentItem( static_cast<int>( _pppdata->flowcontrol() ) ); for(int i=0; i <= modemdevice->count()-1; i++) { if(_pppdata->modemDevice() == modemdevice->text(i)) modemdevice->setCurrentItem(i); } - for(int i=0; i <= flowcontrol->count()-1; i++) - { - if(_pppdata->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->speed()) baud_c->setCurrentItem(i); tl->setRowStretch(1, 1); @@ -335,43 +319,45 @@ bool ModemWidget::save() if(modemname->text().isEmpty() || !_pppdata->isUniqueDevname(modemname->text())) return false; _pppdata->setDevname( modemname->text() ); _pppdata->setModemDevice( modemdevice->currentText() ); - _pppdata->setFlowcontrol(flowcontrol->currentText()); - _pppdata->setFlowcontrol(flowcontrol->currentText()); + _pppdata->setFlowcontrol(static_cast<PPPData::FlowControl>(flowcontrol->currentItem())); + _pppdata->setEnter( static_cast<PPPData::LineTermination>(enter->currentItem())); _pppdata->setSpeed(baud_c->currentText()); _pppdata->setModemLockFile( modemlockfile->isChecked()); _pppdata->setModemTimeout( modemtimeout->value() ); return true; } void ModemWidget::slotBeforeModemQuery() { m_oldModemDev = _pppdata->modemDevice(); - m_oldFlowControl = _pppdata->flowcontrol(); + m_oldFlowControl = static_cast<int>( _pppdata->flowcontrol() ); m_oldSpeed = _pppdata->speed(); m_oldModemLock = _pppdata->modemLockFile(); m_oldModemTimeout = _pppdata->modemTimeout(); + m_oldLineEnd = static_cast<int>( _pppdata->enter() ); _pppdata->setModemDevice( modemdevice->currentText() ); - _pppdata->setFlowcontrol(flowcontrol->currentText()); - _pppdata->setFlowcontrol(flowcontrol->currentText()); + _pppdata->setFlowcontrol(static_cast<PPPData::FlowControl>(flowcontrol->currentItem())); + _pppdata->setEnter(static_cast<PPPData::LineTermination>(enter->currentItem())); _pppdata->setSpeed(baud_c->currentText()); _pppdata->setModemLockFile( modemlockfile->isChecked()); _pppdata->setModemTimeout( modemtimeout->value() ); } void ModemWidget::slotAfterModemQuery() { _pppdata->setModemDevice( m_oldModemDev ); - _pppdata->setFlowcontrol( m_oldFlowControl ); + _pppdata->setFlowcontrol( static_cast<PPPData::FlowControl>(m_oldFlowControl) ); + _pppdata->setEnter( static_cast<PPPData::LineTermination>(m_oldLineEnd) ); _pppdata->setSpeed( m_oldSpeed ); _pppdata->setModemLockFile( m_oldModemLock ); _pppdata->setModemTimeout( m_oldModemTimeout ); } |