summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp67
1 files changed, 64 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index e9b5eda..1ae4a20 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -13,3 +13,3 @@ MainWindow::MainWindow() {
m_sessions.setAutoDelete( TRUE );
- m_curSession = -1;
+ m_curSession = 0;
@@ -25,2 +25,4 @@ void MainWindow::initUI() {
m_console = new QPopupMenu( this );
+ m_sessionsPop= new QPopupMenu( this );
+ m_settings = new QPopupMenu( this );
@@ -35,5 +37,7 @@ void MainWindow::initUI() {
- a = new QAction();
- a->setText( tr("New from Session") );
+
+ /*
+ * connect action
+ */
m_connect = new QAction();
@@ -44,4 +48,40 @@ void MainWindow::initUI() {
+
+ /*
+ * disconnect action
+ */
+ m_disconnect = new QAction();
+ m_disconnect->setText( tr("Disconnect") );
+ m_disconnect->addTo( m_console );
+ connect(m_disconnect, SIGNAL(activated() ),
+ this, SLOT(slotDisconnect() ) );
+
+ /*
+ * terminate action
+ */
+ m_terminate = new QAction();
+ m_terminate->setText( tr("Terminate") );
+ m_terminate->addTo( m_console );
+ connect(m_disconnect, SIGNAL(activated() ),
+ this, SLOT(slotTerminate() ) );
+
+ /*
+ * the settings action
+ */
+ m_setProfiles = new QAction();
+ m_setProfiles->setText( tr("Configure Profiles") );
+ m_setProfiles->addTo( m_settings );
+ connect( m_setProfiles, SIGNAL(activated() ),
+ this, SLOT(slotConfigure() ) );
+
+ /* insert the submenu */
+ m_console->insertItem(tr("New from Profile"), m_sessionsPop,
+ -1, 0);
+
+ /* insert the connection menu */
m_bar->insertItem( tr("Connection"), m_console );
+ /* the settings menu */
+ m_bar->insertItem( tr("Settings"), m_settings );
+
}
@@ -62 +102,22 @@ QList<Session> MainWindow::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");
+}