-rw-r--r-- | noncore/apps/opie-console/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/file_layer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.h | 4 |
7 files changed, 37 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/.cvsignore b/noncore/apps/opie-console/.cvsignore index acc07da..41d9740 100644 --- a/noncore/apps/opie-console/.cvsignore +++ b/noncore/apps/opie-console/.cvsignore @@ -1,3 +1,7 @@ +configurebase.cpp +configurebase.h +editbase.cpp +editbase.h moc*.cpp Makefile Makefile.in diff --git a/noncore/apps/opie-console/file_layer.h b/noncore/apps/opie-console/file_layer.h index 71a0c82..cfa149e 100644 --- a/noncore/apps/opie-console/file_layer.h +++ b/noncore/apps/opie-console/file_layer.h @@ -9,7 +9,9 @@ class QFile; * this is the layer for sending files */ class FileTransferLayer : public QObject { + Q_OBJECT + public: /** *the io layer to be used diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 88d5823..dce08ca 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -9,6 +9,7 @@ #include "metafactory.h" #include "profilemanager.h" #include "mainwindow.h" +#include "tabwidget.h" MainWindow::MainWindow() { m_factory = new MetaFactory(); @@ -40,8 +41,6 @@ void MainWindow::initUI() { connect(a, SIGNAL(activated() ), this, SLOT(slotNew() ) ); - - /* * connect action */ @@ -51,7 +50,6 @@ void MainWindow::initUI() { connect(m_connect, SIGNAL(activated() ), this, SLOT(slotConnect() ) ); - /* * disconnect action */ @@ -101,15 +99,19 @@ void MainWindow::initUI() { connect( m_sessionsPop, SIGNAL(activated(int) ), this, SLOT(slotProfile(int) ) ); + m_consoleWindow = new TabWidget( this, "blah"); + setCentralWidget( m_consoleWindow ); + } + ProfileManager* MainWindow::manager() { return m_manager; } + void MainWindow::populateProfiles() { m_sessionsPop->clear(); Profile::ValueList list = manager()->all(); - for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); - ++it ) { + for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { m_sessionsPop->insertItem( (*it).name() ); } @@ -129,17 +131,21 @@ Session* MainWindow::currentSession() { QList<Session> MainWindow::sessions() { return m_sessions; } + void MainWindow::slotNew() { qWarning("New Connection"); } + void MainWindow::slotConnect() { if ( currentSession() ) currentSession()->layer()->open(); } + void MainWindow::slotDisconnect() { if ( currentSession() ) currentSession()->layer()->close(); } + void MainWindow::slotTerminate() { if ( currentSession() ) currentSession()->layer()->close(); @@ -147,6 +153,7 @@ void MainWindow::slotTerminate() { m_curSession = 0l; /* FIXME move to the next session */ } + void MainWindow::slotConfigure() { qWarning("configure"); ConfigDialog conf( manager()->all() ); @@ -159,9 +166,11 @@ void MainWindow::slotConfigure() { populateProfiles(); } } + void MainWindow::slotClose() { } + void MainWindow::slotProfile(int) { } diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index be4b469..36eb3a7 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -15,8 +15,9 @@ class QToolBar; class QMenuBar; class QAction; class MetaFactory; - +class TabWidget; class ProfileManager; + class MainWindow : public QMainWindow { Q_OBJECT public: @@ -73,6 +74,7 @@ private: MetaFactory* m_factory; ProfileManager* m_manager; + TabWidget* m_consoleWindow; QToolBar* m_tool; QMenuBar* m_bar; QPopupMenu* m_console; diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 0b5df20..7abf385 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro @@ -1,5 +1,6 @@ TEMPLATE = app -CONFIG = qt warn_on release +#CONFIG = qt warn_on release +CONFIG = qt debug DESTDIR = $(OPIEDIR)/bin HEADERS = io_layer.h io_serial.h \ file_layer.h \ diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp index 6091aa2..783bf13 100644 --- a/noncore/apps/opie-console/tabwidget.cpp +++ b/noncore/apps/opie-console/tabwidget.cpp @@ -2,27 +2,33 @@ #include "tabwidget.h" TabWidget::TabWidget( QWidget* parent, const char* name ) - : QTabWidget( parent, name ) -{ + : OTabWidget( parent, name ) { connect(this, SIGNAL(currentChanged(QWidget*) ), this, SLOT(slotCurChanged(QWidget*) ) ); } + TabWidget::~TabWidget() { } + void TabWidget::add( Session* ses ) { if ( !ses->widget() ) return; - addTab( ses->widget(), ses->name() ); + addTab( ses->widget(), "console/konsole", ses->name() ); m_map.insert( ses->widget(), ses ); } + void TabWidget::remove( Session* ses ) { m_map.remove( ses->widget() ); removePage( ses->widget() ); } + void TabWidget::slotCurChanged( QWidget* wid ) { QMap<QWidget*, Session*>::Iterator it; it = m_map.find(wid ); - if (it == m_map.end() ) + if ( it == m_map.end() ) { return; + } emit activated( it.data() ); } + + diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h index d5d4be3..a701488 100644 --- a/noncore/apps/opie-console/tabwidget.h +++ b/noncore/apps/opie-console/tabwidget.h @@ -2,14 +2,14 @@ #define OPIE_TAB_WIDGET_H #include <qmap.h> -#include <qtabwidget.h> +#include <opie/otabwidget.h> #include "session.h" /** * This is our central tab widget * we can add sessions here */ -class TabWidget : QTabWidget{ +class TabWidget : public OTabWidget{ Q_OBJECT public: TabWidget(QWidget *parent, const char* name ); |