summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-14 17:21:03 (UTC)
committer josef <josef>2002-10-14 17:21:03 (UTC)
commit51e18b363eb37621479a059af58da3040db1be7e (patch) (unidiff)
tree0099ca456633dda2ef68c3336a1541ecb95d1ae8
parent49d40f92a6988a3deaf9b775803092616d312403 (diff)
downloadopie-51e18b363eb37621479a059af58da3040db1be7e.zip
opie-51e18b363eb37621479a059af58da3040db1be7e.tar.gz
opie-51e18b363eb37621479a059af58da3040db1be7e.tar.bz2
- only allow sessions if all components (layer, widgetstack) are available
- add io_modem to .pro file so it gets compiled - fix io_modem compilation (untested, but better than nothing)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_modem.cpp8
-rw-r--r--noncore/apps/opie-console/io_modem.h3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
-rw-r--r--noncore/apps/opie-console/opie-console.pro4
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,13 +1,13 @@
1 1
2#include "io_modem.h" 2#include "io_modem.h"
3 3
4#include "dialer.h" 4#include "dialer.h"
5 5
6IOModem:IOModem( const Profile &config ) : IOSerial( config ) { 6IOModem::IOModem( const Profile &profile )
7 m_config = config; 7 : IOSerial( profile ), m_profile( profile ) {
8} 8}
9 9
10 10
11IOModem::~IOModem() { 11IOModem::~IOModem() {
12 12
13} 13}
@@ -17,12 +17,13 @@ void IOModem::close() {
17 17
18 IOSerial::close(); 18 IOSerial::close();
19 19
20} 20}
21 21
22bool IOModem::open() { 22bool 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 {
@@ -65,9 +66,10 @@ QString IOModem::identifier() const {
65} 66}
66 67
67QString IOModem::name() const { 68QString IOModem::name() const {
68 return "Modem IO Layer"; 69 return "Modem IO Layer";
69} 70}
70 71
71void IOIrda::slotExited(OProcess* proc ){ 72void 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,11 +1,12 @@
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
@@ -54,13 +55,13 @@ public slots:
54 void close(); 55 void close();
55 void reload(const Profile &); 56 void reload(const Profile &);
56 57
57private: 58private:
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
65private slots: 66private slots:
66 void slotExited(OProcess* proc); 67 void slotExited(OProcess* proc);
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
@@ -3,12 +3,13 @@
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"
@@ -306,12 +307,21 @@ 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}
309void MainWindow::create( const Profile& prof ) { 310void 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
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,11 +1,11 @@
1TEMPLATE = app 1TEMPLATE = app
2#CONFIG = qt warn_on release 2#CONFIG = qt warn_on release
3 CONFIG = qt debug 3 CONFIG = qt debug
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h\ 5HEADERS = 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 \
@@ -32,13 +32,13 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.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
38SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp \ 38SOURCES = 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 \