summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-04-22 18:58:37 (UTC)
committer harlekin <harlekin>2004-04-22 18:58:37 (UTC)
commit5c6499c56cd5c00603634546e6ba8c4d9da9741d (patch) (side-by-side diff)
tree3ad98bb1a0150b1dd69c79fd58e6e59ce8556e51
parent53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (diff)
downloadopie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.zip
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.gz
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.bz2
2400 and 4800 baud added, also free font selection
Diffstat (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
@@ -100,4 +100,10 @@ void BTConfigWidget::load( const Profile& prof ) {
m_base->setSpeed( IOLayerBase::Baud_19200 );
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
default:
@@ -158,4 +164,10 @@ void BTConfigWidget::save( Profile& prof ) {
speed = 19200;
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
default:
case IOLayerBase::Baud_9600:
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
@@ -42,5 +42,7 @@ EmulationHandler::~EmulationHandler() {
void EmulationHandler::load( const Profile& prof) {
- m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
+
+// m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
+ m_teWid->setVTFont( QFont( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ) );
int num = prof.readNumEntry("Color");
setColor( foreColor(num), backColor(num) );
@@ -131,9 +133,9 @@ QColor EmulationHandler::foreColor(int col) {
break;
case Profile::Green:
- owarn << "Foreground green" << oendl;
+ owarn << "Foreground green" << oendl;
co = Qt::green;
break;
case Profile::Orange:
- owarn << "Foreground orange" << oendl;
+ owarn << "Foreground orange" << oendl;
co.setRgb( 231, 184, 98 );
break;
@@ -155,9 +157,9 @@ QColor EmulationHandler::backColor(int col ) {
break;
case Profile::Green:
- owarn << "Background black" << oendl;
+ owarn << "Background black" << oendl;
co = Qt::black;
break;
case Profile::Orange:
- owarn << "Background black" << oendl;
+ owarn << "Background black" << oendl;
co = Qt::black;
break;
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
@@ -40,5 +40,5 @@ public:
virtual QBitArray supports() const;
virtual bool isConnected();
-
+
/*signals:
void received(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
@@ -25,5 +25,7 @@ namespace {
id_baud_38400,
id_baud_19200,
- id_baud_9600
+ id_baud_9600,
+ id_baud_4800,
+ id_baud_2400
};
@@ -87,5 +89,6 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name )
m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 );
m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 );
-
+ m_speedBox->insertItem(tr("4800 baud"), id_baud_4800 );
+ m_speedBox->insertItem(tr("2400 baud"), id_baud_2400 );
};
IOLayerBase::~IOLayerBase() {
@@ -134,4 +137,10 @@ void IOLayerBase::setSpeed( Speed sp ) {
index = id_baud_19200;
break;
+ case Baud_4800:
+ index = id_baud_4800;
+ break;
+ case Baud_2400:
+ index = id_baud_2400;
+ break;
default:
case Baud_9600:
@@ -209,4 +218,10 @@ IOLayerBase::Speed IOLayerBase::speed()const{
return Baud_19200;
break;
+ case id_baud_4800:
+ return Baud_4800;
+ break;
+ case id_baud_2400:
+ return Baud_2400;
+ break;
default:
case id_baud_9600:
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
@@ -22,5 +22,7 @@ public:
Baud_38400,
Baud_19200,
- Baud_9600 };
+ Baud_9600,
+ Baud_4800,
+ Baud_2400 };
enum Data { Data_Five =5, Data_Six =6, Data_Seven=7, Data_Eight=8 };
enum Stop { Stop_One =1, Stop_OnePointFive=15, Stop_Two=2 };
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
@@ -79,4 +79,10 @@ void IrdaConfigWidget::load( const Profile& prof ) {
m_base->setSpeed( IOLayerBase::Baud_19200 );
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
default:
@@ -137,4 +143,10 @@ void IrdaConfigWidget::save( Profile& prof ) {
speed = 19200;
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
default:
case IOLayerBase::Baud_9600:
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
@@ -4,5 +4,5 @@
#include <stdlib.h>
#include <signal.h>
-
+#include <qfile.h>
#include <qpe/qpeapplication.h>
@@ -10,5 +10,5 @@
#include "mainwindow.h"
-//#define FSCKED_DISTRIBUTION 1
+#define FSCKED_DISTRIBUTION 1
#ifdef FSCKED_DISTRIBUTION
/*
@@ -92,5 +92,5 @@ int main(int argc, char **argv) {
#ifdef FSCKED_DISTRIBUTION
- owarn << "fscked" << oendl;
+// owarn << "fscked" << oendl;
FixIt it;
it.fixIt();
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
@@ -111,4 +111,10 @@ void ModemConfigWidget::load( const Profile& prof ) {
m_base->setSpeed( IOLayerBase::Baud_19200 );
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
default:
@@ -139,5 +145,5 @@ void ModemConfigWidget::load( const Profile& prof ) {
atConf->readConfig( prof );
if ( prof.readEntry( "Device" ).isEmpty() ) {
- owarn << "device empty!" << oendl;
+ owarn << "device empty!" << oendl;
return;
}
@@ -198,4 +204,10 @@ void ModemConfigWidget::save( Profile& prof ) {
speed = 9600;
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ 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
@@ -83,4 +83,10 @@ void SerialConfigWidget::load( const Profile& prof ) {
m_base->setSpeed( IOLayerBase::Baud_19200 );
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
default:
@@ -158,4 +164,10 @@ void SerialConfigWidget::save( Profile& prof ) {
speed = 19200;
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
default:
case IOLayerBase::Baud_9600:
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
@@ -3,4 +3,5 @@
/* OPIE */
#include <opie2/odebug.h>
+
using namespace Opie::Core;
@@ -13,4 +14,5 @@ using namespace Opie::Core;
#include <qhbuttongroup.h>
#include <qlayout.h>
+#include <qhbox.h>
namespace {
@@ -45,8 +47,11 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
m_colorCmb = new QComboBox(this );
- m_groupSize = new QHButtonGroup(tr("Font size"), this );
- m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
- m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
- m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
+// m_groupSize = new QHButtonGroup(tr("Font size"), this );
+ m_groupSize = new QHBox( this );
+ m_fontSelector = new Opie::Ui::OFontSelector( false, m_groupSize );
+
+// m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
+// m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
+// m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
m_groupConv = new QHGroupBox( tr("Line-break conversions"), this );
@@ -54,4 +59,5 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv );
+
m_groupOptions = new QHGroupBox( tr("Options"), this );
m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions );
@@ -75,5 +81,5 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
// Fill in some options
- owarn << "Options for terminal box" << oendl;
+ owarn << "Options for terminal box" << oendl;
m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ );
m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */);
@@ -111,5 +117,5 @@ void TerminalWidget::load( const Profile& prof ) {
int term = prof.readNumEntry("Terminal");
int color = prof.readNumEntry("Color");
- int fontsize = prof.readNumEntry("Font");
+// int fontsize = prof.readNumEntry("Font");
int opt_echo = prof.readNumEntry("Echo");
int opt_wrap = prof.readNumEntry("Wrap");
@@ -152,18 +158,21 @@ void TerminalWidget::load( const Profile& prof ) {
};
- switch( fontsize ) {
- case Profile::Micro:
- m_sizeSmall->setChecked(true );
- break;
- case Profile::Small:
- m_sizeMedium->setChecked(true );
- break;
- case Profile::Medium:
- m_sizeLarge->setChecked( true );
- break;
- default:
- m_sizeMedium->setChecked(true );
- break;
- };
+
+ m_fontSelector->setSelectedFont( prof.readEntry( "Font"), prof.readEntry( "FontStyle"), prof.readNumEntry( "FontSize" ), prof.readEntry( "FontCharset") );
+
+// switch( fontsize ) {
+// case Profile::Micro:
+// m_sizeSmall->setChecked(true );
+// break;
+// case Profile::Small:
+// m_sizeMedium->setChecked(true );
+// break;
+// case Profile::Medium:
+// m_sizeLarge->setChecked( true );
+// break;
+// default:
+// m_sizeMedium->setChecked(true );
+// break;
+// };
if (opt_echo) m_optionEcho->setChecked( true );
@@ -212,11 +221,18 @@ void TerminalWidget::save( Profile& profile ) {
};
- if (m_sizeSmall->isChecked() ) {
- profile.writeEntry("Font", Profile::Micro );
- }else if (m_sizeMedium->isChecked() ) {
- profile.writeEntry("Font", Profile::Small );
- }else {
- profile.writeEntry("Font", Profile::Medium );
- }
+
+ profile.writeEntry( "FontSize", m_fontSelector->fontSize() );
+ profile.writeEntry( "FontStyle", m_fontSelector->fontStyle() );
+ profile.writeEntry( "FontCharset", m_fontSelector->fontCharSet() );
+ profile.writeEntry( "Font", m_fontSelector->fontFamily() );
+
+
+// if (m_sizeSmall->isChecked() ) {
+// profile.writeEntry("Font", Profile::Micro );
+// }else if (m_sizeMedium->isChecked() ) {
+// profile.writeEntry("Font", Profile::Small );
+// }else {
+// profile.writeEntry("Font", Profile::Medium );
+// }
profile.writeEntry("Echo", m_optionEcho->isChecked() );
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
@@ -4,4 +4,6 @@
#include "profiledialogwidget.h"
+#include <opie2/ofontselector.h>
+
class QComboBox;
class QLabel;
@@ -14,4 +16,5 @@ class QHGroupBox;
class QHBox;
+
class TerminalWidget : public ProfileDialogTerminalWidget {
@@ -33,5 +36,5 @@ private:
QComboBox* m_terminalBox, *m_colorCmb;
- QButtonGroup* m_groupSize;
+ QHBox* m_groupSize;
QRadioButton* m_sizeSmall, *m_sizeMedium,
@@ -44,4 +47,5 @@ private:
*m_optionWrap;
+ Opie::Ui::OFontSelector *m_fontSelector;
};