summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-05 22:21:04 (UTC)
committer harlekin <harlekin>2002-10-05 22:21:04 (UTC)
commit48b16b3a3557e70abf90e83b84396258b92b652e (patch) (side-by-side diff)
tree9dad37a08e79da5705a8297b2bf09a0b2441f3b6
parent99425255c4afcd75ee6b2f903487cb958d3acdee (diff)
downloadopie-48b16b3a3557e70abf90e83b84396258b92b652e.zip
opie-48b16b3a3557e70abf90e83b84396258b92b652e.tar.gz
opie-48b16b3a3557e70abf90e83b84396258b92b652e.tar.bz2
otabwidget instead of qtabwidget
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/.cvsignore4
-rw-r--r--noncore/apps/opie-console/file_layer.h2
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp21
-rw-r--r--noncore/apps/opie-console/mainwindow.h6
-rw-r--r--noncore/apps/opie-console/opie-console.pro3
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp22
-rw-r--r--noncore/apps/opie-console/tabwidget.h4
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
@@ -6,13 +6,15 @@
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();
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
@@ -6,12 +6,13 @@
#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);
@@ -37,24 +38,21 @@ void MainWindow::initUI() {
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 );
@@ -98,21 +96,25 @@ void MainWindow::initUI() {
/*
* 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;
@@ -126,42 +128,49 @@ 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
@@ -12,18 +12,19 @@
* 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
*
*/
@@ -70,12 +71,13 @@ private:
/**
* 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;
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,8 +1,9 @@
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 \
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,18 +1,18 @@
#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* );