-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 73 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 2 |
3 files changed, 64 insertions, 14 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 89a0e8d..10c16ef 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -1,227 +1,276 @@ | |||
1 | #include "dialer.h" | 1 | #include "dialer.h" |
2 | 2 | ||
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
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 | 10 | ||
10 | #include <unistd.h> | 11 | #include <unistd.h> |
11 | #include <string.h> | 12 | #include <string.h> |
13 | #include <fcntl.h> | ||
14 | #include <errno.h> | ||
12 | 15 | ||
13 | // State machine: | When an error occurs, we don't have to | 16 | // State machine: | When an error occurs, we don't have to |
14 | // | reset everything. | 17 | // | reset everything. |
15 | // (init) <------+ | But if the user wants to reset, | 18 | // (init) <------+ | But if the user wants to reset, |
16 | // | | | we stop dialing immediately. | 19 | // | | | we stop dialing immediately. |
17 | // v | | | 20 | // v | | |
18 | // (options) ----+ | Following the state machine is necessary | 21 | // (options) ----+ | Following the state machine is necessary |
19 | // | \ | to get determinable results. | 22 | // | \ | to get determinable results. |
20 | // v ^ | | 23 | // v ^ | |
21 | // (dial) ----+ | | 24 | // (dial) ----+ | |
22 | // | ^ | | 25 | // | ^ | |
23 | // v | | | 26 | // v | | |
24 | // (online) --+ | | 27 | // (online) --+ | |
25 | // | | | 28 | // | | |
26 | // v | | 29 | // v | |
27 | 30 | ||
28 | 31 | ||
29 | // from atconfigdialog | 32 | // from atconfigdialog |
30 | //initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); | 33 | //initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); |
31 | //resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); | 34 | //resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); |
32 | //dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 35 | //dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
33 | //dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 36 | //dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
34 | //dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 37 | //dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
35 | //dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 38 | //dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
36 | //dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 39 | //dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
37 | //dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 40 | //dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
38 | //connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); | 41 | //connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); |
39 | //hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); | 42 | //hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); |
40 | 43 | ||
41 | // from modemconfigwidget | 44 | // from modemconfigwidget |
42 | //int rad_flow = prof.readNumEntry("Flow"); | 45 | //int rad_flow = prof.readNumEntry("Flow"); |
43 | //int rad_parity = prof.readNumEntry("Parity"); | 46 | //int rad_parity = prof.readNumEntry("Parity"); |
44 | //int speed = prof.readNumEntry("Speed"); | 47 | //int speed = prof.readNumEntry("Speed"); |
45 | //QString number = prof.readEntry("Number"); | 48 | //QString number = prof.readEntry("Number"); |
46 | 49 | ||
47 | Dialer::Dialer(const Profile& profile, QWidget *parent, const char *name) | 50 | Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name) |
48 | : QDialog(parent, name, true), m_profile(profile) | 51 | : QDialog(parent, name, true), m_fd(fd), m_profile(profile) |
49 | { | 52 | { |
50 | QVBoxLayout *vbox; | 53 | QVBoxLayout *vbox; |
51 | QLabel *desc; | 54 | QLabel *desc; |
52 | 55 | ||
56 | //m_profile.writeEntry("InitString", "ATZ"); | ||
57 | //m_profile.writeEntry("DialPrefix1", "ATDT"); | ||
58 | //m_profile.writeEntry("Termination", "\n"); | ||
59 | |||
53 | usercancel = 0; | 60 | usercancel = 0; |
54 | 61 | ||
62 | fcntl(m_fd, F_SETFL, O_NONBLOCK); | ||
63 | |||
55 | desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); | 64 | desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); |
56 | progress = new QProgressBar(this); | 65 | progress = new QProgressBar(this); |
57 | status = new QLabel("", this); | 66 | status = new QLabel("", this); |
58 | status->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 67 | status->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
59 | cancel = new QPushButton(QObject::tr("Cancel"), this); | 68 | cancel = new QPushButton(QObject::tr("Cancel"), this); |
60 | 69 | ||
61 | vbox = new QVBoxLayout(this, 2); | 70 | vbox = new QVBoxLayout(this, 2); |
62 | vbox->add(desc); | 71 | vbox->add(desc); |
63 | vbox->add(progress); | 72 | vbox->add(progress); |
64 | vbox->add(status); | 73 | vbox->add(status); |
65 | vbox->add(cancel); | 74 | vbox->add(cancel); |
66 | 75 | ||
67 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); | 76 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); |
68 | 77 | ||
69 | show(); | 78 | show(); |
70 | 79 | ||
71 | QTimer::singleShot(500, this, SLOT(slotAutostart())); | 80 | QTimer::singleShot(500, this, SLOT(slotAutostart())); |
72 | } | 81 | } |
73 | 82 | ||
74 | Dialer::~Dialer() | 83 | Dialer::~Dialer() |
75 | { | 84 | { |
76 | } | 85 | } |
77 | 86 | ||
78 | void Dialer::slotCancel() | 87 | void Dialer::slotCancel() |
79 | { | 88 | { |
80 | if(state != state_online) | 89 | if(state != state_online) |
81 | { | 90 | { |
82 | usercancel = 1; | 91 | usercancel = 1; |
83 | reset(); | 92 | reset(); |
84 | } | 93 | } |
85 | else accept(); | 94 | else accept(); |
86 | } | 95 | } |
87 | 96 | ||
88 | void Dialer::reset() | 97 | void Dialer::reset() |
89 | { | 98 | { |
90 | switchState(state_cancel); | 99 | switchState(state_cancel); |
91 | } | 100 | } |
92 | 101 | ||
93 | void Dialer::slotAutostart() | 102 | void Dialer::slotAutostart() |
94 | { | 103 | { |
95 | state = state_preinit; | 104 | //state = state_preinit; |
96 | dial(m_profile.readEntry("Number")); | 105 | dial(m_profile.readEntry("Number")); |
97 | } | 106 | } |
98 | 107 | ||
99 | void Dialer::dial(const QString& number) | 108 | void Dialer::dial(const QString& number) |
100 | { | 109 | { |
101 | while(state != state_online) | 110 | while(state != state_online) |
102 | { | 111 | { |
103 | if(!usercancel) | 112 | if(!usercancel) |
104 | { | 113 | { |
114 | state = state_preinit; | ||
105 | trydial(number); | 115 | trydial(number); |
106 | } | 116 | } |
107 | else break; | 117 | else break; |
108 | } | 118 | } |
109 | 119 | ||
110 | if(usercancel) | 120 | if(usercancel) |
111 | { | 121 | { |
112 | reject(); | 122 | reject(); |
113 | } | 123 | } |
114 | } | 124 | } |
115 | 125 | ||
116 | void Dialer::trydial(const QString& number) | 126 | void Dialer::trydial(const QString& number) |
117 | { | 127 | { |
118 | if(state != state_cancel) | 128 | if(state != state_cancel) |
119 | { | 129 | { |
120 | switchState(state_preinit); | 130 | switchState(state_preinit); |
121 | // ... | 131 | send("+++ATH"); |
122 | QString response = receive(); | 132 | send(""); |
133 | //QString response = receive(); | ||
123 | } | 134 | } |
124 | 135 | ||
125 | if(state != state_cancel) | 136 | if(state != state_cancel) |
126 | { | 137 | { |
127 | switchState(state_init); | 138 | switchState(state_init); |
128 | //send("ATZ"); | 139 | send("ATZ"); |
129 | send(m_profile.readEntry("InitString")); | 140 | //send(m_profile.readEntry("InitString")); |
130 | QString response2 = receive(); | 141 | QString response2 = receive(); |
142 | if(!response2.contains("\nOK\r")) | ||
143 | reset(); | ||
131 | } | 144 | } |
132 | 145 | ||
133 | if(state != state_cancel) | 146 | if(state != state_cancel) |
134 | { | 147 | { |
135 | switchState(state_options); | 148 | switchState(state_options); |
136 | 149 | ||
137 | send("ATM0L0"); | 150 | send("ATM0L0"); |
138 | QString response3 = receive(); | 151 | QString response3 = receive(); |
152 | if(!response3.contains("\nOK\r")) | ||
153 | reset(); | ||
139 | } | 154 | } |
140 | 155 | ||
141 | if(state != state_cancel) | 156 | if(state != state_cancel) |
142 | { | 157 | { |
143 | switchState(state_dialtone); | 158 | switchState(state_dialtone); |
144 | 159 | ||
145 | send("ATX1"); | 160 | send("ATX1"); |
146 | QString response4 = receive(); | 161 | QString response4 = receive(); |
162 | if(!response4.contains("\nOK\r")) | ||
163 | reset(); | ||
147 | } | 164 | } |
148 | 165 | ||
149 | if(state != state_cancel) | 166 | if(state != state_cancel) |
150 | { | 167 | { |
151 | switchState(state_dialing); | 168 | switchState(state_dialing); |
152 | 169 | ||
153 | send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); | 170 | send(QString("ATDT %1").arg(number)); |
171 | //send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); | ||
154 | QString response5 = receive(); | 172 | QString response5 = receive(); |
173 | if(!response5.contains("\nOK\r")) | ||
174 | { | ||
175 | QMessageBox::warning(this, | ||
176 | QObject::tr("Failure"), | ||
177 | QObject::tr("Dialing the number failed.")); | ||
178 | slotCancel(); | ||
179 | } | ||
155 | } | 180 | } |
156 | 181 | ||
157 | if(state != state_cancel) | 182 | if(state != state_cancel) |
158 | { | 183 | { |
159 | switchState(state_online); | 184 | switchState(state_online); |
160 | } | 185 | } |
161 | } | 186 | } |
162 | 187 | ||
163 | void Dialer::send(const QString& msg) | 188 | void Dialer::send(const QString& msg) |
164 | { | 189 | { |
165 | QString m = msg; | 190 | QString m = msg; |
166 | int bytes; | 191 | int bytes; |
167 | QString termination; | 192 | QString termination; |
168 | 193 | ||
169 | termination = m_profile.readEntry("Termination"); | 194 | qWarning("Sending: '%s'", m.latin1()); |
195 | |||
196 | termination = "\r"; | ||
197 | //termination = m_profile.readEntry("Termination"); | ||
170 | if(termination == "\n") m = m + "\n"; | 198 | if(termination == "\n") m = m + "\n"; |
171 | else if(termination == "\r") m = m + "\r"; | 199 | else if(termination == "\r") m = m + "\r"; |
172 | else m = m + "\r\n"; | 200 | else m = m + "\r\n"; |
173 | 201 | ||
174 | bytes = write(0, m.local8Bit(), strlen(m.local8Bit())); | 202 | bytes = ::write(m_fd, m.local8Bit(), strlen(m.local8Bit())); |
175 | if(bytes < 0) | 203 | if(bytes < 0) |
176 | { | 204 | { |
177 | reset(); | 205 | reset(); |
178 | } | 206 | } |
179 | } | 207 | } |
180 | 208 | ||
181 | QString Dialer::receive() | 209 | QString Dialer::receive() |
182 | { | 210 | { |
183 | for(int i = 0; i < 200000;i++) | 211 | char buffer[1024]; |
184 | qApp->processEvents(); | 212 | int ret; |
213 | |||
214 | while(1) | ||
215 | { | ||
216 | ret = ::read(m_fd, buffer, sizeof(buffer)); | ||
217 | |||
218 | if(ret > 0) | ||
219 | { | ||
220 | for(int i = 0; i < ret; i++) | ||
221 | buffer[i] = buffer[i] & 0x7F; | ||
222 | buffer[ret] = 0; | ||
223 | qWarning("Receiving: '%s'", buffer); | ||
224 | return QString(buffer); | ||
225 | } | ||
226 | else if(ret < 0) | ||
227 | { | ||
228 | if(errno != EAGAIN) reset(); | ||
229 | } | ||
230 | } | ||
231 | |||
232 | //for(int i = 0; i < 200000;i++) | ||
233 | //qApp->processEvents(); | ||
185 | return QString::null; | 234 | return QString::null; |
186 | } | 235 | } |
187 | 236 | ||
188 | void Dialer::switchState(int newstate) | 237 | void Dialer::switchState(int newstate) |
189 | { | 238 | { |
190 | int oldstate = state; | 239 | int oldstate = state; |
191 | state = newstate; | 240 | state = newstate; |
192 | 241 | ||
193 | switch(state) | 242 | switch(state) |
194 | { | 243 | { |
195 | case state_cancel: | 244 | case state_cancel: |
196 | status->setText(QObject::tr("Cancelling...")); | 245 | status->setText(QObject::tr("Cancelling...")); |
197 | progress->setProgress(0); | 246 | progress->setProgress(0); |
198 | break; | 247 | break; |
199 | case state_preinit: | 248 | case state_preinit: |
200 | status->setText(QObject::tr("Searching modem")); | 249 | status->setText(QObject::tr("Searching modem")); |
201 | progress->setProgress(10); | 250 | progress->setProgress(10); |
202 | break; | 251 | break; |
203 | case state_init: | 252 | case state_init: |
204 | status->setText(QObject::tr("Initializing...")); | 253 | status->setText(QObject::tr("Initializing...")); |
205 | progress->setProgress(20); | 254 | progress->setProgress(20); |
206 | break; | 255 | break; |
207 | case state_options: | 256 | case state_options: |
208 | status->setText(QObject::tr("Reset speakers")); | 257 | status->setText(QObject::tr("Reset speakers")); |
209 | progress->setProgress(30); | 258 | progress->setProgress(30); |
210 | break; | 259 | break; |
211 | case state_dialtone: | 260 | case state_dialtone: |
212 | status->setText(QObject::tr("Turning off dialtone")); | 261 | status->setText(QObject::tr("Turning off dialtone")); |
213 | progress->setProgress(40); | 262 | progress->setProgress(40); |
214 | break; | 263 | break; |
215 | case state_dialing: | 264 | case state_dialing: |
216 | if(oldstate != state_dialing) status->setText(QObject::tr("Dial number")); | 265 | if(oldstate != state_dialing) status->setText(QObject::tr("Dial number")); |
217 | else status->setText(QObject::tr("Line busy, redialing number")); | 266 | else status->setText(QObject::tr("Line busy, redialing number")); |
218 | progress->setProgress(50); | 267 | progress->setProgress(50); |
219 | break; | 268 | break; |
220 | case state_online: | 269 | case state_online: |
221 | status->setText(QObject::tr("Connection established")); | 270 | status->setText(QObject::tr("Connection established")); |
222 | progress->setProgress(100); | 271 | progress->setProgress(100); |
223 | cancel->setText(QObject::tr("Dismiss")); | 272 | cancel->setText(QObject::tr("Dismiss")); |
224 | break; | 273 | break; |
225 | } | 274 | } |
226 | } | 275 | } |
227 | 276 | ||
diff --git a/noncore/apps/opie-console/dialer.h b/noncore/apps/opie-console/dialer.h index 09cc5ca..4011880 100644 --- a/noncore/apps/opie-console/dialer.h +++ b/noncore/apps/opie-console/dialer.h | |||
@@ -1,51 +1,52 @@ | |||
1 | #ifndef DIALER_H | 1 | #ifndef DIALER_H |
2 | #define DIALER_H | 2 | #define DIALER_H |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | 5 | ||
6 | #include "profile.h" | 6 | #include "profile.h" |
7 | 7 | ||
8 | class QLabel; | 8 | class QLabel; |
9 | class QProgressBar; | 9 | class QProgressBar; |
10 | 10 | ||
11 | class Dialer : public QDialog | 11 | class Dialer : public QDialog |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | Dialer(const Profile& profile, QWidget *parent = NULL, const char *name = NULL); | 15 | Dialer(const Profile& profile, int fd, QWidget *parent = NULL, const char *name = NULL); |
16 | ~Dialer(); | 16 | ~Dialer(); |
17 | 17 | ||
18 | public slots: | 18 | public slots: |
19 | void slotCancel(); | 19 | void slotCancel(); |
20 | void slotAutostart(); | 20 | void slotAutostart(); |
21 | 21 | ||
22 | private: | 22 | private: |
23 | void switchState(int newstate); | 23 | void switchState(int newstate); |
24 | void reset(); | 24 | void reset(); |
25 | void dial(const QString& number); | 25 | void dial(const QString& number); |
26 | void trydial(const QString& number); | 26 | void trydial(const QString& number); |
27 | 27 | ||
28 | void send(const QString& msg); | 28 | void send(const QString& msg); |
29 | QString receive(); | 29 | QString receive(); |
30 | 30 | ||
31 | enum States | 31 | enum States |
32 | { | 32 | { |
33 | state_cancel, | 33 | state_cancel, |
34 | state_preinit, | 34 | state_preinit, |
35 | state_init, | 35 | state_init, |
36 | state_options, | 36 | state_options, |
37 | state_dialtone, | 37 | state_dialtone, |
38 | state_dialing, | 38 | state_dialing, |
39 | state_online | 39 | state_online |
40 | }; | 40 | }; |
41 | 41 | ||
42 | QLabel *status; | 42 | QLabel *status; |
43 | QProgressBar *progress; | 43 | QProgressBar *progress; |
44 | QPushButton *cancel; | 44 | QPushButton *cancel; |
45 | int state; | 45 | int state; |
46 | int usercancel; | 46 | int usercancel; |
47 | const Profile& m_profile; | 47 | const Profile& m_profile; |
48 | int m_fd; | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | #endif | 51 | #endif |
51 | 52 | ||
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 41f553b..c04aad1 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,75 +1,75 @@ | |||
1 | 1 | ||
2 | #include "io_modem.h" | 2 | #include "io_modem.h" |
3 | 3 | ||
4 | #include "dialer.h" | 4 | #include "dialer.h" |
5 | 5 | ||
6 | IOModem::IOModem( const Profile &profile ) | 6 | IOModem::IOModem( const Profile &profile ) |
7 | : IOSerial( profile ) { | 7 | : IOSerial( profile ) { |
8 | m_profile = profile; | 8 | m_profile = profile; |
9 | } | 9 | } |
10 | 10 | ||
11 | 11 | ||
12 | IOModem::~IOModem() { | 12 | IOModem::~IOModem() { |
13 | 13 | ||
14 | } | 14 | } |
15 | 15 | ||
16 | 16 | ||
17 | void IOModem::close() { | 17 | void IOModem::close() { |
18 | // maybe do a hangup here just in case...? | 18 | // maybe do a hangup here just in case...? |
19 | 19 | ||
20 | IOSerial::close(); | 20 | IOSerial::close(); |
21 | } | 21 | } |
22 | 22 | ||
23 | bool IOModem::open() { | 23 | bool IOModem::open() { |
24 | bool ret = IOSerial::open(); | 24 | bool ret = IOSerial::open(); |
25 | if(!ret) return false; | 25 | if(!ret) return false; |
26 | 26 | ||
27 | Dialer d(m_profile); | 27 | Dialer d(m_profile, rawIO()); |
28 | 28 | ||
29 | int result = d.exec(); | 29 | int result = d.exec(); |
30 | if(result == QDialog::Accepted) | 30 | if(result == QDialog::Accepted) |
31 | { | 31 | { |
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | else | 34 | else |
35 | { | 35 | { |
36 | close(); | 36 | close(); |
37 | return false; | 37 | return false; |
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | void IOModem::reload( const Profile &config ) { | 41 | void IOModem::reload( const Profile &config ) { |
42 | 42 | ||
43 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); | 43 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); |
44 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); | 44 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); |
45 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); | 45 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); |
46 | m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS); | 46 | m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS); |
47 | m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS); | 47 | m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS); |
48 | m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW); | 48 | m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW); |
49 | 49 | ||
50 | m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ); | 50 | m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ); |
51 | m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ); | 51 | m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ); |
52 | m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ); | 52 | m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ); |
53 | m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 53 | m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
54 | m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ); | 54 | m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ); |
55 | m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 55 | m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
56 | m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ); | 56 | m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ); |
57 | m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 57 | m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
58 | m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); | 58 | m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); |
59 | m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); | 59 | m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); |
60 | m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); | 60 | m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); |
61 | m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); | 61 | m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); |
62 | m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); | 62 | m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); |
63 | m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); | 63 | m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); |
64 | m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); | 64 | m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); |
65 | m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); | 65 | m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); |
66 | m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); | 66 | m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); |
67 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); | 67 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); |
68 | } | 68 | } |
69 | 69 | ||
70 | 70 | ||
71 | QString IOModem::identifier() const { | 71 | QString IOModem::identifier() const { |
72 | return "modem"; | 72 | return "modem"; |
73 | } | 73 | } |
74 | 74 | ||
75 | QString IOModem::name() const { | 75 | QString IOModem::name() const { |