author | harlekin <harlekin> | 2002-10-05 22:21:04 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-05 22:21:04 (UTC) |
commit | 48b16b3a3557e70abf90e83b84396258b92b652e (patch) (side-by-side diff) | |
tree | 9dad37a08e79da5705a8297b2bf09a0b2441f3b6 /noncore/apps | |
parent | 99425255c4afcd75ee6b2f903487cb958d3acdee (diff) | |
download | opie-48b16b3a3557e70abf90e83b84396258b92b652e.zip opie-48b16b3a3557e70abf90e83b84396258b92b652e.tar.gz opie-48b16b3a3557e70abf90e83b84396258b92b652e.tar.bz2 |
otabwidget instead of qtabwidget
-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 | 21 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.cpp | 22 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.h | 4 |
7 files changed, 43 insertions, 19 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 @@ -4,17 +4,19 @@ #include "io_layer.h" #include <opie/oprocess.h> class QFile; /** * this is the layer for sending files */ class FileTransferLayer : public QObject { + Q_OBJECT + public: /** *the io layer to be used */ FileTransferLayer( IOLayer* ); virtual ~FileTransferLayer(); public slots: 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 @@ -4,16 +4,17 @@ #include <qlabel.h> #include <qpopupmenu.h> #include <qtoolbar.h> #include "configdialog.h" #include "metafactory.h" #include "profilemanager.h" #include "mainwindow.h" +#include "tabwidget.h" MainWindow::MainWindow() { m_factory = new MetaFactory(); m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager(m_factory); m_manager->load(); @@ -35,28 +36,25 @@ void MainWindow::initUI() { * new Action for new sessions */ QAction* a = new QAction(); a->setText( tr("New Connection") ); a->addTo( m_console ); connect(a, SIGNAL(activated() ), this, SLOT(slotNew() ) ); - - /* * connect action */ m_connect = new QAction(); m_connect->setText( tr("Connect") ); m_connect->addTo( m_console ); connect(m_connect, SIGNAL(activated() ), this, SLOT(slotConnect() ) ); - /* * disconnect action */ m_disconnect = new QAction(); m_disconnect->setText( tr("Disconnect") ); m_disconnect->addTo( m_console ); connect(m_disconnect, SIGNAL(activated() ), this, SLOT(slotDisconnect() ) ); @@ -96,25 +94,29 @@ void MainWindow::initUI() { m_bar->insertItem( tr("Settings"), m_settings ); /* * connect to the menu activation */ 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() ); } } MainWindow::~MainWindow() { delete m_factory; } @@ -124,44 +126,51 @@ MetaFactory* MainWindow::factory() { Session* MainWindow::currentSession() { return m_curSession; } 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(); delete m_curSession; m_curSession = 0l; /* FIXME move to the next session */ } + void MainWindow::slotConfigure() { qWarning("configure"); - ConfigDialog conf( manager()->all() ); + ConfigDialog conf( manager()->all() ); conf.showMaximized(); int ret = conf.exec(); if ( QDialog::Accepted == ret ) { manager()->setProfiles( conf.list() ); 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 @@ -10,22 +10,23 @@ * 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 TabWidget; class ProfileManager; + class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow( ); + MainWindow(); ~MainWindow(); /** * our factory to generate IOLayer and so on * */ MetaFactory* factory(); @@ -68,16 +69,17 @@ private: QList<Session> m_sessions; /** * the metafactory */ MetaFactory* m_factory; ProfileManager* m_manager; + TabWidget* m_consoleWindow; QToolBar* m_tool; QMenuBar* m_bar; QPopupMenu* m_console; QPopupMenu* m_settings; QPopupMenu* m_sessionsPop; QAction* m_connect; QAction* m_disconnect; QAction* m_terminate; 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,10 +1,11 @@ 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 \ metafactory.h \ session.h \ mainwindow.h \ profile.h \ profileconfig.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 @@ -1,28 +1,34 @@ #include "tabwidget.h" TabWidget::TabWidget( QWidget* parent, const char* name ) - : QTabWidget( parent, name ) -{ - connect(this, SIGNAL(currentChanged(QWidget*) ), - this, SLOT(slotCurChanged(QWidget*) ) ); + : 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() ) + QMap<QWidget*, Session*>::Iterator it; + it = m_map.find( wid ); + 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 @@ -1,20 +1,20 @@ #ifndef OPIE_TAB_WIDGET_H #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 ); ~TabWidget(); void add( Session* ); void remove( Session* ); signals: |