summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp4
-rw-r--r--noncore/apps/opie-console/io_serial.h0
-rw-r--r--noncore/apps/opie-console/iolayerbase.cpp19
-rw-r--r--noncore/apps/opie-console/iolayerbase.h4
-rw-r--r--noncore/apps/opie-console/irdaconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/main.cpp6
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/serialconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp68
-rw-r--r--noncore/apps/opie-console/terminalwidget.h6
11 files changed, 121 insertions, 34 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index 0ac337f..e1ff18a 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -90,24 +90,30 @@ void BTConfigWidget::load( const Profile& prof ) {
90 case 115200: 90 case 115200:
91 m_base->setSpeed(IOLayerBase::Baud_115200 ); 91 m_base->setSpeed(IOLayerBase::Baud_115200 );
92 break; 92 break;
93 case 57600: 93 case 57600:
94 m_base->setSpeed( IOLayerBase::Baud_57600 ); 94 m_base->setSpeed( IOLayerBase::Baud_57600 );
95 break; 95 break;
96 case 38400: 96 case 38400:
97 m_base->setSpeed(IOLayerBase::Baud_38400 ); 97 m_base->setSpeed(IOLayerBase::Baud_38400 );
98 break; 98 break;
99 case 19200: 99 case 19200:
100 m_base->setSpeed( IOLayerBase::Baud_19200 ); 100 m_base->setSpeed( IOLayerBase::Baud_19200 );
101 break; 101 break;
102 case 4800:
103 m_base->setSpeed( IOLayerBase::Baud_4800 );
104 break;
105 case 2400:
106 m_base->setSpeed( IOLayerBase::Baud_2400 );
107 break;
102 case 9600: 108 case 9600:
103 default: 109 default:
104 m_base->setSpeed(IOLayerBase::Baud_9600 ); 110 m_base->setSpeed(IOLayerBase::Baud_9600 );
105 break; 111 break;
106 } 112 }
107 113
108 if ( prof.readEntry("Device").isEmpty() ) return; 114 if ( prof.readEntry("Device").isEmpty() ) return;
109 setCurrent( prof.readEntry("Device"), m_deviceCmb ); 115 setCurrent( prof.readEntry("Device"), m_deviceCmb );
110 116
111} 117}
112/* 118/*
113 * save speed, 119 * save speed,
@@ -148,24 +154,30 @@ void BTConfigWidget::save( Profile& prof ) {
148 case IOLayerBase::Baud_115200: 154 case IOLayerBase::Baud_115200:
149 speed = 115200; 155 speed = 115200;
150 break; 156 break;
151 case IOLayerBase::Baud_57600: 157 case IOLayerBase::Baud_57600:
152 speed = 57600; 158 speed = 57600;
153 break; 159 break;
154 case IOLayerBase::Baud_38400: 160 case IOLayerBase::Baud_38400:
155 speed = 38400; 161 speed = 38400;
156 break; 162 break;
157 case IOLayerBase::Baud_19200: 163 case IOLayerBase::Baud_19200:
158 speed = 19200; 164 speed = 19200;
159 break; 165 break;
166 case IOLayerBase::Baud_4800:
167 speed = 4800;
168 break;
169 case IOLayerBase::Baud_2400:
170 speed = 2400;
171 break;
160 default: 172 default:
161 case IOLayerBase::Baud_9600: 173 case IOLayerBase::Baud_9600:
162 speed = 9600; 174 speed = 9600;
163 break; 175 break;
164 } 176 }
165 177
166 prof.writeEntry("Flow", flow); 178 prof.writeEntry("Flow", flow);
167 prof.writeEntry("Parity", parity); 179 prof.writeEntry("Parity", parity);
168 prof.writeEntry("Speed", speed); 180 prof.writeEntry("Speed", speed);
169 prof.writeEntry("Mac", m_mac->text() ); 181 prof.writeEntry("Mac", m_mac->text() );
170} 182}
171 183
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 89b70c6..1a0613f 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -32,25 +32,27 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c
32} 32}
33TEmulation* EmulationHandler::emulation() { 33TEmulation* EmulationHandler::emulation() {
34 return m_teEmu; 34 return m_teEmu;
35} 35}
36EmulationHandler::~EmulationHandler() { 36EmulationHandler::~EmulationHandler() {
37 if (isRecording()) 37 if (isRecording())
38 clearScript(); 38 clearScript();
39 delete m_teEmu; 39 delete m_teEmu;
40 delete m_teWid; 40 delete m_teWid;
41} 41}
42 42
43void EmulationHandler::load( const Profile& prof) { 43void EmulationHandler::load( const Profile& prof) {
44 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); 44
45// m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
46 m_teWid->setVTFont( QFont( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ) );
45 int num = prof.readNumEntry("Color"); 47 int num = prof.readNumEntry("Color");
46 setColor( foreColor(num), backColor(num) ); 48 setColor( foreColor(num), backColor(num) );
47 m_teWid->setBackgroundColor(backColor(num) ); 49 m_teWid->setBackgroundColor(backColor(num) );
48 50
49 int term = prof.readNumEntry("Terminal", 0) ; 51 int term = prof.readNumEntry("Terminal", 0) ;
50 switch(term) { 52 switch(term) {
51 default: 53 default:
52 case Profile::VT102: 54 case Profile::VT102:
53 case Profile::VT100: 55 case Profile::VT100:
54 m_teEmu->setKeytrans("vt100.keytab"); 56 m_teEmu->setKeytrans("vt100.keytab");
55 break; 57 break;
56 case Profile::Linux: 58 case Profile::Linux:
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h
index 20c1ae1..f8b04e2 100644
--- a/noncore/apps/opie-console/io_serial.h
+++ b/noncore/apps/opie-console/io_serial.h
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp
index b434e66..0f64d6a 100644
--- a/noncore/apps/opie-console/iolayerbase.cpp
+++ b/noncore/apps/opie-console/iolayerbase.cpp
@@ -15,25 +15,27 @@ namespace {
15 15
16 enum FlowIds { 16 enum FlowIds {
17 id_flow_hw, 17 id_flow_hw,
18 id_flow_sw, 18 id_flow_sw,
19 id_flow_none, 19 id_flow_none,
20 }; 20 };
21 21
22 enum SpeedIds { 22 enum SpeedIds {
23 id_baud_115200, 23 id_baud_115200,
24 id_baud_57600, 24 id_baud_57600,
25 id_baud_38400, 25 id_baud_38400,
26 id_baud_19200, 26 id_baud_19200,
27 id_baud_9600 27 id_baud_9600,
28 id_baud_4800,
29 id_baud_2400
28 }; 30 };
29 31
30 enum DataIds { 32 enum DataIds {
31 id_data_5, 33 id_data_5,
32 id_data_6, 34 id_data_6,
33 id_data_7, 35 id_data_7,
34 id_data_8 36 id_data_8
35 }; 37 };
36 38
37 enum StopIds { 39 enum StopIds {
38 id_stop_1, 40 id_stop_1,
39 id_stop_1_5, 41 id_stop_1_5,
@@ -77,25 +79,26 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name )
77 m_lroot->add(m_groupFlow ); 79 m_lroot->add(m_groupFlow );
78 m_lroot->add(m_groupParity ); 80 m_lroot->add(m_groupParity );
79 m_lroot->add( m_groupData ); 81 m_lroot->add( m_groupData );
80 m_lroot->add( m_groupStop ); 82 m_lroot->add( m_groupStop );
81 m_lroot->addStretch(2); 83 m_lroot->addStretch(2);
82 84
83 // profiles 85 // profiles
84 m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); 86 m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 );
85 m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); 87 m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 );
86 m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); 88 m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 );
87 m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 ); 89 m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 );
88 m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 ); 90 m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 );
89 91 m_speedBox->insertItem(tr("4800 baud"), id_baud_4800 );
92 m_speedBox->insertItem(tr("2400 baud"), id_baud_2400 );
90}; 93};
91IOLayerBase::~IOLayerBase() { 94IOLayerBase::~IOLayerBase() {
92 95
93} 96}
94void IOLayerBase::setFlow( Flow flo ) { 97void IOLayerBase::setFlow( Flow flo ) {
95 switch ( flo ) { 98 switch ( flo ) {
96 case Software: 99 case Software:
97 m_flowSw->setChecked( true ); 100 m_flowSw->setChecked( true );
98 break; 101 break;
99 case Hardware: 102 case Hardware:
100 m_flowHw->setChecked( true ); 103 m_flowHw->setChecked( true );
101 break; 104 break;
@@ -124,24 +127,30 @@ void IOLayerBase::setSpeed( Speed sp ) {
124 case Baud_115200: 127 case Baud_115200:
125 index = id_baud_115200; 128 index = id_baud_115200;
126 break; 129 break;
127 case Baud_57600: 130 case Baud_57600:
128 index = id_baud_57600; 131 index = id_baud_57600;
129 break; 132 break;
130 case Baud_38400: 133 case Baud_38400:
131 index = id_baud_38400; 134 index = id_baud_38400;
132 break; 135 break;
133 case Baud_19200: 136 case Baud_19200:
134 index = id_baud_19200; 137 index = id_baud_19200;
135 break; 138 break;
139 case Baud_4800:
140 index = id_baud_4800;
141 break;
142 case Baud_2400:
143 index = id_baud_2400;
144 break;
136 default: 145 default:
137 case Baud_9600: 146 case Baud_9600:
138 index = id_baud_9600; 147 index = id_baud_9600;
139 break; 148 break;
140 } 149 }
141 m_speedBox->setCurrentItem(index ); 150 m_speedBox->setCurrentItem(index );
142} 151}
143 152
144void IOLayerBase::setData( Data data ) { 153void IOLayerBase::setData( Data data ) {
145 switch( data ) { 154 switch( data ) {
146 case Data_Five: 155 case Data_Five:
147 m_data5->setChecked( true ); 156 m_data5->setChecked( true );
@@ -199,24 +208,30 @@ IOLayerBase::Speed IOLayerBase::speed()const{
199 case id_baud_115200: 208 case id_baud_115200:
200 return Baud_115200; 209 return Baud_115200;
201 break; 210 break;
202 case id_baud_57600: 211 case id_baud_57600:
203 return Baud_57600; 212 return Baud_57600;
204 break; 213 break;
205 case id_baud_38400: 214 case id_baud_38400:
206 return Baud_38400; 215 return Baud_38400;
207 break; 216 break;
208 case id_baud_19200: 217 case id_baud_19200:
209 return Baud_19200; 218 return Baud_19200;
210 break; 219 break;
220 case id_baud_4800:
221 return Baud_4800;
222 break;
223 case id_baud_2400:
224 return Baud_2400;
225 break;
211 default: 226 default:
212 case id_baud_9600: 227 case id_baud_9600:
213 return Baud_9600; 228 return Baud_9600;
214 break; 229 break;
215 } 230 }
216} 231}
217IOLayerBase::Data IOLayerBase::data()const { 232IOLayerBase::Data IOLayerBase::data()const {
218 if ( m_data5->isChecked() ) { 233 if ( m_data5->isChecked() ) {
219 return Data_Five; 234 return Data_Five;
220 } else if ( m_data6->isChecked() ) { 235 } else if ( m_data6->isChecked() ) {
221 return Data_Six; 236 return Data_Six;
222 } else if ( m_data7->isChecked() ) { 237 } else if ( m_data7->isChecked() ) {
diff --git a/noncore/apps/opie-console/iolayerbase.h b/noncore/apps/opie-console/iolayerbase.h
index e1b96df..214a35c 100644
--- a/noncore/apps/opie-console/iolayerbase.h
+++ b/noncore/apps/opie-console/iolayerbase.h
@@ -12,25 +12,27 @@ class QRadioButton;
12class QHBoxLayout; 12class QHBoxLayout;
13class IOLayerBase : public QWidget { 13class IOLayerBase : public QWidget {
14 14
15 Q_OBJECT 15 Q_OBJECT
16 16
17public: 17public:
18 enum Flow { Hardware, Software, None }; 18 enum Flow { Hardware, Software, None };
19 enum Parity{ Odd =2 , Even =1, NonePar =0 }; 19 enum Parity{ Odd =2 , Even =1, NonePar =0 };
20 enum Speed{ Baud_115200, 20 enum Speed{ Baud_115200,
21 Baud_57600, 21 Baud_57600,
22 Baud_38400, 22 Baud_38400,
23 Baud_19200, 23 Baud_19200,
24 Baud_9600 }; 24 Baud_9600,
25 Baud_4800,
26 Baud_2400 };
25 enum Data { Data_Five =5, Data_Six =6, Data_Seven=7, Data_Eight=8 }; 27 enum Data { Data_Five =5, Data_Six =6, Data_Seven=7, Data_Eight=8 };
26 enum Stop { Stop_One =1, Stop_OnePointFive=15, Stop_Two=2 }; 28 enum Stop { Stop_One =1, Stop_OnePointFive=15, Stop_Two=2 };
27 29
28 IOLayerBase( QWidget* base, const char* name = 0l); 30 IOLayerBase( QWidget* base, const char* name = 0l);
29 ~IOLayerBase(); 31 ~IOLayerBase();
30 32
31 void setFlow( Flow flo ); 33 void setFlow( Flow flo );
32 void setParity( Parity par ); 34 void setParity( Parity par );
33 void setSpeed( Speed speed ); 35 void setSpeed( Speed speed );
34 void setData( Data data ); 36 void setData( Data data );
35 void setStop( Stop stop ); 37 void setStop( Stop stop );
36 38
diff --git a/noncore/apps/opie-console/irdaconfigwidget.cpp b/noncore/apps/opie-console/irdaconfigwidget.cpp
index 059530d..4ee770d 100644
--- a/noncore/apps/opie-console/irdaconfigwidget.cpp
+++ b/noncore/apps/opie-console/irdaconfigwidget.cpp
@@ -69,24 +69,30 @@ void IrdaConfigWidget::load( const Profile& prof ) {
69 case 115200: 69 case 115200:
70 m_base->setSpeed(IOLayerBase::Baud_115200 ); 70 m_base->setSpeed(IOLayerBase::Baud_115200 );
71 break; 71 break;
72 case 57600: 72 case 57600:
73 m_base->setSpeed( IOLayerBase::Baud_57600 ); 73 m_base->setSpeed( IOLayerBase::Baud_57600 );
74 break; 74 break;
75 case 38400: 75 case 38400:
76 m_base->setSpeed(IOLayerBase::Baud_38400 ); 76 m_base->setSpeed(IOLayerBase::Baud_38400 );
77 break; 77 break;
78 case 19200: 78 case 19200:
79 m_base->setSpeed( IOLayerBase::Baud_19200 ); 79 m_base->setSpeed( IOLayerBase::Baud_19200 );
80 break; 80 break;
81 case 4800:
82 m_base->setSpeed( IOLayerBase::Baud_4800 );
83 break;
84 case 2400:
85 m_base->setSpeed( IOLayerBase::Baud_2400 );
86 break;
81 case 9600: 87 case 9600:
82 default: 88 default:
83 m_base->setSpeed(IOLayerBase::Baud_9600 ); 89 m_base->setSpeed(IOLayerBase::Baud_9600 );
84 break; 90 break;
85 } 91 }
86 92
87 if ( prof.readEntry("Device").isEmpty() ) return; 93 if ( prof.readEntry("Device").isEmpty() ) return;
88 setCurrent( prof.readEntry("Device"), m_deviceCmb ); 94 setCurrent( prof.readEntry("Device"), m_deviceCmb );
89 95
90} 96}
91/* 97/*
92 * save speed, 98 * save speed,
@@ -127,22 +133,28 @@ void IrdaConfigWidget::save( Profile& prof ) {
127 case IOLayerBase::Baud_115200: 133 case IOLayerBase::Baud_115200:
128 speed = 115200; 134 speed = 115200;
129 break; 135 break;
130 case IOLayerBase::Baud_57600: 136 case IOLayerBase::Baud_57600:
131 speed = 57600; 137 speed = 57600;
132 break; 138 break;
133 case IOLayerBase::Baud_38400: 139 case IOLayerBase::Baud_38400:
134 speed = 38400; 140 speed = 38400;
135 break; 141 break;
136 case IOLayerBase::Baud_19200: 142 case IOLayerBase::Baud_19200:
137 speed = 19200; 143 speed = 19200;
138 break; 144 break;
145 case IOLayerBase::Baud_4800:
146 speed = 4800;
147 break;
148 case IOLayerBase::Baud_2400:
149 speed = 2400;
150 break;
139 default: 151 default:
140 case IOLayerBase::Baud_9600: 152 case IOLayerBase::Baud_9600:
141 speed = 9600; 153 speed = 9600;
142 break; 154 break;
143 } 155 }
144 156
145 prof.writeEntry("Flow", flow); 157 prof.writeEntry("Flow", flow);
146 prof.writeEntry("Parity", parity); 158 prof.writeEntry("Parity", parity);
147 prof.writeEntry("Speed", speed); 159 prof.writeEntry("Speed", speed);
148} 160}
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index 1bd4338..f61f44e 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -1,24 +1,24 @@
1#include <sys/types.h> 1#include <sys/types.h>
2 2
3#include <stdio.h> 3#include <stdio.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#include <signal.h> 5#include <signal.h>
6 6#include <qfile.h>
7 7
8#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
9 9
10#include "mainwindow.h" 10#include "mainwindow.h"
11 11
12//#define FSCKED_DISTRIBUTION 1 12#define FSCKED_DISTRIBUTION 1
13#ifdef FSCKED_DISTRIBUTION 13#ifdef FSCKED_DISTRIBUTION
14/* 14/*
15 * The Zaurus rom 15 * The Zaurus rom
16 */ 16 */
17class FixIt { 17class FixIt {
18public: 18public:
19 FixIt(); 19 FixIt();
20 ~FixIt(); 20 ~FixIt();
21 void fixIt(); 21 void fixIt();
22 /* no real interested in implementing it */ 22 /* no real interested in implementing it */
23 void breakIt() { 23 void breakIt() {
24 24
@@ -82,25 +82,25 @@ void FixIt::fixIt() {
82 file.writeBlock(m_file,strlen(m_file) ); 82 file.writeBlock(m_file,strlen(m_file) );
83 } 83 }
84 file.close(); 84 file.close();
85 ::kill( SIGHUP, 1 ); 85 ::kill( SIGHUP, 1 );
86} 86}
87#endif 87#endif
88 88
89int main(int argc, char **argv) { 89int main(int argc, char **argv) {
90// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; 90// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole";
91 QPEApplication app( argc, argv ); 91 QPEApplication app( argc, argv );
92 92
93#ifdef FSCKED_DISTRIBUTION 93#ifdef FSCKED_DISTRIBUTION
94 owarn << "fscked" << oendl; 94// owarn << "fscked" << oendl;
95 FixIt it; 95 FixIt it;
96 it.fixIt(); 96 it.fixIt();
97#endif 97#endif
98 98
99 MainWindow mw; 99 MainWindow mw;
100 mw.setCaption(QObject::tr("Opie Console") ); 100 mw.setCaption(QObject::tr("Opie Console") );
101 app.showMainWidget( &mw ); 101 app.showMainWidget( &mw );
102 102
103 int ap = app.exec(); 103 int ap = app.exec();
104 104
105#ifdef FSCKED_DISTRIBUTION 105#ifdef FSCKED_DISTRIBUTION
106 /* should add a signal handler too */ 106 /* should add a signal handler too */
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 9fdaf73..90d0b5b 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -101,24 +101,30 @@ void ModemConfigWidget::load( const Profile& prof ) {
101 case 115200: 101 case 115200:
102 m_base->setSpeed( IOLayerBase::Baud_115200 ); 102 m_base->setSpeed( IOLayerBase::Baud_115200 );
103 break; 103 break;
104 case 57600: 104 case 57600:
105 m_base->setSpeed( IOLayerBase::Baud_57600 ); 105 m_base->setSpeed( IOLayerBase::Baud_57600 );
106 break; 106 break;
107 case 38400: 107 case 38400:
108 m_base->setSpeed( IOLayerBase::Baud_38400 ); 108 m_base->setSpeed( IOLayerBase::Baud_38400 );
109 break; 109 break;
110 case 19200: 110 case 19200:
111 m_base->setSpeed( IOLayerBase::Baud_19200 ); 111 m_base->setSpeed( IOLayerBase::Baud_19200 );
112 break; 112 break;
113 case 4800:
114 m_base->setSpeed( IOLayerBase::Baud_4800 );
115 break;
116 case 2400:
117 m_base->setSpeed( IOLayerBase::Baud_2400 );
118 break;
113 case 9600: 119 case 9600:
114 default: 120 default:
115 m_base->setSpeed( IOLayerBase::Baud_9600 ); 121 m_base->setSpeed( IOLayerBase::Baud_9600 );
116 break; 122 break;
117 } 123 }
118 124
119 125
120 if ( dbits == 5) { 126 if ( dbits == 5) {
121 m_base->setData( IOLayerBase::Data_Five ); 127 m_base->setData( IOLayerBase::Data_Five );
122 } else if (rad_flow == 6) { 128 } else if (rad_flow == 6) {
123 m_base->setData( IOLayerBase::Data_Six ); 129 m_base->setData( IOLayerBase::Data_Six );
124 } else if (rad_flow == 7) { 130 } else if (rad_flow == 7) {
@@ -188,24 +194,30 @@ void ModemConfigWidget::save( Profile& prof ) {
188 case IOLayerBase::Baud_57600: 194 case IOLayerBase::Baud_57600:
189 speed = 57600; 195 speed = 57600;
190 break; 196 break;
191 case IOLayerBase::Baud_38400: 197 case IOLayerBase::Baud_38400:
192 speed = 38400; 198 speed = 38400;
193 break; 199 break;
194 case IOLayerBase::Baud_19200: 200 case IOLayerBase::Baud_19200:
195 speed = 19200; 201 speed = 19200;
196 break; 202 break;
197 case IOLayerBase::Baud_9600: 203 case IOLayerBase::Baud_9600:
198 speed = 9600; 204 speed = 9600;
199 break; 205 break;
206 case IOLayerBase::Baud_4800:
207 speed = 4800;
208 break;
209 case IOLayerBase::Baud_2400:
210 speed = 2400;
211 break;
200 } 212 }
201 213
202 switch( m_base->data() ) { 214 switch( m_base->data() ) {
203 case IOLayerBase::Data_Five: 215 case IOLayerBase::Data_Five:
204 data = 5; 216 data = 5;
205 break; 217 break;
206 case IOLayerBase::Data_Six: 218 case IOLayerBase::Data_Six:
207 data = 6; 219 data = 6;
208 break; 220 break;
209 case IOLayerBase::Data_Seven: 221 case IOLayerBase::Data_Seven:
210 data = 7; 222 data = 7;
211 break; 223 break;
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp
index 3edf723..5f3547a 100644
--- a/noncore/apps/opie-console/serialconfigwidget.cpp
+++ b/noncore/apps/opie-console/serialconfigwidget.cpp
@@ -73,24 +73,30 @@ void SerialConfigWidget::load( const Profile& prof ) {
73 case 115200: 73 case 115200:
74 m_base->setSpeed(IOLayerBase::Baud_115200 ); 74 m_base->setSpeed(IOLayerBase::Baud_115200 );
75 break; 75 break;
76 case 57600: 76 case 57600:
77 m_base->setSpeed( IOLayerBase::Baud_57600 ); 77 m_base->setSpeed( IOLayerBase::Baud_57600 );
78 break; 78 break;
79 case 38400: 79 case 38400:
80 m_base->setSpeed(IOLayerBase::Baud_38400 ); 80 m_base->setSpeed(IOLayerBase::Baud_38400 );
81 break; 81 break;
82 case 19200: 82 case 19200:
83 m_base->setSpeed( IOLayerBase::Baud_19200 ); 83 m_base->setSpeed( IOLayerBase::Baud_19200 );
84 break; 84 break;
85 case 4800:
86 m_base->setSpeed( IOLayerBase::Baud_4800 );
87 break;
88 case 2400:
89 m_base->setSpeed( IOLayerBase::Baud_2400 );
90 break;
85 case 9600: 91 case 9600:
86 default: 92 default:
87 m_base->setSpeed(IOLayerBase::Baud_9600 ); 93 m_base->setSpeed(IOLayerBase::Baud_9600 );
88 break; 94 break;
89 } 95 }
90 96
91 if ( dbits == 5) { 97 if ( dbits == 5) {
92 m_base->setData( IOLayerBase::Data_Five ); 98 m_base->setData( IOLayerBase::Data_Five );
93 } else if (rad_flow == 6) { 99 } else if (rad_flow == 6) {
94 m_base->setData( IOLayerBase::Data_Six ); 100 m_base->setData( IOLayerBase::Data_Six );
95 } else if (rad_flow == 7) { 101 } else if (rad_flow == 7) {
96 m_base->setData( IOLayerBase::Data_Seven ); 102 m_base->setData( IOLayerBase::Data_Seven );
@@ -148,24 +154,30 @@ void SerialConfigWidget::save( Profile& prof ) {
148 case IOLayerBase::Baud_115200: 154 case IOLayerBase::Baud_115200:
149 speed = 115200; 155 speed = 115200;
150 break; 156 break;
151 case IOLayerBase::Baud_57600: 157 case IOLayerBase::Baud_57600:
152 speed = 57600; 158 speed = 57600;
153 break; 159 break;
154 case IOLayerBase::Baud_38400: 160 case IOLayerBase::Baud_38400:
155 speed = 38400; 161 speed = 38400;
156 break; 162 break;
157 case IOLayerBase::Baud_19200: 163 case IOLayerBase::Baud_19200:
158 speed = 19200; 164 speed = 19200;
159 break; 165 break;
166 case IOLayerBase::Baud_4800:
167 speed = 4800;
168 break;
169 case IOLayerBase::Baud_2400:
170 speed = 2400;
171 break;
160 default: 172 default:
161 case IOLayerBase::Baud_9600: 173 case IOLayerBase::Baud_9600:
162 speed = 9600; 174 speed = 9600;
163 break; 175 break;
164 } 176 }
165 177
166 switch( m_base->data() ) { 178 switch( m_base->data() ) {
167 case IOLayerBase::Data_Five: 179 case IOLayerBase::Data_Five:
168 data = 5; 180 data = 5;
169 break; 181 break;
170 case IOLayerBase::Data_Six: 182 case IOLayerBase::Data_Six:
171 data = 6; 183 data = 6;
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index 087476b..3e3b8a6 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -1,26 +1,28 @@
1#include "terminalwidget.h" 1#include "terminalwidget.h"
2 2
3/* OPIE */ 3/* OPIE */
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5
5using namespace Opie::Core; 6using namespace Opie::Core;
6 7
7/* QT */ 8/* QT */
8#include <qlabel.h> 9#include <qlabel.h>
9#include <qcheckbox.h> 10#include <qcheckbox.h>
10#include <qcombobox.h> 11#include <qcombobox.h>
11#include <qradiobutton.h> 12#include <qradiobutton.h>
12#include <qhgroupbox.h> 13#include <qhgroupbox.h>
13#include <qhbuttongroup.h> 14#include <qhbuttongroup.h>
14#include <qlayout.h> 15#include <qlayout.h>
16#include <qhbox.h>
15 17
16namespace { 18namespace {
17 enum TermIds { 19 enum TermIds {
18 id_term_vt100 = 0, 20 id_term_vt100 = 0,
19 id_term_vt102, 21 id_term_vt102,
20 id_term_linux, 22 id_term_linux,
21 id_term_xterm 23 id_term_xterm
22 }; 24 };
23 25
24 enum ColourIds { 26 enum ColourIds {
25 id_term_black, 27 id_term_black,
26 id_term_white, 28 id_term_white,
@@ -35,33 +37,37 @@ namespace {
35 }; 37 };
36}; 38};
37 39
38TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, 40TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
39 const char* na ) 41 const char* na )
40 : ProfileDialogTerminalWidget( name, parent, na ) { 42 : ProfileDialogTerminalWidget( name, parent, na ) {
41 43
42 m_terminal = new QLabel(tr("Terminal Type"), this ); 44 m_terminal = new QLabel(tr("Terminal Type"), this );
43 m_terminalBox = new QComboBox(this); 45 m_terminalBox = new QComboBox(this);
44 m_colorLabel = new QLabel(tr("Color scheme"), this); 46 m_colorLabel = new QLabel(tr("Color scheme"), this);
45 m_colorCmb = new QComboBox(this ); 47 m_colorCmb = new QComboBox(this );
46 48
47 m_groupSize = new QHButtonGroup(tr("Font size"), this ); 49// m_groupSize = new QHButtonGroup(tr("Font size"), this );
48 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize ); 50 m_groupSize = new QHBox( this );
49 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize ); 51 m_fontSelector = new Opie::Ui::OFontSelector( false, m_groupSize );
50 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize ); 52
53// m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
54// m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
55// m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
51 56
52 m_groupConv = new QHGroupBox( tr("Line-break conversions"), this ); 57 m_groupConv = new QHGroupBox( tr("Line-break conversions"), this );
53 m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv ); 58 m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv );
54 m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv ); 59 m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv );
55 60
61
56 m_groupOptions = new QHGroupBox( tr("Options"), this ); 62 m_groupOptions = new QHGroupBox( tr("Options"), this );
57 m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions ); 63 m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions );
58 m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions ); 64 m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions );
59 65
60 m_lroot = new QVBoxLayout( this ); 66 m_lroot = new QVBoxLayout( this );
61 m_typeBox = new QVBoxLayout( m_lroot ); 67 m_typeBox = new QVBoxLayout( m_lroot );
62 m_colorBox = new QVBoxLayout( m_lroot ); 68 m_colorBox = new QVBoxLayout( m_lroot );
63 69
64 // Layout 70 // Layout
65 m_typeBox->add( m_terminal ); 71 m_typeBox->add( m_terminal );
66 m_typeBox->add( m_terminalBox ); 72 m_typeBox->add( m_terminalBox );
67 m_lroot->add( m_groupSize ); 73 m_lroot->add( m_groupSize );
@@ -101,25 +107,25 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
101 this, SLOT(slotTermWrap(bool) ) ); 107 this, SLOT(slotTermWrap(bool) ) );
102 connect(m_convInbound, SIGNAL(toggled(bool) ), 108 connect(m_convInbound, SIGNAL(toggled(bool) ),
103 this, SLOT(slotTermInbound(bool) ) ); 109 this, SLOT(slotTermInbound(bool) ) );
104 connect(m_convOutbound, SIGNAL(toggled(bool) ), 110 connect(m_convOutbound, SIGNAL(toggled(bool) ),
105 this, SLOT(slotTermOutbound(bool) ) ); 111 this, SLOT(slotTermOutbound(bool) ) );
106*/ 112*/
107} 113}
108TerminalWidget::~TerminalWidget() { 114TerminalWidget::~TerminalWidget() {
109} 115}
110void TerminalWidget::load( const Profile& prof ) { 116void TerminalWidget::load( const Profile& prof ) {
111 int term = prof.readNumEntry("Terminal"); 117 int term = prof.readNumEntry("Terminal");
112 int color = prof.readNumEntry("Color"); 118 int color = prof.readNumEntry("Color");
113 int fontsize = prof.readNumEntry("Font"); 119// int fontsize = prof.readNumEntry("Font");
114 int opt_echo = prof.readNumEntry("Echo"); 120 int opt_echo = prof.readNumEntry("Echo");
115 int opt_wrap = prof.readNumEntry("Wrap"); 121 int opt_wrap = prof.readNumEntry("Wrap");
116 int opt_inbound = prof.readNumEntry("Inbound"); 122 int opt_inbound = prof.readNumEntry("Inbound");
117 int opt_outbound = prof.readNumEntry("Outbound"); 123 int opt_outbound = prof.readNumEntry("Outbound");
118 124
119 switch( term ) { 125 switch( term ) {
120 case Profile::VT100: 126 case Profile::VT100:
121 m_terminalBox->setCurrentItem(id_term_vt100 ); 127 m_terminalBox->setCurrentItem(id_term_vt100 );
122 break; 128 break;
123 case Profile::VT102: 129 case Profile::VT102:
124 m_terminalBox->setCurrentItem(id_term_vt102 ); 130 m_terminalBox->setCurrentItem(id_term_vt102 );
125 break; 131 break;
@@ -142,38 +148,41 @@ void TerminalWidget::load( const Profile& prof ) {
142 m_colorCmb->setCurrentItem(id_term_white ); 148 m_colorCmb->setCurrentItem(id_term_white );
143 break; 149 break;
144 case Profile::Green: 150 case Profile::Green:
145 m_colorCmb->setCurrentItem(id_term_green ); 151 m_colorCmb->setCurrentItem(id_term_green );
146 break; 152 break;
147 case Profile::Orange: 153 case Profile::Orange:
148 m_colorCmb->setCurrentItem(id_term_orange ); 154 m_colorCmb->setCurrentItem(id_term_orange );
149 break; 155 break;
150 default: 156 default:
151 break; 157 break;
152 }; 158 };
153 159
154 switch( fontsize ) { 160
155 case Profile::Micro: 161 m_fontSelector->setSelectedFont( prof.readEntry( "Font"), prof.readEntry( "FontStyle"), prof.readNumEntry( "FontSize" ), prof.readEntry( "FontCharset") );
156 m_sizeSmall->setChecked(true ); 162
157 break; 163// switch( fontsize ) {
158 case Profile::Small: 164// case Profile::Micro:
159 m_sizeMedium->setChecked(true ); 165// m_sizeSmall->setChecked(true );
160 break; 166// break;
161 case Profile::Medium: 167// case Profile::Small:
162 m_sizeLarge->setChecked( true ); 168// m_sizeMedium->setChecked(true );
163 break; 169// break;
164 default: 170// case Profile::Medium:
165 m_sizeMedium->setChecked(true ); 171// m_sizeLarge->setChecked( true );
166 break; 172// break;
167 }; 173// default:
174// m_sizeMedium->setChecked(true );
175// break;
176// };
168 177
169 if (opt_echo) m_optionEcho->setChecked( true ); 178 if (opt_echo) m_optionEcho->setChecked( true );
170 if (opt_wrap) m_optionWrap->setChecked( true ); 179 if (opt_wrap) m_optionWrap->setChecked( true );
171 if (opt_inbound) m_convInbound->setChecked( true ); 180 if (opt_inbound) m_convInbound->setChecked( true );
172 if (opt_outbound) m_convOutbound->setChecked( true ); 181 if (opt_outbound) m_convOutbound->setChecked( true );
173 182
174} 183}
175void TerminalWidget::save( Profile& profile ) { 184void TerminalWidget::save( Profile& profile ) {
176 switch(m_terminalBox->currentItem() ) { 185 switch(m_terminalBox->currentItem() ) {
177 case id_term_vt100: 186 case id_term_vt100:
178 profile.writeEntry("Terminal", Profile::VT100 ); 187 profile.writeEntry("Terminal", Profile::VT100 );
179 break; 188 break;
@@ -202,25 +211,32 @@ void TerminalWidget::save( Profile& profile ) {
202 profile.writeEntry("Color", Profile::White ); 211 profile.writeEntry("Color", Profile::White );
203 break; 212 break;
204 case id_term_green: 213 case id_term_green:
205 profile.writeEntry("Color", Profile::Green ); 214 profile.writeEntry("Color", Profile::Green );
206 break; 215 break;
207 case id_term_orange: 216 case id_term_orange:
208 profile.writeEntry("Color", Profile::Orange ); 217 profile.writeEntry("Color", Profile::Orange );
209 break; 218 break;
210 default: 219 default:
211 break; 220 break;
212 }; 221 };
213 222
214 if (m_sizeSmall->isChecked() ) { 223
215 profile.writeEntry("Font", Profile::Micro ); 224 profile.writeEntry( "FontSize", m_fontSelector->fontSize() );
216 }else if (m_sizeMedium->isChecked() ) { 225 profile.writeEntry( "FontStyle", m_fontSelector->fontStyle() );
217 profile.writeEntry("Font", Profile::Small ); 226 profile.writeEntry( "FontCharset", m_fontSelector->fontCharSet() );
218 }else { 227 profile.writeEntry( "Font", m_fontSelector->fontFamily() );
219 profile.writeEntry("Font", Profile::Medium ); 228
220 } 229
230// if (m_sizeSmall->isChecked() ) {
231// profile.writeEntry("Font", Profile::Micro );
232// }else if (m_sizeMedium->isChecked() ) {
233// profile.writeEntry("Font", Profile::Small );
234// }else {
235// profile.writeEntry("Font", Profile::Medium );
236// }
221 237
222 profile.writeEntry("Echo", m_optionEcho->isChecked() ); 238 profile.writeEntry("Echo", m_optionEcho->isChecked() );
223 profile.writeEntry("Wrap", m_optionWrap->isChecked() ); 239 profile.writeEntry("Wrap", m_optionWrap->isChecked() );
224 profile.writeEntry("Inbound", m_convInbound->isChecked() ); 240 profile.writeEntry("Inbound", m_convInbound->isChecked() );
225 profile.writeEntry("Outbound",m_convOutbound->isChecked() ); 241 profile.writeEntry("Outbound",m_convOutbound->isChecked() );
226} 242}
diff --git a/noncore/apps/opie-console/terminalwidget.h b/noncore/apps/opie-console/terminalwidget.h
index 217fea7..2bd38d6 100644
--- a/noncore/apps/opie-console/terminalwidget.h
+++ b/noncore/apps/opie-console/terminalwidget.h
@@ -1,48 +1,52 @@
1#ifndef OPIE_TERMINAL_WIDGET_H 1#ifndef OPIE_TERMINAL_WIDGET_H
2#define OPIE_TERMINAL_WIDGET_H 2#define OPIE_TERMINAL_WIDGET_H
3 3
4#include "profiledialogwidget.h" 4#include "profiledialogwidget.h"
5 5
6#include <opie2/ofontselector.h>
7
6class QComboBox; 8class QComboBox;
7class QLabel; 9class QLabel;
8class QVBoxLayout; 10class QVBoxLayout;
9class QHBoxLayout; 11class QHBoxLayout;
10class QButtonGroup; 12class QButtonGroup;
11class QRadioButton; 13class QRadioButton;
12class QCheckBox; 14class QCheckBox;
13class QHGroupBox; 15class QHGroupBox;
14class QHBox; 16class QHBox;
15 17
18
16class TerminalWidget : public ProfileDialogTerminalWidget { 19class TerminalWidget : public ProfileDialogTerminalWidget {
17 20
18 Q_OBJECT 21 Q_OBJECT
19 22
20public: 23public:
21 TerminalWidget(const QString& name, QWidget* wid, 24 TerminalWidget(const QString& name, QWidget* wid,
22 const char* na ) ; 25 const char* na ) ;
23 ~TerminalWidget(); 26 ~TerminalWidget();
24 27
25 void load( const Profile& ); 28 void load( const Profile& );
26 void save( Profile& ); 29 void save( Profile& );
27 30
28private: 31private:
29 QVBoxLayout* m_lroot, *m_typeBox, *m_colorBox; 32 QVBoxLayout* m_lroot, *m_typeBox, *m_colorBox;
30 33
31 QLabel* m_terminal, *m_colorLabel; 34 QLabel* m_terminal, *m_colorLabel;
32 35
33 QComboBox* m_terminalBox, *m_colorCmb; 36 QComboBox* m_terminalBox, *m_colorCmb;
34 37
35 QButtonGroup* m_groupSize; 38 QHBox* m_groupSize;
36 39
37 QRadioButton* m_sizeSmall, *m_sizeMedium, 40 QRadioButton* m_sizeSmall, *m_sizeMedium,
38 *m_sizeLarge; 41 *m_sizeLarge;
39 42
40 QHGroupBox *m_groupConv, *m_groupOptions; 43 QHGroupBox *m_groupConv, *m_groupOptions;
41 44
42 QCheckBox *m_convInbound, 45 QCheckBox *m_convInbound,
43 *m_convOutbound, *m_optionEcho, 46 *m_convOutbound, *m_optionEcho,
44 *m_optionWrap; 47 *m_optionWrap;
45 48
49 Opie::Ui::OFontSelector *m_fontSelector;
46}; 50};
47 51
48#endif 52#endif