-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.h | 2 |
6 files changed, 16 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index bd6b50f..7bf9352 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -63,48 +63,54 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name | |||
63 | 63 | ||
64 | desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); | 64 | desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); |
65 | progress = new QProgressBar(this); | 65 | progress = new QProgressBar(this); |
66 | status = new QLabel("", this); | 66 | status = new QLabel("", this); |
67 | status->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 67 | status->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
68 | cancel = new QPushButton(QObject::tr("Cancel"), this); | 68 | cancel = new QPushButton(QObject::tr("Cancel"), this); |
69 | 69 | ||
70 | vbox = new QVBoxLayout(this, 2); | 70 | vbox = new QVBoxLayout(this, 2); |
71 | vbox->add(desc); | 71 | vbox->add(desc); |
72 | vbox->add(progress); | 72 | vbox->add(progress); |
73 | vbox->add(status); | 73 | vbox->add(status); |
74 | vbox->add(cancel); | 74 | vbox->add(cancel); |
75 | 75 | ||
76 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); | 76 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); |
77 | 77 | ||
78 | show(); | 78 | show(); |
79 | 79 | ||
80 | QTimer::singleShot(500, this, SLOT(slotAutostart())); | 80 | QTimer::singleShot(500, this, SLOT(slotAutostart())); |
81 | } | 81 | } |
82 | 82 | ||
83 | Dialer::~Dialer() | 83 | Dialer::~Dialer() |
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | void Dialer::setHangupOnly() | ||
88 | { | ||
89 | state = state_cancel; | ||
90 | usercancel = 1; | ||
91 | } | ||
92 | |||
87 | void Dialer::slotCancel() | 93 | void Dialer::slotCancel() |
88 | { | 94 | { |
89 | if(state != state_online) | 95 | if(state != state_online) |
90 | { | 96 | { |
91 | usercancel = 1; | 97 | usercancel = 1; |
92 | reset(); | 98 | reset(); |
93 | } | 99 | } |
94 | else accept(); | 100 | else accept(); |
95 | } | 101 | } |
96 | 102 | ||
97 | void Dialer::reset() | 103 | void Dialer::reset() |
98 | { | 104 | { |
99 | switchState(state_cancel); | 105 | switchState(state_cancel); |
100 | } | 106 | } |
101 | 107 | ||
102 | void Dialer::slotAutostart() | 108 | void Dialer::slotAutostart() |
103 | { | 109 | { |
104 | //state = state_preinit; | 110 | //state = state_preinit; |
105 | dial(m_profile.readEntry("Number")); | 111 | dial(m_profile.readEntry("Number")); |
106 | } | 112 | } |
107 | 113 | ||
108 | void Dialer::dial(const QString& number) | 114 | void Dialer::dial(const QString& number) |
109 | { | 115 | { |
110 | while(state != state_online) | 116 | while(state != state_online) |
diff --git a/noncore/apps/opie-console/dialer.h b/noncore/apps/opie-console/dialer.h index 4011880..84444b9 100644 --- a/noncore/apps/opie-console/dialer.h +++ b/noncore/apps/opie-console/dialer.h | |||
@@ -1,40 +1,41 @@ | |||
1 | #ifndef DIALER_H | 1 | #ifndef DIALER_H |
2 | #define DIALER_H | 2 | #define DIALER_H |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | 5 | ||
6 | #include "profile.h" | 6 | #include "profile.h" |
7 | 7 | ||
8 | class QLabel; | 8 | class QLabel; |
9 | class QProgressBar; | 9 | class QProgressBar; |
10 | 10 | ||
11 | class Dialer : public QDialog | 11 | class Dialer : public QDialog |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | Dialer(const Profile& profile, int fd, QWidget *parent = NULL, const char *name = NULL); | 15 | Dialer(const Profile& profile, int fd, QWidget *parent = NULL, const char *name = NULL); |
16 | ~Dialer(); | 16 | ~Dialer(); |
17 | void setHangupOnly(); | ||
17 | 18 | ||
18 | public slots: | 19 | public slots: |
19 | void slotCancel(); | 20 | void slotCancel(); |
20 | void slotAutostart(); | 21 | void slotAutostart(); |
21 | 22 | ||
22 | private: | 23 | private: |
23 | void switchState(int newstate); | 24 | void switchState(int newstate); |
24 | void reset(); | 25 | void reset(); |
25 | void dial(const QString& number); | 26 | void dial(const QString& number); |
26 | void trydial(const QString& number); | 27 | void trydial(const QString& number); |
27 | 28 | ||
28 | void send(const QString& msg); | 29 | void send(const QString& msg); |
29 | QString receive(); | 30 | QString receive(); |
30 | 31 | ||
31 | enum States | 32 | enum States |
32 | { | 33 | { |
33 | state_cancel, | 34 | state_cancel, |
34 | state_preinit, | 35 | state_preinit, |
35 | state_init, | 36 | state_init, |
36 | state_options, | 37 | state_options, |
37 | state_dialtone, | 38 | state_dialtone, |
38 | state_dialing, | 39 | state_dialing, |
39 | state_online | 40 | state_online |
40 | }; | 41 | }; |
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index c04aad1..2f0c04e 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,42 +1,45 @@ | |||
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 &profile ) | 6 | IOModem::IOModem( const Profile &profile ) |
7 | : IOSerial( profile ) { | 7 | : IOSerial( profile ) { |
8 | m_profile = profile; | 8 | m_profile = profile; |
9 | } | 9 | } |
10 | 10 | ||
11 | 11 | ||
12 | IOModem::~IOModem() { | 12 | IOModem::~IOModem() { |
13 | 13 | ||
14 | } | 14 | } |
15 | 15 | ||
16 | 16 | ||
17 | void IOModem::close() { | 17 | void IOModem::close() { |
18 | // maybe do a hangup here just in case...? | 18 | // Hangup, discarding result |
19 | Dialer d(m_profile, rawIO()); | ||
20 | d.setHangupOnly(); | ||
21 | d.exec(); | ||
19 | 22 | ||
20 | IOSerial::close(); | 23 | IOSerial::close(); |
21 | } | 24 | } |
22 | 25 | ||
23 | bool IOModem::open() { | 26 | bool IOModem::open() { |
24 | bool ret = IOSerial::open(); | 27 | bool ret = IOSerial::open(); |
25 | if(!ret) return false; | 28 | if(!ret) return false; |
26 | 29 | ||
27 | Dialer d(m_profile, rawIO()); | 30 | Dialer d(m_profile, rawIO()); |
28 | 31 | ||
29 | int result = d.exec(); | 32 | int result = d.exec(); |
30 | if(result == QDialog::Accepted) | 33 | if(result == QDialog::Accepted) |
31 | { | 34 | { |
32 | return true; | 35 | return true; |
33 | } | 36 | } |
34 | else | 37 | else |
35 | { | 38 | { |
36 | close(); | 39 | close(); |
37 | return false; | 40 | return false; |
38 | } | 41 | } |
39 | } | 42 | } |
40 | 43 | ||
41 | void IOModem::reload( const Profile &config ) { | 44 | void IOModem::reload( const Profile &config ) { |
42 | 45 | ||
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 9a226bb..55e9836 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -421,50 +421,51 @@ void MainWindow::create( const Profile& prof ) { | |||
421 | tabWidget()->add( ses ); | 421 | tabWidget()->add( ses ); |
422 | m_curSession = ses; | 422 | m_curSession = ses; |
423 | 423 | ||
424 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 424 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
425 | m_connect->setEnabled( true ); | 425 | m_connect->setEnabled( true ); |
426 | m_disconnect->setEnabled( false ); | 426 | m_disconnect->setEnabled( false ); |
427 | m_terminate->setEnabled( true ); | 427 | m_terminate->setEnabled( true ); |
428 | m_transfer->setEnabled( true ); | 428 | m_transfer->setEnabled( true ); |
429 | m_recordScript->setEnabled( true ); | 429 | m_recordScript->setEnabled( true ); |
430 | m_saveScript->setEnabled( true ); | 430 | m_saveScript->setEnabled( true ); |
431 | m_runScript->setEnabled( true ); | 431 | m_runScript->setEnabled( true ); |
432 | m_fullscreen->setEnabled( true ); | 432 | m_fullscreen->setEnabled( true ); |
433 | m_closewindow->setEnabled( true ); | 433 | m_closewindow->setEnabled( true ); |
434 | 434 | ||
435 | 435 | ||
436 | // is io_layer wants direct connection, then autoconnect | 436 | // is io_layer wants direct connection, then autoconnect |
437 | if ( ( m_curSession->layer() )->supports()[0] = 1 ) { | 437 | if ( ( m_curSession->layer() )->supports()[0] = 1 ) { |
438 | slotConnect(); | 438 | slotConnect(); |
439 | } | 439 | } |
440 | } | 440 | } |
441 | 441 | ||
442 | void MainWindow::slotTransfer() | 442 | void MainWindow::slotTransfer() |
443 | { | 443 | { |
444 | if ( currentSession() ) { | 444 | if ( currentSession() ) { |
445 | TransferDialog dlg(this); | 445 | TransferDialog dlg(currentSession()->widgetStack(), this); |
446 | dlg.showMaximized(); | 446 | dlg.showMaximized(); |
447 | //currentSession()->widgetStack()->add(dlg); | ||
447 | dlg.exec(); | 448 | dlg.exec(); |
448 | } | 449 | } |
449 | } | 450 | } |
450 | 451 | ||
451 | 452 | ||
452 | void MainWindow::slotOpenKeb(bool state) { | 453 | void MainWindow::slotOpenKeb(bool state) { |
453 | 454 | ||
454 | if (state) m_keyBar->show(); | 455 | if (state) m_keyBar->show(); |
455 | else m_keyBar->hide(); | 456 | else m_keyBar->hide(); |
456 | 457 | ||
457 | } | 458 | } |
458 | 459 | ||
459 | 460 | ||
460 | void MainWindow::slotOpenButtons( bool state ) { | 461 | void MainWindow::slotOpenButtons( bool state ) { |
461 | 462 | ||
462 | if ( state ) { | 463 | if ( state ) { |
463 | m_buttonBar->show(); | 464 | m_buttonBar->show(); |
464 | } else { | 465 | } else { |
465 | m_buttonBar->hide(); | 466 | m_buttonBar->hide(); |
466 | } | 467 | } |
467 | } | 468 | } |
468 | 469 | ||
469 | 470 | ||
470 | 471 | ||
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index f9a0b87..ac5b1d0 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -1,45 +1,45 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qprogressbar.h> | 7 | #include <qprogressbar.h> |
8 | #include <qradiobutton.h> | 8 | #include <qradiobutton.h> |
9 | #include <qbuttongroup.h> | 9 | #include <qbuttongroup.h> |
10 | 10 | ||
11 | #include <opie/ofiledialog.h> | 11 | #include <opie/ofiledialog.h> |
12 | 12 | ||
13 | #include "file_layer.h" | 13 | #include "file_layer.h" |
14 | #include "receive_layer.h" | 14 | #include "receive_layer.h" |
15 | #include "metafactory.h" | 15 | #include "metafactory.h" |
16 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | 17 | ||
18 | #include "transferdialog.h" | 18 | #include "transferdialog.h" |
19 | 19 | ||
20 | TransferDialog::TransferDialog(MainWindow *parent, const char *name) | 20 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *name) |
21 | : QDialog(0l, 0l, true), m_win(parent) | 21 | : QDialog(parent, 0l, true), m_win(mainwindow) |
22 | { | 22 | { |
23 | m_lay = 0l; | 23 | m_lay = 0l; |
24 | m_recvlay = 0l; | 24 | m_recvlay = 0l; |
25 | QVBoxLayout *vbox, *vbox2; | 25 | QVBoxLayout *vbox, *vbox2; |
26 | QHBoxLayout *hbox, *hbox2, *hbox3; | 26 | QHBoxLayout *hbox, *hbox2, *hbox3; |
27 | QLabel *file, *mode, *progress, *status; | 27 | QLabel *file, *mode, *progress, *status; |
28 | QButtonGroup *group; | 28 | QButtonGroup *group; |
29 | QRadioButton *mode_send, *mode_receive; | 29 | QRadioButton *mode_send, *mode_receive; |
30 | 30 | ||
31 | m_autocleanup = 0; | 31 | m_autocleanup = 0; |
32 | 32 | ||
33 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); | 33 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); |
34 | mode_send = new QRadioButton(QObject::tr("Send"), group); | 34 | mode_send = new QRadioButton(QObject::tr("Send"), group); |
35 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); | 35 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); |
36 | group->insert(mode_send, id_send); | 36 | group->insert(mode_send, id_send); |
37 | group->insert(mode_receive, id_receive); | 37 | group->insert(mode_receive, id_receive); |
38 | vbox2 = new QVBoxLayout(group, 2); | 38 | vbox2 = new QVBoxLayout(group, 2); |
39 | vbox2->addSpacing(10); | 39 | vbox2->addSpacing(10); |
40 | hbox3 = new QHBoxLayout(vbox2, 2); | 40 | hbox3 = new QHBoxLayout(vbox2, 2); |
41 | hbox3->add(mode_send); | 41 | hbox3->add(mode_send); |
42 | hbox3->add(mode_receive); | 42 | hbox3->add(mode_receive); |
43 | mode_send->setChecked(true); | 43 | mode_send->setChecked(true); |
44 | m_transfermode = id_send; | 44 | m_transfermode = id_send; |
45 | 45 | ||
diff --git a/noncore/apps/opie-console/transferdialog.h b/noncore/apps/opie-console/transferdialog.h index 1b27f16..d87be6a 100644 --- a/noncore/apps/opie-console/transferdialog.h +++ b/noncore/apps/opie-console/transferdialog.h | |||
@@ -1,43 +1,43 @@ | |||
1 | #ifndef TRANSFER_DIALOG_H | 1 | #ifndef TRANSFER_DIALOG_H |
2 | #define TRANSFER_DIALOG_H | 2 | #define TRANSFER_DIALOG_H |
3 | 3 | ||
4 | #include "qdialog.h" | 4 | #include "qdialog.h" |
5 | 5 | ||
6 | class QLineEdit; | 6 | class QLineEdit; |
7 | class QComboBox; | 7 | class QComboBox; |
8 | class QProgressBar; | 8 | class QProgressBar; |
9 | class QLabel; | 9 | class QLabel; |
10 | class QPushButton; | 10 | class QPushButton; |
11 | class MainWindow; | 11 | class MainWindow; |
12 | class FileTransferLayer; | 12 | class FileTransferLayer; |
13 | class ReceiveLayer; | 13 | class ReceiveLayer; |
14 | 14 | ||
15 | class TransferDialog : public QDialog | 15 | class TransferDialog : public QDialog |
16 | { | 16 | { |
17 | Q_OBJECT | 17 | Q_OBJECT |
18 | public: | 18 | public: |
19 | TransferDialog(MainWindow *parent = 0l, const char *name = 0l); | 19 | TransferDialog(QWidget *parent = 0l, MainWindow *mainwindow = 0l, const char *name = 0l); |
20 | ~TransferDialog(); | 20 | ~TransferDialog(); |
21 | 21 | ||
22 | public slots: | 22 | public slots: |
23 | void slotFilename(); | 23 | void slotFilename(); |
24 | void slotTransfer(); | 24 | void slotTransfer(); |
25 | void slotCancel(); | 25 | void slotCancel(); |
26 | void slotProgress(const QString&, int, int, int, int, int); | 26 | void slotProgress(const QString&, int, int, int, int, int); |
27 | void slotError(int error, const QString& message); | 27 | void slotError(int error, const QString& message); |
28 | void slotSent(); | 28 | void slotSent(); |
29 | void slotReceived(const QString& file); | 29 | void slotReceived(const QString& file); |
30 | void slotMode(int id); | 30 | void slotMode(int id); |
31 | 31 | ||
32 | private: | 32 | private: |
33 | enum Modes | 33 | enum Modes |
34 | { | 34 | { |
35 | id_send, | 35 | id_send, |
36 | id_receive | 36 | id_receive |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void cleanup(); | 39 | void cleanup(); |
40 | 40 | ||
41 | QLineEdit *filename; | 41 | QLineEdit *filename; |
42 | QComboBox *protocol; | 42 | QComboBox *protocol; |
43 | QProgressBar *progressbar; | 43 | QProgressBar *progressbar; |