summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
authorzecke <zecke>2002-10-09 01:22:42 (UTC)
committer zecke <zecke>2002-10-09 01:22:42 (UTC)
commita74bf68065b94efaacb73736c7127ccb74474645 (patch) (unidiff)
treed85c40d367a4922091cc1780d8e1228d38de22c8 /noncore/apps/opie-console/mainwindow.cpp
parent8c353ec8b86ee8f82cc25172fb69dd5fee65e848 (diff)
downloadopie-a74bf68065b94efaacb73736c7127ccb74474645.zip
opie-a74bf68065b94efaacb73736c7127ccb74474645.tar.gz
opie-a74bf68065b94efaacb73736c7127ccb74474645.tar.bz2
PLANS:
move around some stuff to done, open to progress... Default add EmulationLayer stuff (vt102) EmulationLayer tried to use WidgetLayer but this did not work out KeyTrans make sure to load the Q*Dict first before accessing it! ibotty please check if this was correct MainWindow make generation of Sessions possible TabWidget go back to QTabWidget for now... this is much more testedt and I do not have to debug it. Besides that OTabWidget is a kewl widget and we will take it as soon as Sessions are tested enough TabWidget also implement setCurrent for sessions Vt102 make it compile... const QByteArray != const QByteArray&
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp48
1 files changed, 42 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 3531478..aeb3742 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -7,2 +7,3 @@
7 7
8#include "profileeditordialog.h"
8#include "configdialog.h" 9#include "configdialog.h"
@@ -10,2 +11,3 @@
10#include "metafactory.h" 11#include "metafactory.h"
12#include "profile.h"
11#include "profilemanager.h" 13#include "profilemanager.h"
@@ -111,3 +113,5 @@ ProfileManager* MainWindow::manager() {
111} 113}
112 114TabWidget* MainWindow::tabWidget() {
115 return m_consoleWindow;
116}
113void MainWindow::populateProfiles() { 117void MainWindow::populateProfiles() {
@@ -139,2 +143,8 @@ void MainWindow::slotNew() {
139 qWarning("New Connection"); 143 qWarning("New Connection");
144 ProfileEditorDialog dlg(factory() );
145 int ret = dlg.exec();
146
147 if ( ret == QDialog::Accepted ) {
148 create( dlg.profile() );
149 }
140} 150}
@@ -154,4 +164,4 @@ void MainWindow::slotTerminate() {
154 currentSession()->layer()->close(); 164 currentSession()->layer()->close();
155 delete m_curSession; 165
156 m_curSession = 0l; 166 slotClose();
157 /* FIXME move to the next session */ 167 /* FIXME move to the next session */
@@ -172,9 +182,35 @@ void MainWindow::slotConfigure() {
172} 182}
173 183/*
184 * we will remove
185 * this window from the tabwidget
186 * remove it from the list
187 * delete it
188 * and set the currentSession()
189 */
174void MainWindow::slotClose() { 190void MainWindow::slotClose() {
175} 191 if (!currentSession() )
192 return;
176 193
177void MainWindow::slotProfile( int ) { 194 tabWidget()->remove( currentSession() );
195 tabWidget()->setCurrent( m_sessions.first() );
196 m_sessions.remove( m_curSession );
197 delete m_curSession;
198 m_curSession = m_sessions.first();
199}
178 200
201/*
202 * We will get the name
203 * Then the profile
204 * and then we will make a profile
205 */
206void MainWindow::slotProfile( int id) {
207 Profile prof = manager()->profile( m_sessionsPop->text( id) );
208 create( prof );
209}
210void MainWindow::create( const Profile& prof ) {
211 Session *ses = manager()->fromProfile( prof, tabWidget() );
179 212
213 m_sessions.append( ses );
214 tabWidget()->add( ses );
215 m_curSession = ses;
180} 216}