summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/terminalwidget.cpp
authorharlekin <harlekin>2004-04-22 18:58:37 (UTC)
committer harlekin <harlekin>2004-04-22 18:58:37 (UTC)
commit5c6499c56cd5c00603634546e6ba8c4d9da9741d (patch) (unidiff)
tree3ad98bb1a0150b1dd69c79fd58e6e59ce8556e51 /noncore/apps/opie-console/terminalwidget.cpp
parent53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (diff)
downloadopie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.zip
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.gz
opie-5c6499c56cd5c00603634546e6ba8c4d9da9741d.tar.bz2
2400 and 4800 baud added, also free font selection
Diffstat (limited to 'noncore/apps/opie-console/terminalwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp70
1 files changed, 43 insertions, 27 deletions
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 @@
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5
5using namespace Opie::Core; 6using namespace Opie::Core;
@@ -14,2 +15,3 @@ using namespace Opie::Core;
14#include <qlayout.h> 15#include <qlayout.h>
16#include <qhbox.h>
15 17
@@ -46,6 +48,9 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
46 48
47 m_groupSize = new QHButtonGroup(tr("Font size"), this ); 49// m_groupSize = new QHButtonGroup(tr("Font size"), this );
48 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize ); 50 m_groupSize = new QHBox( this );
49 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize ); 51 m_fontSelector = new Opie::Ui::OFontSelector( false, m_groupSize );
50 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize ); 52
53// m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
54// m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
55// m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
51 56
@@ -55,2 +60,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
55 60
61
56 m_groupOptions = new QHGroupBox( tr("Options"), this ); 62 m_groupOptions = new QHGroupBox( tr("Options"), this );
@@ -76,3 +82,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
76 // Fill in some options 82 // Fill in some options
77 owarn << "Options for terminal box" << oendl; 83 owarn << "Options for terminal box" << oendl;
78 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); 84 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ );
@@ -112,3 +118,3 @@ void TerminalWidget::load( const Profile& prof ) {
112 int color = prof.readNumEntry("Color"); 118 int color = prof.readNumEntry("Color");
113 int fontsize = prof.readNumEntry("Font"); 119// int fontsize = prof.readNumEntry("Font");
114 int opt_echo = prof.readNumEntry("Echo"); 120 int opt_echo = prof.readNumEntry("Echo");
@@ -153,16 +159,19 @@ void TerminalWidget::load( const Profile& prof ) {
153 159
154 switch( fontsize ) { 160
155 case Profile::Micro: 161 m_fontSelector->setSelectedFont( prof.readEntry( "Font"), prof.readEntry( "FontStyle"), prof.readNumEntry( "FontSize" ), prof.readEntry( "FontCharset") );
156 m_sizeSmall->setChecked(true ); 162
157 break; 163// switch( fontsize ) {
158 case Profile::Small: 164// case Profile::Micro:
159 m_sizeMedium->setChecked(true ); 165// m_sizeSmall->setChecked(true );
160 break; 166// break;
161 case Profile::Medium: 167// case Profile::Small:
162 m_sizeLarge->setChecked( true ); 168// m_sizeMedium->setChecked(true );
163 break; 169// break;
164 default: 170// case Profile::Medium:
165 m_sizeMedium->setChecked(true ); 171// m_sizeLarge->setChecked( true );
166 break; 172// break;
167 }; 173// default:
174// m_sizeMedium->setChecked(true );
175// break;
176// };
168 177
@@ -213,9 +222,16 @@ void TerminalWidget::save( Profile& profile ) {
213 222
214 if (m_sizeSmall->isChecked() ) { 223
215 profile.writeEntry("Font", Profile::Micro ); 224 profile.writeEntry( "FontSize", m_fontSelector->fontSize() );
216 }else if (m_sizeMedium->isChecked() ) { 225 profile.writeEntry( "FontStyle", m_fontSelector->fontStyle() );
217 profile.writeEntry("Font", Profile::Small ); 226 profile.writeEntry( "FontCharset", m_fontSelector->fontCharSet() );
218 }else { 227 profile.writeEntry( "Font", m_fontSelector->fontFamily() );
219 profile.writeEntry("Font", Profile::Medium ); 228
220 } 229
230// if (m_sizeSmall->isChecked() ) {
231// profile.writeEntry("Font", Profile::Micro );
232// }else if (m_sizeMedium->isChecked() ) {
233// profile.writeEntry("Font", Profile::Small );
234// }else {
235// profile.writeEntry("Font", Profile::Medium );
236// }
221 237