Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 49 |
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 @@ -84,16 +84,26 @@ void MainWindow::initUI() { QAction* a = new QAction(tr("New Connection"), Resource::loadPixmap( "new" ), QString::null, 0, this, 0); a->addTo( m_console ); a->addTo( m_icons ); 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 */ m_connect = new QAction(); m_connect->setText( tr("Connect") ); m_connect->addTo( m_console ); connect(m_connect, SIGNAL(activated() ), this, SLOT(slotConnect() ) ); @@ -171,17 +181,17 @@ void MainWindow::initUI() { connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); m_openKeys->addTo(m_icons); /* * action that open/closes the keyboard - + m_openButtons = new QAction ( tr( "Open Buttons..." ), Resource::loadPixmap( "" ), QString::null, 0, this, 0 ); m_openButtons->setToggleAction( true ); connect ( m_openButtons, SIGNAL( toggled( bool ) ), this, SLOT( slotOpenButtons( bool ) ) ); @@ -217,16 +227,30 @@ void MainWindow::initUI() { m_buttonBar->setHorizontalStretchable( TRUE ); m_buttonBar->hide(); /* m_qb = new QuickButton( m_buttonBar ); 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 ); m_disconnect->setEnabled( false ); m_terminate->setEnabled( false ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false ); m_saveScript->setEnabled( false ); @@ -534,8 +558,31 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); // where should i send this event? doesnt work sending it here QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); 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(); +} |