-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 4 |
4 files changed, 19 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index eb0aeb7..56147d8 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,34 +1,35 @@ | |||
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 &config ) : IOSerial( config ) { | 6 | IOModem::IOModem( const Profile &profile ) |
7 | m_config = config; | 7 | : IOSerial( profile ), m_profile( profile ) { |
8 | } | 8 | } |
9 | 9 | ||
10 | 10 | ||
11 | IOModem::~IOModem() { | 11 | IOModem::~IOModem() { |
12 | 12 | ||
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void IOModem::close() { | 16 | void IOModem::close() { |
17 | 17 | ||
18 | IOSerial::close(); | 18 | IOSerial::close(); |
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | bool IOModem::open() { | 22 | bool IOModem::open() { |
23 | qWarning("IOModem::open"); | ||
23 | IOSerial::open(); | 24 | IOSerial::open(); |
24 | 25 | ||
25 | Dialer d(m_profile); | 26 | Dialer d(m_profile); |
26 | int result = d.exec(); | 27 | int result = d.exec(); |
27 | if(result == QDialog::Accepted) | 28 | if(result == QDialog::Accepted) |
28 | { | 29 | { |
29 | return true; | 30 | return true; |
30 | } | 31 | } |
31 | else return false; | 32 | else return false; |
32 | } | 33 | } |
33 | 34 | ||
34 | void IOModem::reload( const Profile &config ) { | 35 | void IOModem::reload( const Profile &config ) { |
@@ -59,15 +60,16 @@ void IOModem::reload( const Profile &config ) { | |||
59 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); | 60 | m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); |
60 | } | 61 | } |
61 | 62 | ||
62 | 63 | ||
63 | QString IOModem::identifier() const { | 64 | QString IOModem::identifier() const { |
64 | return "modem"; | 65 | return "modem"; |
65 | } | 66 | } |
66 | 67 | ||
67 | QString IOModem::name() const { | 68 | QString IOModem::name() const { |
68 | return "Modem IO Layer"; | 69 | return "Modem IO Layer"; |
69 | } | 70 | } |
70 | 71 | ||
71 | void IOIrda::slotExited(OProcess* proc ){ | 72 | void IOModem::slotExited(OProcess* proc ){ |
72 | close(); | 73 | close(); |
73 | } | 74 | } |
75 | |||
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index 6d44349..d681f66 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h | |||
@@ -1,17 +1,18 @@ | |||
1 | #ifndef OPIE_IO_MODEM | 1 | #ifndef OPIE_IO_MODEM |
2 | #define OPIE_IO_MODEM | 2 | #define OPIE_IO_MODEM |
3 | 3 | ||
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 | 7 | ||
7 | /* Default values to be used if the profile information is incomplete */ | 8 | /* Default values to be used if the profile information is incomplete */ |
8 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" | 9 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" |
9 | #define MODEM_DEFAULT_BAUD 9600 | 10 | #define MODEM_DEFAULT_BAUD 9600 |
10 | #define MODEM_DEFAULT_PARITY 0 | 11 | #define MODEM_DEFAULT_PARITY 0 |
11 | #define MODEM_DEFAULT_DBITS 8 | 12 | #define MODEM_DEFAULT_DBITS 8 |
12 | #define MODEM_DEFAULT_SBITS 1 | 13 | #define MODEM_DEFAULT_SBITS 1 |
13 | #define MODEM_DEFAULT_FLOW 0 | 14 | #define MODEM_DEFAULT_FLOW 0 |
14 | 15 | ||
15 | #define MODEM_DEFAULT_INIT_STRING "~^M~ATZ^M~" | 16 | #define MODEM_DEFAULT_INIT_STRING "~^M~ATZ^M~" |
16 | #define MODEM_DEFAULT_RESET_STRING "~^M~ATZ^M~" | 17 | #define MODEM_DEFAULT_RESET_STRING "~^M~ATZ^M~" |
17 | #define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" | 18 | #define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" |
@@ -48,23 +49,23 @@ public: | |||
48 | signals: | 49 | signals: |
49 | void received(const QByteArray &); | 50 | void received(const QByteArray &); |
50 | void error(int, const QString &); | 51 | void error(int, const QString &); |
51 | 52 | ||
52 | public slots: | 53 | public slots: |
53 | bool open(); | 54 | bool open(); |
54 | void close(); | 55 | void close(); |
55 | void reload(const Profile &); | 56 | void reload(const Profile &); |
56 | 57 | ||
57 | private: | 58 | private: |
58 | 59 | ||
59 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, | 60 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, |
60 | m_dialSuf2, dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; | 61 | m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; |
61 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, | 62 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, |
62 | m_bpsDetect, m_dcdLines, m_multiLineUntag; | 63 | m_bpsDetect, m_dcdLines, m_multiLineUntag; |
63 | const Profile& m_profile; | 64 | const Profile& m_profile; |
64 | 65 | ||
65 | private slots: | 66 | private slots: |
66 | void slotExited(OProcess* proc); | 67 | void slotExited(OProcess* proc); |
67 | 68 | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | #endif | 71 | #endif |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 415259e..1adb43d 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,20 +1,21 @@ | |||
1 | 1 | ||
2 | #include <qaction.h> | 2 | #include <qaction.h> |
3 | #include <qmenubar.h> | 3 | #include <qmenubar.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qpopupmenu.h> | 5 | #include <qpopupmenu.h> |
6 | #include <qtoolbar.h> | 6 | #include <qtoolbar.h> |
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <opie/ofiledialog.h> | 8 | #include <opie/ofiledialog.h> |
9 | #include <qmessagebox.h> | ||
9 | 10 | ||
10 | #include "profileeditordialog.h" | 11 | #include "profileeditordialog.h" |
11 | #include "configdialog.h" | 12 | #include "configdialog.h" |
12 | #include "default.h" | 13 | #include "default.h" |
13 | #include "metafactory.h" | 14 | #include "metafactory.h" |
14 | #include "profile.h" | 15 | #include "profile.h" |
15 | #include "profilemanager.h" | 16 | #include "profilemanager.h" |
16 | #include "mainwindow.h" | 17 | #include "mainwindow.h" |
17 | #include "tabwidget.h" | 18 | #include "tabwidget.h" |
18 | #include "transferdialog.h" | 19 | #include "transferdialog.h" |
19 | #include "function_keyboard.h" | 20 | #include "function_keyboard.h" |
20 | #include "script.h" | 21 | #include "script.h" |
@@ -300,24 +301,33 @@ void MainWindow::slotClose() { | |||
300 | /* | 301 | /* |
301 | * We will get the name | 302 | * We will get the name |
302 | * Then the profile | 303 | * Then the profile |
303 | * and then we will make a profile | 304 | * and then we will make a profile |
304 | */ | 305 | */ |
305 | void MainWindow::slotProfile( int id) { | 306 | void MainWindow::slotProfile( int id) { |
306 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); | 307 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); |
307 | create( prof ); | 308 | create( prof ); |
308 | } | 309 | } |
309 | void MainWindow::create( const Profile& prof ) { | 310 | void MainWindow::create( const Profile& prof ) { |
310 | Session *ses = manager()->fromProfile( prof, tabWidget() ); | 311 | Session *ses = manager()->fromProfile( prof, tabWidget() ); |
311 | 312 | ||
313 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) | ||
314 | { | ||
315 | QMessageBox::warning(this, | ||
316 | QObject::tr("Session failed"), | ||
317 | QObject::tr("Cannot open session: Not all components were found.")); | ||
318 | //if(ses) delete ses; | ||
319 | return; | ||
320 | } | ||
321 | |||
312 | m_sessions.append( ses ); | 322 | m_sessions.append( ses ); |
313 | tabWidget()->add( ses ); | 323 | tabWidget()->add( ses ); |
314 | m_curSession = ses; | 324 | m_curSession = ses; |
315 | 325 | ||
316 | } | 326 | } |
317 | 327 | ||
318 | void MainWindow::slotTransfer() | 328 | void MainWindow::slotTransfer() |
319 | { | 329 | { |
320 | // if ( currentSession() ) { | 330 | // if ( currentSession() ) { |
321 | TransferDialog dlg(this); | 331 | TransferDialog dlg(this); |
322 | dlg.showMaximized(); | 332 | dlg.showMaximized(); |
323 | dlg.exec(); | 333 | dlg.exec(); |
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index ef6bc21..26bce83 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -1,17 +1,17 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on release | 2 | #CONFIG = qt warn_on release |
3 | CONFIG = qt debug | 3 | CONFIG = qt debug |
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h\ | 5 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ |
6 | file_layer.h filetransfer.h \ | 6 | file_layer.h filetransfer.h \ |
7 | metafactory.h \ | 7 | metafactory.h \ |
8 | session.h \ | 8 | session.h \ |
9 | mainwindow.h \ | 9 | mainwindow.h \ |
10 | profile.h \ | 10 | profile.h \ |
11 | profileconfig.h \ | 11 | profileconfig.h \ |
12 | profilemanager.h \ | 12 | profilemanager.h \ |
13 | configwidget.h \ | 13 | configwidget.h \ |
14 | tabwidget.h \ | 14 | tabwidget.h \ |
15 | configdialog.h \ | 15 | configdialog.h \ |
16 | emulation_layer.h \ | 16 | emulation_layer.h \ |
17 | vt102emulation.h \ | 17 | vt102emulation.h \ |
@@ -26,25 +26,25 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h\ | |||
26 | default.h \ | 26 | default.h \ |
27 | terminalwidget.h \ | 27 | terminalwidget.h \ |
28 | iolayerbase.h \ | 28 | iolayerbase.h \ |
29 | serialconfigwidget.h irdaconfigwidget.h \ | 29 | serialconfigwidget.h irdaconfigwidget.h \ |
30 | btconfigwidget.h modemconfigwidget.h \ | 30 | btconfigwidget.h modemconfigwidget.h \ |
31 | atconfigdialog.h dialdialog.h \ | 31 | atconfigdialog.h dialdialog.h \ |
32 | emulation_widget.h procctl.h \ | 32 | emulation_widget.h procctl.h \ |
33 | function_keyboard.h \ | 33 | function_keyboard.h \ |
34 | receive_layer.h filereceive.h \ | 34 | receive_layer.h filereceive.h \ |
35 | script.h \ | 35 | script.h \ |
36 | dialer.h | 36 | dialer.h |
37 | 37 | ||
38 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp \ | 38 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ |
39 | file_layer.cpp filetransfer.cpp \ | 39 | file_layer.cpp filetransfer.cpp \ |
40 | main.cpp \ | 40 | main.cpp \ |
41 | metafactory.cpp \ | 41 | metafactory.cpp \ |
42 | session.cpp \ | 42 | session.cpp \ |
43 | mainwindow.cpp \ | 43 | mainwindow.cpp \ |
44 | profile.cpp \ | 44 | profile.cpp \ |
45 | profileconfig.cpp \ | 45 | profileconfig.cpp \ |
46 | profilemanager.cpp \ | 46 | profilemanager.cpp \ |
47 | tabwidget.cpp \ | 47 | tabwidget.cpp \ |
48 | configdialog.cpp \ | 48 | configdialog.cpp \ |
49 | emulation_layer.cpp \ | 49 | emulation_layer.cpp \ |
50 | vt102emulation.cpp \ | 50 | vt102emulation.cpp \ |