author | josef <josef> | 2002-10-14 18:28:19 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-14 18:28:19 (UTC) |
commit | 5ada62902971fa9ac34e831259442535299f7ef6 (patch) (side-by-side diff) | |
tree | 445974a3569d35267cb7542aefd5235ff14536dd | |
parent | e789f01a4fc6ada39809d40f8c44a6f6deec7785 (diff) | |
download | opie-5ada62902971fa9ac34e831259442535299f7ef6.zip opie-5ada62902971fa9ac34e831259442535299f7ef6.tar.gz opie-5ada62902971fa9ac34e831259442535299f7ef6.tar.bz2 |
- add modem layer so dialer can be used within Connect
-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 @@ #include "io_serial.h" #include "io_irda.h" #include "io_bt.h" +#include "io_modem.h" #include "filetransfer.h" #include "filereceive.h" #include "serialconfigwidget.h" #include "irdaconfigwidget.h" #include "btconfigwidget.h" #include "modemconfigwidget.h" #include "terminalwidget.h" #include "vt102emulation.h" #include "default.h" extern "C" { @@ -36,24 +37,27 @@ extern "C" { } // Layer stuff IOLayer* newSerialLayer( const Profile& prof) { return new IOSerial( prof ); } IOLayer* newBTLayer( const Profile& prof ) { return new IOBt( prof ); } IOLayer* newIrDaLayer( const Profile& prof ) { return new IOIrda( prof ); } + IOLayer* newModemLayer( const Profile& prof ) { + return new IOModem( prof ); + } // Connection Widgets ProfileDialogWidget* newSerialWidget( const QString& str, QWidget* wid ) { return new SerialConfigWidget( str, wid ); } ProfileDialogWidget* newIrDaWidget( const QString& str, QWidget* wid ) { return new IrdaConfigWidget( str, wid ); } ProfileDialogWidget* newModemWidget( const QString& str, QWidget* wid ) { return new ModemConfigWidget(str, wid ); } ProfileDialogWidget* newBTWidget( const QString& str, QWidget* wid ) { @@ -76,24 +80,25 @@ extern "C" { Default::Default( MetaFactory* fact ) { fact->addFileTransferLayer( "SZ", QObject::tr("Z-Modem"), newSZTransfer ); fact->addFileTransferLayer( "SY", QObject::tr("Y-Modem"), newSYTransfer ); fact->addFileTransferLayer( "SX", QObject::tr("X-Modem"), newSXTransfer ); fact->addReceiveLayer( "SZ", QObject::tr("Z-Modem"), newSZReceive ); fact->addReceiveLayer( "SY", QObject::tr("Y-Modem"), newSYReceive ); fact->addReceiveLayer( "SX", QObject::tr("X-Modem"), newSXReceive ); fact->addIOLayerFactory( "serial", QObject::tr("Serial"), newSerialLayer ); fact->addIOLayerFactory( "irda", QObject::tr("Infrared"), newIrDaLayer ); fact->addIOLayerFactory( "bt", QObject::tr("Bluetooth"), newBTLayer ); + fact->addIOLayerFactory( "modem", QObject::tr("Modem"), newModemLayer ); fact->addConnectionWidgetFactory( "serial", QObject::tr("Serial"), newSerialWidget ); fact->addConnectionWidgetFactory( "irda", QObject::tr("Infrared"), newIrDaWidget ); fact->addConnectionWidgetFactory( "modem", QObject::tr("Modem"), newModemWidget ); fact->addConnectionWidgetFactory( "bt", QObject::tr("Bluetooth"), newBTWidget ); // fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); // fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 ); } Default::~Default() { 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 @@ //dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); //dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); //connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); //hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); // from modemconfigwidget //int rad_flow = prof.readNumEntry("Flow"); //int rad_parity = prof.readNumEntry("Parity"); //int speed = prof.readNumEntry("Speed"); //QString number = prof.readEntry("Number"); Dialer::Dialer(const Profile& profile, QWidget *parent, const char *name) -: QDialog(parent, name, true) +: QDialog(parent, name, true), m_profile(profile) { QVBoxLayout *vbox; QLabel *desc; usercancel = 0; - m_profile = profile; desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); progress = new QProgressBar(this); status = new QLabel("", this); status->setFrameStyle(QFrame::Panel | QFrame::Sunken); cancel = new QPushButton(QObject::tr("Cancel"), this); vbox = new QVBoxLayout(this, 2); vbox->add(desc); vbox->add(progress); vbox->add(status); 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 state_init, state_options, state_dialtone, state_dialing, state_online }; QLabel *status; QProgressBar *progress; QPushButton *cancel; int state; int usercancel; - Profile m_profile; + const Profile& m_profile; }; #endif 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 ) IOModem::~IOModem() { } void IOModem::close() { IOSerial::close(); } bool IOModem::open() { - qWarning("IOModem::open"); - IOSerial::open(); + bool ret = IOSerial::open(); + if(!ret) return false; + + qWarning("IOModem::open continues..."); Dialer d(m_profile); + qWarning("dialer created"); + int result = d.exec(); if(result == QDialog::Accepted) { return true; } else return false; } void IOModem::reload( const Profile &config ) { m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); |