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) (side-by-side diff)
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
@@ -5,9 +5,11 @@
#include <qpopupmenu.h>
#include <qtoolbar.h>
+#include "profileeditordialog.h"
#include "configdialog.h"
#include "default.h"
#include "metafactory.h"
+#include "profile.h"
#include "profilemanager.h"
#include "mainwindow.h"
#include "tabwidget.h"
@@ -109,7 +111,9 @@ void MainWindow::initUI() {
ProfileManager* MainWindow::manager() {
return m_manager;
}
-
+TabWidget* MainWindow::tabWidget() {
+ return m_consoleWindow;
+}
void MainWindow::populateProfiles() {
m_sessionsPop->clear();
Profile::ValueList list = manager()->all();
@@ -137,6 +141,12 @@ QList<Session> MainWindow::sessions() {
void MainWindow::slotNew() {
qWarning("New Connection");
+ ProfileEditorDialog dlg(factory() );
+ int ret = dlg.exec();
+
+ if ( ret == QDialog::Accepted ) {
+ create( dlg.profile() );
+ }
}
void MainWindow::slotConnect() {
@@ -152,8 +162,8 @@ void MainWindow::slotDisconnect() {
void MainWindow::slotTerminate() {
if ( currentSession() )
currentSession()->layer()->close();
- delete m_curSession;
- m_curSession = 0l;
+
+ slotClose();
/* FIXME move to the next session */
}
@@ -170,11 +180,37 @@ void MainWindow::slotConfigure() {
populateProfiles();
}
}
-
+/*
+ * we will remove
+ * this window from the tabwidget
+ * remove it from the list
+ * delete it
+ * and set the currentSession()
+ */
void MainWindow::slotClose() {
-}
+ if (!currentSession() )
+ return;
-void MainWindow::slotProfile( int ) {
+ tabWidget()->remove( currentSession() );
+ tabWidget()->setCurrent( m_sessions.first() );
+ m_sessions.remove( m_curSession );
+ delete m_curSession;
+ m_curSession = m_sessions.first();
+}
+/*
+ * We will get the name
+ * Then the profile
+ * and then we will make a profile
+ */
+void MainWindow::slotProfile( int id) {
+ Profile prof = manager()->profile( m_sessionsPop->text( id) );
+ create( prof );
+}
+void MainWindow::create( const Profile& prof ) {
+ Session *ses = manager()->fromProfile( prof, tabWidget() );
+ m_sessions.append( ses );
+ tabWidget()->add( ses );
+ m_curSession = ses;
}