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.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index e2f4d12..02a3fa9 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -90,4 +90,14 @@ void MainWindow::initUI() {
90 this, SLOT(slotNew() ) ); 90 this, SLOT(slotNew() ) );
91 91
92 m_console->insertSeparator();
93 /* save icon is not available */
94 a = new QAction(tr("Save Connection"),
95 Resource::loadPixmap("save"), QString::null,
96 0, this, 0 );
97 a->addTo( m_console );
98 connect(a, SIGNAL(activated() ),
99 this, SLOT(slotSaveSession() ) );
100 m_console->insertSeparator();
101
92 /* 102 /*
93 * connect action 103 * connect action
@@ -177,5 +187,5 @@ void MainWindow::initUI() {
177 /* 187 /*
178 * action that open/closes the keyboard 188 * action that open/closes the keyboard
179 189
180 m_openButtons = new QAction ( tr( "Open Buttons..." ), 190 m_openButtons = new QAction ( tr( "Open Buttons..." ),
181 Resource::loadPixmap( "" ), 191 Resource::loadPixmap( "" ),
@@ -223,4 +233,18 @@ void MainWindow::initUI() {
223 this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) ); 233 this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) );
224 */ 234 */
235 /* now add the copy and paste actions */
236 a = new QAction(tr("Copy"),
237 Resource::loadPixmap("copy"), QString::null,
238 0, this, 0 );
239 //a->addTo( m_icons );
240 connect( a, SIGNAL(activated() ),
241 this, SLOT(slotCopy() ) );
242
243 a = new QAction(tr("Paste"),
244 Resource::loadPixmap("paste"), QString::null,
245 0, this, 0 );
246 a->addTo( m_icons );
247 connect( a, SIGNAL(activated() ),
248 this, SLOT(slotPaste() ) );
225 249
226 250
@@ -540,2 +564,25 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
540 } 564 }
541} 565}
566void MainWindow::slotCopy() {
567 if (!currentSession() ) return;
568 currentSession()->emulationHandler()->copy();
569}
570void MainWindow::slotPaste() {
571 if (!currentSession() ) return;
572 currentSession()->emulationHandler()->paste();
573}
574
575/*
576 * Save the session
577 */
578
579void MainWindow::slotSaveSession() {
580 if (!currentSession() ) {
581 QMessageBox::information(this, tr("Save Connection"),
582 tr("<qt>There is no Connection.</qt>"), 1 );
583 return;
584 }
585 manager()->add( currentSession()->profile() );
586 manager()->save();
587 populateProfiles();
588}