author | harlekin <harlekin> | 2002-10-13 21:10:15 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-13 21:10:15 (UTC) |
commit | 5a6ecdac2e62708b55300ca6eef8441fea0a7b05 (patch) (side-by-side diff) | |
tree | 003577346dc8f9c73f1d86d8dd9d5038d6995662 | |
parent | 03c81e6d55d1a837e543a00f6e0a7334e96f1eef (diff) | |
download | opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.zip opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.gz opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.bz2 |
fixes to modem stuff
-rw-r--r-- | noncore/apps/opie-console/atconfigdialog.cpp | 41 | ||||
-rw-r--r-- | noncore/apps/opie-console/atconfigdialog.h | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 71 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.h | 6 |
6 files changed, 82 insertions, 63 deletions
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp index ef6d1ae..87a08f6 100644 --- a/noncore/apps/opie-console/atconfigdialog.cpp +++ b/noncore/apps/opie-console/atconfigdialog.cpp @@ -153,4 +153,4 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) { -void ATConfigDialog::readConfig() { -/* +void ATConfigDialog::readConfig( const Profile& config ) { + initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); @@ -163,15 +163,32 @@ void ATConfigDialog::readConfig() { dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); - connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); + connectLine->setText( config.readEntry("DefaultConnect", MODEM_DEFAULT_CONNECT_STRING ) ); hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); - dialTimeSpin; - delayRedialSpin; - numberTriesSpin; - dtrDropTimeSpin; - bpsDetectBox; - cdLinesBox; - multiLineUntagBox; -*/ + dialTimeSpin->setValue( config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ) ); + delayRedialSpin->setValue( config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ) ); + numberTriesSpin->setValue( config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ) ); + dtrDropTimeSpin->setValue( config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ) ); + bpsDetectBox->setCurrentItem( config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ) ); + dcdLinesBox->setCurrentItem( config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ) ); + multiLineUntagBox->setCurrentItem( config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ) ); } -void ATConfigDialog::writeConfig() { +void ATConfigDialog::writeConfig( Profile& config ) { + + config.writeEntry( "InitString", initStringLine->text() ); + config.writeEntry( "ResetString", resetStringLine->text() ); + config.writeEntry( "DialPrefix1", dialPref1Line->text() ); + config.writeEntry( "DialSuffix1", dialSuf1Line->text() ); + config.writeEntry( "DialPrefix2", dialPref2Line->text() ); + config.writeEntry( "DialSuffix2", dialSuf2Line->text() ); + config.writeEntry( "DialPrefix3", dialPref3Line->text() ); + config.writeEntry( "DialSuffix3", dialSuf3Line->text() ); + config.writeEntry( "DefaultConnect", connectLine->text() ); + config.writeEntry( "HangupString", hangupLine->text() ); + config.writeEntry( "DialTime", dialTimeSpin->value() ); + config.writeEntry( "DelayRedial", delayRedialSpin->value() ); + config.writeEntry( "NumberTries", numberTriesSpin->value() ); + config.writeEntry( "DTRDRopTime", dtrDropTimeSpin->value() ); + config.writeEntry( "BPSDetect", bpsDetectBox->currentItem() ); + config.writeEntry( "DCDLines", dcdLinesBox->currentItem() ); + config.writeEntry( "MultiLineUntag", multiLineUntagBox->currentItem() ); diff --git a/noncore/apps/opie-console/atconfigdialog.h b/noncore/apps/opie-console/atconfigdialog.h index 47ff01d..4dd033b 100644 --- a/noncore/apps/opie-console/atconfigdialog.h +++ b/noncore/apps/opie-console/atconfigdialog.h @@ -5,2 +5,3 @@ #include <qdialog.h> +#include "profile.h" @@ -38,4 +39,4 @@ public: - void readConfig(); - void writeConfig(); + void readConfig( const Profile& ); + void writeConfig( Profile& ); diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 41febfb..eb0aeb7 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -51,10 +51,10 @@ void IOModem::reload( const Profile &config ) { m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); - m_cancel = config.readEntry("CancelString" MODEM_DEFAULT_CANCEL_STRING ); - m_dialTime = config.readEntry("DialTime" MODEM_DEFAULT_DIAL_TIME ); - m_delayRedial = config.readEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); - m_numberTries = config.readEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); - m_dtrDropTime = config.readEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); - m_bpsDetect = config.readEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); - m_dcdLines = config.readEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); - m_multiLineUntag = config.readEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); + m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); + m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); + m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); + m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); + m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); + m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); + m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); + m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); } diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index bfd1c2e..27bcc09 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -318,7 +318,7 @@ void MainWindow::slotTransfer() { - if ( currentSession() ) { + // if ( currentSession() ) { TransferDialog dlg(this); - //dlg.showMaximized(); + dlg.showMaximized(); dlg.exec(); - } + // } } diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 0968f62..ac62e45 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp @@ -7,5 +7,4 @@ -#include "iolayerbase.h" + #include "modemconfigwidget.h" -#include "atconfigdialog.h" #include "dialdialog.h" @@ -26,4 +25,3 @@ namespace { -ModemConfigWidget::ModemConfigWidget( const QString& name, - QWidget* parent, +ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, const char* na ) @@ -31,4 +29,4 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, - m_lay = new QVBoxLayout(this ); - m_device = new QLabel(tr("Modem is attached to:"), this ); + m_lay = new QVBoxLayout( this ); + m_device = new QLabel(tr( "Modem is attached to:" ), this ); m_deviceCmb = new QComboBox(this ); @@ -37,3 +35,3 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QLabel* telLabel = new QLabel( this ); - telLabel->setText( tr("Enter telefon number here:") ); + telLabel->setText( tr( "Enter telefon number here:" ) ); m_telNumber = new QLineEdit( this ); @@ -41,3 +39,3 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QPushButton *atButton = new QPushButton( buttonBox ); - atButton->setText( tr("AT commands") ); + atButton->setText( tr( "AT commands" ) ); connect( atButton, SIGNAL( clicked() ), this, SLOT( slotAT() ) ); @@ -45,3 +43,3 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QPushButton *dialButton = new QPushButton( buttonBox ); - dialButton->setText( tr("Enter number") ); + dialButton->setText( tr( "Enter number" ) ); connect( dialButton, SIGNAL( clicked() ), this, SLOT( slotDial() ) ); @@ -49,3 +47,3 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, - m_base = new IOLayerBase(this, "base"); + m_base = new IOLayerBase( this, "base" ); @@ -62,3 +60,3 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, - + atConf = new ATConfigDialog( this, "ATConfig", true ); } @@ -70,8 +68,8 @@ void ModemConfigWidget::load( const Profile& prof ) { - int rad_flow = prof.readNumEntry("Flow"); - int rad_parity = prof.readNumEntry("Parity"); - int speed = prof.readNumEntry("Speed"); - QString number = prof.readEntry("Number"); + int rad_flow = prof.readNumEntry( "Flow" ); + int rad_parity = prof.readNumEntry( "Parity" ); + int speed = prof.readNumEntry( "Speed" ); + QString number = prof.readEntry( "Number" ); - if (!number.isEmpty() ) { + if ( !number.isEmpty() ) { m_telNumber->setText( number ); @@ -79,3 +77,3 @@ void ModemConfigWidget::load( const Profile& prof ) { - if (rad_flow == 1) { + if ( rad_flow == 1 ) { m_base->setFlow( IOLayerBase::Hardware ); @@ -87,3 +85,3 @@ void ModemConfigWidget::load( const Profile& prof ) { - if (rad_parity == 1) { + if ( rad_parity == 1 ) { m_base->setParity( IOLayerBase::Even ); @@ -95,12 +93,12 @@ void ModemConfigWidget::load( const Profile& prof ) { case 115200: - m_base->setSpeed(IOLayerBase::Baud_115200 ); + m_base->setSpeed( IOLayerBase::Baud_115200 ); break; case 57600: - m_base->setSpeed( IOLayerBase::Baud_57600 ); + m_base->setSpeed( IOLayerBase::Baud_57600 ); break; case 38400: - m_base->setSpeed(IOLayerBase::Baud_38400 ); + m_base->setSpeed( IOLayerBase::Baud_38400 ); break; case 19200: - m_base->setSpeed( IOLayerBase::Baud_19200 ); + m_base->setSpeed( IOLayerBase::Baud_19200 ); break; @@ -108,3 +106,3 @@ void ModemConfigWidget::load( const Profile& prof ) { default: - m_base->setSpeed(IOLayerBase::Baud_9600 ); + m_base->setSpeed( IOLayerBase::Baud_9600 ); break; @@ -112,6 +110,10 @@ void ModemConfigWidget::load( const Profile& prof ) { - if ( prof.readEntry("Device").isEmpty() ) return; - setCurrent( prof.readEntry("Device"), m_deviceCmb ); + if ( prof.readEntry( "Device" ).isEmpty() ) { + return; + } + setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); + atConf->readConfig( prof ); } + /* @@ -123,3 +125,3 @@ void ModemConfigWidget::save( Profile& prof ) { int flow, parity, speed; - prof.writeEntry("Device", m_deviceCmb->currentText() ); + prof.writeEntry( "Device", m_deviceCmb->currentText() ); @@ -165,6 +167,6 @@ void ModemConfigWidget::save( Profile& prof ) { - prof.writeEntry("Flow", flow); - prof.writeEntry("Parity", parity); - prof.writeEntry("Speed", speed); - prof.writeEntry("Number", m_telNumber->text() ); + prof.writeEntry( "Flow", flow ); + prof.writeEntry( "Parity", parity ); + prof.writeEntry( "Speed", speed ); + prof.writeEntry( "Number", m_telNumber->text() ); } @@ -172,7 +174,6 @@ void ModemConfigWidget::save( Profile& prof ) { void ModemConfigWidget::slotAT() { - ATConfigDialog conf( this, "ATConfig", true ); - conf.readConfig(); - conf.showMaximized(); - if ( conf.exec() == QDialog::Accepted ) { - conf.writeConfig(); + // ATConfigDialog conf( this, "ATConfig", true ); + atConf->showMaximized(); + if ( atConf->exec() == QDialog::Accepted ) { + // atConf->writeConfig(); } diff --git a/noncore/apps/opie-console/modemconfigwidget.h b/noncore/apps/opie-console/modemconfigwidget.h index 1363f78..4fdde0c 100644 --- a/noncore/apps/opie-console/modemconfigwidget.h +++ b/noncore/apps/opie-console/modemconfigwidget.h @@ -4,3 +4,4 @@ #include "profiledialogwidget.h" - +#include "iolayerbase.h" +#include "atconfigdialog.h" @@ -27,4 +28,3 @@ private: QLineEdit* m_telNumber; - - + ATConfigDialog *atConf; private slots: |