summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
authorzecke <zecke>2002-10-29 19:07:22 (UTC)
committer zecke <zecke>2002-10-29 19:07:22 (UTC)
commita575fd4c862693705018902b4482c5135a8cb6a2 (patch) (unidiff)
treebcdfd7b2b8f62b2fb766b8b8808e17c96668563c /noncore/apps/opie-console
parent5ac67b8aece5aca20419f8953f88a36fd729adfc (diff)
downloadopie-a575fd4c862693705018902b4482c5135a8cb6a2.zip
opie-a575fd4c862693705018902b4482c5135a8cb6a2.tar.gz
opie-a575fd4c862693705018902b4482c5135a8cb6a2.tar.bz2
Make the Modem take custom Ats again
Supply default values set labels to richtext this way we achieve word wrap IO_Layer added a closed(IOLayer*) signal ProfileEditorDialog make Horizontal scrolling on the QScrollView possible. Once the Vertical Scrollbar is there the Modem dialog does not have enough space
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/atconfigdialog.cpp1
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp1
-rw-r--r--noncore/apps/opie-console/dialer.cpp26
-rw-r--r--noncore/apps/opie-console/io_layer.h6
-rw-r--r--noncore/apps/opie-console/io_modem.h2
-rw-r--r--noncore/apps/opie-console/io_serial.cpp6
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp9
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp4
8 files changed, 30 insertions, 25 deletions
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp
index 5c02692..e683ab3 100644
--- a/noncore/apps/opie-console/atconfigdialog.cpp
+++ b/noncore/apps/opie-console/atconfigdialog.cpp
@@ -144,24 +144,25 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) {
144 multiLineUntagBox = new QComboBox( returnWidget ); 144 multiLineUntagBox = new QComboBox( returnWidget );
145 layout->addWidget( multiLineUntagLabel, 6, 0 ); 145 layout->addWidget( multiLineUntagLabel, 6, 0 );
146 layout->addWidget( multiLineUntagBox, 6, 1 ); 146 layout->addWidget( multiLineUntagBox, 6, 1 );
147 multiLineUntagBox->insertItem( tr("No") ); 147 multiLineUntagBox->insertItem( tr("No") );
148 multiLineUntagBox->insertItem( tr("Yes") ); 148 multiLineUntagBox->insertItem( tr("Yes") );
149 149
150 return returnWidget; 150 return returnWidget;
151 151
152} 152}
153 153
154 154
155void ATConfigDialog::readConfig( const Profile& config ) { 155void ATConfigDialog::readConfig( const Profile& config ) {
156 qWarning("config in atconfigdialog");
156 157
157 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); 158 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) );
158 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); 159 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) );
159 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 160 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) );
160 dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 161 dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
161 dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 162 dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) );
162 dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 163 dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
163 dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 164 dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) );
164 dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 165 dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
165 connectLine->setText( config.readEntry("DefaultConnect", MODEM_DEFAULT_CONNECT_STRING ) ); 166 connectLine->setText( config.readEntry("DefaultConnect", MODEM_DEFAULT_CONNECT_STRING ) );
166 hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); 167 hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) );
167 dialTimeSpin->setValue( config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ) ); 168 dialTimeSpin->setValue( config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ) );
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp
index ac1e1db..b91727b 100644
--- a/noncore/apps/opie-console/dialdialog.cpp
+++ b/noncore/apps/opie-console/dialdialog.cpp
@@ -11,24 +11,25 @@
11#include "dialdialog.h" 11#include "dialdialog.h"
12 12
13 13
14 14
15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
16 : QDialog( parent, name, modal, fl ) { 16 : QDialog( parent, name, modal, fl ) {
17 17
18 setCaption( tr( "Enter number" ) ); 18 setCaption( tr( "Enter number" ) );
19 19
20 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 20 QVBoxLayout *mainLayout = new QVBoxLayout( this );
21 21
22 QLabel *textLabel = new QLabel( this ); 22 QLabel *textLabel = new QLabel( this );
23 textLabel->setTextFormat( QLabel::RichText );
23 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") ); 24 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") );
24 25
25 m_dialLine = new QLineEdit( this ); 26 m_dialLine = new QLineEdit( this );
26 m_dialLine->setReadOnly( true ); 27 m_dialLine->setReadOnly( true );
27 m_dialLine->setFrame( false ); 28 m_dialLine->setFrame( false );
28 m_dialLine->setAlignment( Qt::AlignLeft ); 29 m_dialLine->setAlignment( Qt::AlignLeft );
29 QFont dialLine_font( m_dialLine->font() ); 30 QFont dialLine_font( m_dialLine->font() );
30 dialLine_font.setBold( TRUE ); 31 dialLine_font.setBold( TRUE );
31 dialLine_font.setPointSize( 18 ); 32 dialLine_font.setPointSize( 18 );
32 m_dialLine->setFont( dialLine_font ); 33 m_dialLine->setFont( dialLine_font );
33 34
34 QWidget* dialWidget = new QWidget( this ); 35 QWidget* dialWidget = new QWidget( this );
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index 8524422..67ad10e 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -4,24 +4,26 @@
4#include <qprogressbar.h> 4#include <qprogressbar.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qpushbutton.h> 6#include <qpushbutton.h>
7#include <qapp.h> 7#include <qapp.h>
8#include <qtimer.h> 8#include <qtimer.h>
9#include <qmessagebox.h> 9#include <qmessagebox.h>
10 10
11#include <unistd.h> 11#include <unistd.h>
12#include <string.h> 12#include <string.h>
13#include <fcntl.h> 13#include <fcntl.h>
14#include <errno.h> 14#include <errno.h>
15 15
16#include "io_modem.h"
17
16// State machine: | When an error occurs, we don't have to 18// State machine: | When an error occurs, we don't have to
17// | reset everything. 19// | reset everything.
18// (init) <------+ | But if the user wants to reset, 20// (init) <------+ | But if the user wants to reset,
19// | | | we stop dialing immediately. 21// | | | we stop dialing immediately.
20// v | | 22// v | |
21// (options) ----+ | Following the state machine is necessary 23// (options) ----+ | Following the state machine is necessary
22// | \ | to get determinable results. 24// | \ | to get determinable results.
23// v ^ | 25// v ^ |
24// (dial) ----+ | 26// (dial) ----+ |
25// | ^ | 27// | ^ |
26// v | | 28// v | |
27// (online) --+ | 29// (online) --+ |
@@ -44,32 +46,28 @@
44// from modemconfigwidget 46// from modemconfigwidget
45//int rad_flow = prof.readNumEntry("Flow"); 47//int rad_flow = prof.readNumEntry("Flow");
46//int rad_parity = prof.readNumEntry("Parity"); 48//int rad_parity = prof.readNumEntry("Parity");
47//int speed = prof.readNumEntry("Speed"); 49//int speed = prof.readNumEntry("Speed");
48//QString number = prof.readEntry("Number"); 50//QString number = prof.readEntry("Number");
49 51
50Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name) 52Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name)
51: QDialog(parent, name, true), m_fd(fd), m_profile(profile) 53: QDialog(parent, name, true), m_fd(fd), m_profile(profile)
52{ 54{
53 QVBoxLayout *vbox; 55 QVBoxLayout *vbox;
54 QLabel *desc; 56 QLabel *desc;
55 57
56 //m_profile.writeEntry("InitString", "ATZ");
57 //m_profile.writeEntry("DialPrefix1", "ATDT");
58 //m_profile.writeEntry("Termination", "\n");
59 58
60 usercancel = 0; 59 usercancel = 0;
61 cleanshutdown = 0; 60 cleanshutdown = 0;
62 61
63 //fcntl(m_fd, F_SETFL, O_NONBLOCK);
64 62
65 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); 63 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this);
66 progress = new QProgressBar(this); 64 progress = new QProgressBar(this);
67 status = new QLabel("", this); 65 status = new QLabel("", this);
68 status->setFrameStyle(QFrame::Panel | QFrame::Sunken); 66 status->setFrameStyle(QFrame::Panel | QFrame::Sunken);
69 cancel = new QPushButton(QObject::tr("Cancel"), this); 67 cancel = new QPushButton(QObject::tr("Cancel"), this);
70 68
71 vbox = new QVBoxLayout(this, 2); 69 vbox = new QVBoxLayout(this, 2);
72 vbox->add(desc); 70 vbox->add(desc);
73 vbox->add(progress); 71 vbox->add(progress);
74 vbox->add(status); 72 vbox->add(status);
75 vbox->add(cancel); 73 vbox->add(cancel);
@@ -80,25 +78,25 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name
80 78
81 QTimer::singleShot(500, this, SLOT(slotAutostart())); 79 QTimer::singleShot(500, this, SLOT(slotAutostart()));
82} 80}
83 81
84Dialer::~Dialer() 82Dialer::~Dialer()
85{ 83{
86} 84}
87 85
88void Dialer::setHangupOnly() 86void Dialer::setHangupOnly()
89{ 87{
90 state = state_cancel; 88 state = state_cancel;
91 usercancel = 1; 89 usercancel = 1;
92 send("+++ATH\r"); 90 send( m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING )+"\r" );
93} 91}
94 92
95void Dialer::slotCancel() 93void Dialer::slotCancel()
96{ 94{
97 if(state != state_online) 95 if(state != state_online)
98 { 96 {
99 usercancel = 1; 97 usercancel = 1;
100 reset(); 98 reset();
101 } 99 }
102 else { 100 else {
103 accept(); 101 accept();
104 } 102 }
@@ -133,37 +131,33 @@ void Dialer::dial(const QString& number)
133 // modem hangup 131 // modem hangup
134 trydial(QString::null); 132 trydial(QString::null);
135 reject(); 133 reject();
136 } 134 }
137} 135}
138 136
139void Dialer::trydial(const QString& number) 137void Dialer::trydial(const QString& number)
140{ 138{
141 qWarning("TryDial:%s", number.latin1() ); 139 qWarning("TryDial:%s", number.latin1() );
142 if(state != state_cancel) switchState(state_preinit); 140 if(state != state_cancel) switchState(state_preinit);
143 if(cleanshutdown) 141 if(cleanshutdown)
144 { 142 {
145 qWarning("HangupString " + m_profile.readEntry("HangupString")); 143 qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING));
146 //send(m_profile.readEntry("HangupString")); 144 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r");
147 send("+++ATH\r");
148 //send("");
149 } 145 }
150 146
151 if(state != state_cancel) 147 if(state != state_cancel)
152 { 148 {
153 switchState(state_init); 149 switchState(state_init);
154 //send("ATZ"); 150// qWarning("Init String " + m_profile.readEntry("InitString") );
155 qWarning("Init String " + m_profile.readEntry("InitString") ); 151 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r");
156 // send(m_profile.readEntry("InitString", "AT"));
157 send("AT\r");
158 QString response2 = receive(); 152 QString response2 = receive();
159 if(!response2.contains("\nOK\r")) 153 if(!response2.contains("\nOK\r"))
160 reset(); 154 reset();
161 } 155 }
162 156
163 /*if(state != state_cancel) 157 /*if(state != state_cancel)
164 { 158 {
165 switchState(state_options); 159 switchState(state_options);
166 160
167 qWarning("ATM3l3"); 161 qWarning("ATM3l3");
168 send("ATM3L3\r"); 162 send("ATM3L3\r");
169 QString response3 = receive(); 163 QString response3 = receive();
@@ -178,26 +172,28 @@ void Dialer::trydial(const QString& number)
178 172
179 send("ATX1\r"); 173 send("ATX1\r");
180 QString response4 = receive(); 174 QString response4 = receive();
181 if(!response4.contains("\nOK\r")) 175 if(!response4.contains("\nOK\r"))
182 reset(); 176 reset();
183 } 177 }
184 178
185 if(state != state_cancel) 179 if(state != state_cancel)
186 { 180 {
187 qWarning("progress"); 181 qWarning("progress");
188 switchState(state_dialing); 182 switchState(state_dialing);
189 183
190 send(QString("ATDT %1\r").arg(number)); 184 // send(QString("ATDT %1\r").arg(number));
191 // send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); 185 send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ))
186 .arg(number));
187
192 QString response5 = receive(); 188 QString response5 = receive();
193 if(!response5.contains("CONNECT") ) 189 if(!response5.contains("CONNECT") )
194 { 190 {
195 if(response5.contains("BUSY")) 191 if(response5.contains("BUSY"))
196 switchState(state_dialing); 192 switchState(state_dialing);
197 else 193 else
198 { 194 {
199 QMessageBox::warning(this, 195 QMessageBox::warning(this,
200 QObject::tr("Failure"), 196 QObject::tr("Failure"),
201 QObject::tr("Dialing the number failed.")); 197 QObject::tr("Dialing the number failed."));
202 slotCancel(); 198 slotCancel();
203 } 199 }
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h
index af61099..ed4478b 100644
--- a/noncore/apps/opie-console/io_layer.h
+++ b/noncore/apps/opie-console/io_layer.h
@@ -85,25 +85,31 @@ signals:
85 /** 85 /**
86 * received input as QCString 86 * received input as QCString
87 */ 87 */
88 virtual void received( const QByteArray& ); 88 virtual void received( const QByteArray& );
89 89
90 /** 90 /**
91 * an error occured 91 * an error occured
92 * int for the error number 92 * int for the error number
93 * and QString for a text 93 * and QString for a text
94 */ 94 */
95 virtual void error( int, const QString& ); 95 virtual void error( int, const QString& );
96 96
97
97 virtual void closed(); 98 virtual void closed();
99
100 /* signal emitted for closure of the IOLayer
101 * for some reasons
102 */
103 virtual void closed(IOLayer*);
98public slots: 104public slots:
99 /** 105 /**
100 * send a QCString to the device 106 * send a QCString to the device
101 */ 107 */
102 virtual void send( const QByteArray& ) = 0; 108 virtual void send( const QByteArray& ) = 0;
103 109
104 /** 110 /**
105 * bool open 111 * bool open
106 */ 112 */
107 virtual bool open() = 0; 113 virtual bool open() = 0;
108 114
109 /** 115 /**
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h
index 1328706..17228bd 100644
--- a/noncore/apps/opie-console/io_modem.h
+++ b/noncore/apps/opie-console/io_modem.h
@@ -4,25 +4,25 @@
4#include <opie/oprocess.h> 4#include <opie/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
6#include "profile.h" 6#include "profile.h"
7 7
8/* Default values to be used if the profile information is incomplete */ 8/* Default values to be used if the profile information is incomplete */
9#define MODEM_DEFAULT_DEVICE "/dev/ttyS0" 9#define MODEM_DEFAULT_DEVICE "/dev/ttyS0"
10#define MODEM_DEFAULT_BAUD 9600 10#define MODEM_DEFAULT_BAUD 9600
11#define MODEM_DEFAULT_PARITY 0 11#define MODEM_DEFAULT_PARITY 0
12#define MODEM_DEFAULT_DBITS 8 12#define MODEM_DEFAULT_DBITS 8
13#define MODEM_DEFAULT_SBITS 1 13#define MODEM_DEFAULT_SBITS 1
14#define MODEM_DEFAULT_FLOW 0 14#define MODEM_DEFAULT_FLOW 0
15 15
16#define MODEM_DEFAULT_INIT_STRING "ATZ" 16#define MODEM_DEFAULT_INIT_STRING "AT"
17#define MODEM_DEFAULT_RESET_STRING "ATZ~" 17#define MODEM_DEFAULT_RESET_STRING "ATZ~"
18#define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" 18#define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT"
19#define MODEM_DEFAULT_DIAL_SUFFIX1 "" 19#define MODEM_DEFAULT_DIAL_SUFFIX1 ""
20#define MODEM_DEFAULT_DIAL_PREFIX2 "" 20#define MODEM_DEFAULT_DIAL_PREFIX2 ""
21#define MODEM_DEFAULT_DIAL_SUFFIX2 "" 21#define MODEM_DEFAULT_DIAL_SUFFIX2 ""
22#define MODEM_DEFAULT_DIAL_PREFIX3 "" 22#define MODEM_DEFAULT_DIAL_PREFIX3 ""
23#define MODEM_DEFAULT_DIAL_SUFFIX3 "" 23#define MODEM_DEFAULT_DIAL_SUFFIX3 ""
24#define MODEM_DEFAULT_CONNECT_STRING "CONNECT" 24#define MODEM_DEFAULT_CONNECT_STRING "CONNECT"
25#define MODEM_DEFAULT_HANGUP_STRING "+++ATH" 25#define MODEM_DEFAULT_HANGUP_STRING "+++ATH"
26#define MODEM_DEFAULT_CANCEL_STRING "" 26#define MODEM_DEFAULT_CANCEL_STRING ""
27#define MODEM_DEFAULT_DIAL_TIME 45 27#define MODEM_DEFAULT_DIAL_TIME 45
28#define MODEM_DEFAULT_DELAY_REDIAL 2 28#define MODEM_DEFAULT_DELAY_REDIAL 2
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 03e92dd..ddd4994 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -157,29 +157,25 @@ void IOSerial::errorOccured() {
157 emit error(ClosedUnexpected, strerror(errno)); 157 emit error(ClosedUnexpected, strerror(errno));
158 close(); 158 close();
159} 159}
160 160
161void IOSerial::dataArrived() { 161void IOSerial::dataArrived() {
162 QByteArray array(4097); 162 QByteArray array(4097);
163 163
164 int len = read(m_fd, array.data(), 4096); 164 int len = read(m_fd, array.data(), 4096);
165 if (len == 0) 165 if (len == 0)
166 close(); 166 close();
167 if (len < 0) 167 if (len < 0)
168 return; 168 return;
169 qWarning("got from layer"); 169
170 for (int i = 0; i < len; i++ ) {
171 printf("%c", array[i] );
172 }
173 printf("\n");
174 array.resize( len ); 170 array.resize( len );
175 emit received(array); 171 emit received(array);
176} 172}
177 173
178QString IOSerial::identifier() const { 174QString IOSerial::identifier() const {
179 return "serial"; 175 return "serial";
180} 176}
181 177
182QString IOSerial::name() const { 178QString IOSerial::name() const {
183 return "RS232 Serial IO Layer"; 179 return "RS232 Serial IO Layer";
184} 180}
185int IOSerial::rawIO()const { 181int IOSerial::rawIO()const {
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 37eb184..f7fb6f3 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -123,31 +123,32 @@ void ModemConfigWidget::load( const Profile& prof ) {
123 m_base->setData( IOLayerBase::Data_Eight ); 123 m_base->setData( IOLayerBase::Data_Eight );
124 } 124 }
125 125
126 if ( sbits == 2) { 126 if ( sbits == 2) {
127 m_base->setStop( IOLayerBase::Stop_Two ); 127 m_base->setStop( IOLayerBase::Stop_Two );
128 } else if ( sbits == 15 ) { 128 } else if ( sbits == 15 ) {
129 m_base->setStop( IOLayerBase::Stop_OnePointFive ); 129 m_base->setStop( IOLayerBase::Stop_OnePointFive );
130 } else { 130 } else {
131 m_base->setStop( IOLayerBase::Stop_One ); 131 m_base->setStop( IOLayerBase::Stop_One );
132 } 132 }
133 133
134 134
135 135 atConf->readConfig( prof );
136 if ( prof.readEntry( "Device" ).isEmpty() ) { 136 if ( prof.readEntry( "Device" ).isEmpty() ) {
137 qWarning("device empty!");
137 return; 138 return;
138 } 139 }
139 setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); 140 setCurrent( prof.readEntry( "Device" ), m_deviceCmb );
140 141
141 atConf->readConfig( prof ); 142
142} 143}
143 144
144/* 145/*
145 * save speed, 146 * save speed,
146 * flow, 147 * flow,
147 * parity 148 * parity
148 */ 149 */
149void ModemConfigWidget::save( Profile& prof ) { 150void ModemConfigWidget::save( Profile& prof ) {
150 int flow, parity, speed, data, stop; 151 int flow, parity, speed, data, stop;
151 flow = parity = speed = data = stop = 0; 152 flow = parity = speed = data = stop = 0;
152 prof.writeEntry( "Device", m_deviceCmb->currentText() ); 153 prof.writeEntry( "Device", m_deviceCmb->currentText() );
153 154
@@ -225,24 +226,28 @@ void ModemConfigWidget::save( Profile& prof ) {
225 prof.writeEntry( "Parity", parity ); 226 prof.writeEntry( "Parity", parity );
226 prof.writeEntry( "Speed", speed ); 227 prof.writeEntry( "Speed", speed );
227 prof.writeEntry("DataBits", data); 228 prof.writeEntry("DataBits", data);
228 prof.writeEntry("StopBits", stop); 229 prof.writeEntry("StopBits", stop);
229 prof.writeEntry( "Number", m_telNumber->text() ); 230 prof.writeEntry( "Number", m_telNumber->text() );
230 231
231 232
232 atConf->writeConfig(prof); 233 atConf->writeConfig(prof);
233} 234}
234 235
235void ModemConfigWidget::slotAT() { 236void ModemConfigWidget::slotAT() {
236 // ATConfigDialog conf( this, "ATConfig", true ); 237 // ATConfigDialog conf( this, "ATConfig", true );
238 // josef/Max I know why don't you create the stuff on the stack
239 // but making it a TopLevel Dialog and ignoring
240 // cancel is not fun either...
241 // what to do? FIXME!!! -zecke
237 atConf->showMaximized(); 242 atConf->showMaximized();
238 if ( atConf->exec() != QDialog::Accepted ) { 243 if ( atConf->exec() != QDialog::Accepted ) {
239 // reload old settings 244 // reload old settings
240 } 245 }
241} 246}
242 247
243void ModemConfigWidget::slotDial() { 248void ModemConfigWidget::slotDial() {
244 DialDialog dial( this, "DialConfig", true ); 249 DialDialog dial( this, "DialConfig", true );
245 if(!m_telNumber->text().isEmpty()) { 250 if(!m_telNumber->text().isEmpty()) {
246 dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), "")); 251 dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), ""));
247 } 252 }
248 dial.showMaximized(); 253 dial.showMaximized();
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 36daaef..fd04b6b 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -57,29 +57,29 @@ void ProfileEditorDialog::initUI()
57 tabWidget = new OTabWidget( this ); 57 tabWidget = new OTabWidget( this );
58 tabWidget->setTabStyle(OTabWidget::TextTab); 58 tabWidget->setTabStyle(OTabWidget::TextTab);
59 mainLayout->add(tabWidget); 59 mainLayout->add(tabWidget);
60 60
61 /* base tabs */ 61 /* base tabs */
62 tabprof = new QWidget(this); 62 tabprof = new QWidget(this);
63 m_tabTerm = new QWidget(this); 63 m_tabTerm = new QWidget(this);
64 m_tabCon = new QWidget(this); 64 m_tabCon = new QWidget(this);
65 m_tabKey = new QWidget(this); 65 m_tabKey = new QWidget(this);
66 66
67 m_svCon = new QScrollView( m_tabCon ); 67 m_svCon = new QScrollView( m_tabCon );
68 m_svCon->setResizePolicy( QScrollView::AutoOneFit ); 68 m_svCon->setResizePolicy( QScrollView::AutoOneFit );
69 m_svCon->setHScrollBarMode( QScrollView::AlwaysOff ); 69 //m_svCon->setHScrollBarMode( QScrollView::AlwaysOff );
70 m_svCon->setFrameShape( QFrame::NoFrame ); 70 m_svCon->setFrameShape( QFrame::NoFrame );
71 m_svTerm = new QScrollView( m_tabTerm ); 71 m_svTerm = new QScrollView( m_tabTerm );
72 m_svTerm->setResizePolicy( QScrollView::AutoOneFit ); 72 m_svTerm->setResizePolicy( QScrollView::AutoOneFit );
73 m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff ); 73 //m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff );
74 m_svTerm->setFrameShape( QFrame::NoFrame ); 74 m_svTerm->setFrameShape( QFrame::NoFrame );
75 75
76 /* base layout for tabs */ 76 /* base layout for tabs */
77 m_layCon = new QHBoxLayout( m_tabCon , 2 ); 77 m_layCon = new QHBoxLayout( m_tabCon , 2 );
78 m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); 78 m_layTerm = new QHBoxLayout( m_tabTerm, 2 );
79 m_layKey = new QHBoxLayout( m_tabKey, 2 ); 79 m_layKey = new QHBoxLayout( m_tabKey, 2 );
80 80
81 m_layCon->addWidget( m_svCon ); 81 m_layCon->addWidget( m_svCon );
82 m_layTerm->addWidget( m_svTerm ); 82 m_layTerm->addWidget( m_svTerm );
83 83
84 // profile tab 84 // profile tab
85 85