-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 | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 2 | ||||
-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 | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 4 |
17 files changed, 18 insertions, 22 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 @@ config OPIE-CONSOLE boolean "opie-console (scriptable terminal program)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + 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,22 +1,20 @@ -#include <opie/oprocess.h> - #include "file_layer.h" FileTransferLayer::FileTransferLayer(IOLayer *layer) : QObject(), m_layer( layer ) { } FileTransferLayer::~FileTransferLayer() { } void FileTransferLayer::sendFile(const QFile&) { } void FileTransferLayer::sendFile(const QString&) { } IOLayer* FileTransferLayer::layer() { return m_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 @@ -1,58 +1,56 @@ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <qsocketnotifier.h> -#include <opie/oprocess.h> - #include "procctl.h" #include "filetransfer.h" FileTransfer::FileTransfer( Type t, IOLayer* lay ) : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { signal(SIGPIPE, SIG_IGN ); m_pid = 0; m_not = 0l; m_proc = 0l; } FileTransfer::~FileTransfer() { } /** * now we will send the file. * * we request an fd. The IOLayer should be closed * then we will setup a pipe for progress communication * then we will dup2 the m_fd in the forked process * to do direct IO from and to the fd */ void FileTransfer::sendFile( const QString& file ) { m_prog =-1; m_fd = layer()->rawIO(); // // m_fd = ::open("/dev/ttyS0", O_RDWR); m_file = file; if ( pipe( m_comm ) < 0 ) m_comm[0] = m_comm[1] = 0; if ( pipe( m_info ) < 0 ) m_info[0] = m_info[1] = 0; m_pid = fork(); switch( m_pid ) { case -1: emit error( StartError, tr("Was not able to fork") ); slotExec(); break; case 0:{ setupChild(); /* exec */ char* verbose = "-vv"; char* binray = "-b"; 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,48 +1,49 @@ #ifndef OPIE_FILE_TRANSFER_H #define OPIE_FILE_TRANSFER_H #include <sys/types.h> +#include <opie2/oprocess.h> + #include <qfile.h> #include <qstringlist.h> #include "file_layer.h" class QSocketNotifier; -class OProcess; class FileTransferControl; class FileTransfer : public FileTransferLayer{ Q_OBJECT friend class FileTransferControl; public: enum Type { SZ = 0, SX, SY }; FileTransfer( Type t, IOLayer* ); ~FileTransfer(); void sendFile( const QString& file ); void sendFile( const QFile& ); void cancel(); private slots: void setupChild(); void slotRead(); void slotProgress( const QStringList& ); void slotExec(); private: Type m_type; pid_t m_pid; int m_fd; int m_prog; int m_info[2]; int m_comm[2]; int m_term[2]; QString m_file; QSocketNotifier *m_not; QSocketNotifier* m_proc; }; #endif 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,51 +1,51 @@ #ifndef OPIE_IO_BT #define OPIE_IO_BT -#include <opie/oprocess.h> +#include <opie2/oprocess.h> #include "io_serial.h" /* Default values to be used if the profile information is incomplete */ #define BT_DEFAULT_DEVICE "/dev/ttyU0" #define BT_DEFAULT_BAUD 9600 #define BT_DEFAULT_PARITY 0 #define BT_DEFAULT_DBITS 8 #define BT_DEFAULT_SBITS 1 #define BT_DEFAULT_FLOW 0 #define BT_DEFAULT_MAC 0 /* IOSerial implements a RS232 IO Layer */ class IOBt : public IOSerial { Q_OBJECT public: IOBt(const Profile &); ~IOBt(); virtual QString identifier() const; virtual QString name() const; virtual QBitArray supports() const; virtual bool isConnected(); signals: void received(const QByteArray &); void error(int, const QString &); public slots: virtual void send( const QByteArray& ); virtual bool open(); virtual void close(); virtual void reload(const Profile &); private: OProcess *m_attach; QString m_mac; private slots: void slotExited(OProcess* proc); }; #endif /* OPIE_IO_IRDA */ 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,49 +1,49 @@ #ifndef OPIE_IO_IRDA #define OPIE_IO_IRDA -#include <opie/oprocess.h> +#include <opie2/oprocess.h> #include "io_serial.h" /* Default values to be used if the profile information is incomplete */ #define IRDA_DEFAULT_DEVICE "/dev/ircomm0" #define IRDA_DEFAULT_BAUD 9600 #define IRDA_DEFAULT_PARITY 0 #define IRDA_DEFAULT_DBITS 8 #define IRDA_DEFAULT_SBITS 1 #define IRDA_DEFAULT_FLOW 0 /* IOSerial implements a RS232 IO Layer */ class IOIrda : public IOSerial { Q_OBJECT public: IOIrda(const Profile &); ~IOIrda(); virtual QString identifier() const; virtual QString name() const; virtual QBitArray supports() const; virtual bool isConnected(); signals: void received(const QByteArray &); void error(int, const QString &); public slots: virtual void send( const QByteArray& ); virtual bool open(); virtual void close(); virtual void reload(const Profile &); private: OProcess *m_attach; private slots: void slotExited(OProcess* proc); }; #endif /* OPIE_IO_IRDA */ 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,52 +1,52 @@ #ifndef OPIE_IO_MODEM #define OPIE_IO_MODEM -#include <opie/oprocess.h> +#include <opie2/oprocess.h> #include "io_serial.h" #include "profile.h" /* Default values to be used if the profile information is incomplete */ #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" #define MODEM_DEFAULT_BAUD 9600 #define MODEM_DEFAULT_PARITY 0 #define MODEM_DEFAULT_DBITS 8 #define MODEM_DEFAULT_SBITS 1 #define MODEM_DEFAULT_FLOW 0 #define MODEM_DEFAULT_INIT_STRING "AT" #define MODEM_DEFAULT_RESET_STRING "ATZ~" #define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" #define MODEM_DEFAULT_DIAL_SUFFIX1 "" #define MODEM_DEFAULT_DIAL_PREFIX2 "" #define MODEM_DEFAULT_DIAL_SUFFIX2 "" #define MODEM_DEFAULT_DIAL_PREFIX3 "" #define MODEM_DEFAULT_DIAL_SUFFIX3 "" #define MODEM_DEFAULT_CONNECT_STRING "CONNECT" #define MODEM_DEFAULT_HANGUP_STRING "+++ATH" #define MODEM_DEFAULT_CANCEL_STRING "" #define MODEM_DEFAULT_DIAL_TIME 45 #define MODEM_DEFAULT_DELAY_REDIAL 2 #define MODEM_DEFAULT_NUMBER_TRIES 10 #define MODEM_DEFAULT_DTR_DROP_TIME 1 #define MODEM_DEFAULT_BPS_DETECT 0 // bool #define MODEM_DEFAULT_DCD_LINES 1 //bool #define MODEM_DEFAULT_MULTI_LINE_UNTAG 0 // bool /* IOSerial implements a RS232 IO Layer */ class IOModem : public IOSerial { Q_OBJECT public: IOModem(const Profile &); ~IOModem(); virtual QString identifier() const; virtual QString name() const; virtual QBitArray supports() const; virtual bool isConnected(); signals: void received(const QByteArray &); 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,61 +1,61 @@ #include <assert.h> #include <qaction.h> #include <qmenubar.h> #include <qtoolbar.h> #include <qmessagebox.h> #include <qwhatsthis.h> #include <qfileinfo.h> #include <qpe/filemanager.h> #include <qpe/qpeapplication.h> -#include <opie/ofiledialog.h> +#include <opie2/ofiledialog.h> #include "TEmulation.h" #include "profileeditordialog.h" #include "configdialog.h" #include "default.h" #include "profilemanager.h" #include "mainwindow.h" #include "tabwidget.h" #include "transferdialog.h" #include "function_keyboard.h" #include "emulation_handler.h" #include "script.h" MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { KeyTrans::loadAll(); for (int i = 0; i < KeyTrans::count(); i++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } m_factory = new MetaFactory(); Default def(m_factory); m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager( m_factory ); m_manager->load(); m_scriptsData.setAutoDelete(TRUE); initUI(); populateProfiles(); populateScripts(); } void MainWindow::initUI() { setToolBarsMovable( FALSE ); /* tool bar for the menu */ m_tool = new QToolBar( this ); m_tool->setHorizontalStretchable( TRUE ); m_bar = new QMenuBar( m_tool ); m_console = new QPopupMenu( this ); m_scripts = new QPopupMenu( this ); m_sessionsPop= new QPopupMenu( this ); m_scriptsPop = new QPopupMenu( this ); /* add a toolbar for icons */ @@ -288,97 +288,97 @@ void MainWindow::populateScripts() { m_scriptsPop->insertItem((*dit)->name()); } } } } MainWindow::~MainWindow() { delete m_factory; manager()->save(); } MetaFactory* MainWindow::factory() { return m_factory; } Session* MainWindow::currentSession() { return m_curSession; } QList<Session> MainWindow::sessions() { return m_sessions; } void MainWindow::slotNew() { ProfileEditorDialog dlg(factory() ); dlg.setCaption( tr("New Connection") ); int ret = QPEApplication::execDialog( &dlg ); if ( ret == QDialog::Accepted ) { create( dlg.profile() ); } } void MainWindow::slotRecordScript() { if (currentSession()) { currentSession()->emulationHandler()->startRecording(); m_saveScript->setEnabled(true); m_recordScript->setEnabled(false); } } void MainWindow::slotSaveScript() { if (currentSession() && currentSession()->emulationHandler()->isRecording()) { QMap<QString, QStringList> map; QStringList text; text << "text/plain"; map.insert(tr("Script"), text ); - QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); + QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); if (!filename.isEmpty()) { QFileInfo info(filename); if (info.extension(FALSE) != "script") filename += ".script"; DocLnk nf; nf.setType("text/plain"); nf.setFile(filename); nf.setName(info.fileName()); FileManager fm; fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); currentSession()->emulationHandler()->clearScript(); m_saveScript->setEnabled(false); m_recordScript->setEnabled(true); populateScripts(); } } } void MainWindow::slotRunScript(int id) { if (currentSession()) { int index = m_scriptsPop->indexOf(id); DocLnk *lnk = m_scriptsData.at(index); QString filePath = lnk->file(); Script script(filePath); currentSession()->emulationHandler()->runScript(&script); } } void MainWindow::slotConnect() { if ( currentSession() ) { bool ret = currentSession()->layer()->open(); if(!ret) QMessageBox::warning(currentSession()->widgetStack(), QObject::tr("Failed"), QObject::tr("Connecting failed for this session.")); else { m_connect->setEnabled( false ); m_disconnect->setEnabled( true ); // if it does not support file transfer, disable the menu entry if ( ( m_curSession->layer() )->supports()[1] == 0 ) { m_transfer->setEnabled( false ); } else { m_transfer->setEnabled( true ); } m_recordScript->setEnabled( true ); m_scripts->setItemEnabled(m_runScript_id, true); } @@ -661,68 +661,68 @@ void MainWindow::slotFullscreen() { m_isFullscreen = !m_isFullscreen; } void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { if ( m_curSession ) { QEvent::Type state; if (pressed) state = QEvent::KeyPress; else state = QEvent::KeyRelease; QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); // is this the best way to do this? cant figure out any other way to work QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); ke.ignore(); } } void MainWindow::slotCopy() { if (!currentSession() ) return; currentSession()->emulationHandler()->copy(); } void MainWindow::slotPaste() { if (!currentSession() ) return; currentSession()->emulationHandler()->paste(); } /* * Save the session */ void MainWindow::slotSaveSession() { if (!currentSession() ) { QMessageBox::information(this, tr("Save Connection"), tr("<qt>There is no Connection.</qt>"), 1 ); return; } manager()->add( currentSession()->profile() ); manager()->save(); populateProfiles(); } void MainWindow::slotSaveHistory() { QMap<QString, QStringList> map; QStringList text; text << "text/plain"; map.insert(tr("History"), text ); - QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); + QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); if (filename.isEmpty() ) return; QFileInfo info(filename); DocLnk nf; nf.setType("text/plain"); nf.setFile(filename); nf.setName(info.fileName()); QFile file(filename); file.open(IO_WriteOnly ); QTextStream str(&file ); if ( currentSession() ) currentSession()->emulationHandler()->emulation()->streamHistory(&str); file.close(); nf.writeLink(); } 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 @@ Package: opie-console Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* Priority: optional Section: opie/applications Maintainer: Opie Team <opie@handhelds.org> Architecture: arm Version: 0.6-$SUB_VERSION -Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs +Depends: qpe-base, libopiecore2, libopieui2, opie-console-help-en, lrzsz, opie-keytabs License: GPL 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 @@ -22,55 +22,55 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ serialconfigwidget.h irdaconfigwidget.h \ btconfigwidget.h modemconfigwidget.h \ atconfigdialog.h dialdialog.h \ procctl.h \ function_keyboard.h \ receive_layer.h filereceive.h \ script.h \ dialer.h \ terminalwidget.h \ emulation_handler.h TECommon.h \ TEHistory.h TEScreen.h TEWidget.h \ TEmuVt102.h TEmulation.h MyPty.h \ consoleconfigwidget.h SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ file_layer.cpp filetransfer.cpp \ main.cpp \ metafactory.cpp \ session.cpp \ mainwindow.cpp \ profile.cpp \ profileconfig.cpp \ profilemanager.cpp \ tabwidget.cpp \ configdialog.cpp \ keytrans.cpp \ transferdialog.cpp \ profiledialogwidget.cpp \ profileeditordialog.cpp \ iolayerbase.cpp \ serialconfigwidget.cpp irdaconfigwidget.cpp \ btconfigwidget.cpp modemconfigwidget.cpp \ atconfigdialog.cpp dialdialog.cpp \ default.cpp procctl.cpp \ function_keyboard.cpp \ receive_layer.cpp filereceive.cpp \ script.cpp \ dialer.cpp \ terminalwidget.cpp \ emulation_handler.cpp TEHistory.cpp \ TEScreen.cpp TEWidget.cpp \ TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ consoleconfigwidget.cpp INTERFACES = configurebase.ui editbase.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie -lutil +LIBS += -lqpe -lopiecore2 -lopieui2 -lutil TARGET = opie-console 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,53 +1,53 @@ #ifndef PROFILE_EDITOR_DIALOG #define PROFILE_EDITOR_DIALOG #include <qdialog.h> -#include <opie/otabwidget.h> +#include <opie2/otabwidget.h> #include "profile.h" class MetaFactory; class EditBase; class QTabWidget; class QHBoxLayout; class QLineEdit; class QComboBox; class QCheckBox; class QLabel; class QScrollView; class ProfileDialogWidget; class ProfileEditorDialog : public QDialog { Q_OBJECT public: ProfileEditorDialog(MetaFactory* fact, const Profile& prof ); ProfileEditorDialog(MetaFactory* fact ); ~ProfileEditorDialog(); Profile profile()const; public slots: void accept(); private slots: void slotConActivated(const QString& ); void slotTermActivated( const QString& ); void slotKeyActivated(const QString&); private: void initUI(); QString profName()const; QCString profType()const; MetaFactory* m_fact; QHBoxLayout* m_lay; Profile m_prof; QLineEdit *m_name; QComboBox *m_conCmb, *m_termCmb; QCheckBox *m_autoConnect; QScrollView *m_svCon, *m_svTerm; QWidget *m_tabCon, *m_tabTerm, *m_tabKey; 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,52 +1,51 @@ #include "sz_transfer.h" #include <qfile.h> -#include <opie/oprocess.h> #include <stdio.h> #include <sys/termios.h> SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) { } SzTransfer::~SzTransfer() { } void SzTransfer::sendFile(const QFile& file) { sendFile(file.name()); } void SzTransfer::sendFile(const QString& file) { //setcbreak(2); /* raw no echo */ proc = new OProcess; *proc << "sz"; *proc << "-v" << "-v" << "-b" << file; connect(proc, SIGNAL(processExited(OProcess *)), this, SLOT(sent())); connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), this, SLOT(SzReceivedStdout(OProcess *, char *, int))); connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), this, SLOT(SzReceivedStderr(OProcess *, char *, int))); connect(layer(), SIGNAL(received(const QByteArray &)), this, SLOT(receivedStdin(const QByteArray &))); proc->start(OProcess::NotifyOnExit, OProcess::All); } void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { qWarning("recieved from sz on stdout %d bytes", buflen); QByteArray data(buflen); data.fill(*buffer, buflen); for (uint i = 0; i < data.count(); i++ ) { printf("%c", buffer[i] ); } printf("\n"); // send out through the io layer 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,40 +1,40 @@ #ifndef OPIE_FL_SZ_H #define OPIE_FL_SZ_H #include "file_layer.h" -#include <opie/oprocess.h> +#include <opie2/oprocess.h> class SzTransfer : public FileTransferLayer { Q_OBJECT public: enum Type { SZ=0, SX, SY }; SzTransfer( Type t, IOLayer * ); ~SzTransfer(); public slots: /** * send a file over the layer */ void sendFile( const QString& file ) ; void sendFile( const QFile& ); void sent(); private slots: void SzReceivedStdout(OProcess *, char *, int); void SzReceivedStderr(OProcess *, char *, int); void receivedStdin(const QByteArray &); private: OProcess *proc; Type m_t; }; #endif 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,29 +1,29 @@ #ifndef OPIE_TAB_WIDGET_H #define OPIE_TAB_WIDGET_H #include <qmap.h> -#include <opie/otabwidget.h> +#include <opie2/otabwidget.h> #include "session.h" /** * This is our central tab widget * we can add sessions here */ class TabWidget : public OTabWidget{ Q_OBJECT public: TabWidget(QWidget *parent, const char* name ); ~TabWidget(); void add( Session* ); void remove( Session* ); void setCurrent( Session* ); signals: void activated(Session* ses ); private slots: void slotCurChanged( QWidget* wid ); private: QMap<QWidget*, Session*> m_map; }; #endif 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 @@ TEMPLATE = app #CONFIG = qt warn_on release CONFIG = qt debug #DESTDIR = $(OPIEDIR)/bin HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ senderui.h ../profile.h ../filetransfer.h ../procctl.h \ ../filereceive.h ../receive_layer.h SOURCES = ../io_layer.cpp ../io_serial.cpp \ ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ main.cpp senderui.cpp ../filetransfer.cpp ../procctl.cpp \ ../filereceive.cpp ../receive_layer.cpp INTERFACES = sender.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie +LIBS += -lqpe -lopiecore2 TARGET = test 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 @@ -1,62 +1,62 @@ #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <sys/termios.h> #include <qmultilineedit.h> #include <qsocketnotifier.h> #include "../profile.h" #include "../io_serial.h" #include "../filetransfer.h" #include "../filereceive.h" -#include <opie/oprocess.h> +#include <opie2/oprocess.h> #include "senderui.h" SenderUI::SenderUI() : Sender() { /* we do that manually */ Profile prof; QString str = "/dev/bty0"; prof.writeEntry("Device",str ); prof.writeEntry("Baud", 19200 ); qWarning("prof " + prof.readEntry("Device") + " " + str); ser = new IOSerial(prof); connect(ser, SIGNAL(received(const QByteArray& ) ), this, SLOT(got(const QByteArray&) ) ); if ( ser->open() ) qWarning("opened!!!"); else qWarning("could not open"); } SenderUI::~SenderUI() { } void SenderUI::slotSendFile() { sz = new FileTransfer(FileTransfer::SY, ser); sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); connect (sz, SIGNAL(sent()), this, SLOT(fileTransComplete())); } void SenderUI::slotSend() { QCString str = MultiLineEdit1->text().utf8(); qWarning("sending: %s", str.data() ); str = str.replace( QRegExp("\n"), "\r"); ser->send( str ); } void SenderUI::got(const QByteArray& ar) { qWarning("got:"); for ( uint i = 0; i < ar.count(); i++ ) { printf("%c", ar[i] ); } printf("\n"); 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,149 +1,149 @@ #include <qlayout.h> #include <qcombobox.h> #include <qlabel.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qmessagebox.h> #include <qprogressbar.h> #include <qradiobutton.h> #include <qbuttongroup.h> -#include <opie/ofiledialog.h> +#include <opie2/ofiledialog.h> #include "metafactory.h" #include "mainwindow.h" #include "transferdialog.h" TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) : QDialog(parent, 0l, false), m_win(mainwindow) { m_lay = 0l; m_recvlay = 0l; QVBoxLayout *vbox, *vbox2; QHBoxLayout *hbox, *hbox2, *hbox3; QLabel *file, *mode, *progress, *status; QButtonGroup *group; QRadioButton *mode_send, *mode_receive; m_autocleanup = 0; m_running = true; group = new QButtonGroup(QObject::tr("Transfer mode"), this); mode_send = new QRadioButton(QObject::tr("Send"), group); mode_receive = new QRadioButton(QObject::tr("Receive"), group); group->insert(mode_send, id_send); group->insert(mode_receive, id_receive); vbox2 = new QVBoxLayout(group, 2); vbox2->addSpacing(10); hbox3 = new QHBoxLayout(vbox2, 2); hbox3->add(mode_send); hbox3->add(mode_receive); mode_send->setChecked(true); m_transfermode = id_send; file = new QLabel(QObject::tr("Send file"), this); mode = new QLabel(QObject::tr("Transfer protocol"), this); progress = new QLabel(QObject::tr("Progress"), this); status = new QLabel(QObject::tr("Status"), this); statusbar = new QLabel(QObject::tr("Ready"), this); statusbar->setFrameStyle(QFrame::Panel | QFrame::Sunken); protocol = new QComboBox(this); QStringList list = m_win->factory()->fileTransferLayers(); for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) protocol->insertItem((*it)); filename = new QLineEdit(this); progressbar = new QProgressBar(this); progressbar->setProgress(0); selector = new QPushButton("...", this); ok = new QPushButton(QObject::tr("Start transfer"), this); cancel = new QPushButton(QObject::tr("Cancel"), this); vbox = new QVBoxLayout(this, 2); vbox->add(group); vbox->add(file); hbox = new QHBoxLayout(vbox, 0); hbox->add(filename); hbox->add(selector); vbox->add(mode); vbox->add(protocol); vbox->add(progress); vbox->add(progressbar); vbox->add(status); vbox->add(statusbar); vbox->addStretch(1); hbox2 = new QHBoxLayout(vbox, 2); hbox2->add(ok); hbox2->add(cancel); setCaption(QObject::tr("File transfer")); show(); connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); } TransferDialog::~TransferDialog() { } void TransferDialog::slotFilename() { QString f; - f = OFileDialog::getOpenFileName(0); + f = Opie::OFileDialog::getOpenFileName(0); if(!f.isNull()) filename->setText(f); } void TransferDialog::slotTransfer() { if((m_transfermode == id_send) && (filename->text().isEmpty())) { QMessageBox::information(this, QObject::tr("Attention"), QObject::tr("No file has been specified.")); return; } ok->setEnabled(false); cleanup(); m_autocleanup = 0; if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); else statusbar->setText(QObject::tr("Receiving...")); if(m_transfermode == id_send) { m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); m_lay->sendFile(filename->text()); connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), SLOT(slotProgress(const QString&, int, int, int, int, int))); connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); } else { m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); m_recvlay->receive(); connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), SLOT(slotProgress(const QString&, int, int, int, int, int))); connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); } } void TransferDialog::cleanup() { if(m_lay) { m_lay->cancel(); |