-rw-r--r-- | noncore/apps/opie-console/btconfigwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/irdaconfigwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 70 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.h | 6 |
11 files changed, 128 insertions, 41 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 | |||
@@ -96,12 +96,18 @@ void BTConfigWidget::load( const Profile& prof ) { | |||
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 | ||
@@ -154,12 +160,18 @@ void BTConfigWidget::save( Profile& prof ) { | |||
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 | ||
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 | |||
@@ -38,13 +38,15 @@ EmulationHandler::~EmulationHandler() { | |||
38 | clearScript(); | 38 | clearScript(); |
39 | delete m_teEmu; | 39 | delete m_teEmu; |
40 | delete m_teWid; | 40 | delete m_teWid; |
41 | } | 41 | } |
42 | 42 | ||
43 | void EmulationHandler::load( const Profile& prof) { | 43 | void 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) { |
@@ -127,17 +129,17 @@ QColor EmulationHandler::foreColor(int col) { | |||
127 | co = Qt::white; | 129 | co = Qt::white; |
128 | break; | 130 | break; |
129 | case Profile::Black: | 131 | case Profile::Black: |
130 | co = Qt::black; | 132 | co = Qt::black; |
131 | break; | 133 | break; |
132 | case Profile::Green: | 134 | case Profile::Green: |
133 | owarn << "Foreground green" << oendl; | 135 | owarn << "Foreground green" << oendl; |
134 | co = Qt::green; | 136 | co = Qt::green; |
135 | break; | 137 | break; |
136 | case Profile::Orange: | 138 | case Profile::Orange: |
137 | owarn << "Foreground orange" << oendl; | 139 | owarn << "Foreground orange" << oendl; |
138 | co.setRgb( 231, 184, 98 ); | 140 | co.setRgb( 231, 184, 98 ); |
139 | break; | 141 | break; |
140 | } | 142 | } |
141 | 143 | ||
142 | return co; | 144 | return co; |
143 | } | 145 | } |
@@ -151,17 +153,17 @@ QColor EmulationHandler::backColor(int col ) { | |||
151 | co = Qt::black; | 153 | co = Qt::black; |
152 | break; | 154 | break; |
153 | case Profile::Black: | 155 | case Profile::Black: |
154 | co = Qt::white; | 156 | co = Qt::white; |
155 | break; | 157 | break; |
156 | case Profile::Green: | 158 | case Profile::Green: |
157 | owarn << "Background black" << oendl; | 159 | owarn << "Background black" << oendl; |
158 | co = Qt::black; | 160 | co = Qt::black; |
159 | break; | 161 | break; |
160 | case Profile::Orange: | 162 | case Profile::Orange: |
161 | owarn << "Background black" << oendl; | 163 | owarn << "Background black" << oendl; |
162 | co = Qt::black; | 164 | co = Qt::black; |
163 | break; | 165 | break; |
164 | } | 166 | } |
165 | 167 | ||
166 | return co; | 168 | return co; |
167 | } | 169 | } |
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 | |||
@@ -36,13 +36,13 @@ public: | |||
36 | virtual QString identifier() const; | 36 | virtual QString identifier() const; |
37 | virtual QString name() const; | 37 | virtual QString name() const; |
38 | int rawIO() const; | 38 | int rawIO() const; |
39 | void closeRawIO (int fd ); | 39 | void closeRawIO (int fd ); |
40 | virtual QBitArray supports() const; | 40 | virtual QBitArray supports() const; |
41 | virtual bool isConnected(); | 41 | virtual bool isConnected(); |
42 | 42 | ||
43 | /*signals: | 43 | /*signals: |
44 | void received(const QByteArray &); | 44 | void received(const QByteArray &); |
45 | void error(int, const QString &); | 45 | void error(int, const QString &); |
46 | */ | 46 | */ |
47 | public slots: | 47 | public slots: |
48 | virtual void send(const QByteArray &); | 48 | virtual void send(const QByteArray &); |
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 | |||
@@ -21,13 +21,15 @@ namespace { | |||
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, |
@@ -83,13 +85,14 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) | |||
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 | }; |
91 | IOLayerBase::~IOLayerBase() { | 94 | IOLayerBase::~IOLayerBase() { |
92 | 95 | ||
93 | } | 96 | } |
94 | void IOLayerBase::setFlow( Flow flo ) { | 97 | void IOLayerBase::setFlow( Flow flo ) { |
95 | switch ( flo ) { | 98 | switch ( flo ) { |
@@ -130,12 +133,18 @@ void IOLayerBase::setSpeed( Speed sp ) { | |||
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 ); |
@@ -205,12 +214,18 @@ IOLayerBase::Speed IOLayerBase::speed()const{ | |||
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 | } |
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 | |||
@@ -18,13 +18,15 @@ public: | |||
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 | ||
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 | |||
@@ -75,12 +75,18 @@ void IrdaConfigWidget::load( const Profile& prof ) { | |||
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 | ||
@@ -133,12 +139,18 @@ void IrdaConfigWidget::save( Profile& prof ) { | |||
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 | ||
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,18 +1,18 @@ | |||
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 | */ |
17 | class FixIt { | 17 | class FixIt { |
18 | public: | 18 | public: |
@@ -88,13 +88,13 @@ void FixIt::fixIt() { | |||
88 | 88 | ||
89 | int main(int argc, char **argv) { | 89 | int 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") ); |
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 | |||
@@ -107,12 +107,18 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
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 | ||
@@ -135,13 +141,13 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
135 | m_base->setStop( IOLayerBase::Stop_One ); | 141 | m_base->setStop( IOLayerBase::Stop_One ); |
136 | } | 142 | } |
137 | 143 | ||
138 | 144 | ||
139 | atConf->readConfig( prof ); | 145 | atConf->readConfig( prof ); |
140 | if ( prof.readEntry( "Device" ).isEmpty() ) { | 146 | if ( prof.readEntry( "Device" ).isEmpty() ) { |
141 | owarn << "device empty!" << oendl; | 147 | owarn << "device empty!" << oendl; |
142 | return; | 148 | return; |
143 | } | 149 | } |
144 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); | 150 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); |
145 | 151 | ||
146 | 152 | ||
147 | } | 153 | } |
@@ -194,12 +200,18 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
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; |
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 | |||
@@ -79,12 +79,18 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
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 | ||
@@ -154,12 +160,18 @@ void SerialConfigWidget::save( Profile& prof ) { | |||
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 | ||
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,20 +1,22 @@ | |||
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 | |||
5 | using namespace Opie::Core; | 6 | using 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 | ||
16 | namespace { | 18 | namespace { |
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, |
@@ -41,21 +43,25 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
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 ); |
@@ -71,13 +77,13 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
71 | 77 | ||
72 | m_lroot->add( m_groupConv ); | 78 | m_lroot->add( m_groupConv ); |
73 | m_lroot->add( m_groupOptions ); | 79 | m_lroot->add( m_groupOptions ); |
74 | m_lroot->addStretch( 0 ); | 80 | m_lroot->addStretch( 0 ); |
75 | 81 | ||
76 | // Fill in some options | 82 | // Fill in some options |
77 | owarn << "Options for terminal box" << oendl; | 83 | owarn << "Options for terminal box" << oendl; |
78 | m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); | 84 | m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); |
79 | m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); | 85 | m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); |
80 | m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); | 86 | m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); |
81 | m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); | 87 | m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); |
82 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); | 88 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); |
83 | 89 | ||
@@ -107,13 +113,13 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
107 | } | 113 | } |
108 | TerminalWidget::~TerminalWidget() { | 114 | TerminalWidget::~TerminalWidget() { |
109 | } | 115 | } |
110 | void TerminalWidget::load( const Profile& prof ) { | 116 | void 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 ) { |
@@ -148,26 +154,29 @@ void TerminalWidget::load( const Profile& prof ) { | |||
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 | ||
@@ -208,19 +217,26 @@ void TerminalWidget::save( Profile& profile ) { | |||
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,21 +1,24 @@ | |||
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 | |||
6 | class QComboBox; | 8 | class QComboBox; |
7 | class QLabel; | 9 | class QLabel; |
8 | class QVBoxLayout; | 10 | class QVBoxLayout; |
9 | class QHBoxLayout; | 11 | class QHBoxLayout; |
10 | class QButtonGroup; | 12 | class QButtonGroup; |
11 | class QRadioButton; | 13 | class QRadioButton; |
12 | class QCheckBox; | 14 | class QCheckBox; |
13 | class QHGroupBox; | 15 | class QHGroupBox; |
14 | class QHBox; | 16 | class QHBox; |
15 | 17 | ||
18 | |||
16 | class TerminalWidget : public ProfileDialogTerminalWidget { | 19 | class TerminalWidget : public ProfileDialogTerminalWidget { |
17 | 20 | ||
18 | Q_OBJECT | 21 | Q_OBJECT |
19 | 22 | ||
20 | public: | 23 | public: |
21 | TerminalWidget(const QString& name, QWidget* wid, | 24 | TerminalWidget(const QString& name, QWidget* wid, |
@@ -29,20 +32,21 @@ private: | |||
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 |