summaryrefslogtreecommitdiff
path: root/noncore/apps
authorharlekin <harlekin>2002-10-13 21:10:15 (UTC)
committer harlekin <harlekin>2002-10-13 21:10:15 (UTC)
commit5a6ecdac2e62708b55300ca6eef8441fea0a7b05 (patch) (unidiff)
tree003577346dc8f9c73f1d86d8dd9d5038d6995662 /noncore/apps
parent03c81e6d55d1a837e543a00f6e0a7334e96f1eef (diff)
downloadopie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.zip
opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.gz
opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.bz2
fixes to modem stuff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/atconfigdialog.cpp41
-rw-r--r--noncore/apps/opie-console/atconfigdialog.h5
-rw-r--r--noncore/apps/opie-console/io_modem.cpp16
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp6
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp71
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.h6
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
@@ -151,8 +151,8 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) {
151} 151}
152 152
153 153
154void ATConfigDialog::readConfig() { 154void ATConfigDialog::readConfig( const Profile& config ) {
155/* 155
156 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); 156 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) );
157 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); 157 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) );
158 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 158 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) );
@@ -161,19 +161,36 @@ void ATConfigDialog::readConfig() {
161 dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 161 dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
162 dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 162 dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) );
163 dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 163 dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
164 connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); 164 connectLine->setText( config.readEntry("DefaultConnect", MODEM_DEFAULT_CONNECT_STRING ) );
165 hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); 165 hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) );
166 dialTimeSpin; 166 dialTimeSpin->setValue( config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ) );
167 delayRedialSpin; 167 delayRedialSpin->setValue( config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ) );
168 numberTriesSpin; 168 numberTriesSpin->setValue( config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ) );
169 dtrDropTimeSpin; 169 dtrDropTimeSpin->setValue( config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ) );
170 bpsDetectBox; 170 bpsDetectBox->setCurrentItem( config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ) );
171 cdLinesBox; 171 dcdLinesBox->setCurrentItem( config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ) );
172 multiLineUntagBox; 172 multiLineUntagBox->setCurrentItem( config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ) );
173*/
174} 173}
175 174
176void ATConfigDialog::writeConfig() { 175void ATConfigDialog::writeConfig( Profile& config ) {
176
177 config.writeEntry( "InitString", initStringLine->text() );
178 config.writeEntry( "ResetString", resetStringLine->text() );
179 config.writeEntry( "DialPrefix1", dialPref1Line->text() );
180 config.writeEntry( "DialSuffix1", dialSuf1Line->text() );
181 config.writeEntry( "DialPrefix2", dialPref2Line->text() );
182 config.writeEntry( "DialSuffix2", dialSuf2Line->text() );
183 config.writeEntry( "DialPrefix3", dialPref3Line->text() );
184 config.writeEntry( "DialSuffix3", dialSuf3Line->text() );
185 config.writeEntry( "DefaultConnect", connectLine->text() );
186 config.writeEntry( "HangupString", hangupLine->text() );
187 config.writeEntry( "DialTime", dialTimeSpin->value() );
188 config.writeEntry( "DelayRedial", delayRedialSpin->value() );
189 config.writeEntry( "NumberTries", numberTriesSpin->value() );
190 config.writeEntry( "DTRDRopTime", dtrDropTimeSpin->value() );
191 config.writeEntry( "BPSDetect", bpsDetectBox->currentItem() );
192 config.writeEntry( "DCDLines", dcdLinesBox->currentItem() );
193 config.writeEntry( "MultiLineUntag", multiLineUntagBox->currentItem() );
177 194
178} 195}
179 196
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
@@ -3,6 +3,7 @@
3#define ATCONFIGDIALOG_H 3#define ATCONFIGDIALOG_H
4 4
5#include <qdialog.h> 5#include <qdialog.h>
6#include "profile.h"
6 7
7#define MODEM_DEFAULT_INIT_STRING "~^M~ATZ^M~" 8#define MODEM_DEFAULT_INIT_STRING "~^M~ATZ^M~"
8#define MODEM_DEFAULT_RESET_STRING "~^M~ATZ^M~" 9#define MODEM_DEFAULT_RESET_STRING "~^M~ATZ^M~"
@@ -36,8 +37,8 @@ public:
36 37
37 ~ATConfigDialog(); 38 ~ATConfigDialog();
38 39
39 void readConfig(); 40 void readConfig( const Profile& );
40 void writeConfig(); 41 void writeConfig( Profile& );
41 42
42private: 43private:
43 QWidget *tab0( QWidget* parent); 44 QWidget *tab0( QWidget* parent);
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
@@ -49,14 +49,14 @@ void IOModem::reload( const Profile &config ) {
49 m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); 49 m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 );
50 m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); 50 m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING );
51 m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); 51 m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING );
52 m_cancel = config.readEntry("CancelString" MODEM_DEFAULT_CANCEL_STRING ); 52 m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING );
53 m_dialTime = config.readEntry("DialTime" MODEM_DEFAULT_DIAL_TIME ); 53 m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME );
54 m_delayRedial = config.readEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); 54 m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL );
55 m_numberTries = config.readEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); 55 m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES );
56 m_dtrDropTime = config.readEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); 56 m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME );
57 m_bpsDetect = config.readEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); 57 m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT );
58 m_dcdLines = config.readEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); 58 m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES );
59 m_multiLineUntag = config.readEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); 59 m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG );
60} 60}
61 61
62 62
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
@@ -316,11 +316,11 @@ void MainWindow::create( const Profile& prof ) {
316 316
317void MainWindow::slotTransfer() 317void MainWindow::slotTransfer()
318{ 318{
319 if ( currentSession() ) { 319 // if ( currentSession() ) {
320 TransferDialog dlg(this); 320 TransferDialog dlg(this);
321 //dlg.showMaximized(); 321 dlg.showMaximized();
322 dlg.exec(); 322 dlg.exec();
323 } 323 // }
324} 324}
325 325
326 326
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
@@ -5,9 +5,8 @@
5#include <qpushbutton.h> 5#include <qpushbutton.h>
6#include <qhbox.h> 6#include <qhbox.h>
7 7
8#include "iolayerbase.h" 8
9#include "modemconfigwidget.h" 9#include "modemconfigwidget.h"
10#include "atconfigdialog.h"
11#include "dialdialog.h" 10#include "dialdialog.h"
12 11
13namespace { 12namespace {
@@ -24,30 +23,29 @@ namespace {
24 } 23 }
25} 24}
26 25
27ModemConfigWidget::ModemConfigWidget( const QString& name, 26ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent,
28 QWidget* parent,
29 const char* na ) 27 const char* na )
30 : ProfileDialogConnectionWidget( name, parent, na ) { 28 : ProfileDialogConnectionWidget( name, parent, na ) {
31 29
32 m_lay = new QVBoxLayout(this ); 30 m_lay = new QVBoxLayout( this );
33 m_device = new QLabel(tr("Modem is attached to:"), this ); 31 m_device = new QLabel(tr( "Modem is attached to:" ), this );
34 m_deviceCmb = new QComboBox(this ); 32 m_deviceCmb = new QComboBox(this );
35 m_deviceCmb->setEditable( TRUE ); 33 m_deviceCmb->setEditable( TRUE );
36 34
37 QLabel* telLabel = new QLabel( this ); 35 QLabel* telLabel = new QLabel( this );
38 telLabel->setText( tr("Enter telefon number here:") ); 36 telLabel->setText( tr( "Enter telefon number here:" ) );
39 m_telNumber = new QLineEdit( this ); 37 m_telNumber = new QLineEdit( this );
40 QHBox *buttonBox = new QHBox( this ); 38 QHBox *buttonBox = new QHBox( this );
41 QPushButton *atButton = new QPushButton( buttonBox ); 39 QPushButton *atButton = new QPushButton( buttonBox );
42 atButton->setText( tr("AT commands") ); 40 atButton->setText( tr( "AT commands" ) );
43 connect( atButton, SIGNAL( clicked() ), this, SLOT( slotAT() ) ); 41 connect( atButton, SIGNAL( clicked() ), this, SLOT( slotAT() ) );
44 42
45 QPushButton *dialButton = new QPushButton( buttonBox ); 43 QPushButton *dialButton = new QPushButton( buttonBox );
46 dialButton->setText( tr("Enter number") ); 44 dialButton->setText( tr( "Enter number" ) );
47 connect( dialButton, SIGNAL( clicked() ), this, SLOT( slotDial() ) ); 45 connect( dialButton, SIGNAL( clicked() ), this, SLOT( slotDial() ) );
48 46
49 47
50 m_base = new IOLayerBase(this, "base"); 48 m_base = new IOLayerBase( this, "base" );
51 49
52 m_lay->addWidget( m_device ); 50 m_lay->addWidget( m_device );
53 m_lay->addWidget( m_deviceCmb ); 51 m_lay->addWidget( m_deviceCmb );
@@ -60,7 +58,7 @@ ModemConfigWidget::ModemConfigWidget( const QString& name,
60 m_deviceCmb->insertItem( "/dev/ttyS1" ); 58 m_deviceCmb->insertItem( "/dev/ttyS1" );
61 m_deviceCmb->insertItem( "/dev/ttyS2" ); 59 m_deviceCmb->insertItem( "/dev/ttyS2" );
62 60
63 61 atConf = new ATConfigDialog( this, "ATConfig", true );
64} 62}
65 63
66ModemConfigWidget::~ModemConfigWidget() { 64ModemConfigWidget::~ModemConfigWidget() {
@@ -68,16 +66,16 @@ ModemConfigWidget::~ModemConfigWidget() {
68} 66}
69void ModemConfigWidget::load( const Profile& prof ) { 67void ModemConfigWidget::load( const Profile& prof ) {
70 68
71 int rad_flow = prof.readNumEntry("Flow"); 69 int rad_flow = prof.readNumEntry( "Flow" );
72 int rad_parity = prof.readNumEntry("Parity"); 70 int rad_parity = prof.readNumEntry( "Parity" );
73 int speed = prof.readNumEntry("Speed"); 71 int speed = prof.readNumEntry( "Speed" );
74 QString number = prof.readEntry("Number"); 72 QString number = prof.readEntry( "Number" );
75 73
76 if (!number.isEmpty() ) { 74 if ( !number.isEmpty() ) {
77 m_telNumber->setText( number ); 75 m_telNumber->setText( number );
78 } 76 }
79 77
80 if (rad_flow == 1) { 78 if ( rad_flow == 1 ) {
81 m_base->setFlow( IOLayerBase::Hardware ); 79 m_base->setFlow( IOLayerBase::Hardware );
82 } else if (rad_flow == 2) { 80 } else if (rad_flow == 2) {
83 m_base->setFlow( IOLayerBase::Software ); 81 m_base->setFlow( IOLayerBase::Software );
@@ -85,7 +83,7 @@ void ModemConfigWidget::load( const Profile& prof ) {
85 m_base->setFlow( IOLayerBase::None ); 83 m_base->setFlow( IOLayerBase::None );
86 } 84 }
87 85
88 if (rad_parity == 1) { 86 if ( rad_parity == 1 ) {
89 m_base->setParity( IOLayerBase::Even ); 87 m_base->setParity( IOLayerBase::Even );
90 } else { 88 } else {
91 m_base->setParity( IOLayerBase::Odd ); 89 m_base->setParity( IOLayerBase::Odd );
@@ -93,27 +91,31 @@ void ModemConfigWidget::load( const Profile& prof ) {
93 91
94 switch( speed ) { 92 switch( speed ) {
95 case 115200: 93 case 115200:
96 m_base->setSpeed(IOLayerBase::Baud_115200 ); 94 m_base->setSpeed( IOLayerBase::Baud_115200 );
97 break; 95 break;
98 case 57600: 96 case 57600:
99 m_base->setSpeed( IOLayerBase::Baud_57600 ); 97 m_base->setSpeed( IOLayerBase::Baud_57600 );
100 break; 98 break;
101 case 38400: 99 case 38400:
102 m_base->setSpeed(IOLayerBase::Baud_38400 ); 100 m_base->setSpeed( IOLayerBase::Baud_38400 );
103 break; 101 break;
104 case 19200: 102 case 19200:
105 m_base->setSpeed( IOLayerBase::Baud_19200 ); 103 m_base->setSpeed( IOLayerBase::Baud_19200 );
106 break; 104 break;
107 case 9600: 105 case 9600:
108 default: 106 default:
109 m_base->setSpeed(IOLayerBase::Baud_9600 ); 107 m_base->setSpeed( IOLayerBase::Baud_9600 );
110 break; 108 break;
111 } 109 }
112 110
113 if ( prof.readEntry("Device").isEmpty() ) return; 111 if ( prof.readEntry( "Device" ).isEmpty() ) {
114 setCurrent( prof.readEntry("Device"), m_deviceCmb ); 112 return;
113 }
114 setCurrent( prof.readEntry( "Device" ), m_deviceCmb );
115 115
116 atConf->readConfig( prof );
116} 117}
118
117/* 119/*
118 * save speed, 120 * save speed,
119 * flow, 121 * flow,
@@ -121,7 +123,7 @@ void ModemConfigWidget::load( const Profile& prof ) {
121 */ 123 */
122void ModemConfigWidget::save( Profile& prof ) { 124void ModemConfigWidget::save( Profile& prof ) {
123 int flow, parity, speed; 125 int flow, parity, speed;
124 prof.writeEntry("Device", m_deviceCmb->currentText() ); 126 prof.writeEntry( "Device", m_deviceCmb->currentText() );
125 127
126 128
127 switch( m_base->flow() ) { 129 switch( m_base->flow() ) {
@@ -163,18 +165,17 @@ void ModemConfigWidget::save( Profile& prof ) {
163 break; 165 break;
164 } 166 }
165 167
166 prof.writeEntry("Flow", flow); 168 prof.writeEntry( "Flow", flow );
167 prof.writeEntry("Parity", parity); 169 prof.writeEntry( "Parity", parity );
168 prof.writeEntry("Speed", speed); 170 prof.writeEntry( "Speed", speed );
169 prof.writeEntry("Number", m_telNumber->text() ); 171 prof.writeEntry( "Number", m_telNumber->text() );
170} 172}
171 173
172void ModemConfigWidget::slotAT() { 174void ModemConfigWidget::slotAT() {
173 ATConfigDialog conf( this, "ATConfig", true ); 175 // ATConfigDialog conf( this, "ATConfig", true );
174 conf.readConfig(); 176 atConf->showMaximized();
175 conf.showMaximized(); 177 if ( atConf->exec() == QDialog::Accepted ) {
176 if ( conf.exec() == QDialog::Accepted ) { 178 // atConf->writeConfig();
177 conf.writeConfig();
178 } 179 }
179} 180}
180 181
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
@@ -2,7 +2,8 @@
2#define OPIE_MODEM_CONFIG_WIDGET_H 2#define OPIE_MODEM_CONFIG_WIDGET_H
3 3
4#include "profiledialogwidget.h" 4#include "profiledialogwidget.h"
5 5#include "iolayerbase.h"
6#include "atconfigdialog.h"
6 7
7class QVBoxLayout; 8class QVBoxLayout;
8class QLabel; 9class QLabel;
@@ -25,8 +26,7 @@ private:
25 QComboBox* m_deviceCmb; 26 QComboBox* m_deviceCmb;
26 IOLayerBase* m_base; 27 IOLayerBase* m_base;
27 QLineEdit* m_telNumber; 28 QLineEdit* m_telNumber;
28 29 ATConfigDialog *atConf;
29
30private slots: 30private slots:
31 void slotAT(); 31 void slotAT();
32 void slotDial(); 32 void slotDial();