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 | 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 @@ -90,24 +90,30 @@ void BTConfigWidget::load( const Profile& prof ) { case 115200: m_base->setSpeed(IOLayerBase::Baud_115200 ); break; case 57600: 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 ); } /* * save speed, @@ -148,24 +154,30 @@ void BTConfigWidget::save( Profile& prof ) { case IOLayerBase::Baud_115200: speed = 115200; break; case IOLayerBase::Baud_57600: 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); prof.writeEntry("Speed", speed); prof.writeEntry("Mac", m_mac->text() ); } 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 @@ -32,25 +32,27 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c } TEmulation* EmulationHandler::emulation() { return m_teEmu; } 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: case Profile::VT100: m_teEmu->setKeytrans("vt100.keytab"); break; case Profile::Linux: @@ -121,53 +123,53 @@ QColor EmulationHandler::foreColor(int col) { QColor co; /* we need to switch it */ switch( col ) { default: 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; /* we need to switch it */ switch( col ) { default: 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() { return m_teWid->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 @@ -30,25 +30,25 @@ public: FlowSW = 0x02 }; IOSerial(const Profile &); ~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(); virtual void reload(const Profile &); protected: int baud(int baud) const; void internDetach(); 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 @@ -15,25 +15,27 @@ namespace { enum FlowIds { id_flow_hw, id_flow_sw, 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 }; enum StopIds { id_stop_1, id_stop_1_5, @@ -77,25 +79,26 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) m_lroot->add(m_groupFlow ); m_lroot->add(m_groupParity ); m_lroot->add( m_groupData ); m_lroot->add( m_groupStop ); 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 ); break; case Hardware: m_flowHw->setChecked( true ); break; @@ -124,24 +127,30 @@ void IOLayerBase::setSpeed( Speed sp ) { case Baud_115200: index = id_baud_115200; break; case Baud_57600: 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 ); } void IOLayerBase::setData( Data data ) { switch( data ) { case Data_Five: m_data5->setChecked( true ); @@ -199,24 +208,30 @@ IOLayerBase::Speed IOLayerBase::speed()const{ case id_baud_115200: return Baud_115200; break; case id_baud_57600: 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() ) { return Data_Five; } else if ( m_data6->isChecked() ) { return Data_Six; } else if ( m_data7->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 @@ -12,25 +12,27 @@ class QRadioButton; class QHBoxLayout; class IOLayerBase : public QWidget { Q_OBJECT 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 ); void setSpeed( Speed speed ); void setData( Data data ); void setStop( Stop stop ); 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 @@ -69,24 +69,30 @@ void IrdaConfigWidget::load( const Profile& prof ) { case 115200: m_base->setSpeed(IOLayerBase::Baud_115200 ); break; case 57600: 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 ); } /* * save speed, @@ -127,22 +133,28 @@ void IrdaConfigWidget::save( Profile& prof ) { case IOLayerBase::Baud_115200: speed = 115200; break; case IOLayerBase::Baud_57600: 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); prof.writeEntry("Speed", speed); } 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,24 +1,24 @@ #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(); void fixIt(); /* no real interested in implementing it */ void breakIt() { @@ -82,25 +82,25 @@ void FixIt::fixIt() { file.writeBlock(m_file,strlen(m_file) ); } file.close(); ::kill( SIGHUP, 1 ); } #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 ); int ap = app.exec(); #ifdef FSCKED_DISTRIBUTION /* should add a signal handler too */ 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 @@ -101,24 +101,30 @@ void ModemConfigWidget::load( const Profile& prof ) { case 115200: m_base->setSpeed( IOLayerBase::Baud_115200 ); break; case 57600: 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 ); } else if (rad_flow == 6) { m_base->setData( IOLayerBase::Data_Six ); } else if (rad_flow == 7) { @@ -129,25 +135,25 @@ void ModemConfigWidget::load( const Profile& prof ) { if ( sbits == 2) { m_base->setStop( IOLayerBase::Stop_Two ); } else if ( sbits == 15 ) { 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 ); } /* * save speed, * flow, * parity */ @@ -188,24 +194,30 @@ void ModemConfigWidget::save( Profile& prof ) { case IOLayerBase::Baud_57600: speed = 57600; break; case IOLayerBase::Baud_38400: 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; break; case IOLayerBase::Data_Seven: data = 7; 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 @@ -73,24 +73,30 @@ void SerialConfigWidget::load( const Profile& prof ) { case 115200: m_base->setSpeed(IOLayerBase::Baud_115200 ); break; case 57600: 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 ); } else if (rad_flow == 6) { m_base->setData( IOLayerBase::Data_Six ); } else if (rad_flow == 7) { m_base->setData( IOLayerBase::Data_Seven ); @@ -148,24 +154,30 @@ void SerialConfigWidget::save( Profile& prof ) { case IOLayerBase::Baud_115200: speed = 115200; break; case IOLayerBase::Baud_57600: 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: data = 5; break; case IOLayerBase::Data_Six: data = 6; 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,26 +1,28 @@ #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 }; enum ColourIds { id_term_black, id_term_white, @@ -35,55 +37,59 @@ namespace { }; }; 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 ); // Layout m_typeBox->add( m_terminal ); m_typeBox->add( m_terminalBox ); m_lroot->add( m_groupSize ); 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 ); m_colorCmb->insertItem( tr("green on black"), id_term_green ); m_colorCmb->insertItem( tr("orange on black"), id_term_orange ); // signals + slots @@ -101,25 +107,25 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, this, SLOT(slotTermWrap(bool) ) ); connect(m_convInbound, SIGNAL(toggled(bool) ), this, SLOT(slotTermInbound(bool) ) ); connect(m_convOutbound, SIGNAL(toggled(bool) ), 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 ); break; case Profile::VT102: m_terminalBox->setCurrentItem(id_term_vt102 ); break; @@ -142,38 +148,41 @@ void TerminalWidget::load( const Profile& prof ) { m_colorCmb->setCurrentItem(id_term_white ); break; case Profile::Green: m_colorCmb->setCurrentItem(id_term_green ); 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 ) { switch(m_terminalBox->currentItem() ) { case id_term_vt100: profile.writeEntry("Terminal", Profile::VT100 ); break; @@ -202,25 +211,32 @@ void TerminalWidget::save( Profile& profile ) { profile.writeEntry("Color", Profile::White ); break; case id_term_green: profile.writeEntry("Color", Profile::Green ); 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,48 +1,52 @@ #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(); void load( const Profile& ); void save( Profile& ); 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 |