summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_bt.cpp4
-rw-r--r--noncore/apps/opie-console/io_bt.h4
-rw-r--r--noncore/apps/opie-console/io_irda.cpp4
-rw-r--r--noncore/apps/opie-console/io_irda.h4
-rw-r--r--noncore/apps/opie-console/io_modem.cpp2
-rw-r--r--noncore/apps/opie-console/io_modem.h2
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp1
-rw-r--r--noncore/apps/opie-console/profileeditordialog.h2
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp8
-rw-r--r--noncore/apps/opie-console/sz_transfer.h6
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp1
-rw-r--r--noncore/apps/opie-console/tabwidget.h2
-rw-r--r--noncore/apps/opie-console/test/senderui.cpp2
-rw-r--r--noncore/apps/opie-console/test/senderui.h4
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp3
16 files changed, 34 insertions, 20 deletions
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 1a8c979..35a328f 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -1,15 +1,17 @@
#include "io_bt.h"
+using namespace Opie::Core;
+using namespace Opie::Core;
IOBt::IOBt( const Profile &config ) : IOSerial( config ) {
m_attach = 0;
}
IOBt::~IOBt() {
if ( m_attach ) {
delete m_attach;
}
}
@@ -27,25 +29,25 @@ bool IOBt::open() {
bool ret = false;
// only set up bt stuff if mac address was set, otherwise use the device set
if ( !m_mac.isEmpty() ) {
// now it should also be checked, if there is a connection to the device with that mac allready
// hciattach here
m_attach = new OProcess();
*m_attach << "hciattach /dev/ttyS2 any 57600";
// then start hcid, then rcfomm handling (m_mac)
- connect( m_attach, SIGNAL( processExited(OProcess*) ),
+ connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
this, SLOT( slotExited(OProcess*) ) );
if ( m_attach->start() ) {
ret = IOSerial::open();
} else {
qWarning("could not attach to device");
delete m_attach;
m_attach = 0;
}
} else {
// directly to the normal serial
// TODO: look first if the connection really exists. ( is set up )
diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h
index df6dd38..00ca7e5 100644
--- a/noncore/apps/opie-console/io_bt.h
+++ b/noncore/apps/opie-console/io_bt.h
@@ -32,20 +32,20 @@ public:
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;
+ Opie::Core::OProcess *m_attach;
QString m_mac;
private slots:
- void slotExited(OProcess* proc);
+ void slotExited(Opie::Core::OProcess* proc);
};
#endif /* OPIE_IO_IRDA */
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index b281b7d..ba0b0e5 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -1,15 +1,17 @@
#include "io_irda.h"
+using namespace Opie::Core;
+using namespace Opie::Core;
IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) {
m_attach = 0;
}
IOIrda::~IOIrda() {
if ( m_attach ) {
delete m_attach;
}
}
@@ -18,25 +20,25 @@ void IOIrda::close() {
IOSerial::close();
// still need error handling
delete m_attach;
}
bool IOIrda::open() {
bool ret;
// irdaattach here
m_attach = new OProcess();
*m_attach << "irattach /dev/ttyS2 -s";
- connect( m_attach, SIGNAL( processExited(OProcess*) ),
+ connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
this, SLOT( slotExited(OProcess*) ) );
if ( m_attach->start() ) {
ret= IOSerial::open();
} else {
// emit error!!!
qWarning("could not attach to device");
delete m_attach;
m_attach = 0l;
}
return ret;
}
diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h
index 69bed7d..fb29686 100644
--- a/noncore/apps/opie-console/io_irda.h
+++ b/noncore/apps/opie-console/io_irda.h
@@ -30,20 +30,20 @@ public:
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;
+ Opie::Core::OProcess *m_attach;
private slots:
- void slotExited(OProcess* proc);
+ void slotExited(Opie::Core::OProcess* proc);
};
#endif /* OPIE_IO_IRDA */
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp
index 1ce680a..b74d076 100644
--- a/noncore/apps/opie-console/io_modem.cpp
+++ b/noncore/apps/opie-console/io_modem.cpp
@@ -1,17 +1,19 @@
#include "io_modem.h"
#include "dialer.h"
+using namespace Opie::Core;
+using namespace Opie::Core;
IOModem::IOModem( const Profile &profile )
: IOSerial( profile ) {
m_profile = profile;
}
IOModem::~IOModem() {
}
void IOModem::close() {
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h
index 96ec3ef..5b99e00 100644
--- a/noncore/apps/opie-console/io_modem.h
+++ b/noncore/apps/opie-console/io_modem.h
@@ -58,17 +58,17 @@ public slots:
virtual void close();
virtual void reload(const Profile &);
private:
QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2,
m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel;
int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime,
m_bpsDetect, m_dcdLines, m_multiLineUntag;
Profile m_profile;
private slots:
- void slotExited(OProcess* proc);
+ void slotExited(Opie::Core::OProcess* proc);
};
#endif
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 197f799..06a8f7d 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -15,24 +15,25 @@
#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"
+using namespace Opie::Ui;
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();
@@ -323,25 +324,25 @@ void MainWindow::slotRecordScript() {
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 = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map);
+ QString filename = 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);
@@ -696,25 +697,25 @@ void MainWindow::slotSaveSession() {
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 = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map);
+ QString filename = 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 );
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 6e1e23e..dc42d8b 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -1,23 +1,24 @@
#include <qlayout.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qscrollview.h>
#include "metafactory.h"
#include "profileeditordialog.h"
+using namespace Opie::Ui;
namespace {
void setCurrent( const QString& str, QComboBox* bo ) {
for (int i = 0; i < bo->count(); i++ ) {
if ( bo->text(i) == str ) {
bo->setCurrentItem( i );
}
}
};
}
ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
const Profile& prof )
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h
index 97bd650..e7a88e9 100644
--- a/noncore/apps/opie-console/profileeditordialog.h
+++ b/noncore/apps/opie-console/profileeditordialog.h
@@ -44,18 +44,18 @@ private:
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;
ProfileDialogWidget* m_con, *m_term, *m_key;
QHBoxLayout *m_layCon, *m_layTerm, *m_layKey;
- OTabWidget *tabWidget;
+ Opie::Ui::OTabWidget *tabWidget;
QWidget *tabprof;
int m_showconntab;
};
#endif
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index 2f82417..5958e93 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -1,44 +1,46 @@
#include "sz_transfer.h"
#include <qfile.h>
#include <stdio.h>
#include <sys/termios.h>
+using namespace Opie::Core;
+using namespace Opie::Core;
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*)),
+ connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT(sent()));
- connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
this, SLOT(SzReceivedStdout(OProcess*,char*,int)));
- connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ connect(proc, SIGNAL(receivedStderr(Opie::Core::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);
diff --git a/noncore/apps/opie-console/sz_transfer.h b/noncore/apps/opie-console/sz_transfer.h
index aa97c32..0505215 100644
--- a/noncore/apps/opie-console/sz_transfer.h
+++ b/noncore/apps/opie-console/sz_transfer.h
@@ -18,23 +18,23 @@ public:
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 SzReceivedStdout(Opie::Core::OProcess *, char *, int);
+ void SzReceivedStderr(Opie::Core::OProcess *, char *, int);
void receivedStdin(const QByteArray &);
private:
- OProcess *proc;
+ Opie::Core::OProcess *proc;
Type m_t;
};
#endif
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp
index 419f8ac..6429e3c 100644
--- a/noncore/apps/opie-console/tabwidget.cpp
+++ b/noncore/apps/opie-console/tabwidget.cpp
@@ -1,15 +1,16 @@
#include "tabwidget.h"
+using namespace Opie::Ui;
TabWidget::TabWidget( QWidget* parent, const char* name )
: OTabWidget( parent, name ) {
connect(this, SIGNAL( currentChanged(QWidget*) ),
this, SLOT( slotCurChanged(QWidget*) ) );
}
TabWidget::~TabWidget() {
}
void TabWidget::add( Session* ses ) {
qWarning("session ses " + ses->name() );
if ( !ses->widgetStack() ) return;
diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h
index 98450a3..0138645 100644
--- a/noncore/apps/opie-console/tabwidget.h
+++ b/noncore/apps/opie-console/tabwidget.h
@@ -1,24 +1,24 @@
#ifndef OPIE_TAB_WIDGET_H
#define OPIE_TAB_WIDGET_H
#include <qmap.h>
#include <opie2/otabwidget.h>
#include "session.h"
/**
* This is our central tab widget
* we can add sessions here
*/
-class TabWidget : public OTabWidget{
+class TabWidget : public Opie::Ui::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 );
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp
index b1725db..df27055 100644
--- a/noncore/apps/opie-console/test/senderui.cpp
+++ b/noncore/apps/opie-console/test/senderui.cpp
@@ -6,24 +6,26 @@
#include <qmultilineedit.h>
#include <qsocketnotifier.h>
#include "../profile.h"
#include "../io_serial.h"
#include "../filetransfer.h"
#include "../filereceive.h"
#include <opie2/oprocess.h>
#include "senderui.h"
+using namespace Opie::Core;
+using namespace Opie::Core;
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&) ),
diff --git a/noncore/apps/opie-console/test/senderui.h b/noncore/apps/opie-console/test/senderui.h
index c130dcf..15f0743 100644
--- a/noncore/apps/opie-console/test/senderui.h
+++ b/noncore/apps/opie-console/test/senderui.h
@@ -1,34 +1,34 @@
#ifndef SENDER_UI_H
#define SENDER_UI_H
#include <qcstring.h>
#include "sender.h"
class IOSerial;
class FileTransfer;
class QSocketNotifier;
-class OProcess;
+namespace Opie {namespace Core {class Opie::Core::OProcess;}}
class SenderUI : public Sender {
Q_OBJECT
public:
SenderUI();
~SenderUI();
public slots:
void send();
void slotSendFile();
void slotSend();
void slotRev();
void got(const QByteArray& );
void fileTransComplete();
private:
IOSerial* ser;
FileTransfer* sz;
int m_fd;
QSocketNotifier* m_sock;
- OProcess* m_proc;
+ Opie::Core::OProcess* m_proc;
};
#endif
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index d494a6c..75eb443 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -6,24 +6,25 @@
#include <qmessagebox.h>
#include <qprogressbar.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <opie2/ofiledialog.h>
#include "metafactory.h"
#include "mainwindow.h"
#include "transferdialog.h"
+using namespace Opie::Ui;
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;
@@ -89,25 +90,25 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch
connect(cancel, SIGNAL(clicked()), SLOT(slotCancel()));
connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int)));
}
TransferDialog::~TransferDialog()
{
}
void TransferDialog::slotFilename()
{
QString f;
- f = Opie::OFileDialog::getOpenFileName(0);
+ f = 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;
}