summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/config.in2
-rw-r--r--noncore/apps/opie-console/file_layer.cpp2
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp2
-rw-r--r--noncore/apps/opie-console/filetransfer.h3
-rw-r--r--noncore/apps/opie-console/io_bt.h2
-rw-r--r--noncore/apps/opie-console/io_irda.h2
-rw-r--r--noncore/apps/opie-console/io_modem.h4
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp74
-rw-r--r--noncore/apps/opie-console/opie-console.control2
-rw-r--r--noncore/apps/opie-console/opie-console.pro112
-rw-r--r--noncore/apps/opie-console/profileeditordialog.h2
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp1
-rw-r--r--noncore/apps/opie-console/sz_transfer.h2
-rw-r--r--noncore/apps/opie-console/tabwidget.h2
-rw-r--r--noncore/apps/opie-console/test/console.pro10
-rw-r--r--noncore/apps/opie-console/test/senderui.cpp2
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp416
17 files changed, 318 insertions, 322 deletions
diff --git a/noncore/apps/opie-console/config.in b/noncore/apps/opie-console/config.in
index 521154d..b5702a9 100644
--- a/noncore/apps/opie-console/config.in
+++ b/noncore/apps/opie-console/config.in
@@ -3,2 +3,2 @@
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp
index 9ddef80..870e913 100644
--- a/noncore/apps/opie-console/file_layer.cpp
+++ b/noncore/apps/opie-console/file_layer.cpp
@@ -1,3 +1 @@
1#include <opie/oprocess.h>
2
3#include "file_layer.h" #include "file_layer.h"
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp
index 347d6e0..7eebc65 100644
--- a/noncore/apps/opie-console/filetransfer.cpp
+++ b/noncore/apps/opie-console/filetransfer.cpp
@@ -8,4 +8,2 @@
8 8
9#include <opie/oprocess.h>
10
11#include "procctl.h" 9#include "procctl.h"
diff --git a/noncore/apps/opie-console/filetransfer.h b/noncore/apps/opie-console/filetransfer.h
index 8f55041..3b79cda 100644
--- a/noncore/apps/opie-console/filetransfer.h
+++ b/noncore/apps/opie-console/filetransfer.h
@@ -5,2 +5,4 @@
5 5
6#include <opie2/oprocess.h>
7
6#include <qfile.h> 8#include <qfile.h>
@@ -11,3 +13,2 @@
11class QSocketNotifier; 13class QSocketNotifier;
12class OProcess;
13class FileTransferControl; 14class FileTransferControl;
diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h
index 239eefb..df6dd38 100644
--- a/noncore/apps/opie-console/io_bt.h
+++ b/noncore/apps/opie-console/io_bt.h
@@ -3,3 +3,3 @@
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h
index 14b1ae3..69bed7d 100644
--- a/noncore/apps/opie-console/io_irda.h
+++ b/noncore/apps/opie-console/io_irda.h
@@ -3,3 +3,3 @@
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h
index 2a926df..96ec3ef 100644
--- a/noncore/apps/opie-console/io_modem.h
+++ b/noncore/apps/opie-console/io_modem.h
@@ -3,3 +3,3 @@
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
@@ -66,3 +66,3 @@ private:
66 m_bpsDetect, m_dcdLines, m_multiLineUntag; 66 m_bpsDetect, m_dcdLines, m_multiLineUntag;
67 Profile m_profile; 67 Profile m_profile;
68 68
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 3fe9040..0a475d8 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -12,3 +12,3 @@
12 12
13#include <opie/ofiledialog.h> 13#include <opie2/ofiledialog.h>
14 14
@@ -335,3 +335,3 @@ void MainWindow::slotSaveScript() {
335 map.insert(tr("Script"), text ); 335 map.insert(tr("Script"), text );
336 QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); 336 QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map);
337 if (!filename.isEmpty()) { 337 if (!filename.isEmpty()) {
@@ -449,4 +449,4 @@ void MainWindow::slotClose() {
449 qWarning("removing! currentSession %s", currentSession()->name().latin1() ); 449 qWarning("removing! currentSession %s", currentSession()->name().latin1() );
450 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ 450 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
451 m_curSession = NULL; 451 m_curSession = NULL;
452 tabWidget()->remove( /*currentSession()*/ses ); 452 tabWidget()->remove( /*currentSession()*/ses );
@@ -485,4 +485,4 @@ void MainWindow::slotProfile( int id) {
485void MainWindow::create( const Profile& prof ) { 485void MainWindow::create( const Profile& prof ) {
486 if(m_curSession) 486 if(m_curSession)
487 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 487 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
488 488
@@ -491,9 +491,9 @@ void MainWindow::create( const Profile& prof ) {
491 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 491 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
492 { 492 {
493 QMessageBox::warning(this, 493 QMessageBox::warning(this,
494 QObject::tr("Session failed"), 494 QObject::tr("Session failed"),
495 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 495 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
496 //if(ses) delete ses; 496 //if(ses) delete ses;
497 return; 497 return;
498 } 498 }
499 499
@@ -538,12 +538,12 @@ void MainWindow::slotTransfer()
538 if ( currentSession() ) { 538 if ( currentSession() ) {
539 Session *mysession = currentSession(); 539 Session *mysession = currentSession();
540 TransferDialog dlg(/*mysession->widgetStack()*/this, this); 540 TransferDialog dlg(/*mysession->widgetStack()*/this, this);
541 mysession->setTransferDialog(&dlg); 541 mysession->setTransferDialog(&dlg);
542 //dlg.reparent(mysession->widgetStack(), QPoint(0, 0)); 542 //dlg.reparent(mysession->widgetStack(), QPoint(0, 0));
543 //dlg.showMaximized(); 543 //dlg.showMaximized();
544 currentSession()->widgetStack()->addWidget(&dlg, -1); 544 currentSession()->widgetStack()->addWidget(&dlg, -1);
545 dlg.show(); 545 dlg.show();
546 //dlg.exec(); 546 //dlg.exec();
547 while(dlg.isRunning()) qApp->processEvents(); 547 while(dlg.isRunning()) qApp->processEvents();
548 mysession->setTransferDialog(0l); 548 mysession->setTransferDialog(0l);
549 } 549 }
@@ -574,6 +574,6 @@ void MainWindow::slotSessionChanged( Session* ses ) {
574 574
575 if(m_curSession) 575 if(m_curSession)
576 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 576 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
577 if(ses) 577 if(ses)
578 if(ses->transferDialog()) ses->transferDialog()->show(); 578 if(ses->transferDialog()) ses->transferDialog()->show();
579 579
@@ -623,11 +623,11 @@ void MainWindow::slotWrap()
623 if(m_isWrapped) 623 if(m_isWrapped)
624 { 624 {
625 e->setWrap(80); 625 e->setWrap(80);
626 m_isWrapped = false; 626 m_isWrapped = false;
627 } 627 }
628 else 628 else
629 { 629 {
630 e->setWrap(0); 630 e->setWrap(0);
631 m_isWrapped = true; 631 m_isWrapped = true;
632 } 632 }
633 } 633 }
@@ -708,3 +708,3 @@ void MainWindow::slotSaveHistory() {
708 map.insert(tr("History"), text ); 708 map.insert(tr("History"), text );
709 QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); 709 QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map);
710 if (filename.isEmpty() ) return; 710 if (filename.isEmpty() ) return;
diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control
index 5548baf..a7ff1f3 100644
--- a/noncore/apps/opie-console/opie-console.control
+++ b/noncore/apps/opie-console/opie-console.control
@@ -7,3 +7,3 @@ Architecture: arm
7Version: 0.6-$SUB_VERSION 7Version: 0.6-$SUB_VERSION
8Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs 8Depends: qpe-base, libopiecore2, libopieui2, opie-console-help-en, lrzsz, opie-keytabs
9License: GPL 9License: GPL
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro
index ccf2e08..d3d7b25 100644
--- a/noncore/apps/opie-console/opie-console.pro
+++ b/noncore/apps/opie-console/opie-console.pro
@@ -1,66 +1,66 @@
1TEMPLATE = app 1TEMPLATE = app
2 TMAKE_CXXFLAGS+= -DHAVE_OPENPTY 2TMAKE_CXXFLAGS += -DHAVE_OPENPTY
3CONFIG += qt warn_on release 3CONFIG += qt warn_on release
4 #CONFIG = qt debug 4#CONFIG = qt debug
5DESTDIR = $(OPIEDIR)/bin 5DESTDIR = $(OPIEDIR)/bin
6HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ 6HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \
7 file_layer.h filetransfer.h \ 7 file_layer.h filetransfer.h \
8 metafactory.h \ 8 metafactory.h \
9 session.h \ 9 session.h \
10 mainwindow.h \ 10 mainwindow.h \
11 profile.h \ 11 profile.h \
12 profileconfig.h \ 12 profileconfig.h \
13 profilemanager.h \ 13 profilemanager.h \
14 tabwidget.h \ 14 tabwidget.h \
15 configdialog.h \ 15 configdialog.h \
16 keytrans.h \ 16 keytrans.h \
17 transferdialog.h \ 17 transferdialog.h \
18 profiledialogwidget.h \ 18 profiledialogwidget.h \
19 profileeditordialog.h \ 19 profileeditordialog.h \
20 default.h \ 20 default.h \
21 iolayerbase.h \ 21 iolayerbase.h \
22 serialconfigwidget.h irdaconfigwidget.h \ 22 serialconfigwidget.h irdaconfigwidget.h \
23 btconfigwidget.h modemconfigwidget.h \ 23 btconfigwidget.h modemconfigwidget.h \
24 atconfigdialog.h dialdialog.h \ 24 atconfigdialog.h dialdialog.h \
25 procctl.h \ 25 procctl.h \
26 function_keyboard.h \ 26 function_keyboard.h \
27 receive_layer.h filereceive.h \ 27 receive_layer.h filereceive.h \
28 script.h \ 28 script.h \
29 dialer.h \ 29 dialer.h \
30 terminalwidget.h \ 30 terminalwidget.h \
31 emulation_handler.h TECommon.h \ 31 emulation_handler.h TECommon.h \
32 TEHistory.h TEScreen.h TEWidget.h \ 32 TEHistory.h TEScreen.h TEWidget.h \
33 TEmuVt102.h TEmulation.h MyPty.h \ 33 TEmuVt102.h TEmulation.h MyPty.h \
34 consoleconfigwidget.h 34 consoleconfigwidget.h
35 35
36SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ 36SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \
37 file_layer.cpp filetransfer.cpp \ 37 file_layer.cpp filetransfer.cpp \
38 main.cpp \ 38 main.cpp \
39 metafactory.cpp \ 39 metafactory.cpp \
40 session.cpp \ 40 session.cpp \
41 mainwindow.cpp \ 41 mainwindow.cpp \
42 profile.cpp \ 42 profile.cpp \
43 profileconfig.cpp \ 43 profileconfig.cpp \
44 profilemanager.cpp \ 44 profilemanager.cpp \
45 tabwidget.cpp \ 45 tabwidget.cpp \
46 configdialog.cpp \ 46 configdialog.cpp \
47 keytrans.cpp \ 47 keytrans.cpp \
48 transferdialog.cpp \ 48 transferdialog.cpp \
49 profiledialogwidget.cpp \ 49 profiledialogwidget.cpp \
50 profileeditordialog.cpp \ 50 profileeditordialog.cpp \
51 iolayerbase.cpp \ 51 iolayerbase.cpp \
52 serialconfigwidget.cpp irdaconfigwidget.cpp \ 52 serialconfigwidget.cpp irdaconfigwidget.cpp \
53 btconfigwidget.cpp modemconfigwidget.cpp \ 53 btconfigwidget.cpp modemconfigwidget.cpp \
54 atconfigdialog.cpp dialdialog.cpp \ 54 atconfigdialog.cpp dialdialog.cpp \
55 default.cpp procctl.cpp \ 55 default.cpp procctl.cpp \
56 function_keyboard.cpp \ 56 function_keyboard.cpp \
57 receive_layer.cpp filereceive.cpp \ 57 receive_layer.cpp filereceive.cpp \
58 script.cpp \ 58 script.cpp \
59 dialer.cpp \ 59 dialer.cpp \
60 terminalwidget.cpp \ 60 terminalwidget.cpp \
61 emulation_handler.cpp TEHistory.cpp \ 61 emulation_handler.cpp TEHistory.cpp \
62 TEScreen.cpp TEWidget.cpp \ 62 TEScreen.cpp TEWidget.cpp \
63 TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ 63 TEmuVt102.cpp TEmulation.cpp MyPty.cpp \
64 consoleconfigwidget.cpp 64 consoleconfigwidget.cpp
65 65
66 66
@@ -69,3 +69,3 @@ INCLUDEPATH += $(OPIEDIR)/include
69DEPENDPATH += $(OPIEDIR)/include 69DEPENDPATH += $(OPIEDIR)/include
70LIBS += -lqpe -lopie -lutil 70LIBS += -lqpe -lopiecore2 -lopieui2 -lutil
71TARGET = opie-console 71TARGET = opie-console
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h
index c731747..97bd650 100644
--- a/noncore/apps/opie-console/profileeditordialog.h
+++ b/noncore/apps/opie-console/profileeditordialog.h
@@ -4,3 +4,3 @@
4#include <qdialog.h> 4#include <qdialog.h>
5#include <opie/otabwidget.h> 5#include <opie2/otabwidget.h>
6 6
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index 0a315cf..c47e73e 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -3,3 +3,2 @@
3#include <qfile.h> 3#include <qfile.h>
4#include <opie/oprocess.h>
5#include <stdio.h> 4#include <stdio.h>
diff --git a/noncore/apps/opie-console/sz_transfer.h b/noncore/apps/opie-console/sz_transfer.h
index d3e6621..aa97c32 100644
--- a/noncore/apps/opie-console/sz_transfer.h
+++ b/noncore/apps/opie-console/sz_transfer.h
@@ -4,3 +4,3 @@
4#include "file_layer.h" 4#include "file_layer.h"
5#include <opie/oprocess.h> 5#include <opie2/oprocess.h>
6 6
diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h
index cbaa0f1..98450a3 100644
--- a/noncore/apps/opie-console/tabwidget.h
+++ b/noncore/apps/opie-console/tabwidget.h
@@ -4,3 +4,3 @@
4#include <qmap.h> 4#include <qmap.h>
5#include <opie/otabwidget.h> 5#include <opie2/otabwidget.h>
6 6
diff --git a/noncore/apps/opie-console/test/console.pro b/noncore/apps/opie-console/test/console.pro
index 7b4c310..624f381 100644
--- a/noncore/apps/opie-console/test/console.pro
+++ b/noncore/apps/opie-console/test/console.pro
@@ -2,7 +2,7 @@ TEMPLATE = app
2#CONFIG = qt warn_on release 2#CONFIG = qt warn_on release
3 CONFIG = qt debug 3CONFIG = qt debug
4#DESTDIR = $(OPIEDIR)/bin 4#DESTDIR = $(OPIEDIR)/bin
5HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ 5HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\
6 senderui.h ../profile.h ../filetransfer.h ../procctl.h \ 6 senderui.h ../profile.h ../filetransfer.h ../procctl.h \
7 ../filereceive.h ../receive_layer.h 7 ../filereceive.h ../receive_layer.h
8SOURCES = ../io_layer.cpp ../io_serial.cpp \ 8SOURCES = ../io_layer.cpp ../io_serial.cpp \
@@ -10,3 +10,3 @@ SOURCES = ../io_layer.cpp ../io_serial.cpp \
10 main.cpp senderui.cpp ../filetransfer.cpp ../procctl.cpp \ 10 main.cpp senderui.cpp ../filetransfer.cpp ../procctl.cpp \
11 ../filereceive.cpp ../receive_layer.cpp 11 ../filereceive.cpp ../receive_layer.cpp
12INTERFACES = sender.ui 12INTERFACES = sender.ui
@@ -14,3 +14,3 @@ INCLUDEPATH += $(OPIEDIR)/include
14DEPENDPATH += $(OPIEDIR)/include 14DEPENDPATH += $(OPIEDIR)/include
15LIBS += -lqpe -lopie 15LIBS += -lqpe -lopiecore2
16TARGET = test 16TARGET = test
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp
index 4026808..4a7202d 100644
--- a/noncore/apps/opie-console/test/senderui.cpp
+++ b/noncore/apps/opie-console/test/senderui.cpp
@@ -13,3 +13,3 @@
13 13
14#include <opie/oprocess.h> 14#include <opie2/oprocess.h>
15 15
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index 55dd748..30e7caf 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -10,3 +10,3 @@
10 10
11#include <opie/ofiledialog.h> 11#include <opie2/ofiledialog.h>
12 12
@@ -21,71 +21,71 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch
21 m_lay = 0l; 21 m_lay = 0l;
22 m_recvlay = 0l; 22 m_recvlay = 0l;
23 QVBoxLayout *vbox, *vbox2; 23 QVBoxLayout *vbox, *vbox2;
24 QHBoxLayout *hbox, *hbox2, *hbox3; 24 QHBoxLayout *hbox, *hbox2, *hbox3;
25 QLabel *file, *mode, *progress, *status; 25 QLabel *file, *mode, *progress, *status;
26 QButtonGroup *group; 26 QButtonGroup *group;
27 QRadioButton *mode_send, *mode_receive; 27 QRadioButton *mode_send, *mode_receive;
28 28
29 m_autocleanup = 0; 29 m_autocleanup = 0;
30 m_running = true; 30 m_running = true;
31 31
32 group = new QButtonGroup(QObject::tr("Transfer mode"), this); 32 group = new QButtonGroup(QObject::tr("Transfer mode"), this);
33 mode_send = new QRadioButton(QObject::tr("Send"), group); 33 mode_send = new QRadioButton(QObject::tr("Send"), group);
34 mode_receive = new QRadioButton(QObject::tr("Receive"), group); 34 mode_receive = new QRadioButton(QObject::tr("Receive"), group);
35 group->insert(mode_send, id_send); 35 group->insert(mode_send, id_send);
36 group->insert(mode_receive, id_receive); 36 group->insert(mode_receive, id_receive);
37 vbox2 = new QVBoxLayout(group, 2); 37 vbox2 = new QVBoxLayout(group, 2);
38 vbox2->addSpacing(10); 38 vbox2->addSpacing(10);
39 hbox3 = new QHBoxLayout(vbox2, 2); 39 hbox3 = new QHBoxLayout(vbox2, 2);
40 hbox3->add(mode_send); 40 hbox3->add(mode_send);
41 hbox3->add(mode_receive); 41 hbox3->add(mode_receive);
42 mode_send->setChecked(true); 42 mode_send->setChecked(true);
43 m_transfermode = id_send; 43 m_transfermode = id_send;
44 44
45 file = new QLabel(QObject::tr("Send file"), this); 45 file = new QLabel(QObject::tr("Send file"), this);
46 mode = new QLabel(QObject::tr("Transfer protocol"), this); 46 mode = new QLabel(QObject::tr("Transfer protocol"), this);
47 progress = new QLabel(QObject::tr("Progress"), this); 47 progress = new QLabel(QObject::tr("Progress"), this);
48 status = new QLabel(QObject::tr("Status"), this); 48 status = new QLabel(QObject::tr("Status"), this);
49 49
50 statusbar = new QLabel(QObject::tr("Ready"), this); 50 statusbar = new QLabel(QObject::tr("Ready"), this);
51 statusbar->setFrameStyle(QFrame::Panel | QFrame::Sunken); 51 statusbar->setFrameStyle(QFrame::Panel | QFrame::Sunken);
52 52
53 protocol = new QComboBox(this); 53 protocol = new QComboBox(this);
54 QStringList list = m_win->factory()->fileTransferLayers(); 54 QStringList list = m_win->factory()->fileTransferLayers();
55 for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) 55 for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
56 protocol->insertItem((*it)); 56 protocol->insertItem((*it));
57 57
58 filename = new QLineEdit(this); 58 filename = new QLineEdit(this);
59 59
60 progressbar = new QProgressBar(this); 60 progressbar = new QProgressBar(this);
61 progressbar->setProgress(0); 61 progressbar->setProgress(0);
62 62
63 selector = new QPushButton("...", this); 63 selector = new QPushButton("...", this);
64 ok = new QPushButton(QObject::tr("Start transfer"), this); 64 ok = new QPushButton(QObject::tr("Start transfer"), this);
65 cancel = new QPushButton(QObject::tr("Cancel"), this); 65 cancel = new QPushButton(QObject::tr("Cancel"), this);
66 66
67 vbox = new QVBoxLayout(this, 2); 67 vbox = new QVBoxLayout(this, 2);
68 vbox->add(group); 68 vbox->add(group);
69 vbox->add(file); 69 vbox->add(file);
70 hbox = new QHBoxLayout(vbox, 0); 70 hbox = new QHBoxLayout(vbox, 0);
71 hbox->add(filename); 71 hbox->add(filename);
72 hbox->add(selector); 72 hbox->add(selector);
73 vbox->add(mode); 73 vbox->add(mode);
74 vbox->add(protocol); 74 vbox->add(protocol);
75 vbox->add(progress); 75 vbox->add(progress);
76 vbox->add(progressbar); 76 vbox->add(progressbar);
77 vbox->add(status); 77 vbox->add(status);
78 vbox->add(statusbar); 78 vbox->add(statusbar);
79 vbox->addStretch(1); 79 vbox->addStretch(1);
80 hbox2 = new QHBoxLayout(vbox, 2); 80 hbox2 = new QHBoxLayout(vbox, 2);
81 hbox2->add(ok); 81 hbox2->add(ok);
82 hbox2->add(cancel); 82 hbox2->add(cancel);
83 83
84 setCaption(QObject::tr("File transfer")); 84 setCaption(QObject::tr("File transfer"));
85 show(); 85 show();
86 86
87 connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); 87 connect(selector, SIGNAL(clicked()), SLOT(slotFilename()));
88 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); 88 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer()));
89 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); 89 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel()));
90 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); 90 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int)));
91} 91}
@@ -98,6 +98,6 @@ void TransferDialog::slotFilename()
98{ 98{
99 QString f; 99 QString f;
100 100
101 f = OFileDialog::getOpenFileName(0); 101 f = Opie::OFileDialog::getOpenFileName(0);
102 if(!f.isNull()) filename->setText(f); 102 if(!f.isNull()) filename->setText(f);
103} 103}
@@ -106,38 +106,38 @@ void TransferDialog::slotTransfer()
106{ 106{
107 if((m_transfermode == id_send) && (filename->text().isEmpty())) 107 if((m_transfermode == id_send) && (filename->text().isEmpty()))
108 { 108 {
109 QMessageBox::information(this, 109 QMessageBox::information(this,
110 QObject::tr("Attention"), 110 QObject::tr("Attention"),
111 QObject::tr("No file has been specified.")); 111 QObject::tr("No file has been specified."));
112 return; 112 return;
113 } 113 }
114 114
115 ok->setEnabled(false); 115 ok->setEnabled(false);
116 116
117 cleanup(); 117 cleanup();
118 m_autocleanup = 0; 118 m_autocleanup = 0;
119 119
120 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); 120 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending..."));
121 else statusbar->setText(QObject::tr("Receiving...")); 121 else statusbar->setText(QObject::tr("Receiving..."));
122 122
123 if(m_transfermode == id_send) 123 if(m_transfermode == id_send)
124 { 124 {
125 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); 125 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer());
126 m_lay->sendFile(filename->text()); 126 m_lay->sendFile(filename->text());
127 127
128 connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), 128 connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)),
129 SLOT(slotProgress(const QString&, int, int, int, int, int))); 129 SLOT(slotProgress(const QString&, int, int, int, int, int)));
130 connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); 130 connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&)));
131 connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); 131 connect(m_lay, SIGNAL(sent()), SLOT(slotSent()));
132 } 132 }
133 else 133 else
134 { 134 {
135 m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); 135 m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer());
136 m_recvlay->receive(); 136 m_recvlay->receive();
137 137
138 connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), 138 connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)),
139 SLOT(slotProgress(const QString&, int, int, int, int, int))); 139 SLOT(slotProgress(const QString&, int, int, int, int, int)));
140 connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); 140 connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&)));
141 connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); 141 connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&)));
142 } 142 }
143} 143}
@@ -146,14 +146,14 @@ void TransferDialog::cleanup()
146{ 146{
147 if(m_lay) 147 if(m_lay)
148 { 148 {
149 m_lay->cancel(); 149 m_lay->cancel();
150 delete m_lay; 150 delete m_lay;
151 m_lay = 0l; 151 m_lay = 0l;
152 } 152 }
153 if(m_recvlay) 153 if(m_recvlay)
154 { 154 {
155 m_recvlay->cancel(); 155 m_recvlay->cancel();
156 delete m_recvlay; 156 delete m_recvlay;
157 m_recvlay = 0l; 157 m_recvlay = 0l;
158 } 158 }
159} 159}
@@ -162,25 +162,25 @@ void TransferDialog::slotCancel()
162{ 162{
163 ok->setEnabled(true); 163 ok->setEnabled(true);
164 statusbar->setText(QObject::tr("Ready")); 164 statusbar->setText(QObject::tr("Ready"));
165 165
166 if((m_lay) || (m_recvlay)) 166 if((m_lay) || (m_recvlay))
167 { 167 {
168 cleanup(); 168 cleanup();
169 if(m_autocleanup) 169 if(m_autocleanup)
170 { 170 {
171 m_running = false; 171 m_running = false;
172 close(); 172 close();
173 } 173 }
174 else 174 else
175 { 175 {
176 QMessageBox::information(this, 176 QMessageBox::information(this,
177 QObject::tr("Cancelled"), 177 QObject::tr("Cancelled"),
178 QObject::tr("The file transfer has been cancelled.")); 178 QObject::tr("The file transfer has been cancelled."));
179 } 179 }
180 } 180 }
181 else 181 else
182 { 182 {
183 m_running = false; 183 m_running = false;
184 close(); 184 close();
185 } 185 }
186} 186}
@@ -189,3 +189,3 @@ void TransferDialog::slotProgress(const QString& , int progress, int , int , int
189{ 189{
190 progressbar->setProgress(progress); 190 progressbar->setProgress(progress);
191} 191}
@@ -194,40 +194,40 @@ void TransferDialog::slotError(int error, const QString& )
194{ 194{
195 statusbar->setText(QObject::tr("Ready")); 195 statusbar->setText(QObject::tr("Ready"));
196 196
197 switch(error) 197 switch(error)
198 { 198 {
199 case FileTransferLayer::NotSupported: 199 case FileTransferLayer::NotSupported:
200 QMessageBox::critical(this, 200 QMessageBox::critical(this,
201 QObject::tr("Error"), 201 QObject::tr("Error"),
202 QObject::tr("Operation not supported.")); 202 QObject::tr("Operation not supported."));
203 break; 203 break;
204 case FileTransferLayer::StartError: 204 case FileTransferLayer::StartError:
205 QMessageBox::critical(this, 205 QMessageBox::critical(this,
206 QObject::tr("Error"), 206 QObject::tr("Error"),
207 QObject::tr("Transfer could not be started.")); 207 QObject::tr("Transfer could not be started."));
208 break; 208 break;
209 case FileTransferLayer::NoError: 209 case FileTransferLayer::NoError:
210 QMessageBox::critical(this, 210 QMessageBox::critical(this,
211 QObject::tr("Error"), 211 QObject::tr("Error"),
212 QObject::tr("No error.")); 212 QObject::tr("No error."));
213 break; 213 break;
214 case FileTransferLayer::Undefined: 214 case FileTransferLayer::Undefined:
215 QMessageBox::critical(this, 215 QMessageBox::critical(this,
216 QObject::tr("Error"), 216 QObject::tr("Error"),
217 QObject::tr("Undefined error occured.")); 217 QObject::tr("Undefined error occured."));
218 break; 218 break;
219 case FileTransferLayer::Incomplete: 219 case FileTransferLayer::Incomplete:
220 QMessageBox::critical(this, 220 QMessageBox::critical(this,
221 QObject::tr("Error"), 221 QObject::tr("Error"),
222 QObject::tr("Incomplete transfer.")); 222 QObject::tr("Incomplete transfer."));
223 break; 223 break;
224 case FileTransferLayer::Unknown: 224 case FileTransferLayer::Unknown:
225 default: 225 default:
226 QMessageBox::critical(this, 226 QMessageBox::critical(this,
227 QObject::tr("Error"), 227 QObject::tr("Error"),
228 QObject::tr("Unknown error occured.")); 228 QObject::tr("Unknown error occured."));
229 break; 229 break;
230 } 230 }
231 231
232 m_autocleanup = 1; 232 m_autocleanup = 1;
233} 233}
@@ -236,8 +236,8 @@ void TransferDialog::slotSent()
236{ 236{
237 progressbar->setProgress(100); 237 progressbar->setProgress(100);
238 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); 238 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent."));
239 ok->setEnabled(true); 239 ok->setEnabled(true);
240 progressbar->setProgress(0); 240 progressbar->setProgress(0);
241 statusbar->setText(QObject::tr("Ready")); 241 statusbar->setText(QObject::tr("Ready"));
242 m_autocleanup = 1; 242 m_autocleanup = 1;
243} 243}
@@ -246,9 +246,9 @@ void TransferDialog::slotReceived(const QString& )
246{ 246{
247 progressbar->setProgress(100); 247 progressbar->setProgress(100);
248 QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received.")); 248 QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received."));
249 //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); 249 //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file));
250 ok->setEnabled(true); 250 ok->setEnabled(true);
251 progressbar->setProgress(0); 251 progressbar->setProgress(0);
252 statusbar->setText(QObject::tr("Ready")); 252 statusbar->setText(QObject::tr("Ready"));
253 m_autocleanup = 1; 253 m_autocleanup = 1;
254} 254}
@@ -257,13 +257,13 @@ void TransferDialog::slotMode(int id)
257{ 257{
258 if(id == id_send) 258 if(id == id_send)
259 { 259 {
260 selector->setEnabled(true); 260 selector->setEnabled(true);
261 filename->setEnabled(true); 261 filename->setEnabled(true);
262 } 262 }
263 else 263 else
264 { 264 {
265 selector->setEnabled(false); 265 selector->setEnabled(false);
266 filename->setEnabled(false); 266 filename->setEnabled(false);
267 } 267 }
268 m_transfermode = id; 268 m_transfermode = id;
269} 269}
@@ -272,3 +272,3 @@ bool TransferDialog::isRunning()
272{ 272{
273 return m_running; 273 return m_running;
274} 274}