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
@@ -101,2 +101,8 @@ void BTConfigWidget::load( const Profile& prof ) {
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
@@ -159,2 +165,8 @@ void BTConfigWidget::save( Profile& prof ) {
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
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() {
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");
@@ -132,3 +134,3 @@ QColor EmulationHandler::foreColor(int col) {
case Profile::Green:
- owarn << "Foreground green" << oendl;
+ owarn << "Foreground green" << oendl;
co = Qt::green;
@@ -136,3 +138,3 @@ QColor EmulationHandler::foreColor(int col) {
case Profile::Orange:
- owarn << "Foreground orange" << oendl;
+ owarn << "Foreground orange" << oendl;
co.setRgb( 231, 184, 98 );
@@ -156,3 +158,3 @@ QColor EmulationHandler::backColor(int col ) {
case Profile::Green:
- owarn << "Background black" << oendl;
+ owarn << "Background black" << oendl;
co = Qt::black;
@@ -160,3 +162,3 @@ QColor EmulationHandler::backColor(int col ) {
case Profile::Orange:
- owarn << "Background black" << oendl;
+ owarn << "Background black" << oendl;
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:
virtual bool isConnected();
-
+
/*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 {
id_baud_19200,
- id_baud_9600
+ id_baud_9600,
+ id_baud_4800,
+ id_baud_2400
};
@@ -88,3 +90,4 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name )
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 );
};
@@ -135,2 +138,8 @@ void IOLayerBase::setSpeed( Speed sp ) {
break;
+ case Baud_4800:
+ index = id_baud_4800;
+ break;
+ case Baud_2400:
+ index = id_baud_2400;
+ break;
default:
@@ -210,2 +219,8 @@ IOLayerBase::Speed IOLayerBase::speed()const{
break;
+ case id_baud_4800:
+ return Baud_4800;
+ break;
+ case id_baud_2400:
+ return Baud_2400;
+ break;
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:
Baud_19200,
- Baud_9600 };
+ Baud_9600,
+ Baud_4800,
+ Baud_2400 };
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 ) {
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
@@ -138,2 +144,8 @@ void IrdaConfigWidget::save( Profile& prof ) {
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
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 @@
#include <signal.h>
-
+#include <qfile.h>
@@ -11,3 +11,3 @@
-//#define FSCKED_DISTRIBUTION 1
+#define FSCKED_DISTRIBUTION 1
#ifdef FSCKED_DISTRIBUTION
@@ -93,3 +93,3 @@ int main(int argc, char **argv) {
#ifdef FSCKED_DISTRIBUTION
- owarn << "fscked" << oendl;
+// owarn << "fscked" << oendl;
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 ) {
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
@@ -140,3 +146,3 @@ void ModemConfigWidget::load( const Profile& prof ) {
if ( prof.readEntry( "Device" ).isEmpty() ) {
- owarn << "device empty!" << oendl;
+ owarn << "device empty!" << oendl;
return;
@@ -199,2 +205,8 @@ void ModemConfigWidget::save( Profile& prof ) {
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
@@ -84,2 +84,8 @@ void SerialConfigWidget::load( const Profile& prof ) {
break;
+ case 4800:
+ m_base->setSpeed( IOLayerBase::Baud_4800 );
+ break;
+ case 2400:
+ m_base->setSpeed( IOLayerBase::Baud_2400 );
+ break;
case 9600:
@@ -159,2 +165,8 @@ void SerialConfigWidget::save( Profile& prof ) {
break;
+ case IOLayerBase::Baud_4800:
+ speed = 4800;
+ break;
+ case IOLayerBase::Baud_2400:
+ speed = 2400;
+ break;
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 @@
#include <opie2/odebug.h>
+
using namespace Opie::Core;
@@ -14,2 +15,3 @@ using namespace Opie::Core;
#include <qlayout.h>
+#include <qhbox.h>
@@ -46,6 +48,9 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
- 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 );
@@ -55,2 +60,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
+
m_groupOptions = new QHGroupBox( tr("Options"), this );
@@ -76,3 +82,3 @@ 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*/ );
@@ -112,3 +118,3 @@ void TerminalWidget::load( const Profile& prof ) {
int color = prof.readNumEntry("Color");
- int fontsize = prof.readNumEntry("Font");
+// int fontsize = prof.readNumEntry("Font");
int opt_echo = prof.readNumEntry("Echo");
@@ -153,16 +159,19 @@ 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;
+// };
@@ -213,9 +222,16 @@ 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 );
+// }
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 @@
+#include <opie2/ofontselector.h>
+
class QComboBox;
@@ -15,2 +17,3 @@ class QHBox;
+
class TerminalWidget : public ProfileDialogTerminalWidget {
@@ -34,3 +37,3 @@ private:
- QButtonGroup* m_groupSize;
+ QHBox* m_groupSize;
@@ -45,2 +48,3 @@ private:
+ Opie::Ui::OFontSelector *m_fontSelector;
};