author | harlekin <harlekin> | 2004-04-22 18:58:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-04-22 18:58:37 (UTC) |
commit | 5c6499c56cd5c00603634546e6ba8c4d9da9741d (patch) (side-by-side diff) | |
tree | 3ad98bb1a0150b1dd69c79fd58e6e59ce8556e51 | |
parent | 53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (diff) | |
download | opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.zip opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.gz opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.bz2 |
2400 and 4800 baud added, also free font selection
-rw-r--r-- | noncore/apps/opie-console/btconfigwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.h | 0 | ||||
-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 | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 68 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.h | 6 |
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 @@ -98,8 +98,14 @@ void BTConfigWidget::load( const Profile& prof ) { break; case 19200: 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: m_base->setSpeed(IOLayerBase::Baud_9600 ); break; @@ -156,8 +162,14 @@ void BTConfigWidget::save( Profile& prof ) { break; case IOLayerBase::Baud_19200: speed = 19200; break; + case IOLayerBase::Baud_4800: + speed = 4800; + break; + case IOLayerBase::Baud_2400: + speed = 2400; + break; default: case IOLayerBase::Baud_9600: speed = 9600; break; 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 @@ -40,9 +40,11 @@ EmulationHandler::~EmulationHandler() { delete m_teWid; } 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) ); m_teWid->setBackgroundColor(backColor(num) ); 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 @@ -23,9 +23,11 @@ namespace { id_baud_115200, id_baud_57600, id_baud_38400, id_baud_19200, - id_baud_9600 + id_baud_9600, + id_baud_4800, + id_baud_2400 }; enum DataIds { id_data_5, @@ -85,9 +87,10 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); 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() { } @@ -132,8 +135,14 @@ void IOLayerBase::setSpeed( Speed sp ) { break; case Baud_19200: 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: index = id_baud_9600; break; @@ -207,8 +216,14 @@ IOLayerBase::Speed IOLayerBase::speed()const{ break; case id_baud_19200: 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: return Baud_9600; break; 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 @@ -20,9 +20,11 @@ public: enum Speed{ Baud_115200, Baud_57600, 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 }; IOLayerBase( QWidget* base, const char* name = 0l); 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 @@ -77,8 +77,14 @@ void IrdaConfigWidget::load( const Profile& prof ) { break; case 19200: 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: m_base->setSpeed(IOLayerBase::Baud_9600 ); break; @@ -135,8 +141,14 @@ void IrdaConfigWidget::save( Profile& prof ) { break; case IOLayerBase::Baud_19200: speed = 19200; break; + case IOLayerBase::Baud_4800: + speed = 4800; + break; + case IOLayerBase::Baud_2400: + speed = 2400; + break; default: case IOLayerBase::Baud_9600: speed = 9600; break; 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 @@ -2,15 +2,15 @@ #include <stdio.h> #include <stdlib.h> #include <signal.h> - +#include <qfile.h> #include <qpe/qpeapplication.h> #include "mainwindow.h" -//#define FSCKED_DISTRIBUTION 1 +#define FSCKED_DISTRIBUTION 1 #ifdef FSCKED_DISTRIBUTION /* * The Zaurus rom */ @@ -90,9 +90,9 @@ int main(int argc, char **argv) { // too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; QPEApplication app( argc, argv ); #ifdef FSCKED_DISTRIBUTION - owarn << "fscked" << oendl; +// owarn << "fscked" << oendl; FixIt it; it.fixIt(); #endif 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 @@ -109,8 +109,14 @@ void ModemConfigWidget::load( const Profile& prof ) { break; case 19200: 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: m_base->setSpeed( IOLayerBase::Baud_9600 ); break; @@ -196,8 +202,14 @@ void ModemConfigWidget::save( Profile& prof ) { break; case IOLayerBase::Baud_9600: speed = 9600; break; + case IOLayerBase::Baud_4800: + speed = 4800; + break; + case IOLayerBase::Baud_2400: + speed = 2400; + break; } switch( m_base->data() ) { case IOLayerBase::Data_Five: 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 @@ -81,8 +81,14 @@ void SerialConfigWidget::load( const Profile& prof ) { break; case 19200: 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: m_base->setSpeed(IOLayerBase::Baud_9600 ); break; @@ -156,8 +162,14 @@ void SerialConfigWidget::save( Profile& prof ) { break; case IOLayerBase::Baud_19200: speed = 19200; break; + case IOLayerBase::Baud_4800: + speed = 4800; + break; + case IOLayerBase::Baud_2400: + speed = 2400; + break; default: case IOLayerBase::Baud_9600: speed = 9600; break; 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,8 +1,9 @@ #include "terminalwidget.h" /* OPIE */ #include <opie2/odebug.h> + using namespace Opie::Core; /* QT */ #include <qlabel.h> @@ -11,8 +12,9 @@ using namespace Opie::Core; #include <qradiobutton.h> #include <qhgroupbox.h> #include <qhbuttongroup.h> #include <qlayout.h> +#include <qhbox.h> namespace { enum TermIds { id_term_vt100 = 0, @@ -43,17 +45,21 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, m_terminalBox = new QComboBox(this); m_colorLabel = new QLabel(tr("Color scheme"), this); 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 ); m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv ); m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv ); + m_groupOptions = new QHGroupBox( tr("Options"), this ); m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions ); m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions ); @@ -109,9 +115,9 @@ TerminalWidget::~TerminalWidget() { } 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"); int opt_inbound = prof.readNumEntry("Inbound"); int opt_outbound = prof.readNumEntry("Outbound"); @@ -150,22 +156,25 @@ void TerminalWidget::load( const Profile& prof ) { default: break; }; - 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 ); if (opt_wrap) m_optionWrap->setChecked( true ); if (opt_inbound) m_convInbound->setChecked( true ); @@ -210,15 +219,22 @@ void TerminalWidget::save( Profile& profile ) { default: break; }; - 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() ); profile.writeEntry("Wrap", m_optionWrap->isChecked() ); profile.writeEntry("Inbound", m_convInbound->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 @@ -2,8 +2,10 @@ #define OPIE_TERMINAL_WIDGET_H #include "profiledialogwidget.h" +#include <opie2/ofontselector.h> + class QComboBox; class QLabel; class QVBoxLayout; class QHBoxLayout; @@ -12,8 +14,9 @@ class QRadioButton; class QCheckBox; class QHGroupBox; class QHBox; + class TerminalWidget : public ProfileDialogTerminalWidget { Q_OBJECT @@ -31,9 +34,9 @@ private: QLabel* m_terminal, *m_colorLabel; QComboBox* m_terminalBox, *m_colorCmb; - QButtonGroup* m_groupSize; + QHBox* m_groupSize; QRadioButton* m_sizeSmall, *m_sizeMedium, *m_sizeLarge; @@ -42,7 +45,8 @@ private: QCheckBox *m_convInbound, *m_convOutbound, *m_optionEcho, *m_optionWrap; + Opie::Ui::OFontSelector *m_fontSelector; }; #endif |