summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-14 00:39:47 (UTC)
committer zecke <zecke>2004-10-14 00:39:47 (UTC)
commitb17b6c77af35b610d236321279d3f18eb3060c90 (patch) (side-by-side diff)
tree4ff66b2060c91373f86f3fd14890dcb8e98babb6
parent9cc9ed1e746477c59b1fd3d572cdce052f0ccf85 (diff)
downloadopie-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
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/devices.cpp7
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp34
-rw-r--r--noncore/settings/networksettings/ppp/general.h17
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
@@ -196,4 +196,9 @@ int DevicesWidget::doTab(){
tabWindow->addTab( modem2, tr("&Modem") );
+ connect(modem2, SIGNAL(sig_beforeQueryModem()),
+ modem1, SLOT(slotBeforeModemQuery()));
+ connect(modem2, SIGNAL(sig_afterQueryModem()),
+ modem1, SLOT(slotAfterModemQuery()));
+
int result = 0;
bool ok = false;
@@ -205,5 +210,5 @@ int DevicesWidget::doTab(){
if(result == QDialog::Accepted) {
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;
}else{
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
@@ -287,5 +287,4 @@ ModemWidget::~ModemWidget()
devs << edited;
}
- _pppdata->setModemDevice( edited );
}
@@ -338,5 +337,4 @@ bool ModemWidget::save()
return false;
- odebug << "ModemWidget::save saving modem1 data" << oendl;
_pppdata->setDevname( modemname->text() );
_pppdata->setModemDevice( modemdevice->currentText() );
@@ -350,4 +348,32 @@ 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,
const char *name)
@@ -489,6 +515,10 @@ void ModemWidget2::modemcmdsbutton()
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
@@ -47,4 +47,12 @@ public:
bool save();
+private slots:
+ /*
+ * temporarily commit configuration so queryModem
+ * will use 'current' settings
+ */
+ void slotBeforeModemQuery();
+ void slotAfterModemQuery();
+
/* private slots: */
/* void setmodemdc(int); */
@@ -72,4 +80,9 @@ private:
QCheckBox *modemlockfile;
PPPData *_pppdata;
+
+private:
+ QString m_oldModemDev, m_oldFlowControl, m_oldSpeed;
+ bool m_oldModemLock;
+ int m_oldModemTimeout;
};
@@ -81,4 +94,8 @@ public:
bool save();
+signals:
+ void sig_beforeQueryModem();
+ void sig_afterQueryModem();
+
private slots:
/* void waitfordtchanged(bool); */