author | zecke <zecke> | 2004-10-14 00:39:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-14 00:39:47 (UTC) |
commit | b17b6c77af35b610d236321279d3f18eb3060c90 (patch) (unidiff) | |
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(){ | |||
197 | 197 | ||
198 | connect(modem2, SIGNAL(sig_beforeQueryModem()), | ||
199 | modem1, SLOT(slotBeforeModemQuery())); | ||
200 | connect(modem2, SIGNAL(sig_afterQueryModem()), | ||
201 | modem1, SLOT(slotAfterModemQuery())); | ||
202 | |||
198 | int result = 0; | 203 | int result = 0; |
@@ -206,3 +211,3 @@ int DevicesWidget::doTab(){ | |||
206 | if (!modem1->save()){ | 211 | if (!modem1->save()){ |
207 | QMessageBox::critical(this, "error", tr( "You must enter a unique device name")); | 212 | QMessageBox::critical(this, tr("Error"), tr( "You must enter a unique device name")); |
208 | ok = false; | 213 | 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() | |||
288 | } | 288 | } |
289 | _pppdata->setModemDevice( edited ); | ||
290 | } | 289 | } |
@@ -339,3 +338,2 @@ bool ModemWidget::save() | |||
339 | 338 | ||
340 | odebug << "ModemWidget::save saving modem1 data" << oendl; | ||
341 | _pppdata->setDevname( modemname->text() ); | 339 | _pppdata->setDevname( modemname->text() ); |
@@ -351,2 +349,30 @@ bool ModemWidget::save() | |||
351 | 349 | ||
350 | void ModemWidget::slotBeforeModemQuery() | ||
351 | { | ||
352 | m_oldModemDev = _pppdata->modemDevice(); | ||
353 | m_oldFlowControl = _pppdata->flowcontrol(); | ||
354 | m_oldSpeed = _pppdata->speed(); | ||
355 | m_oldModemLock = _pppdata->modemLockFile(); | ||
356 | m_oldModemTimeout = _pppdata->modemTimeout(); | ||
357 | |||
358 | |||
359 | _pppdata->setModemDevice( modemdevice->currentText() ); | ||
360 | _pppdata->setFlowcontrol(flowcontrol->currentText()); | ||
361 | _pppdata->setFlowcontrol(flowcontrol->currentText()); | ||
362 | _pppdata->setSpeed(baud_c->currentText()); | ||
363 | _pppdata->setModemLockFile( modemlockfile->isChecked()); | ||
364 | _pppdata->setModemTimeout( modemtimeout->value() ); | ||
365 | } | ||
366 | |||
367 | |||
368 | void ModemWidget::slotAfterModemQuery() | ||
369 | { | ||
370 | _pppdata->setModemDevice( m_oldModemDev ); | ||
371 | _pppdata->setFlowcontrol( m_oldFlowControl ); | ||
372 | _pppdata->setSpeed( m_oldSpeed ); | ||
373 | _pppdata->setModemLockFile( m_oldModemLock ); | ||
374 | _pppdata->setModemTimeout( m_oldModemTimeout ); | ||
375 | } | ||
376 | |||
377 | |||
352 | ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent, | 378 | ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent, |
@@ -490,4 +516,8 @@ void ModemWidget2::query_modem() | |||
490 | { | 516 | { |
517 | emit sig_beforeQueryModem(); | ||
518 | |||
491 | ModemTransfer mt(_ifaceppp->modem(), this); | 519 | ModemTransfer mt(_ifaceppp->modem(), this); |
492 | mt.exec(); | 520 | mt.exec(); |
521 | |||
522 | emit sig_afterQueryModem(); | ||
493 | } | 523 | } |
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: | |||
48 | 48 | ||
49 | private slots: | ||
50 | /* | ||
51 | * temporarily commit configuration so queryModem | ||
52 | * will use 'current' settings | ||
53 | */ | ||
54 | void slotBeforeModemQuery(); | ||
55 | void slotAfterModemQuery(); | ||
56 | |||
49 | /* private slots: */ | 57 | /* private slots: */ |
@@ -73,2 +81,7 @@ private: | |||
73 | PPPData *_pppdata; | 81 | PPPData *_pppdata; |
82 | |||
83 | private: | ||
84 | QString m_oldModemDev, m_oldFlowControl, m_oldSpeed; | ||
85 | bool m_oldModemLock; | ||
86 | int m_oldModemTimeout; | ||
74 | }; | 87 | }; |
@@ -82,2 +95,6 @@ public: | |||
82 | 95 | ||
96 | signals: | ||
97 | void sig_beforeQueryModem(); | ||
98 | void sig_afterQueryModem(); | ||
99 | |||
83 | private slots: | 100 | private slots: |