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
@@ -1,4 +1,4 @@
1 config OPIE-CONSOLE 1 config OPIE-CONSOLE
2 boolean "opie-console (scriptable terminal program)" 2 boolean "opie-console (scriptable terminal program)"
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,5 +1,3 @@
1#include <opie/oprocess.h>
2
3#include "file_layer.h" 1#include "file_layer.h"
4 2
5FileTransferLayer::FileTransferLayer(IOLayer *layer) 3FileTransferLayer::FileTransferLayer(IOLayer *layer)
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
@@ -6,8 +6,6 @@
6 6
7#include <qsocketnotifier.h> 7#include <qsocketnotifier.h>
8 8
9#include <opie/oprocess.h>
10
11#include "procctl.h" 9#include "procctl.h"
12#include "filetransfer.h" 10#include "filetransfer.h"
13 11
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
@@ -3,13 +3,14 @@
3 3
4#include <sys/types.h> 4#include <sys/types.h>
5 5
6#include <opie2/oprocess.h>
7
6#include <qfile.h> 8#include <qfile.h>
7#include <qstringlist.h> 9#include <qstringlist.h>
8 10
9#include "file_layer.h" 11#include "file_layer.h"
10 12
11class QSocketNotifier; 13class QSocketNotifier;
12class OProcess;
13class FileTransferControl; 14class FileTransferControl;
14class FileTransfer : public FileTransferLayer{ 15class FileTransfer : public FileTransferLayer{
15 Q_OBJECT 16 Q_OBJECT
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
@@ -1,7 +1,7 @@
1#ifndef OPIE_IO_BT 1#ifndef OPIE_IO_BT
2#define OPIE_IO_BT 2#define OPIE_IO_BT
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
6 6
7/* Default values to be used if the profile information is incomplete */ 7/* Default values to be used if the profile information is incomplete */
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
@@ -1,7 +1,7 @@
1#ifndef OPIE_IO_IRDA 1#ifndef OPIE_IO_IRDA
2#define OPIE_IO_IRDA 2#define OPIE_IO_IRDA
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
6 6
7/* Default values to be used if the profile information is incomplete */ 7/* Default values to be used if the profile information is incomplete */
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
@@ -1,7 +1,7 @@
1#ifndef OPIE_IO_MODEM 1#ifndef OPIE_IO_MODEM
2#define OPIE_IO_MODEM 2#define OPIE_IO_MODEM
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5#include "io_serial.h" 5#include "io_serial.h"
6#include "profile.h" 6#include "profile.h"
7 7
@@ -64,7 +64,7 @@ private:
64 m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; 64 m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel;
65 int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, 65 int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime,
66 m_bpsDetect, m_dcdLines, m_multiLineUntag; 66 m_bpsDetect, m_dcdLines, m_multiLineUntag;
67 Profile m_profile; 67 Profile m_profile;
68 68
69private slots: 69private slots:
70 void slotExited(OProcess* proc); 70 void slotExited(OProcess* proc);
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
@@ -10,7 +10,7 @@
10#include <qpe/filemanager.h> 10#include <qpe/filemanager.h>
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12 12
13#include <opie/ofiledialog.h> 13#include <opie2/ofiledialog.h>
14 14
15#include "TEmulation.h" 15#include "TEmulation.h"
16#include "profileeditordialog.h" 16#include "profileeditordialog.h"
@@ -333,7 +333,7 @@ void MainWindow::slotSaveScript() {
333 QStringList text; 333 QStringList text;
334 text << "text/plain"; 334 text << "text/plain";
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()) {
338 QFileInfo info(filename); 338 QFileInfo info(filename);
339 if (info.extension(FALSE) != "script") 339 if (info.extension(FALSE) != "script")
@@ -447,8 +447,8 @@ void MainWindow::slotClose() {
447 447
448 Session* ses = currentSession(); 448 Session* ses = currentSession();
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 );
453 /*it's autodelete */ 453 /*it's autodelete */
454 m_sessions.remove( ses ); 454 m_sessions.remove( ses );
@@ -483,19 +483,19 @@ void MainWindow::slotProfile( int id) {
483 483
484 484
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
489 Session *ses = manager()->fromProfile( prof, tabWidget() ); 489 Session *ses = manager()->fromProfile( prof, tabWidget() );
490 490
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
500 m_sessions.append( ses ); 500 m_sessions.append( ses );
501 tabWidget()->add( ses ); 501 tabWidget()->add( ses );
@@ -536,16 +536,16 @@ void MainWindow::create( const Profile& prof ) {
536void MainWindow::slotTransfer() 536void MainWindow::slotTransfer()
537{ 537{
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 }
550} 550}
551 551
@@ -572,10 +572,10 @@ void MainWindow::slotOpenButtons( bool state ) {
572void MainWindow::slotSessionChanged( Session* ses ) { 572void MainWindow::slotSessionChanged( Session* ses ) {
573 qWarning("changed!"); 573 qWarning("changed!");
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
580 if ( ses ) { 580 if ( ses ) {
581 m_curSession = ses; 581 m_curSession = ses;
@@ -621,15 +621,15 @@ void MainWindow::slotWrap()
621 if(e) 621 if(e)
622 { 622 {
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 }
634 } 634 }
635} 635}
@@ -706,7 +706,7 @@ void MainWindow::slotSaveHistory() {
706 QStringList text; 706 QStringList text;
707 text << "text/plain"; 707 text << "text/plain";
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;
711 711
712 QFileInfo info(filename); 712 QFileInfo info(filename);
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
@@ -5,6 +5,6 @@ Section: opie/applications
5Maintainer: Opie Team <opie@handhelds.org> 5Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: 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
10Description: Opie terminal app 10Description: Opie terminal app
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,73 +1,73 @@
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
67INTERFACES = configurebase.ui editbase.ui 67INTERFACES = configurebase.ui editbase.ui
68INCLUDEPATH += $(OPIEDIR)/include 68INCLUDEPATH += $(OPIEDIR)/include
69DEPENDPATH += $(OPIEDIR)/include 69DEPENDPATH += $(OPIEDIR)/include
70LIBS += -lqpe -lopie -lutil 70LIBS += -lqpe -lopiecore2 -lopieui2 -lutil
71TARGET = opie-console 71TARGET = opie-console
72 72
73 73
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
@@ -2,7 +2,7 @@
2#define PROFILE_EDITOR_DIALOG 2#define PROFILE_EDITOR_DIALOG
3 3
4#include <qdialog.h> 4#include <qdialog.h>
5#include <opie/otabwidget.h> 5#include <opie2/otabwidget.h>
6 6
7#include "profile.h" 7#include "profile.h"
8 8
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
@@ -1,7 +1,6 @@
1 1
2#include "sz_transfer.h" 2#include "sz_transfer.h"
3#include <qfile.h> 3#include <qfile.h>
4#include <opie/oprocess.h>
5#include <stdio.h> 4#include <stdio.h>
6#include <sys/termios.h> 5#include <sys/termios.h>
7 6
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
@@ -2,7 +2,7 @@
2#define OPIE_FL_SZ_H 2#define OPIE_FL_SZ_H
3 3
4#include "file_layer.h" 4#include "file_layer.h"
5#include <opie/oprocess.h> 5#include <opie2/oprocess.h>
6 6
7class SzTransfer : public FileTransferLayer { 7class SzTransfer : public FileTransferLayer {
8 8
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
@@ -2,7 +2,7 @@
2#define OPIE_TAB_WIDGET_H 2#define OPIE_TAB_WIDGET_H
3 3
4#include <qmap.h> 4#include <qmap.h>
5#include <opie/otabwidget.h> 5#include <opie2/otabwidget.h>
6 6
7#include "session.h" 7#include "session.h"
8/** 8/**
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
@@ -1,18 +1,18 @@
1TEMPLATE = app 1TEMPLATE = 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 \
9 ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ 9 ../profile.cpp ../sz_transfer.cpp ../file_layer.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
13INCLUDEPATH += $(OPIEDIR)/include 13INCLUDEPATH += $(OPIEDIR)/include
14DEPENDPATH += $(OPIEDIR)/include 14DEPENDPATH += $(OPIEDIR)/include
15LIBS += -lqpe -lopie 15LIBS += -lqpe -lopiecore2
16TARGET = test 16TARGET = test
17 17
18 18
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
@@ -11,7 +11,7 @@
11#include "../filetransfer.h" 11#include "../filetransfer.h"
12#include "../filereceive.h" 12#include "../filereceive.h"
13 13
14#include <opie/oprocess.h> 14#include <opie2/oprocess.h>
15 15
16#include "senderui.h" 16#include "senderui.h"
17 17
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
@@ -8,7 +8,7 @@
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 <opie2/ofiledialog.h>
12 12
13#include "metafactory.h" 13#include "metafactory.h"
14#include "mainwindow.h" 14#include "mainwindow.h"
@@ -19,75 +19,75 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch
19: QDialog(parent, 0l, false), m_win(mainwindow) 19: QDialog(parent, 0l, false), m_win(mainwindow)
20{ 20{
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}
92 92
93TransferDialog::~TransferDialog() 93TransferDialog::~TransferDialog()
@@ -96,180 +96,180 @@ TransferDialog::~TransferDialog()
96 96
97void TransferDialog::slotFilename() 97void 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}
104 104
105void TransferDialog::slotTransfer() 105void 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}
144 144
145void TransferDialog::cleanup() 145void 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}
160 160
161void TransferDialog::slotCancel() 161void 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}
187 187
188void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) 188void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int )
189{ 189{
190 progressbar->setProgress(progress); 190 progressbar->setProgress(progress);
191} 191}
192 192
193void TransferDialog::slotError(int error, const QString& ) 193void 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}
234 234
235void TransferDialog::slotSent() 235void 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}
244 244
245void TransferDialog::slotReceived(const QString& ) 245void 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}
255 255
256void TransferDialog::slotMode(int id) 256void 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}
270 270
271bool TransferDialog::isRunning() 271bool TransferDialog::isRunning()
272{ 272{
273 return m_running; 273 return m_running;
274} 274}
275 275