summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Unidiff
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() {
13 m_sessions.setAutoDelete( TRUE ); 13 m_sessions.setAutoDelete( TRUE );
14 m_curSession = -1; 14 m_curSession = 0;
15 15
@@ -25,2 +25,4 @@ void MainWindow::initUI() {
25 m_console = new QPopupMenu( this ); 25 m_console = new QPopupMenu( this );
26 m_sessionsPop= new QPopupMenu( this );
27 m_settings = new QPopupMenu( this );
26 28
@@ -35,5 +37,7 @@ void MainWindow::initUI() {
35 37
36 a = new QAction();
37 a->setText( tr("New from Session") );
38 38
39
40 /*
41 * connect action
42 */
39 m_connect = new QAction(); 43 m_connect = new QAction();
@@ -44,4 +48,40 @@ void MainWindow::initUI() {
44 48
49
50 /*
51 * disconnect action
52 */
53 m_disconnect = new QAction();
54 m_disconnect->setText( tr("Disconnect") );
55 m_disconnect->addTo( m_console );
56 connect(m_disconnect, SIGNAL(activated() ),
57 this, SLOT(slotDisconnect() ) );
58
59 /*
60 * terminate action
61 */
62 m_terminate = new QAction();
63 m_terminate->setText( tr("Terminate") );
64 m_terminate->addTo( m_console );
65 connect(m_disconnect, SIGNAL(activated() ),
66 this, SLOT(slotTerminate() ) );
67
68 /*
69 * the settings action
70 */
71 m_setProfiles = new QAction();
72 m_setProfiles->setText( tr("Configure Profiles") );
73 m_setProfiles->addTo( m_settings );
74 connect( m_setProfiles, SIGNAL(activated() ),
75 this, SLOT(slotConfigure() ) );
76
77 /* insert the submenu */
78 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
79 -1, 0);
80
81 /* insert the connection menu */
45 m_bar->insertItem( tr("Connection"), m_console ); 82 m_bar->insertItem( tr("Connection"), m_console );
46 83
84 /* the settings menu */
85 m_bar->insertItem( tr("Settings"), m_settings );
86
47} 87}
@@ -62 +102,22 @@ QList<Session> MainWindow::sessions() {
62} 102}
103void MainWindow::slotNew() {
104 qWarning("New Connection");
105}
106void MainWindow::slotConnect() {
107 if ( currentSession() )
108 currentSession()->layer()->open();
109}
110void MainWindow::slotDisconnect() {
111 if ( currentSession() )
112 currentSession()->layer()->close();
113}
114void MainWindow::slotTerminate() {
115 if ( currentSession() )
116 currentSession()->layer()->close();
117 delete m_curSession;
118 m_curSession = 0l;
119 /* FIXME move to the next session */
120}
121void MainWindow::slotConfigure() {
122 qWarning("configure");
123}