summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
authorjosef <josef>2002-10-18 10:25:44 (UTC)
committer josef <josef>2002-10-18 10:25:44 (UTC)
commitdd15f8b7104678da5969a3e93a4b14cd3640955c (patch) (unidiff)
treeca05d8e196a72101a6044ac0f7ca5fefdbd63d66 /noncore/apps/opie-console
parentc01fc99488d4ff9e1de2eb4d93fc200ed8e19a81 (diff)
downloadopie-dd15f8b7104678da5969a3e93a4b14cd3640955c.zip
opie-dd15f8b7104678da5969a3e93a4b14cd3640955c.tar.gz
opie-dd15f8b7104678da5969a3e93a4b14cd3640955c.tar.bz2
- implement proper disconnect for modem connections
- let transfer dialog use widgetStack()
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/dialer.cpp6
-rw-r--r--noncore/apps/opie-console/dialer.h1
-rw-r--r--noncore/apps/opie-console/io_modem.cpp5
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp3
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp4
-rw-r--r--noncore/apps/opie-console/transferdialog.h2
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
@@ -75,24 +75,30 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name
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
83Dialer::~Dialer() 83Dialer::~Dialer()
84{ 84{
85} 85}
86 86
87void Dialer::setHangupOnly()
88{
89 state = state_cancel;
90 usercancel = 1;
91}
92
87void Dialer::slotCancel() 93void 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
97void Dialer::reset() 103void Dialer::reset()
98{ 104{
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
@@ -5,24 +5,25 @@
5 5
6#include "profile.h" 6#include "profile.h"
7 7
8class QLabel; 8class QLabel;
9class QProgressBar; 9class QProgressBar;
10 10
11class Dialer : public QDialog 11class 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);
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
@@ -6,25 +6,28 @@
6IOModem::IOModem( const Profile &profile ) 6IOModem::IOModem( const Profile &profile )
7 : IOSerial( profile ) { 7 : IOSerial( profile ) {
8 m_profile = profile; 8 m_profile = profile;
9} 9}
10 10
11 11
12IOModem::~IOModem() { 12IOModem::~IOModem() {
13 13
14} 14}
15 15
16 16
17void IOModem::close() { 17void 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
23bool IOModem::open() { 26bool 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)
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
@@ -433,26 +433,27 @@ void MainWindow::create( const Profile& prof ) {
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
442void MainWindow::slotTransfer() 442void 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
452void MainWindow::slotOpenKeb(bool state) { 453void 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
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
@@ -8,26 +8,26 @@
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
20TransferDialog::TransferDialog(MainWindow *parent, const char *name) 20TransferDialog::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);
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
@@ -7,25 +7,25 @@ class QLineEdit;
7class QComboBox; 7class QComboBox;
8class QProgressBar; 8class QProgressBar;
9class QLabel; 9class QLabel;
10class QPushButton; 10class QPushButton;
11class MainWindow; 11class MainWindow;
12class FileTransferLayer; 12class FileTransferLayer;
13class ReceiveLayer; 13class ReceiveLayer;
14 14
15class TransferDialog : public QDialog 15class 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