-rw-r--r-- | noncore/apps/opie-console/default.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 8 |
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,15 +1,16 @@ | |||
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" |
12 | 13 | ||
13 | #include "default.h" | 14 | #include "default.h" |
14 | 15 | ||
15 | extern "C" { | 16 | extern "C" { |
@@ -36,24 +37,27 @@ extern "C" { | |||
36 | } | 37 | } |
37 | 38 | ||
38 | // Layer stuff | 39 | // Layer stuff |
39 | IOLayer* newSerialLayer( const Profile& prof) { | 40 | IOLayer* newSerialLayer( const Profile& prof) { |
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 | } |
56 | ProfileDialogWidget* newModemWidget( const QString& str, QWidget* wid ) { | 60 | ProfileDialogWidget* newModemWidget( const QString& str, QWidget* wid ) { |
57 | return new ModemConfigWidget(str, wid ); | 61 | return new ModemConfigWidget(str, wid ); |
58 | } | 62 | } |
59 | ProfileDialogWidget* newBTWidget( const QString& str, QWidget* wid ) { | 63 | ProfileDialogWidget* newBTWidget( const QString& str, QWidget* wid ) { |
@@ -76,24 +80,25 @@ extern "C" { | |||
76 | Default::Default( MetaFactory* fact ) { | 80 | Default::Default( MetaFactory* fact ) { |
77 | fact->addFileTransferLayer( "SZ", QObject::tr("Z-Modem"), newSZTransfer ); | 81 | fact->addFileTransferLayer( "SZ", QObject::tr("Z-Modem"), newSZTransfer ); |
78 | fact->addFileTransferLayer( "SY", QObject::tr("Y-Modem"), newSYTransfer ); | 82 | fact->addFileTransferLayer( "SY", QObject::tr("Y-Modem"), newSYTransfer ); |
79 | fact->addFileTransferLayer( "SX", QObject::tr("X-Modem"), newSXTransfer ); | 83 | fact->addFileTransferLayer( "SX", QObject::tr("X-Modem"), newSXTransfer ); |
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 | ||
96 | // fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 ); | 101 | // fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 ); |
97 | } | 102 | } |
98 | Default::~Default() { | 103 | Default::~Default() { |
99 | 104 | ||
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 | |||
@@ -36,31 +36,30 @@ | |||
36 | //dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 36 | //dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
37 | //dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 37 | //dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
38 | //connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); | 38 | //connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); |
39 | //hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); | 39 | //hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); |
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 | ||
47 | Dialer::Dialer(const Profile& profile, QWidget *parent, const char *name) | 47 | Dialer::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); |
63 | vbox->add(desc); | 62 | vbox->add(desc); |
64 | vbox->add(progress); | 63 | vbox->add(progress); |
65 | vbox->add(status); | 64 | vbox->add(status); |
66 | vbox->add(cancel); | 65 | vbox->add(cancel); |
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 | |||
@@ -35,17 +35,17 @@ class Dialer : public QDialog | |||
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 | 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 | |||
@@ -11,28 +11,32 @@ IOModem::IOModem( const Profile &profile ) | |||
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 | 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 | ||
35 | void IOModem::reload( const Profile &config ) { | 39 | void IOModem::reload( const Profile &config ) { |
36 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); | 40 | m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); |
37 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); | 41 | m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); |
38 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); | 42 | m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); |