summaryrefslogtreecommitdiff
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
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 (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp2
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp27
-rw-r--r--noncore/apps/opie-console/TEWidget.h20
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp6
-rw-r--r--noncore/apps/opie-console/emulation_handler.h2
-rw-r--r--noncore/apps/opie-console/file_layer.cpp4
-rw-r--r--noncore/apps/opie-console/io_bt.cpp7
-rw-r--r--noncore/apps/opie-console/io_irda.cpp5
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp47
-rw-r--r--noncore/apps/opie-console/mainwindow.h7
-rw-r--r--noncore/apps/opie-console/opie-console.control2
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp4
-rw-r--r--noncore/apps/opie-console/receive_layer.cpp3
-rw-r--r--noncore/apps/opie-console/session.cpp7
-rw-r--r--noncore/apps/opie-console/session.h7
15 files changed, 121 insertions, 29 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index 16bb5ff..984e347 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -112,3 +112,2 @@ void MyPty::donePty()
// This is code from the Qt DumbTerminal example
- int status = 0;
@@ -259,2 +258,3 @@ MyPty::MyPty(const Profile& prof) : m_cpid(0)
ProcCtl* ctl = ProcCtl::self();
+ Q_UNUSED(ctl);
}
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp
index f3f462f..e4415dc 100644
--- a/noncore/apps/opie-console/TEWidget.cpp
+++ b/noncore/apps/opie-console/TEWidget.cpp
@@ -97,2 +97,27 @@
+/* Button XPM */
+namespace {
+static char * menu_xpm[] = {
+"12 12 5 1",
+" c None",
+". c #000000",
+"+ c #FFFDAD",
+"@ c #FFFF00",
+"# c #E5E100",
+" ",
+" ",
+" ......... ",
+" .+++++++. ",
+" .+@@@@#. ",
+" .+@@@#. ",
+" .+@@#. ",
+" .+@#. ",
+" .+#. ",
+" .+. ",
+" .. ",
+" "};
+
+}
+
+
/* ------------------------------------------------------------------------- */
@@ -1243,3 +1268,3 @@ void TEWidget::dropEvent(QDropEvent* event)
-void TEWidget::drop_menu_activated(int item)
+void TEWidget::drop_menu_activated(int)
{
diff --git a/noncore/apps/opie-console/TEWidget.h b/noncore/apps/opie-console/TEWidget.h
index 1b5300f..f03a16e 100644
--- a/noncore/apps/opie-console/TEWidget.h
+++ b/noncore/apps/opie-console/TEWidget.h
@@ -36,21 +36,3 @@ extern unsigned short vt100_graphics[32];
-static char * menu_xpm[] = {
-"12 12 5 1",
-" c None",
-". c #000000",
-"+ c #FFFDAD",
-"@ c #FFFF00",
-"# c #E5E100",
-" ",
-" ",
-" ......... ",
-" .+++++++. ",
-" .+@@@@#. ",
-" .+@@@#. ",
-" .+@@#. ",
-" .+@#. ",
-" .+#. ",
-" .+. ",
-" .. ",
-" "};
+
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index bdc8b43..bb3dd28 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -194 +194,7 @@ void EmulationHandler::runScript(const Script *script) {
+void EmulationHandler::copy() {
+ m_teWid->emitSelection();
+}
+void EmulationHandler::paste() {
+ m_teWid->pasteClipboard();
+}
diff --git a/noncore/apps/opie-console/emulation_handler.h b/noncore/apps/opie-console/emulation_handler.h
index 7ca2cf3..12abbc5 100644
--- a/noncore/apps/opie-console/emulation_handler.h
+++ b/noncore/apps/opie-console/emulation_handler.h
@@ -75,2 +75,4 @@ public slots:
void recv( const QByteArray& );
+ void paste();
+ void copy();
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp
index 43e9c8f..0c83700 100644
--- a/noncore/apps/opie-console/file_layer.cpp
+++ b/noncore/apps/opie-console/file_layer.cpp
@@ -13,3 +13,3 @@ FileTransferLayer::~FileTransferLayer() {
-void FileTransferLayer::sendFile(const QFile& file) {
+void FileTransferLayer::sendFile(const QFile&) {
@@ -17,3 +17,3 @@ void FileTransferLayer::sendFile(const QFile& file) {
-void FileTransferLayer::sendFile(const QString& file) {
+void FileTransferLayer::sendFile(const QString&) {
}
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 4486eea..8dd8151 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -26,2 +26,3 @@ void IOBt::close() {
bool IOBt::open() {
+ bool ret = false;
@@ -41,3 +42,3 @@ bool IOBt::open() {
if ( m_attach->start() ) {
- IOSerial::open();
+ ret = IOSerial::open();
} else {
@@ -51,4 +52,5 @@ bool IOBt::open() {
- IOSerial::open();
+ ret =IOSerial::open();
}
+ return ret;
}
@@ -76,2 +78,3 @@ void IOBt::slotExited( OProcess* proc ){
close();
+ delete proc;
}
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index 56a373c..b3b693f 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -23,2 +23,3 @@ void IOIrda::close() {
bool IOIrda::open() {
+ bool ret;
@@ -32,3 +33,3 @@ bool IOIrda::open() {
if ( m_attach->start() ) {
- IOSerial::open();
+ ret= IOSerial::open();
} else {
@@ -39,2 +40,3 @@ bool IOIrda::open() {
}
+ return ret;
}
@@ -61,2 +63,3 @@ void IOIrda::slotExited(OProcess* proc ){
close();
+ delete proc;
}
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
@@ -91,2 +91,12 @@ void MainWindow::initUI() {
+ 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();
+
/*
@@ -224,2 +234,16 @@ void MainWindow::initUI() {
*/
+ /* 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() ) );
@@ -541 +565,24 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
}
+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();
+}
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 0f52e76..16b6252 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -72,2 +72,9 @@ private slots:
+ /* what could these both slot do? */
+ void slotCopy();
+ void slotPaste();
+
+ /* save the currentSession() to Profiles */
+ void slotSaveSession();
+
private:
diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control
index d41ef58..8541d22 100644
--- a/noncore/apps/opie-console/opie-console.control
+++ b/noncore/apps/opie-console/opie-console.control
@@ -1,2 +1,2 @@
-Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab
+Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab bin/sz bin/rz
Priority: optional
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 5d39d96..cad2567 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -95,2 +95,3 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
session->connect();
+ session->setProfile( prof );
@@ -123,2 +124,5 @@ void ProfileManager::save( ) {
}
+void ProfileManager::add( const Profile& prof) {
+ m_list.append( prof );
+}
void ProfileManager::setProfiles( const Profile::ValueList& list ) {
diff --git a/noncore/apps/opie-console/receive_layer.cpp b/noncore/apps/opie-console/receive_layer.cpp
index 05e2c67..bbde339 100644
--- a/noncore/apps/opie-console/receive_layer.cpp
+++ b/noncore/apps/opie-console/receive_layer.cpp
@@ -2,2 +2,3 @@
+#include <qdir.h>
#include <qstring.h>
@@ -21,3 +22,3 @@ QString ReceiveLayer::currentDir()const{
if (m_curDir.isEmpty() )
- return QString::fromLocal8Bit( ::getwd(NULL) );
+ return QDir::currentDirPath();
return m_curDir;
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index 03d0fcd..c166d95 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -2,2 +2,3 @@
+#include "profile.h"
#include "io_layer.h"
@@ -44,2 +45,5 @@ QWidget* Session::widget() {
}
+Profile Session::profile()const {
+ return m_prof;
+}
/*
@@ -93,2 +97,5 @@ void Session::setEmulationHandler( EmulationHandler* lay ) {
}
+void Session::setProfile( const Profile& prof ) {
+ m_prof = prof;
+}
/*
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h
index 83b2046..f60a6c0 100644
--- a/noncore/apps/opie-console/session.h
+++ b/noncore/apps/opie-console/session.h
@@ -5,2 +5,4 @@
+#include "profile.h"
+
class IOLayer;
@@ -44,2 +46,3 @@ public:
EmulationHandler* emulationHandler();
+ Profile profile()const;
@@ -61,2 +64,3 @@ public:
void setName( const QString& );
+ void setProfile( const Profile& );
@@ -67,3 +71,4 @@ private:
EmulationHandler* m_emu;
- bool m_connected;
+ bool m_connected : 1;
+ Profile m_prof;