summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore 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.h4
-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.cpp49
-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, 123 insertions, 31 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
@@ -111,5 +111,4 @@ void MyPty::donePty()
111{ 111{
112 // This is code from the Qt DumbTerminal example 112 // This is code from the Qt DumbTerminal example
113 int status = 0;
114 113
115 ::close(m_fd); 114 ::close(m_fd);
@@ -258,4 +257,5 @@ MyPty::MyPty(const Profile& prof) : m_cpid(0)
258 m_fd = openPty(); 257 m_fd = openPty();
259 ProcCtl* ctl = ProcCtl::self(); 258 ProcCtl* ctl = ProcCtl::self();
259 Q_UNUSED(ctl);
260} 260}
261 261
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
@@ -96,4 +96,29 @@
96// scroll increment used when dragging selection at top/bottom of window. 96// scroll increment used when dragging selection at top/bottom of window.
97 97
98/* Button XPM */
99namespace {
100static char * menu_xpm[] = {
101"12 12 5 1",
102 " c None",
103 ".c #000000",
104 "+c #FFFDAD",
105 "@c #FFFF00",
106 "#c #E5E100",
107" ",
108" ",
109" ......... ",
110" .+++++++. ",
111" .+@@@@#. ",
112" .+@@@#. ",
113" .+@@#. ",
114" .+@#. ",
115" .+#. ",
116" .+. ",
117" .. ",
118" "};
119
120}
121
122
98/* ------------------------------------------------------------------------- */ 123/* ------------------------------------------------------------------------- */
99/* */ 124/* */
@@ -1242,5 +1267,5 @@ void TEWidget::dropEvent(QDropEvent* event)
1242 1267
1243 1268
1244void TEWidget::drop_menu_activated(int item) 1269void TEWidget::drop_menu_activated(int)
1245{ 1270{
1246#ifndef QT_NO_DRAGANDDROP 1271#ifndef QT_NO_DRAGANDDROP
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
@@ -35,23 +35,5 @@ extern unsigned short vt100_graphics[32];
35 35
36 36
37static char * menu_xpm[] = { 37
38"12 12 5 1",
39 " c None",
40 ".c #000000",
41 "+c #FFFDAD",
42 "@c #FFFF00",
43 "#c #E5E100",
44" ",
45" ",
46" ......... ",
47" .+++++++. ",
48" .+@@@@#. ",
49" .+@@@#. ",
50" .+@@#. ",
51" .+@#. ",
52" .+#. ",
53" .+. ",
54" .. ",
55" "};
56 38
57class TESession; 39class TESession;
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
@@ -193,2 +193,8 @@ void EmulationHandler::runScript(const Script *script) {
193} 193}
194 194
195void EmulationHandler::copy() {
196 m_teWid->emitSelection();
197}
198void EmulationHandler::paste() {
199 m_teWid->pasteClipboard();
200}
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
@@ -50,5 +50,5 @@ public:
50 void setColor( const QColor& fore, const QColor& back ); 50 void setColor( const QColor& fore, const QColor& back );
51 QPushButton* cornerButton(); 51 QPushButton* cornerButton();
52 52
53 /* Scripts */ 53 /* Scripts */
54 /* Create a new script and record all typed characters */ 54 /* Create a new script and record all typed characters */
@@ -74,4 +74,6 @@ signals:
74public slots: 74public slots:
75 void recv( const QByteArray& ); 75 void recv( const QByteArray& );
76 void paste();
77 void copy();
76 78
77private slots: 79private slots:
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
@@ -12,9 +12,9 @@ FileTransferLayer::~FileTransferLayer() {
12} 12}
13 13
14void FileTransferLayer::sendFile(const QFile& file) { 14void FileTransferLayer::sendFile(const QFile&) {
15 15
16} 16}
17 17
18void FileTransferLayer::sendFile(const QString& file) { 18void FileTransferLayer::sendFile(const QString&) {
19} 19}
20 20
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
@@ -25,4 +25,5 @@ void IOBt::close() {
25 25
26bool IOBt::open() { 26bool IOBt::open() {
27 bool ret = false;
27 28
28 // only set up bt stuff if mac address was set, otherwise use the device set 29 // only set up bt stuff if mac address was set, otherwise use the device set
@@ -40,5 +41,5 @@ bool IOBt::open() {
40 41
41 if ( m_attach->start() ) { 42 if ( m_attach->start() ) {
42 IOSerial::open(); 43 ret = IOSerial::open();
43 } else { 44 } else {
44 qWarning("could not attach to device"); 45 qWarning("could not attach to device");
@@ -50,6 +51,7 @@ bool IOBt::open() {
50 // TODO: look first if the connection really exists. ( is set up ) 51 // TODO: look first if the connection really exists. ( is set up )
51 52
52 IOSerial::open(); 53 ret =IOSerial::open();
53 } 54 }
55 return ret;
54} 56}
55 57
@@ -75,3 +77,4 @@ QString IOBt::name() const {
75void IOBt::slotExited( OProcess* proc ){ 77void IOBt::slotExited( OProcess* proc ){
76 close(); 78 close();
79 delete proc;
77} 80}
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
@@ -22,4 +22,5 @@ void IOIrda::close() {
22 22
23bool IOIrda::open() { 23bool IOIrda::open() {
24 bool ret;
24 25
25 // irdaattach here 26 // irdaattach here
@@ -31,5 +32,5 @@ bool IOIrda::open() {
31 32
32 if ( m_attach->start() ) { 33 if ( m_attach->start() ) {
33 IOSerial::open(); 34 ret= IOSerial::open();
34 } else { 35 } else {
35 // emit error!!! 36 // emit error!!!
@@ -38,4 +39,5 @@ bool IOIrda::open() {
38 m_attach = 0l; 39 m_attach = 0l;
39 } 40 }
41 return ret;
40} 42}
41 43
@@ -60,3 +62,4 @@ QString IOIrda::name() const {
60void IOIrda::slotExited(OProcess* proc ){ 62void IOIrda::slotExited(OProcess* proc ){
61 close(); 63 close();
64 delete proc;
62} 65}
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}
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
@@ -71,4 +71,11 @@ private slots:
71 void slotKeyReceived(FKey, ushort, ushort, bool); 71 void slotKeyReceived(FKey, ushort, ushort, bool);
72 72
73 /* what could these both slot do? */
74 void slotCopy();
75 void slotPaste();
76
77 /* save the currentSession() to Profiles */
78 void slotSaveSession();
79
73private: 80private:
74 void initUI(); 81 void initUI();
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,3 +1,3 @@
1Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab 1Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab bin/sz bin/rz
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
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
@@ -94,4 +94,5 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
94 session->setEmulationHandler( handler ); 94 session->setEmulationHandler( handler );
95 session->connect(); 95 session->connect();
96 session->setProfile( prof );
96 97
97 return session; 98 return session;
@@ -122,4 +123,7 @@ void ProfileManager::save( ) {
122 } 123 }
123} 124}
125void ProfileManager::add( const Profile& prof) {
126 m_list.append( prof );
127}
124void ProfileManager::setProfiles( const Profile::ValueList& list ) { 128void ProfileManager::setProfiles( const Profile::ValueList& list ) {
125 m_list = list; 129 m_list = 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
@@ -1,4 +1,5 @@
1#include <unistd.h> 1#include <unistd.h>
2 2
3#include <qdir.h>
3#include <qstring.h> 4#include <qstring.h>
4#include <qfile.h> 5#include <qfile.h>
@@ -20,5 +21,5 @@ IOLayer* ReceiveLayer::layer() {
20QString ReceiveLayer::currentDir()const{ 21QString ReceiveLayer::currentDir()const{
21 if (m_curDir.isEmpty() ) 22 if (m_curDir.isEmpty() )
22 return QString::fromLocal8Bit( ::getwd(NULL) ); 23 return QDir::currentDirPath();
23 return m_curDir; 24 return m_curDir;
24} 25}
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
@@ -1,4 +1,5 @@
1 1
2 2
3#include "profile.h"
3#include "io_layer.h" 4#include "io_layer.h"
4#include "file_layer.h" 5#include "file_layer.h"
@@ -43,4 +44,7 @@ QWidget* Session::widget() {
43 return m_emu->widget(); 44 return m_emu->widget();
44} 45}
46Profile Session::profile()const {
47 return m_prof;
48}
45/* 49/*
46WidgetLayer* Session::emulationWidget() { 50WidgetLayer* Session::emulationWidget() {
@@ -92,4 +96,7 @@ void Session::setEmulationHandler( EmulationHandler* lay ) {
92 m_emu = lay; 96 m_emu = lay;
93} 97}
98void Session::setProfile( const Profile& prof ) {
99 m_prof = prof;
100}
94/* 101/*
95void Session::setEmulationWidget( WidgetLayer* lay ) { 102void Session::setEmulationWidget( WidgetLayer* lay ) {
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
@@ -4,4 +4,6 @@
4#include <qwidgetstack.h> 4#include <qwidgetstack.h>
5 5
6#include "profile.h"
7
6class IOLayer; 8class IOLayer;
7class EmulationHandler; 9class EmulationHandler;
@@ -43,4 +45,5 @@ public:
43 45
44 EmulationHandler* emulationHandler(); 46 EmulationHandler* emulationHandler();
47 Profile profile()const;
45 48
46 /* 49 /*
@@ -60,4 +63,5 @@ public:
60 void setIOLayer( IOLayer* ); 63 void setIOLayer( IOLayer* );
61 void setName( const QString& ); 64 void setName( const QString& );
65 void setProfile( const Profile& );
62 66
63private: 67private:
@@ -66,5 +70,6 @@ private:
66 IOLayer* m_layer; 70 IOLayer* m_layer;
67 EmulationHandler* m_emu; 71 EmulationHandler* m_emu;
68 bool m_connected; 72 bool m_connected : 1;
73 Profile m_prof;
69 74
70}; 75};