summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-29 19:07:22 (UTC)
committer zecke <zecke>2002-10-29 19:07:22 (UTC)
commita575fd4c862693705018902b4482c5135a8cb6a2 (patch) (unidiff)
treebcdfd7b2b8f62b2fb766b8b8808e17c96668563c
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 (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
@@ -154,4 +154,5 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) {
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 ) );
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
@@ -21,4 +21,5 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
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
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
@@ -14,4 +14,6 @@
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.
@@ -54,12 +56,8 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name
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);
@@ -90,5 +88,5 @@ void Dialer::setHangupOnly()
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
@@ -143,8 +141,6 @@ void Dialer::trydial(const QString& number)
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
@@ -152,8 +148,6 @@ void Dialer::trydial(const QString& number)
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"))
@@ -188,6 +182,8 @@ void Dialer::trydial(const QString& number)
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") )
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
@@ -95,5 +95,11 @@ signals:
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 /**
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
@@ -14,5 +14,5 @@
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"
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
@@ -167,9 +167,5 @@ void IOSerial::dataArrived() {
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);
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
@@ -133,11 +133,12 @@ void ModemConfigWidget::load( const Profile& prof ) {
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
@@ -235,4 +236,8 @@ void ModemConfigWidget::save( Profile& prof ) {
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 ) {
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
@@ -67,9 +67,9 @@ void ProfileEditorDialog::initUI()
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