summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-14 18:28:19 (UTC)
committer josef <josef>2002-10-14 18:28:19 (UTC)
commit5ada62902971fa9ac34e831259442535299f7ef6 (patch) (unidiff)
tree445974a3569d35267cb7542aefd5235ff14536dd
parente789f01a4fc6ada39809d40f8c44a6f6deec7785 (diff)
downloadopie-5ada62902971fa9ac34e831259442535299f7ef6.zip
opie-5ada62902971fa9ac34e831259442535299f7ef6.tar.gz
opie-5ada62902971fa9ac34e831259442535299f7ef6.tar.bz2
- add modem layer so dialer can be used within Connect
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/default.cpp5
-rw-r--r--noncore/apps/opie-console/dialer.cpp3
-rw-r--r--noncore/apps/opie-console/dialer.h2
-rw-r--r--noncore/apps/opie-console/io_modem.cpp8
4 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/default.cpp b/noncore/apps/opie-console/default.cpp
index ce5c870..5c1c05a 100644
--- a/noncore/apps/opie-console/default.cpp
+++ b/noncore/apps/opie-console/default.cpp
@@ -1,11 +1,12 @@
1#include "io_serial.h" 1#include "io_serial.h"
2#include "io_irda.h" 2#include "io_irda.h"
3#include "io_bt.h" 3#include "io_bt.h"
4#include "io_modem.h"
4#include "filetransfer.h" 5#include "filetransfer.h"
5#include "filereceive.h" 6#include "filereceive.h"
6#include "serialconfigwidget.h" 7#include "serialconfigwidget.h"
7#include "irdaconfigwidget.h" 8#include "irdaconfigwidget.h"
8#include "btconfigwidget.h" 9#include "btconfigwidget.h"
9#include "modemconfigwidget.h" 10#include "modemconfigwidget.h"
10#include "terminalwidget.h" 11#include "terminalwidget.h"
11#include "vt102emulation.h" 12#include "vt102emulation.h"
@@ -40,16 +41,19 @@ extern "C" {
40 return new IOSerial( prof ); 41 return new IOSerial( prof );
41 } 42 }
42 IOLayer* newBTLayer( const Profile& prof ) { 43 IOLayer* newBTLayer( const Profile& prof ) {
43 return new IOBt( prof ); 44 return new IOBt( prof );
44 } 45 }
45 IOLayer* newIrDaLayer( const Profile& prof ) { 46 IOLayer* newIrDaLayer( const Profile& prof ) {
46 return new IOIrda( prof ); 47 return new IOIrda( prof );
47 } 48 }
49 IOLayer* newModemLayer( const Profile& prof ) {
50 return new IOModem( prof );
51 }
48 52
49 // Connection Widgets 53 // Connection Widgets
50 ProfileDialogWidget* newSerialWidget( const QString& str, QWidget* wid ) { 54 ProfileDialogWidget* newSerialWidget( const QString& str, QWidget* wid ) {
51 return new SerialConfigWidget( str, wid ); 55 return new SerialConfigWidget( str, wid );
52 } 56 }
53 ProfileDialogWidget* newIrDaWidget( const QString& str, QWidget* wid ) { 57 ProfileDialogWidget* newIrDaWidget( const QString& str, QWidget* wid ) {
54 return new IrdaConfigWidget( str, wid ); 58 return new IrdaConfigWidget( str, wid );
55 } 59 }
@@ -80,16 +84,17 @@ Default::Default( MetaFactory* fact ) {
80 84
81 fact->addReceiveLayer( "SZ", QObject::tr("Z-Modem"), newSZReceive ); 85 fact->addReceiveLayer( "SZ", QObject::tr("Z-Modem"), newSZReceive );
82 fact->addReceiveLayer( "SY", QObject::tr("Y-Modem"), newSYReceive ); 86 fact->addReceiveLayer( "SY", QObject::tr("Y-Modem"), newSYReceive );
83 fact->addReceiveLayer( "SX", QObject::tr("X-Modem"), newSXReceive ); 87 fact->addReceiveLayer( "SX", QObject::tr("X-Modem"), newSXReceive );
84 88
85 fact->addIOLayerFactory( "serial", QObject::tr("Serial"), newSerialLayer ); 89 fact->addIOLayerFactory( "serial", QObject::tr("Serial"), newSerialLayer );
86 fact->addIOLayerFactory( "irda", QObject::tr("Infrared"), newIrDaLayer ); 90 fact->addIOLayerFactory( "irda", QObject::tr("Infrared"), newIrDaLayer );
87 fact->addIOLayerFactory( "bt", QObject::tr("Bluetooth"), newBTLayer ); 91 fact->addIOLayerFactory( "bt", QObject::tr("Bluetooth"), newBTLayer );
92 fact->addIOLayerFactory( "modem", QObject::tr("Modem"), newModemLayer );
88 93
89 fact->addConnectionWidgetFactory( "serial", QObject::tr("Serial"), newSerialWidget ); 94 fact->addConnectionWidgetFactory( "serial", QObject::tr("Serial"), newSerialWidget );
90 fact->addConnectionWidgetFactory( "irda", QObject::tr("Infrared"), newIrDaWidget ); 95 fact->addConnectionWidgetFactory( "irda", QObject::tr("Infrared"), newIrDaWidget );
91 fact->addConnectionWidgetFactory( "modem", QObject::tr("Modem"), newModemWidget ); 96 fact->addConnectionWidgetFactory( "modem", QObject::tr("Modem"), newModemWidget );
92 fact->addConnectionWidgetFactory( "bt", QObject::tr("Bluetooth"), newBTWidget ); 97 fact->addConnectionWidgetFactory( "bt", QObject::tr("Bluetooth"), newBTWidget );
93 98
94// fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); 99// fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget );
95 100
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index d20965a..90e2b6c 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -40,23 +40,22 @@
40 40
41// from modemconfigwidget 41// from modemconfigwidget
42//int rad_flow = prof.readNumEntry("Flow"); 42//int rad_flow = prof.readNumEntry("Flow");
43//int rad_parity = prof.readNumEntry("Parity"); 43//int rad_parity = prof.readNumEntry("Parity");
44//int speed = prof.readNumEntry("Speed"); 44//int speed = prof.readNumEntry("Speed");
45//QString number = prof.readEntry("Number"); 45//QString number = prof.readEntry("Number");
46 46
47Dialer::Dialer(const Profile& profile, QWidget *parent, const char *name) 47Dialer::Dialer(const Profile& profile, QWidget *parent, const char *name)
48: QDialog(parent, name, true) 48: QDialog(parent, name, true), m_profile(profile)
49{ 49{
50 QVBoxLayout *vbox; 50 QVBoxLayout *vbox;
51 QLabel *desc; 51 QLabel *desc;
52 52
53 usercancel = 0; 53 usercancel = 0;
54 m_profile = profile;
55 54
56 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); 55 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this);
57 progress = new QProgressBar(this); 56 progress = new QProgressBar(this);
58 status = new QLabel("", this); 57 status = new QLabel("", this);
59 status->setFrameStyle(QFrame::Panel | QFrame::Sunken); 58 status->setFrameStyle(QFrame::Panel | QFrame::Sunken);
60 cancel = new QPushButton(QObject::tr("Cancel"), this); 59 cancel = new QPushButton(QObject::tr("Cancel"), this);
61 60
62 vbox = new QVBoxLayout(this, 2); 61 vbox = new QVBoxLayout(this, 2);
diff --git a/noncore/apps/opie-console/dialer.h b/noncore/apps/opie-console/dialer.h
index 8c83bb6..09cc5ca 100644
--- a/noncore/apps/opie-console/dialer.h
+++ b/noncore/apps/opie-console/dialer.h
@@ -39,13 +39,13 @@ class Dialer : public QDialog
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 Profile m_profile; 47 const Profile& m_profile;
48}; 48};
49 49
50#endif 50#endif
51 51
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp
index 56147d8..28d1722 100644
--- a/noncore/apps/opie-console/io_modem.cpp
+++ b/noncore/apps/opie-console/io_modem.cpp
@@ -15,20 +15,24 @@ IOModem::~IOModem() {
15 15
16void IOModem::close() { 16void 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 bool ret = IOSerial::open();
24 IOSerial::open(); 24 if(!ret) return false;
25
26 qWarning("IOModem::open continues...");
25 27
26 Dialer d(m_profile); 28 Dialer d(m_profile);
29 qWarning("dialer created");
30
27 int result = d.exec(); 31 int result = d.exec();
28 if(result == QDialog::Accepted) 32 if(result == QDialog::Accepted)
29 { 33 {
30 return true; 34 return true;
31 } 35 }
32 else return false; 36 else return false;
33} 37}
34 38