-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/TEWidget.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/opie-console/TEWidget.h | 20 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/file_layer.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 49 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 7 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/receive_layer.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.h | 7 |
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 | |||
@@ -109,9 +109,8 @@ void MyPty::setSize(int lines, int columns) | |||
109 | 109 | ||
110 | void MyPty::donePty() | 110 | 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); |
116 | 115 | ||
117 | if (m_cpid) { | 116 | if (m_cpid) { |
@@ -256,8 +255,9 @@ MyPty::MyPty(const Profile& prof) : m_cpid(0) | |||
256 | m_sn_e = 0l; | 255 | m_sn_e = 0l; |
257 | m_sn_r = 0l; | 256 | m_sn_r = 0l; |
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 | ||
262 | /*! | 262 | /*! |
263 | Destructor. | 263 | Destructor. |
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 | |||
@@ -94,8 +94,33 @@ | |||
94 | 94 | ||
95 | #define yMouseScroll 1 | 95 | #define yMouseScroll 1 |
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 */ | ||
99 | namespace { | ||
100 | static 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 | /* */ |
100 | /* Colors */ | 125 | /* Colors */ |
101 | /* */ | 126 | /* */ |
@@ -1240,9 +1265,9 @@ void TEWidget::dropEvent(QDropEvent* event) | |||
1240 | } | 1265 | } |
1241 | #endif | 1266 | #endif |
1242 | 1267 | ||
1243 | 1268 | ||
1244 | void TEWidget::drop_menu_activated(int item) | 1269 | void TEWidget::drop_menu_activated(int) |
1245 | { | 1270 | { |
1246 | #ifndef QT_NO_DRAGANDDROP | 1271 | #ifndef QT_NO_DRAGANDDROP |
1247 | switch (item) | 1272 | switch (item) |
1248 | { | 1273 | { |
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 | |||
@@ -33,27 +33,9 @@ | |||
33 | extern unsigned short vt100_graphics[32]; | 33 | extern unsigned short vt100_graphics[32]; |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | static 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 | ||
57 | class TESession; | 39 | class TESession; |
58 | 40 | ||
59 | // class Konsole; | 41 | // class Konsole; |
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 | |||
@@ -191,4 +191,10 @@ void EmulationHandler::clearScript() { | |||
191 | void EmulationHandler::runScript(const Script *script) { | 191 | void EmulationHandler::runScript(const Script *script) { |
192 | emit send(script->script()); | 192 | emit send(script->script()); |
193 | } | 193 | } |
194 | 194 | ||
195 | void EmulationHandler::copy() { | ||
196 | m_teWid->emitSelection(); | ||
197 | } | ||
198 | void 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 | |||
@@ -48,9 +48,9 @@ public: | |||
48 | void load( const Profile& ); | 48 | void load( const Profile& ); |
49 | QWidget* widget(); | 49 | QWidget* widget(); |
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 */ |
55 | void startRecording(); | 55 | void startRecording(); |
56 | 56 | ||
@@ -72,8 +72,10 @@ signals: | |||
72 | 72 | ||
73 | 73 | ||
74 | public slots: | 74 | public slots: |
75 | void recv( const QByteArray& ); | 75 | void recv( const QByteArray& ); |
76 | void paste(); | ||
77 | void copy(); | ||
76 | 78 | ||
77 | private slots: | 79 | private slots: |
78 | void recvEmulation( const char*, int len ); | 80 | void recvEmulation( const char*, int len ); |
79 | private: | 81 | private: |
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 | |||
@@ -10,13 +10,13 @@ FileTransferLayer::FileTransferLayer(IOLayer *layer) | |||
10 | 10 | ||
11 | FileTransferLayer::~FileTransferLayer() { | 11 | FileTransferLayer::~FileTransferLayer() { |
12 | } | 12 | } |
13 | 13 | ||
14 | void FileTransferLayer::sendFile(const QFile& file) { | 14 | void FileTransferLayer::sendFile(const QFile&) { |
15 | 15 | ||
16 | } | 16 | } |
17 | 17 | ||
18 | void FileTransferLayer::sendFile(const QString& file) { | 18 | void FileTransferLayer::sendFile(const QString&) { |
19 | } | 19 | } |
20 | 20 | ||
21 | IOLayer* FileTransferLayer::layer() { | 21 | IOLayer* FileTransferLayer::layer() { |
22 | return m_layer; | 22 | return m_layer; |
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 | |||
@@ -23,8 +23,9 @@ void IOBt::close() { | |||
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | bool IOBt::open() { | 26 | bool 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 |
29 | if ( !m_mac.isEmpty() ) { | 30 | if ( !m_mac.isEmpty() ) { |
30 | 31 | ||
@@ -38,9 +39,9 @@ bool IOBt::open() { | |||
38 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 39 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), |
39 | this, SLOT( slotExited( OProcess* ) ) ); | 40 | this, SLOT( slotExited( OProcess* ) ) ); |
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"); |
45 | delete m_attach; | 46 | delete m_attach; |
46 | m_attach = 0; | 47 | m_attach = 0; |
@@ -48,10 +49,11 @@ bool IOBt::open() { | |||
48 | } else { | 49 | } else { |
49 | // directly to the normal serial | 50 | // directly to the normal serial |
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 | ||
56 | void IOBt::reload( const Profile &config ) { | 58 | void IOBt::reload( const Profile &config ) { |
57 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); | 59 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); |
@@ -73,5 +75,6 @@ QString IOBt::name() const { | |||
73 | } | 75 | } |
74 | 76 | ||
75 | void IOBt::slotExited( OProcess* proc ){ | 77 | void 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 | |||
@@ -20,8 +20,9 @@ void IOIrda::close() { | |||
20 | delete m_attach; | 20 | delete m_attach; |
21 | } | 21 | } |
22 | 22 | ||
23 | bool IOIrda::open() { | 23 | bool IOIrda::open() { |
24 | bool ret; | ||
24 | 25 | ||
25 | // irdaattach here | 26 | // irdaattach here |
26 | m_attach = new OProcess(); | 27 | m_attach = new OProcess(); |
27 | *m_attach << "irattach /dev/ttyS2 -s"; | 28 | *m_attach << "irattach /dev/ttyS2 -s"; |
@@ -29,15 +30,16 @@ bool IOIrda::open() { | |||
29 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 30 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), |
30 | this, SLOT( slotExited( OProcess* ) ) ); | 31 | this, SLOT( slotExited( OProcess* ) ) ); |
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!!! |
36 | qWarning("could not attach to device"); | 37 | qWarning("could not attach to device"); |
37 | delete m_attach; | 38 | delete m_attach; |
38 | m_attach = 0l; | 39 | m_attach = 0l; |
39 | } | 40 | } |
41 | return ret; | ||
40 | } | 42 | } |
41 | 43 | ||
42 | void IOIrda::reload( const Profile &config ) { | 44 | void IOIrda::reload( const Profile &config ) { |
43 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
@@ -58,5 +60,6 @@ QString IOIrda::name() const { | |||
58 | } | 60 | } |
59 | 61 | ||
60 | void IOIrda::slotExited(OProcess* proc ){ | 62 | void 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 | |||
@@ -88,8 +88,18 @@ void MainWindow::initUI() { | |||
88 | a->addTo( m_icons ); | 88 | a->addTo( m_icons ); |
89 | connect(a, SIGNAL(activated() ), | 89 | connect(a, SIGNAL(activated() ), |
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 |
94 | */ | 104 | */ |
95 | m_connect = new QAction(); | 105 | m_connect = new QAction(); |
@@ -175,9 +185,9 @@ void MainWindow::initUI() { | |||
175 | 185 | ||
176 | 186 | ||
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( "" ), |
182 | QString::null, 0, this, 0 ); | 192 | QString::null, 0, this, 0 ); |
183 | 193 | ||
@@ -221,8 +231,22 @@ void MainWindow::initUI() { | |||
221 | m_qb = new QuickButton( m_buttonBar ); | 231 | m_qb = new QuickButton( m_buttonBar ); |
222 | connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ), | 232 | connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ), |
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 | ||
227 | m_connect->setEnabled( false ); | 251 | m_connect->setEnabled( false ); |
228 | m_disconnect->setEnabled( false ); | 252 | m_disconnect->setEnabled( false ); |
@@ -538,4 +562,27 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { | |||
538 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); | 562 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); |
539 | ke.ignore(); | 563 | ke.ignore(); |
540 | } | 564 | } |
541 | } | 565 | } |
566 | void MainWindow::slotCopy() { | ||
567 | if (!currentSession() ) return; | ||
568 | currentSession()->emulationHandler()->copy(); | ||
569 | } | ||
570 | void MainWindow::slotPaste() { | ||
571 | if (!currentSession() ) return; | ||
572 | currentSession()->emulationHandler()->paste(); | ||
573 | } | ||
574 | |||
575 | /* | ||
576 | * Save the session | ||
577 | */ | ||
578 | |||
579 | void 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 | |||
@@ -69,8 +69,15 @@ private slots: | |||
69 | void slotFullscreen(); | 69 | void slotFullscreen(); |
70 | void slotSessionChanged( Session* ); | 70 | void slotSessionChanged( Session* ); |
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 | |||
73 | private: | 80 | private: |
74 | void initUI(); | 81 | void initUI(); |
75 | void populateProfiles(); | 82 | void populateProfiles(); |
76 | void create( const Profile& ); | 83 | void create( const Profile& ); |
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,5 +1,5 @@ | |||
1 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab | 1 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* etc/keytabs/default.Keytab bin/sz bin/rz |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Opie team <opie@handhelds.org> | 4 | Maintainer: Opie team <opie@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
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 | |||
@@ -92,8 +92,9 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { | |||
92 | 92 | ||
93 | EmulationHandler* handler = new EmulationHandler(prof,dummy ); | 93 | EmulationHandler* handler = new EmulationHandler(prof,dummy ); |
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; |
98 | } | 99 | } |
99 | void ProfileManager::save( ) { | 100 | void ProfileManager::save( ) { |
@@ -120,8 +121,11 @@ void ProfileManager::save( ) { | |||
120 | conf.writeEntry( "fore", (*it2).foreground() ); | 121 | conf.writeEntry( "fore", (*it2).foreground() ); |
121 | conf.writeEntry( "terminal", (*it2).terminal() ); | 122 | conf.writeEntry( "terminal", (*it2).terminal() ); |
122 | } | 123 | } |
123 | } | 124 | } |
125 | void ProfileManager::add( const Profile& prof) { | ||
126 | m_list.append( prof ); | ||
127 | } | ||
124 | void ProfileManager::setProfiles( const Profile::ValueList& list ) { | 128 | void ProfileManager::setProfiles( const Profile::ValueList& list ) { |
125 | m_list = list; | 129 | m_list = list; |
126 | }; | 130 | }; |
127 | Profile ProfileManager::profile( const QString& name )const { | 131 | Profile ProfileManager::profile( const QString& name )const { |
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,6 +1,7 @@ | |||
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> |
5 | 6 | ||
6 | #include "io_layer.h" | 7 | #include "io_layer.h" |
@@ -18,9 +19,9 @@ IOLayer* ReceiveLayer::layer() { | |||
18 | return m_layer; | 19 | return m_layer; |
19 | } | 20 | } |
20 | QString ReceiveLayer::currentDir()const{ | 21 | QString 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 | } |
25 | void ReceiveLayer::changeDir( const QString& str) { | 26 | void ReceiveLayer::changeDir( const QString& str) { |
26 | ::chdir( str.latin1() ); | 27 | ::chdir( str.latin1() ); |
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,6 +1,7 @@ | |||
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" |
5 | #include "emulation_handler.h" | 6 | #include "emulation_handler.h" |
6 | #include "session.h" | 7 | #include "session.h" |
@@ -41,8 +42,11 @@ QWidget* Session::widget() { | |||
41 | return 0l; | 42 | return 0l; |
42 | 43 | ||
43 | return m_emu->widget(); | 44 | return m_emu->widget(); |
44 | } | 45 | } |
46 | Profile Session::profile()const { | ||
47 | return m_prof; | ||
48 | } | ||
45 | /* | 49 | /* |
46 | WidgetLayer* Session::emulationWidget() { | 50 | WidgetLayer* Session::emulationWidget() { |
47 | return m_widLay; | 51 | return m_widLay; |
48 | } | 52 | } |
@@ -90,8 +94,11 @@ void Session::setIOLayer( IOLayer* lay ) { | |||
90 | void Session::setEmulationHandler( EmulationHandler* lay ) { | 94 | void Session::setEmulationHandler( EmulationHandler* lay ) { |
91 | delete m_emu; | 95 | delete m_emu; |
92 | m_emu = lay; | 96 | m_emu = lay; |
93 | } | 97 | } |
98 | void Session::setProfile( const Profile& prof ) { | ||
99 | m_prof = prof; | ||
100 | } | ||
94 | /* | 101 | /* |
95 | void Session::setEmulationWidget( WidgetLayer* lay ) { | 102 | void Session::setEmulationWidget( WidgetLayer* lay ) { |
96 | delete m_widLay; | 103 | delete m_widLay; |
97 | m_widLay = lay; | 104 | m_widLay = 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 | |||
@@ -2,8 +2,10 @@ | |||
2 | #define OPIE_SESSION_H | 2 | #define OPIE_SESSION_H |
3 | 3 | ||
4 | #include <qwidgetstack.h> | 4 | #include <qwidgetstack.h> |
5 | 5 | ||
6 | #include "profile.h" | ||
7 | |||
6 | class IOLayer; | 8 | class IOLayer; |
7 | class EmulationHandler; | 9 | class EmulationHandler; |
8 | /** | 10 | /** |
9 | * This is a Session. A session contains | 11 | * This is a Session. A session contains |
@@ -41,8 +43,9 @@ public: | |||
41 | */ | 43 | */ |
42 | IOLayer* layer(); | 44 | IOLayer* layer(); |
43 | 45 | ||
44 | EmulationHandler* emulationHandler(); | 46 | EmulationHandler* emulationHandler(); |
47 | Profile profile()const; | ||
45 | 48 | ||
46 | /* | 49 | /* |
47 | * connects the data flow from | 50 | * connects the data flow from |
48 | * the IOLayer to the EmulationLayer | 51 | * the IOLayer to the EmulationLayer |
@@ -58,15 +61,17 @@ public: | |||
58 | void setWidgetStack( QWidgetStack* widget ); | 61 | void setWidgetStack( QWidgetStack* widget ); |
59 | void setEmulationHandler( EmulationHandler* lay ); | 62 | void setEmulationHandler( EmulationHandler* lay ); |
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 | ||
63 | private: | 67 | private: |
64 | QString m_name; | 68 | QString m_name; |
65 | QWidgetStack* m_widget; | 69 | QWidgetStack* m_widget; |
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 | }; |
71 | 76 | ||
72 | #endif | 77 | #endif |