summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
authorzecke <zecke>2002-10-24 12:13:09 (UTC)
committer zecke <zecke>2002-10-24 12:13:09 (UTC)
commitacf708cee945b8b843b0132672d79f5c4571c22b (patch) (side-by-side diff)
tree96b6bee6e6df3c6a252ff5680275f7080ad93729 /noncore/apps/opie-console/mainwindow.cpp
parent41c59e994e023f5c236502538f54d0f3fce8435a (diff)
downloadopie-acf708cee945b8b843b0132672d79f5c4571c22b.zip
opie-acf708cee945b8b843b0132672d79f5c4571c22b.tar.gz
opie-acf708cee945b8b843b0132672d79f5c4571c22b.tar.bz2
Fixed warnings
Now we're down to two warning with number conversions Enable Saving Sessions Enable Copy and Paste
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
@@ -89,6 +89,16 @@ void MainWindow::initUI() {
connect(a, SIGNAL(activated() ),
this, SLOT(slotNew() ) );
+ m_console->insertSeparator();
+ /* save icon is not available */
+ a = new QAction(tr("Save Connection"),
+ Resource::loadPixmap("save"), QString::null,
+ 0, this, 0 );
+ a->addTo( m_console );
+ connect(a, SIGNAL(activated() ),
+ this, SLOT(slotSaveSession() ) );
+ m_console->insertSeparator();
+
/*
* connect action
*/
@@ -176,7 +186,7 @@ void MainWindow::initUI() {
/*
* action that open/closes the keyboard
-
+
m_openButtons = new QAction ( tr( "Open Buttons..." ),
Resource::loadPixmap( "" ),
QString::null, 0, this, 0 );
@@ -222,6 +232,20 @@ void MainWindow::initUI() {
connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ),
this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) );
*/
+ /* now add the copy and paste actions */
+ a = new QAction(tr("Copy"),
+ Resource::loadPixmap("copy"), QString::null,
+ 0, this, 0 );
+ //a->addTo( m_icons );
+ connect( a, SIGNAL(activated() ),
+ this, SLOT(slotCopy() ) );
+
+ a = new QAction(tr("Paste"),
+ Resource::loadPixmap("paste"), QString::null,
+ 0, this, 0 );
+ a->addTo( m_icons );
+ connect( a, SIGNAL(activated() ),
+ this, SLOT(slotPaste() ) );
m_connect->setEnabled( false );
@@ -539,3 +563,26 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
ke.ignore();
}
}
+void MainWindow::slotCopy() {
+ if (!currentSession() ) return;
+ currentSession()->emulationHandler()->copy();
+}
+void MainWindow::slotPaste() {
+ if (!currentSession() ) return;
+ currentSession()->emulationHandler()->paste();
+}
+
+/*
+ * Save the session
+ */
+
+void MainWindow::slotSaveSession() {
+ if (!currentSession() ) {
+ QMessageBox::information(this, tr("Save Connection"),
+ tr("<qt>There is no Connection.</qt>"), 1 );
+ return;
+ }
+ manager()->add( currentSession()->profile() );
+ manager()->save();
+ populateProfiles();
+}