summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_serial.cpp4
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
-rw-r--r--noncore/apps/opie-console/mainwindow.h5
-rw-r--r--noncore/apps/opie-console/metafactory.h9
4 files changed, 16 insertions, 12 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 9a81de9..c9155d1 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -113,16 +113,20 @@ bool IOSerial::open() {
emit error(Refuse, tr("Device is already connected"));
return FALSE;
}
}
void IOSerial::reload(const Config &config) {
m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE);
m_baud = config.readNumEntry("Baud", SERIAL_DEFAULT_BAUD);
+ m_parity = config.readNumEntry("Parity", SERIAL_DEFAULT_PARITY);
+ m_dbits = config.readNumEntry("DataBits", SERIAL_DEFAULT_DBITS);
+ m_sbits = config.readNumEntry("StopBits", SERIAL_DEFAULT_SBITS);
+ m_flow = config.readNumEntry("Flow", SERIAL_DEFAULT_FLOW);
}
int IOSerial::getBaud(int baud) const {
switch (baud) {
case 300: return B300; break;
case 600: return B600; break;
case 1200: return B1200; break;
case 2400: return B2400; break;
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index b6b2a2e..e9b5eda 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -3,25 +3,22 @@
#include <qmenubar.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include "metafactory.h"
#include "mainwindow.h"
-MainWindow::MainWindow()
-{
- qWarning("c'tor");
+MainWindow::MainWindow() {
m_factory = new MetaFactory();
m_sessions.setAutoDelete( TRUE );
- m_curSession = 0l;
+ m_curSession = -1;
initUI();
-
}
void MainWindow::initUI() {
setToolBarsMovable( FALSE );
m_tool = new QToolBar( this );
m_tool->setHorizontalStretchable( TRUE );
m_bar = new QMenuBar( m_tool );
@@ -46,17 +43,20 @@ void MainWindow::initUI() {
this, SLOT(slotConnect() ) );
m_bar->insertItem( tr("Connection"), m_console );
}
MainWindow::~MainWindow() {
delete m_factory;
}
+
MetaFactory* MainWindow::factory() {
return m_factory;
}
+
Session* MainWindow::currentSession() {
return m_curSession;
}
+
QList<Session> MainWindow::sessions() {
return m_sessions;
}
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 3d1e1c8..db3a653 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -10,16 +10,17 @@
* this is the MainWindow of the new opie console
* it's also the dispatcher between the different
* actions supported by the gui
*/
class QToolBar;
class QMenuBar;
class QAction;
class MetaFactory;
+
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow( );
~MainWindow();
/**
* our factory to generate IOLayer and so on
@@ -32,17 +33,19 @@ public:
* an IOLayer* and some infos for us
*/
Session* currentSession();
/**
* the session list
*/
QList<Session> sessions();
-
+protected slots:
+ void slotNew();
+ void slotConnect();
private:
void initUI();
/**
* the current session
*/
Session* m_curSession;
/**
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h
index 9c0f0a1..aae9391 100644
--- a/noncore/apps/opie-console/metafactory.h
+++ b/noncore/apps/opie-console/metafactory.h
@@ -1,46 +1,43 @@
#ifndef OPIE_META_FACTORY_H
#define OPIE_META_FACTORY_H
/**
- * meta factory is our factory servie
+ * The MetaFactory is used to keep track of all IOLayers, FileTransferLayers and ConfigWidgets
+ * and to instantiate these implementations on demand
*/
#include <qwidget.h>
#include <qmap.h>
#include <qpe/config.h>
#include "io_layer.h"
#include "file_layer.h"
class MetaFactory {
public:
typedef QWidget* (*configWidget)(QWidget* parent);
typedef IOLayer* (*iolayer)(const Config& );
typedef FileTransferLayer* (*filelayer)(IOLayer*);
+
MetaFactory();
~MetaFactory();
void addConfigWidgetFactory( const QString&,
configWidget );
void addIOLayerFactory(const QString&,
iolayer );
void addFileTransferLayer( const QString&,
filelayer );
QStringList ioLayers()const;
QStringList configWidgets()const;
QStringList fileTransferLayers()const;
-
-
private:
QMap<QString, configWidget> m_confFact;
QMap<QString, iolayer> m_layerFact;
QMap<QString, filelayer> m_fileFact;
-
-
-
};
#endif