summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
authorharlekin <harlekin>2004-04-22 18:58:37 (UTC)
committer harlekin <harlekin>2004-04-22 18:58:37 (UTC)
commit5c6499c56cd5c00603634546e6ba8c4d9da9741d (patch) (unidiff)
tree3ad98bb1a0150b1dd69c79fd58e6e59ce8556e51 /noncore/apps/opie-console
parent53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (diff)
downloadopie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.zip
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.gz
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.bz2
2400 and 4800 baud added, also free font selection
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp12
-rw-r--r--noncore/apps/opie-console/io_serial.h2
-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.cpp14
-rw-r--r--noncore/apps/opie-console/serialconfigwidget.cpp12
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp70
-rw-r--r--noncore/apps/opie-console/terminalwidget.h6
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
@@ -101,2 +101,8 @@ void BTConfigWidget::load( const Profile& prof ) {
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:
@@ -159,2 +165,8 @@ void BTConfigWidget::save( Profile& prof ) {
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:
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
@@ -43,3 +43,5 @@ EmulationHandler::~EmulationHandler() {
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");
@@ -132,3 +134,3 @@ QColor EmulationHandler::foreColor(int col) {
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;
@@ -136,3 +138,3 @@ QColor EmulationHandler::foreColor(int col) {
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 );
@@ -156,3 +158,3 @@ QColor EmulationHandler::backColor(int col ) {
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;
@@ -160,3 +162,3 @@ QColor EmulationHandler::backColor(int col ) {
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;
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
@@ -41,3 +41,3 @@ public:
41 virtual bool isConnected(); 41 virtual bool isConnected();
42 42
43/*signals: 43/*signals:
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
@@ -26,3 +26,5 @@ namespace {
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 };
@@ -88,3 +90,4 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name )
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};
@@ -135,2 +138,8 @@ void IOLayerBase::setSpeed( Speed sp ) {
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:
@@ -210,2 +219,8 @@ IOLayerBase::Speed IOLayerBase::speed()const{
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:
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
@@ -23,3 +23,5 @@ public:
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 };
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
@@ -80,2 +80,8 @@ void IrdaConfigWidget::load( const Profile& prof ) {
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:
@@ -138,2 +144,8 @@ void IrdaConfigWidget::save( Profile& prof ) {
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:
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
@@ -5,3 +5,3 @@
5#include <signal.h> 5#include <signal.h>
6 6#include <qfile.h>
7 7
@@ -11,3 +11,3 @@
11 11
12//#define FSCKED_DISTRIBUTION 1 12#define FSCKED_DISTRIBUTION 1
13#ifdef FSCKED_DISTRIBUTION 13#ifdef FSCKED_DISTRIBUTION
@@ -93,3 +93,3 @@ int main(int argc, char **argv) {
93#ifdef FSCKED_DISTRIBUTION 93#ifdef FSCKED_DISTRIBUTION
94 owarn << "fscked" << oendl; 94// owarn << "fscked" << oendl;
95 FixIt it; 95 FixIt it;
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
@@ -112,2 +112,8 @@ void ModemConfigWidget::load( const Profile& prof ) {
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:
@@ -140,3 +146,3 @@ void ModemConfigWidget::load( const Profile& 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;
@@ -199,2 +205,8 @@ void ModemConfigWidget::save( Profile& prof ) {
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 }
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
@@ -84,2 +84,8 @@ void SerialConfigWidget::load( const Profile& prof ) {
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:
@@ -159,2 +165,8 @@ void SerialConfigWidget::save( Profile& prof ) {
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:
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
@@ -4,2 +4,3 @@
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5
5using namespace Opie::Core; 6using namespace Opie::Core;
@@ -14,2 +15,3 @@ using namespace Opie::Core;
14#include <qlayout.h> 15#include <qlayout.h>
16#include <qhbox.h>
15 17
@@ -46,6 +48,9 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
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
@@ -55,2 +60,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
55 60
61
56 m_groupOptions = new QHGroupBox( tr("Options"), this ); 62 m_groupOptions = new QHGroupBox( tr("Options"), this );
@@ -76,3 +82,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
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*/ );
@@ -112,3 +118,3 @@ void TerminalWidget::load( const Profile& prof ) {
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");
@@ -153,16 +159,19 @@ void TerminalWidget::load( const Profile& prof ) {
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
@@ -213,9 +222,16 @@ void TerminalWidget::save( Profile& profile ) {
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
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
@@ -5,2 +5,4 @@
5 5
6#include <opie2/ofontselector.h>
7
6class QComboBox; 8class QComboBox;
@@ -15,2 +17,3 @@ class QHBox;
15 17
18
16class TerminalWidget : public ProfileDialogTerminalWidget { 19class TerminalWidget : public ProfileDialogTerminalWidget {
@@ -34,3 +37,3 @@ private:
34 37
35 QButtonGroup* m_groupSize; 38 QHBox* m_groupSize;
36 39
@@ -45,2 +48,3 @@ private:
45 48
49 Opie::Ui::OFontSelector *m_fontSelector;
46}; 50};