-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 @@ -94,16 +94,22 @@ void BTConfigWidget::load( const Profile& prof ) { m_base->setSpeed( IOLayerBase::Baud_57600 ); break; case 38400: m_base->setSpeed(IOLayerBase::Baud_38400 ); 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; } if ( prof.readEntry("Device").isEmpty() ) return; setCurrent( prof.readEntry("Device"), m_deviceCmb ); @@ -152,16 +158,22 @@ void BTConfigWidget::save( Profile& prof ) { speed = 57600; break; case IOLayerBase::Baud_38400: speed = 38400; 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; } prof.writeEntry("Flow", flow); prof.writeEntry("Parity", parity); 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 @@ -36,17 +36,19 @@ TEmulation* EmulationHandler::emulation() { EmulationHandler::~EmulationHandler() { if (isRecording()) clearScript(); delete m_teEmu; 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) ); int term = prof.readNumEntry("Terminal", 0) ; switch(term) { default: case Profile::VT102: @@ -125,21 +127,21 @@ QColor EmulationHandler::foreColor(int col) { case Profile::White: /* color is black */ co = Qt::white; break; case Profile::Black: co = Qt::black; 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; } return co; } QColor EmulationHandler::backColor(int col ) { QColor co; @@ -149,21 +151,21 @@ QColor EmulationHandler::backColor(int col ) { case Profile::White: /* color is white */ co = Qt::black; break; case Profile::Black: co = Qt::white; 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; } return co; } QPushButton* EmulationHandler::cornerButton() { 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 @@ -34,17 +34,17 @@ public: ~IOSerial(); virtual QString identifier() const; virtual QString name() const; int rawIO() const; void closeRawIO (int fd ); virtual QBitArray supports() const; virtual bool isConnected(); - + /*signals: void received(const QByteArray &); void error(int, const QString &); */ public slots: virtual void send(const QByteArray &); virtual bool open(); virtual void close(); 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 @@ -19,17 +19,19 @@ namespace { id_flow_none, }; enum SpeedIds { 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, id_data_6, id_data_7, id_data_8 }; @@ -81,17 +83,18 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) m_lroot->addStretch(2); // profiles m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); 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() { } void IOLayerBase::setFlow( Flow flo ) { switch ( flo ) { case Software: m_flowSw->setChecked( true ); @@ -128,16 +131,22 @@ void IOLayerBase::setSpeed( Speed sp ) { index = id_baud_57600; break; case Baud_38400: index = id_baud_38400; 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; } m_speedBox->setCurrentItem(index ); } @@ -203,16 +212,22 @@ IOLayerBase::Speed IOLayerBase::speed()const{ return Baud_57600; break; case id_baud_38400: return Baud_38400; 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; } } IOLayerBase::Data IOLayerBase::data()const { if ( m_data5->isChecked() ) { 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 @@ -16,17 +16,19 @@ class IOLayerBase : public QWidget { public: enum Flow { Hardware, Software, None }; enum Parity{ Odd =2 , Even =1, NonePar =0 }; 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); ~IOLayerBase(); void setFlow( Flow flo ); void setParity( Parity par ); 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 @@ -73,16 +73,22 @@ void IrdaConfigWidget::load( const Profile& prof ) { m_base->setSpeed( IOLayerBase::Baud_57600 ); break; case 38400: m_base->setSpeed(IOLayerBase::Baud_38400 ); 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; } if ( prof.readEntry("Device").isEmpty() ) return; setCurrent( prof.readEntry("Device"), m_deviceCmb ); @@ -131,16 +137,22 @@ void IrdaConfigWidget::save( Profile& prof ) { speed = 57600; break; case IOLayerBase::Baud_38400: speed = 38400; 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; } prof.writeEntry("Flow", flow); prof.writeEntry("Parity", parity); 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,20 +1,20 @@ #include <sys/types.h> #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 */ class FixIt { public: FixIt(); ~FixIt(); @@ -86,17 +86,17 @@ void FixIt::fixIt() { } #endif 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 MainWindow mw; mw.setCaption(QObject::tr("Opie Console") ); app.showMainWidget( &mw ); 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 @@ -105,16 +105,22 @@ void ModemConfigWidget::load( const Profile& prof ) { m_base->setSpeed( IOLayerBase::Baud_57600 ); break; case 38400: m_base->setSpeed( IOLayerBase::Baud_38400 ); 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; } if ( dbits == 5) { @@ -133,17 +139,17 @@ void ModemConfigWidget::load( const Profile& prof ) { m_base->setStop( IOLayerBase::Stop_OnePointFive ); } else { m_base->setStop( IOLayerBase::Stop_One ); } atConf->readConfig( prof ); if ( prof.readEntry( "Device" ).isEmpty() ) { - owarn << "device empty!" << oendl; + owarn << "device empty!" << oendl; return; } setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); } /* @@ -192,16 +198,22 @@ void ModemConfigWidget::save( Profile& prof ) { speed = 38400; break; case IOLayerBase::Baud_19200: speed = 19200; 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: data = 5; break; case IOLayerBase::Data_Six: data = 6; 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 @@ -77,16 +77,22 @@ void SerialConfigWidget::load( const Profile& prof ) { m_base->setSpeed( IOLayerBase::Baud_57600 ); break; case 38400: m_base->setSpeed(IOLayerBase::Baud_38400 ); 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; } if ( dbits == 5) { m_base->setData( IOLayerBase::Data_Five ); @@ -152,16 +158,22 @@ void SerialConfigWidget::save( Profile& prof ) { speed = 57600; break; case IOLayerBase::Baud_38400: speed = 38400; 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; } switch( m_base->data() ) { case IOLayerBase::Data_Five: 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,22 +1,24 @@ #include "terminalwidget.h" /* OPIE */ #include <opie2/odebug.h> + using namespace Opie::Core; /* QT */ #include <qlabel.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qradiobutton.h> #include <qhgroupbox.h> #include <qhbuttongroup.h> #include <qlayout.h> +#include <qhbox.h> namespace { enum TermIds { id_term_vt100 = 0, id_term_vt102, id_term_linux, id_term_xterm }; @@ -39,25 +41,29 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogTerminalWidget( name, parent, na ) { m_terminal = new QLabel(tr("Terminal Type"), this ); 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 ); m_lroot = new QVBoxLayout( this ); m_typeBox = new QVBoxLayout( m_lroot ); m_colorBox = new QVBoxLayout( m_lroot ); @@ -69,17 +75,17 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, m_colorBox->add( m_colorLabel ); m_colorBox->add( m_colorCmb ); m_lroot->add( m_groupConv ); m_lroot->add( m_groupOptions ); m_lroot->addStretch( 0 ); // 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 */); m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); m_colorCmb->insertItem( tr("black on white"), id_term_black ); m_colorCmb->insertItem( tr("white on black"), id_term_white ); @@ -105,17 +111,17 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, this, SLOT(slotTermOutbound(bool) ) ); */ } 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"); switch( term ) { case Profile::VT100: m_terminalBox->setCurrentItem(id_term_vt100 ); @@ -146,30 +152,33 @@ void TerminalWidget::load( const Profile& prof ) { break; case Profile::Orange: m_colorCmb->setCurrentItem(id_term_orange ); break; 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 ); if (opt_outbound) m_convOutbound->setChecked( true ); } void TerminalWidget::save( Profile& profile ) { @@ -206,21 +215,28 @@ void TerminalWidget::save( Profile& profile ) { break; case id_term_orange: profile.writeEntry("Color", Profile::Orange ); break; 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() ); profile.writeEntry("Outbound",m_convOutbound->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 @@ -1,23 +1,26 @@ #ifndef OPIE_TERMINAL_WIDGET_H #define OPIE_TERMINAL_WIDGET_H #include "profiledialogwidget.h" +#include <opie2/ofontselector.h> + class QComboBox; class QLabel; class QVBoxLayout; class QHBoxLayout; class QButtonGroup; class QRadioButton; class QCheckBox; class QHGroupBox; class QHBox; + class TerminalWidget : public ProfileDialogTerminalWidget { Q_OBJECT public: TerminalWidget(const QString& name, QWidget* wid, const char* na ) ; ~TerminalWidget(); @@ -27,22 +30,23 @@ public: private: QVBoxLayout* m_lroot, *m_typeBox, *m_colorBox; QLabel* m_terminal, *m_colorLabel; QComboBox* m_terminalBox, *m_colorCmb; - QButtonGroup* m_groupSize; + QHBox* m_groupSize; QRadioButton* m_sizeSmall, *m_sizeMedium, *m_sizeLarge; QHGroupBox *m_groupConv, *m_groupOptions; QCheckBox *m_convInbound, *m_convOutbound, *m_optionEcho, *m_optionWrap; + Opie::Ui::OFontSelector *m_fontSelector; }; #endif |