-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index e1f9ff1..f246d81 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,87 +1,89 @@ | |||
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 | // Hangup, discarding result | 18 | // Hangup, discarding result |
19 | Dialer d(m_profile, rawIO()); | 19 | int fd = rawIO(); |
20 | Dialer d(m_profile, fd); | ||
20 | d.setHangupOnly(); | 21 | d.setHangupOnly(); |
21 | d.exec(); | 22 | d.exec(); |
22 | closeRawIO(); | 23 | closeRawIO(fd); |
23 | 24 | ||
24 | IOSerial::close(); | 25 | IOSerial::close(); |
25 | } | 26 | } |
26 | 27 | ||
27 | bool IOModem::open() { | 28 | bool IOModem::open() { |
28 | bool ret = IOSerial::open(); | 29 | bool ret = IOSerial::open(); |
29 | if(!ret) return false; | 30 | if(!ret) return false; |
30 | 31 | ||
31 | Dialer d(m_profile, rawIO()); | 32 | int fd = rawIO(); |
33 | Dialer d(m_profile, fd); | ||
32 | 34 | ||
33 | int result = d.exec(); | 35 | int result = d.exec(); |
34 | closeRawIO(); | 36 | closeRawIO(fd); |
35 | if(result == QDialog::Accepted) | 37 | if(result == QDialog::Accepted) |
36 | { | 38 | { |
37 | return true; | 39 | return true; |
38 | } | 40 | } |
39 | else | 41 | else |
40 | { | 42 | { |
41 | close(); | 43 | close(); |
42 | return false; | 44 | return false; |
43 | } | 45 | } |
44 | } | 46 | } |
45 | 47 | ||
46 | void IOModem::reload( const Profile &config ) { | 48 | void IOModem::reload( const Profile &config ) { |
47 | 49 | ||
48 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); | 50 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); |
49 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); | 51 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); |
50 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); | 52 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); |
51 | m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS); | 53 | m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS); |
52 | m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS); | 54 | m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS); |
53 | m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW); | 55 | m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW); |
54 | 56 | ||
55 | m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ); | 57 | m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ); |
56 | m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ); | 58 | m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ); |
57 | m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ); | 59 | m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ); |
58 | m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 60 | m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
59 | m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ); | 61 | m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ); |
60 | m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 62 | m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
61 | m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ); | 63 | m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ); |
62 | m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); | 64 | m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); |
63 | m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); | 65 | m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); |
64 | m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); | 66 | m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); |
65 | m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); | 67 | m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); |
66 | m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); | 68 | m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); |
67 | m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); | 69 | m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); |
68 | m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); | 70 | m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); |
69 | m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); | 71 | m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); |
70 | m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); | 72 | m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); |
71 | m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); | 73 | m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); |
72 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); | 74 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); |
73 | } | 75 | } |
74 | 76 | ||
75 | 77 | ||
76 | QString IOModem::identifier() const { | 78 | QString IOModem::identifier() const { |
77 | return "modem"; | 79 | return "modem"; |
78 | } | 80 | } |
79 | 81 | ||
80 | QString IOModem::name() const { | 82 | QString IOModem::name() const { |
81 | return "Modem IO Layer"; | 83 | return "Modem IO Layer"; |
82 | } | 84 | } |
83 | 85 | ||
84 | void IOModem::slotExited(OProcess* proc ){ | 86 | void IOModem::slotExited(OProcess* proc ){ |
85 | close(); | 87 | close(); |
86 | } | 88 | } |
87 | 89 | ||