author | drw <drw> | 2004-02-23 17:41:08 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-23 17:41:08 (UTC) |
commit | 0259f547f4dea6e10df1e02ee78b343137de24ed (patch) (unidiff) | |
tree | c09a0a69c8dfe397238bf476a849875306072855 /noncore/apps | |
parent | d1e639b1272a6ba18ebe3fc982148ce0cb5c8c84 (diff) | |
download | opie-0259f547f4dea6e10df1e02ee78b343137de24ed.zip opie-0259f547f4dea6e10df1e02ee78b343137de24ed.tar.gz opie-0259f547f4dea6e10df1e02ee78b343137de24ed.tar.bz2 |
Opie Console: libopie->libopie2
-rw-r--r-- | noncore/apps/opie-console/config.in | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/file_layer.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 74 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 112 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/console.pro | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 416 |
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,14 +1,12 @@ | |||
1 | #include <opie/oprocess.h> | ||
2 | |||
3 | #include "file_layer.h" | 1 | #include "file_layer.h" |
4 | 2 | ||
5 | FileTransferLayer::FileTransferLayer(IOLayer *layer) | 3 | FileTransferLayer::FileTransferLayer(IOLayer *layer) |
6 | : QObject(), m_layer( layer ) | 4 | : QObject(), m_layer( layer ) |
7 | { | 5 | { |
8 | } | 6 | } |
9 | 7 | ||
10 | FileTransferLayer::~FileTransferLayer() { | 8 | FileTransferLayer::~FileTransferLayer() { |
11 | } | 9 | } |
12 | 10 | ||
13 | void FileTransferLayer::sendFile(const QFile&) { | 11 | void FileTransferLayer::sendFile(const QFile&) { |
14 | 12 | ||
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 | |||
@@ -1,22 +1,20 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | #include <fcntl.h> | 4 | #include <fcntl.h> |
5 | #include <unistd.h> | 5 | #include <unistd.h> |
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 | ||
14 | 12 | ||
15 | FileTransfer::FileTransfer( Type t, IOLayer* lay ) | 13 | FileTransfer::FileTransfer( Type t, IOLayer* lay ) |
16 | : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { | 14 | : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { |
17 | signal(SIGPIPE, SIG_IGN ); | 15 | signal(SIGPIPE, SIG_IGN ); |
18 | 16 | ||
19 | m_pid = 0; | 17 | m_pid = 0; |
20 | m_not = 0l; | 18 | m_not = 0l; |
21 | m_proc = 0l; | 19 | m_proc = 0l; |
22 | } | 20 | } |
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 | |||
@@ -1,24 +1,25 @@ | |||
1 | #ifndef OPIE_FILE_TRANSFER_H | 1 | #ifndef OPIE_FILE_TRANSFER_H |
2 | #define OPIE_FILE_TRANSFER_H | 2 | #define OPIE_FILE_TRANSFER_H |
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 | ||
11 | class QSocketNotifier; | 13 | class QSocketNotifier; |
12 | class OProcess; | ||
13 | class FileTransferControl; | 14 | class FileTransferControl; |
14 | class FileTransfer : public FileTransferLayer{ | 15 | class FileTransfer : public FileTransferLayer{ |
15 | Q_OBJECT | 16 | Q_OBJECT |
16 | friend class FileTransferControl; | 17 | friend class FileTransferControl; |
17 | public: | 18 | public: |
18 | enum Type { | 19 | enum Type { |
19 | SZ = 0, | 20 | SZ = 0, |
20 | SX, | 21 | SX, |
21 | SY | 22 | SY |
22 | }; | 23 | }; |
23 | FileTransfer( Type t, IOLayer* ); | 24 | FileTransfer( Type t, IOLayer* ); |
24 | ~FileTransfer(); | 25 | ~FileTransfer(); |
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,16 +1,16 @@ | |||
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 */ |
8 | #define BT_DEFAULT_DEVICE "/dev/ttyU0" | 8 | #define BT_DEFAULT_DEVICE "/dev/ttyU0" |
9 | #define BT_DEFAULT_BAUD 9600 | 9 | #define BT_DEFAULT_BAUD 9600 |
10 | #define BT_DEFAULT_PARITY 0 | 10 | #define BT_DEFAULT_PARITY 0 |
11 | #define BT_DEFAULT_DBITS 8 | 11 | #define BT_DEFAULT_DBITS 8 |
12 | #define BT_DEFAULT_SBITS 1 | 12 | #define BT_DEFAULT_SBITS 1 |
13 | #define BT_DEFAULT_FLOW 0 | 13 | #define BT_DEFAULT_FLOW 0 |
14 | #define BT_DEFAULT_MAC 0 | 14 | #define BT_DEFAULT_MAC 0 |
15 | 15 | ||
16 | 16 | ||
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,16 +1,16 @@ | |||
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 */ |
8 | #define IRDA_DEFAULT_DEVICE "/dev/ircomm0" | 8 | #define IRDA_DEFAULT_DEVICE "/dev/ircomm0" |
9 | #define IRDA_DEFAULT_BAUD 9600 | 9 | #define IRDA_DEFAULT_BAUD 9600 |
10 | #define IRDA_DEFAULT_PARITY 0 | 10 | #define IRDA_DEFAULT_PARITY 0 |
11 | #define IRDA_DEFAULT_DBITS 8 | 11 | #define IRDA_DEFAULT_DBITS 8 |
12 | #define IRDA_DEFAULT_SBITS 1 | 12 | #define IRDA_DEFAULT_SBITS 1 |
13 | #define IRDA_DEFAULT_FLOW 0 | 13 | #define IRDA_DEFAULT_FLOW 0 |
14 | 14 | ||
15 | /* IOSerial implements a RS232 IO Layer */ | 15 | /* IOSerial implements a RS232 IO Layer */ |
16 | 16 | ||
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,16 +1,16 @@ | |||
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 | ||
8 | /* Default values to be used if the profile information is incomplete */ | 8 | /* Default values to be used if the profile information is incomplete */ |
9 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" | 9 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" |
10 | #define MODEM_DEFAULT_BAUD 9600 | 10 | #define MODEM_DEFAULT_BAUD 9600 |
11 | #define MODEM_DEFAULT_PARITY 0 | 11 | #define MODEM_DEFAULT_PARITY 0 |
12 | #define MODEM_DEFAULT_DBITS 8 | 12 | #define MODEM_DEFAULT_DBITS 8 |
13 | #define MODEM_DEFAULT_SBITS 1 | 13 | #define MODEM_DEFAULT_SBITS 1 |
14 | #define MODEM_DEFAULT_FLOW 0 | 14 | #define MODEM_DEFAULT_FLOW 0 |
15 | 15 | ||
16 | #define MODEM_DEFAULT_INIT_STRING "AT" | 16 | #define MODEM_DEFAULT_INIT_STRING "AT" |
@@ -55,20 +55,20 @@ signals: | |||
55 | public slots: | 55 | public slots: |
56 | virtual void send( const QByteArray& ); | 56 | virtual void send( const QByteArray& ); |
57 | virtual bool open(); | 57 | virtual bool open(); |
58 | virtual void close(); | 58 | virtual void close(); |
59 | virtual void reload(const Profile &); | 59 | virtual void reload(const Profile &); |
60 | 60 | ||
61 | private: | 61 | private: |
62 | 62 | ||
63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, | 63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, |
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 | ||
69 | private slots: | 69 | private slots: |
70 | void slotExited(OProcess* proc); | 70 | void slotExited(OProcess* proc); |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | #endif | 74 | #endif |
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 | |||
@@ -1,25 +1,25 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qmenubar.h> | 4 | #include <qmenubar.h> |
5 | #include <qtoolbar.h> | 5 | #include <qtoolbar.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qwhatsthis.h> | 7 | #include <qwhatsthis.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | 9 | ||
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" |
17 | #include "configdialog.h" | 17 | #include "configdialog.h" |
18 | #include "default.h" | 18 | #include "default.h" |
19 | #include "profilemanager.h" | 19 | #include "profilemanager.h" |
20 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
21 | #include "tabwidget.h" | 21 | #include "tabwidget.h" |
22 | #include "transferdialog.h" | 22 | #include "transferdialog.h" |
23 | #include "function_keyboard.h" | 23 | #include "function_keyboard.h" |
24 | #include "emulation_handler.h" | 24 | #include "emulation_handler.h" |
25 | #include "script.h" | 25 | #include "script.h" |
@@ -324,25 +324,25 @@ void MainWindow::slotRecordScript() { | |||
324 | currentSession()->emulationHandler()->startRecording(); | 324 | currentSession()->emulationHandler()->startRecording(); |
325 | m_saveScript->setEnabled(true); | 325 | m_saveScript->setEnabled(true); |
326 | m_recordScript->setEnabled(false); | 326 | m_recordScript->setEnabled(false); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | void MainWindow::slotSaveScript() { | 330 | void MainWindow::slotSaveScript() { |
331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { | 331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { |
332 | QMap<QString, QStringList> map; | 332 | QMap<QString, QStringList> map; |
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") |
340 | filename += ".script"; | 340 | filename += ".script"; |
341 | DocLnk nf; | 341 | DocLnk nf; |
342 | nf.setType("text/plain"); | 342 | nf.setType("text/plain"); |
343 | nf.setFile(filename); | 343 | nf.setFile(filename); |
344 | nf.setName(info.fileName()); | 344 | nf.setName(info.fileName()); |
345 | FileManager fm; | 345 | FileManager fm; |
346 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); | 346 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); |
347 | currentSession()->emulationHandler()->clearScript(); | 347 | currentSession()->emulationHandler()->clearScript(); |
348 | m_saveScript->setEnabled(false); | 348 | m_saveScript->setEnabled(false); |
@@ -438,26 +438,26 @@ void MainWindow::slotConfigure() { | |||
438 | * we will remove | 438 | * we will remove |
439 | * this window from the tabwidget | 439 | * this window from the tabwidget |
440 | * remove it from the list | 440 | * remove it from the list |
441 | * delete it | 441 | * delete it |
442 | * and set the currentSession() | 442 | * and set the currentSession() |
443 | */ | 443 | */ |
444 | void MainWindow::slotClose() { | 444 | void MainWindow::slotClose() { |
445 | if (!currentSession() ) | 445 | if (!currentSession() ) |
446 | return; | 446 | return; |
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 ); |
455 | qWarning("after remove!!"); | 455 | qWarning("after remove!!"); |
456 | 456 | ||
457 | if (!currentSession() ) { | 457 | if (!currentSession() ) { |
458 | m_connect->setEnabled( false ); | 458 | m_connect->setEnabled( false ); |
459 | m_disconnect->setEnabled( false ); | 459 | m_disconnect->setEnabled( false ); |
460 | m_terminate->setEnabled( false ); | 460 | m_terminate->setEnabled( false ); |
461 | m_transfer->setEnabled( false ); | 461 | m_transfer->setEnabled( false ); |
462 | m_recordScript->setEnabled( false ); | 462 | m_recordScript->setEnabled( false ); |
463 | m_saveScript->setEnabled( false ); | 463 | m_saveScript->setEnabled( false ); |
@@ -474,37 +474,37 @@ void MainWindow::slotClose() { | |||
474 | * We will get the name | 474 | * We will get the name |
475 | * Then the profile | 475 | * Then the profile |
476 | * and then we will make a profile | 476 | * and then we will make a profile |
477 | */ | 477 | */ |
478 | void MainWindow::slotProfile( int id) { | 478 | void MainWindow::slotProfile( int id) { |
479 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); | 479 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); |
480 | create( prof ); | 480 | create( prof ); |
481 | } | 481 | } |
482 | 482 | ||
483 | 483 | ||
484 | 484 | ||
485 | void MainWindow::create( const Profile& prof ) { | 485 | void 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 ); |
502 | tabWidget()->repaint(); | 502 | tabWidget()->repaint(); |
503 | m_curSession = ses; | 503 | m_curSession = ses; |
504 | 504 | ||
505 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 505 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
506 | m_connect->setEnabled( true ); | 506 | m_connect->setEnabled( true ); |
507 | m_disconnect->setEnabled( false ); | 507 | m_disconnect->setEnabled( false ); |
508 | m_terminate->setEnabled( true ); | 508 | m_terminate->setEnabled( true ); |
509 | m_fullscreen->setEnabled( true ); | 509 | m_fullscreen->setEnabled( true ); |
510 | m_wrap->setEnabled( true ); | 510 | m_wrap->setEnabled( true ); |
@@ -527,34 +527,34 @@ void MainWindow::create( const Profile& prof ) { | |||
527 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | 527 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ |
528 | m_isWrapped = true; | 528 | m_isWrapped = true; |
529 | } else { | 529 | } else { |
530 | m_isWrapped = false; | 530 | m_isWrapped = false; |
531 | } | 531 | } |
532 | 532 | ||
533 | m_kb->load(currentSession()->profile()); | 533 | m_kb->load(currentSession()->profile()); |
534 | } | 534 | } |
535 | 535 | ||
536 | void MainWindow::slotTransfer() | 536 | void 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 | ||
552 | 552 | ||
553 | void MainWindow::slotOpenKeb(bool state) { | 553 | void MainWindow::slotOpenKeb(bool state) { |
554 | 554 | ||
555 | if (state) m_keyBar->show(); | 555 | if (state) m_keyBar->show(); |
556 | else m_keyBar->hide(); | 556 | else m_keyBar->hide(); |
557 | 557 | ||
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
@@ -563,28 +563,28 @@ void MainWindow::slotOpenButtons( bool state ) { | |||
563 | if ( state ) { | 563 | if ( state ) { |
564 | m_buttonBar->show(); | 564 | m_buttonBar->show(); |
565 | } else { | 565 | } else { |
566 | m_buttonBar->hide(); | 566 | m_buttonBar->hide(); |
567 | } | 567 | } |
568 | } | 568 | } |
569 | 569 | ||
570 | 570 | ||
571 | 571 | ||
572 | void MainWindow::slotSessionChanged( Session* ses ) { | 572 | void 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; |
582 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); | 582 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); |
583 | if ( m_curSession->layer()->isConnected() ) { | 583 | if ( m_curSession->layer()->isConnected() ) { |
584 | m_connect->setEnabled( false ); | 584 | m_connect->setEnabled( false ); |
585 | m_disconnect->setEnabled( true ); | 585 | m_disconnect->setEnabled( true ); |
586 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); | 586 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); |
587 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); | 587 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); |
588 | m_scripts->setItemEnabled(m_runScript_id, true); | 588 | m_scripts->setItemEnabled(m_runScript_id, true); |
589 | } else { | 589 | } else { |
590 | m_connect->setEnabled( true ); | 590 | m_connect->setEnabled( true ); |
@@ -612,33 +612,33 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
612 | m_kb->load(currentSession()->profile()); | 612 | m_kb->load(currentSession()->profile()); |
613 | } | 613 | } |
614 | } | 614 | } |
615 | 615 | ||
616 | void MainWindow::slotWrap() | 616 | void MainWindow::slotWrap() |
617 | { | 617 | { |
618 | if(m_curSession) | 618 | if(m_curSession) |
619 | { | 619 | { |
620 | EmulationHandler *e = m_curSession->emulationHandler(); | 620 | EmulationHandler *e = m_curSession->emulationHandler(); |
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 | } |
636 | 636 | ||
637 | void MainWindow::slotFullscreen() { | 637 | void MainWindow::slotFullscreen() { |
638 | 638 | ||
639 | 639 | ||
640 | 640 | ||
641 | if ( m_isFullscreen ) { | 641 | if ( m_isFullscreen ) { |
642 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); | 642 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); |
643 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); | 643 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); |
644 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); | 644 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |
@@ -697,25 +697,25 @@ void MainWindow::slotSaveSession() { | |||
697 | tr("<qt>There is no Connection.</qt>"), 1 ); | 697 | tr("<qt>There is no Connection.</qt>"), 1 ); |
698 | return; | 698 | return; |
699 | } | 699 | } |
700 | manager()->add( currentSession()->profile() ); | 700 | manager()->add( currentSession()->profile() ); |
701 | manager()->save(); | 701 | manager()->save(); |
702 | populateProfiles(); | 702 | populateProfiles(); |
703 | } | 703 | } |
704 | void MainWindow::slotSaveHistory() { | 704 | void MainWindow::slotSaveHistory() { |
705 | QMap<QString, QStringList> map; | 705 | QMap<QString, QStringList> map; |
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); |
713 | 713 | ||
714 | DocLnk nf; | 714 | DocLnk nf; |
715 | nf.setType("text/plain"); | 715 | nf.setType("text/plain"); |
716 | nf.setFile(filename); | 716 | nf.setFile(filename); |
717 | nf.setName(info.fileName()); | 717 | nf.setName(info.fileName()); |
718 | 718 | ||
719 | 719 | ||
720 | QFile file(filename); | 720 | QFile file(filename); |
721 | file.open(IO_WriteOnly ); | 721 | file.open(IO_WriteOnly ); |
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 | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-console | 1 | Package: opie-console |
2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* | 2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 0.6-$SUB_VERSION | 7 | Version: 0.6-$SUB_VERSION |
8 | Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs | 8 | Depends: qpe-base, libopiecore2, libopieui2, opie-console-help-en, lrzsz, opie-keytabs |
9 | License: GPL | 9 | License: GPL |
10 | Description: Opie terminal app | 10 | Description: 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,76 +1,76 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | TMAKE_CXXFLAGS+= -DHAVE_OPENPTY | 2 | TMAKE_CXXFLAGS += -DHAVE_OPENPTY |
3 | CONFIG += qt warn_on release | 3 | CONFIG += qt warn_on release |
4 | #CONFIG = qt debug | 4 | #CONFIG = qt debug |
5 | DESTDIR = $(OPIEDIR)/bin | 5 | DESTDIR = $(OPIEDIR)/bin |
6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ | 6 | HEADERS = 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 | ||
36 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ | 36 | SOURCES = 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 | ||
67 | INTERFACES = configurebase.ui editbase.ui | 67 | INTERFACES = configurebase.ui editbase.ui |
68 | INCLUDEPATH += $(OPIEDIR)/include | 68 | INCLUDEPATH += $(OPIEDIR)/include |
69 | DEPENDPATH += $(OPIEDIR)/include | 69 | DEPENDPATH += $(OPIEDIR)/include |
70 | LIBS += -lqpe -lopie -lutil | 70 | LIBS += -lqpe -lopiecore2 -lopieui2 -lutil |
71 | TARGET = opie-console | 71 | TARGET = opie-console |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | include ( $(OPIEDIR)/include.pro ) | 76 | include ( $(OPIEDIR)/include.pro ) |
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 | |||
@@ -1,17 +1,17 @@ | |||
1 | #ifndef PROFILE_EDITOR_DIALOG | 1 | #ifndef PROFILE_EDITOR_DIALOG |
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 | ||
9 | class MetaFactory; | 9 | class MetaFactory; |
10 | class EditBase; | 10 | class EditBase; |
11 | class QTabWidget; | 11 | class QTabWidget; |
12 | class QHBoxLayout; | 12 | class QHBoxLayout; |
13 | class QLineEdit; | 13 | class QLineEdit; |
14 | class QComboBox; | 14 | class QComboBox; |
15 | class QCheckBox; | 15 | class QCheckBox; |
16 | class QLabel; | 16 | class QLabel; |
17 | class QScrollView; | 17 | class QScrollView; |
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,16 +1,15 @@ | |||
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 | ||
8 | 7 | ||
9 | 8 | ||
10 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
11 | { | 10 | { |
12 | } | 11 | } |
13 | 12 | ||
14 | SzTransfer::~SzTransfer() { | 13 | SzTransfer::~SzTransfer() { |
15 | } | 14 | } |
16 | 15 | ||
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 | |||
@@ -1,17 +1,17 @@ | |||
1 | #ifndef OPIE_FL_SZ_H | 1 | #ifndef OPIE_FL_SZ_H |
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 | ||
7 | class SzTransfer : public FileTransferLayer { | 7 | class SzTransfer : public FileTransferLayer { |
8 | 8 | ||
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | enum Type { | 12 | enum Type { |
13 | SZ=0, | 13 | SZ=0, |
14 | SX, | 14 | SX, |
15 | SY | 15 | SY |
16 | }; | 16 | }; |
17 | 17 | ||
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 | |||
@@ -1,17 +1,17 @@ | |||
1 | #ifndef OPIE_TAB_WIDGET_H | 1 | #ifndef OPIE_TAB_WIDGET_H |
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 | /** |
9 | * This is our central tab widget | 9 | * This is our central tab widget |
10 | * we can add sessions here | 10 | * we can add sessions here |
11 | */ | 11 | */ |
12 | class TabWidget : public OTabWidget{ | 12 | class TabWidget : public OTabWidget{ |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | TabWidget(QWidget *parent, const char* name ); | 15 | TabWidget(QWidget *parent, const char* name ); |
16 | ~TabWidget(); | 16 | ~TabWidget(); |
17 | void add( Session* ); | 17 | void add( Session* ); |
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,21 +1,21 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on release | 2 | #CONFIG = qt warn_on release |
3 | CONFIG = qt debug | 3 | CONFIG = qt debug |
4 | #DESTDIR = $(OPIEDIR)/bin | 4 | #DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ | 5 | HEADERS = ../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 |
8 | SOURCES = ../io_layer.cpp ../io_serial.cpp \ | 8 | SOURCES = ../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 |
12 | INTERFACES = sender.ui | 12 | INTERFACES = sender.ui |
13 | INCLUDEPATH += $(OPIEDIR)/include | 13 | INCLUDEPATH += $(OPIEDIR)/include |
14 | DEPENDPATH += $(OPIEDIR)/include | 14 | DEPENDPATH += $(OPIEDIR)/include |
15 | LIBS += -lqpe -lopie | 15 | LIBS += -lqpe -lopiecore2 |
16 | TARGET = test | 16 | TARGET = test |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | include ( $(OPIEDIR)/include.pro ) | 21 | include ( $(OPIEDIR)/include.pro ) |
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 | |||
@@ -2,25 +2,25 @@ | |||
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <fcntl.h> | 3 | #include <fcntl.h> |
4 | #include <sys/termios.h> | 4 | #include <sys/termios.h> |
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | #include <qsocketnotifier.h> | 7 | #include <qsocketnotifier.h> |
8 | 8 | ||
9 | #include "../profile.h" | 9 | #include "../profile.h" |
10 | #include "../io_serial.h" | 10 | #include "../io_serial.h" |
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 | ||
18 | SenderUI::SenderUI() | 18 | SenderUI::SenderUI() |
19 | : Sender() { | 19 | : Sender() { |
20 | 20 | ||
21 | /* we do that manually */ | 21 | /* we do that manually */ |
22 | Profile prof; | 22 | Profile prof; |
23 | QString str = "/dev/bty0"; | 23 | QString str = "/dev/bty0"; |
24 | prof.writeEntry("Device",str ); | 24 | prof.writeEntry("Device",str ); |
25 | prof.writeEntry("Baud", 19200 ); | 25 | prof.writeEntry("Baud", 19200 ); |
26 | 26 | ||
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 | |||
@@ -1,275 +1,275 @@ | |||
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 <opie2/ofiledialog.h> |
12 | 12 | ||
13 | #include "metafactory.h" | 13 | #include "metafactory.h" |
14 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
15 | 15 | ||
16 | #include "transferdialog.h" | 16 | #include "transferdialog.h" |
17 | 17 | ||
18 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) | 18 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) |
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 | ||
93 | TransferDialog::~TransferDialog() | 93 | TransferDialog::~TransferDialog() |
94 | { | 94 | { |
95 | } | 95 | } |
96 | 96 | ||
97 | void TransferDialog::slotFilename() | 97 | 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 | } |
104 | 104 | ||
105 | void TransferDialog::slotTransfer() | 105 | 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 | } |
144 | 144 | ||
145 | void TransferDialog::cleanup() | 145 | 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 | } |
160 | 160 | ||
161 | void TransferDialog::slotCancel() | 161 | 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 | } |
187 | 187 | ||
188 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) | 188 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) |
189 | { | 189 | { |
190 | progressbar->setProgress(progress); | 190 | progressbar->setProgress(progress); |
191 | } | 191 | } |
192 | 192 | ||
193 | void TransferDialog::slotError(int error, const QString& ) | 193 | 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 | } |
234 | 234 | ||
235 | void TransferDialog::slotSent() | 235 | 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 | } |
244 | 244 | ||
245 | void TransferDialog::slotReceived(const QString& ) | 245 | 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 | } |
255 | 255 | ||
256 | void TransferDialog::slotMode(int id) | 256 | 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 | } |
270 | 270 | ||
271 | bool TransferDialog::isRunning() | 271 | bool TransferDialog::isRunning() |
272 | { | 272 | { |
273 | return m_running; | 273 | return m_running; |
274 | } | 274 | } |
275 | 275 | ||