summaryrefslogtreecommitdiff
Unidiff
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 @@
1configurebase.cpp
2configurebase.h
3editbase.cpp
4editbase.h
1moc*.cpp 5moc*.cpp
2Makefile 6Makefile
3Makefile.in 7Makefile.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;
9 * this is the layer for sending files 9 * this is the layer for sending files
10 */ 10 */
11class FileTransferLayer : public QObject { 11class FileTransferLayer : public QObject {
12
12 Q_OBJECT 13 Q_OBJECT
14
13public: 15public:
14 /** 16 /**
15 *the io layer to be used 17 *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 @@
9#include "metafactory.h" 9#include "metafactory.h"
10#include "profilemanager.h" 10#include "profilemanager.h"
11#include "mainwindow.h" 11#include "mainwindow.h"
12#include "tabwidget.h"
12 13
13MainWindow::MainWindow() { 14MainWindow::MainWindow() {
14 m_factory = new MetaFactory(); 15 m_factory = new MetaFactory();
@@ -40,8 +41,6 @@ void MainWindow::initUI() {
40 connect(a, SIGNAL(activated() ), 41 connect(a, SIGNAL(activated() ),
41 this, SLOT(slotNew() ) ); 42 this, SLOT(slotNew() ) );
42 43
43
44
45 /* 44 /*
46 * connect action 45 * connect action
47 */ 46 */
@@ -51,7 +50,6 @@ void MainWindow::initUI() {
51 connect(m_connect, SIGNAL(activated() ), 50 connect(m_connect, SIGNAL(activated() ),
52 this, SLOT(slotConnect() ) ); 51 this, SLOT(slotConnect() ) );
53 52
54
55 /* 53 /*
56 * disconnect action 54 * disconnect action
57 */ 55 */
@@ -101,15 +99,19 @@ void MainWindow::initUI() {
101 connect( m_sessionsPop, SIGNAL(activated(int) ), 99 connect( m_sessionsPop, SIGNAL(activated(int) ),
102 this, SLOT(slotProfile(int) ) ); 100 this, SLOT(slotProfile(int) ) );
103 101
102 m_consoleWindow = new TabWidget( this, "blah");
103 setCentralWidget( m_consoleWindow );
104
104} 105}
106
105ProfileManager* MainWindow::manager() { 107ProfileManager* MainWindow::manager() {
106 return m_manager; 108 return m_manager;
107} 109}
110
108void MainWindow::populateProfiles() { 111void MainWindow::populateProfiles() {
109 m_sessionsPop->clear(); 112 m_sessionsPop->clear();
110 Profile::ValueList list = manager()->all(); 113 Profile::ValueList list = manager()->all();
111 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); 114 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
112 ++it ) {
113 m_sessionsPop->insertItem( (*it).name() ); 115 m_sessionsPop->insertItem( (*it).name() );
114 } 116 }
115 117
@@ -129,17 +131,21 @@ Session* MainWindow::currentSession() {
129QList<Session> MainWindow::sessions() { 131QList<Session> MainWindow::sessions() {
130 return m_sessions; 132 return m_sessions;
131} 133}
134
132void MainWindow::slotNew() { 135void MainWindow::slotNew() {
133 qWarning("New Connection"); 136 qWarning("New Connection");
134} 137}
138
135void MainWindow::slotConnect() { 139void MainWindow::slotConnect() {
136 if ( currentSession() ) 140 if ( currentSession() )
137 currentSession()->layer()->open(); 141 currentSession()->layer()->open();
138} 142}
143
139void MainWindow::slotDisconnect() { 144void MainWindow::slotDisconnect() {
140 if ( currentSession() ) 145 if ( currentSession() )
141 currentSession()->layer()->close(); 146 currentSession()->layer()->close();
142} 147}
148
143void MainWindow::slotTerminate() { 149void MainWindow::slotTerminate() {
144 if ( currentSession() ) 150 if ( currentSession() )
145 currentSession()->layer()->close(); 151 currentSession()->layer()->close();
@@ -147,9 +153,10 @@ void MainWindow::slotTerminate() {
147 m_curSession = 0l; 153 m_curSession = 0l;
148 /* FIXME move to the next session */ 154 /* FIXME move to the next session */
149} 155}
156
150void MainWindow::slotConfigure() { 157void MainWindow::slotConfigure() {
151 qWarning("configure"); 158 qWarning("configure");
152 ConfigDialog conf( manager()->all() ); 159 ConfigDialog conf( manager()->all() );
153 conf.showMaximized(); 160 conf.showMaximized();
154 161
155 int ret = conf.exec(); 162 int ret = conf.exec();
@@ -159,9 +166,11 @@ void MainWindow::slotConfigure() {
159 populateProfiles(); 166 populateProfiles();
160 } 167 }
161} 168}
169
162void MainWindow::slotClose() { 170void MainWindow::slotClose() {
163 171
164} 172}
173
165void MainWindow::slotProfile(int) { 174void MainWindow::slotProfile(int) {
166 175
167} 176}
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,12 +15,13 @@ class QToolBar;
15class QMenuBar; 15class QMenuBar;
16class QAction; 16class QAction;
17class MetaFactory; 17class MetaFactory;
18 18class TabWidget;
19class ProfileManager; 19class ProfileManager;
20
20class MainWindow : public QMainWindow { 21class MainWindow : public QMainWindow {
21 Q_OBJECT 22 Q_OBJECT
22public: 23public:
23 MainWindow( ); 24 MainWindow();
24 ~MainWindow(); 25 ~MainWindow();
25 26
26 /** 27 /**
@@ -73,6 +74,7 @@ private:
73 MetaFactory* m_factory; 74 MetaFactory* m_factory;
74 ProfileManager* m_manager; 75 ProfileManager* m_manager;
75 76
77 TabWidget* m_consoleWindow;
76 QToolBar* m_tool; 78 QToolBar* m_tool;
77 QMenuBar* m_bar; 79 QMenuBar* m_bar;
78 QPopupMenu* m_console; 80 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 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on release 2#CONFIG = qt warn_on release
3 CONFIG = qt debug
3DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
4HEADERS = io_layer.h io_serial.h \ 5HEADERS = io_layer.h io_serial.h \
5 file_layer.h \ 6 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 @@
2#include "tabwidget.h" 2#include "tabwidget.h"
3 3
4TabWidget::TabWidget( QWidget* parent, const char* name ) 4TabWidget::TabWidget( QWidget* parent, const char* name )
5 : QTabWidget( parent, name ) 5 : OTabWidget( parent, name ) {
6{ 6 connect(this, SIGNAL( currentChanged(QWidget*) ),
7 connect(this, SIGNAL(currentChanged(QWidget*) ), 7 this, SLOT( slotCurChanged(QWidget*) ) );
8 this, SLOT(slotCurChanged(QWidget*) ) );
9} 8}
9
10TabWidget::~TabWidget() { 10TabWidget::~TabWidget() {
11} 11}
12
12void TabWidget::add( Session* ses ) { 13void TabWidget::add( Session* ses ) {
13 if ( !ses->widget() ) return; 14 if ( !ses->widget() ) return;
14 addTab( ses->widget(), ses->name() ); 15 addTab( ses->widget(), "console/konsole", ses->name() );
15 m_map.insert( ses->widget(), ses ); 16 m_map.insert( ses->widget(), ses );
16} 17}
18
17void TabWidget::remove( Session* ses ) { 19void TabWidget::remove( Session* ses ) {
18 m_map.remove( ses->widget() ); 20 m_map.remove( ses->widget() );
19 removePage( ses->widget() ); 21 removePage( ses->widget() );
20} 22}
23
21void TabWidget::slotCurChanged( QWidget* wid ) { 24void TabWidget::slotCurChanged( QWidget* wid ) {
22 QMap<QWidget*, Session*>::Iterator it; 25 QMap<QWidget*, Session*>::Iterator it;
23 it = m_map.find(wid ); 26 it = m_map.find( wid );
24 if (it == m_map.end() ) 27 if ( it == m_map.end() ) {
25 return; 28 return;
29 }
26 30
27 emit activated( it.data() ); 31 emit activated( it.data() );
28} 32}
33
34
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 @@
2#define OPIE_TAB_WIDGET_H 2#define OPIE_TAB_WIDGET_H
3 3
4#include <qmap.h> 4#include <qmap.h>
5#include <qtabwidget.h> 5#include <opie/otabwidget.h>
6 6
7#include "session.h" 7#include "session.h"
8/** 8/**
9 * This is our central tab widget 9 * This is our central tab widget
10 * we can add sessions here 10 * we can add sessions here
11 */ 11 */
12class TabWidget : QTabWidget{ 12class TabWidget : public OTabWidget{
13 Q_OBJECT 13 Q_OBJECT
14public: 14public:
15 TabWidget(QWidget *parent, const char* name ); 15 TabWidget(QWidget *parent, const char* name );