author | zecke <zecke> | 2004-10-14 00:39:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-14 00:39:47 (UTC) |
commit | b17b6c77af35b610d236321279d3f18eb3060c90 (patch) (side-by-side diff) | |
tree | 4ff66b2060c91373f86f3fd14890dcb8e98babb6 | |
parent | 9cc9ed1e746477c59b1fd3d572cdce052f0ccf85 (diff) | |
download | opie-b17b6c77af35b610d236321279d3f18eb3060c90.zip opie-b17b6c77af35b610d236321279d3f18eb3060c90.tar.gz opie-b17b6c77af35b610d236321279d3f18eb3060c90.tar.bz2 |
-Make ModemQuery to use the 'current' configuration
-Todo make FlowControl, LineTermination lwork across locales
for safe and restore
-rw-r--r-- | noncore/settings/networksettings/ppp/devices.cpp | 7 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/general.cpp | 34 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/general.h | 17 |
3 files changed, 55 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/ppp/devices.cpp b/noncore/settings/networksettings/ppp/devices.cpp index e2c67d8..c658227 100644 --- a/noncore/settings/networksettings/ppp/devices.cpp +++ b/noncore/settings/networksettings/ppp/devices.cpp @@ -197,2 +197,7 @@ int DevicesWidget::doTab(){ + connect(modem2, SIGNAL(sig_beforeQueryModem()), + modem1, SLOT(slotBeforeModemQuery())); + connect(modem2, SIGNAL(sig_afterQueryModem()), + modem1, SLOT(slotAfterModemQuery())); + int result = 0; @@ -206,3 +211,3 @@ int DevicesWidget::doTab(){ if (!modem1->save()){ - QMessageBox::critical(this, "error", tr( "You must enter a unique device name")); + QMessageBox::critical(this, tr("Error"), tr( "You must enter a unique device name")); ok = false; diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp index 40ba19b..5e2a04f 100644 --- a/noncore/settings/networksettings/ppp/general.cpp +++ b/noncore/settings/networksettings/ppp/general.cpp @@ -288,3 +288,2 @@ ModemWidget::~ModemWidget() } - _pppdata->setModemDevice( edited ); } @@ -339,3 +338,2 @@ bool ModemWidget::save() - odebug << "ModemWidget::save saving modem1 data" << oendl; _pppdata->setDevname( modemname->text() ); @@ -351,2 +349,30 @@ bool ModemWidget::save() +void ModemWidget::slotBeforeModemQuery() +{ + m_oldModemDev = _pppdata->modemDevice(); + m_oldFlowControl = _pppdata->flowcontrol(); + m_oldSpeed = _pppdata->speed(); + m_oldModemLock = _pppdata->modemLockFile(); + m_oldModemTimeout = _pppdata->modemTimeout(); + + + _pppdata->setModemDevice( modemdevice->currentText() ); + _pppdata->setFlowcontrol(flowcontrol->currentText()); + _pppdata->setFlowcontrol(flowcontrol->currentText()); + _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->setSpeed( m_oldSpeed ); + _pppdata->setModemLockFile( m_oldModemLock ); + _pppdata->setModemTimeout( m_oldModemTimeout ); +} + + ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent, @@ -490,4 +516,8 @@ void ModemWidget2::query_modem() { + emit sig_beforeQueryModem(); + ModemTransfer mt(_ifaceppp->modem(), this); mt.exec(); + + emit sig_afterQueryModem(); } diff --git a/noncore/settings/networksettings/ppp/general.h b/noncore/settings/networksettings/ppp/general.h index f43f241..a4dece4 100644 --- a/noncore/settings/networksettings/ppp/general.h +++ b/noncore/settings/networksettings/ppp/general.h @@ -48,2 +48,10 @@ public: +private slots: + /* + * temporarily commit configuration so queryModem + * will use 'current' settings + */ + void slotBeforeModemQuery(); + void slotAfterModemQuery(); + /* private slots: */ @@ -73,2 +81,7 @@ private: PPPData *_pppdata; + +private: + QString m_oldModemDev, m_oldFlowControl, m_oldSpeed; + bool m_oldModemLock; + int m_oldModemTimeout; }; @@ -82,2 +95,6 @@ public: +signals: + void sig_beforeQueryModem(); + void sig_afterQueryModem(); + private slots: |