summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore 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
@@ -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: