author | harlekin <harlekin> | 2004-04-22 18:58:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-04-22 18:58:37 (UTC) |
commit | 5c6499c56cd5c00603634546e6ba8c4d9da9741d (patch) (unidiff) | |
tree | 3ad98bb1a0150b1dd69c79fd58e6e59ce8556e51 /noncore/apps/opie-console/terminalwidget.cpp | |
parent | 53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (diff) | |
download | opie-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) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 68 |
1 files changed, 42 insertions, 26 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 | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | /* OPIE */ | 3 | /* OPIE */ |
4 | #include <opie2/odebug.h> | 4 | #include <opie2/odebug.h> |
5 | |||
5 | using namespace Opie::Core; | 6 | using namespace Opie::Core; |
6 | 7 | ||
7 | /* QT */ | 8 | /* QT */ |
@@ -12,6 +13,7 @@ using namespace Opie::Core; | |||
12 | #include <qhgroupbox.h> | 13 | #include <qhgroupbox.h> |
13 | #include <qhbuttongroup.h> | 14 | #include <qhbuttongroup.h> |
14 | #include <qlayout.h> | 15 | #include <qlayout.h> |
16 | #include <qhbox.h> | ||
15 | 17 | ||
16 | namespace { | 18 | namespace { |
17 | enum TermIds { | 19 | enum TermIds { |
@@ -44,15 +46,19 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
44 | m_colorLabel = new QLabel(tr("Color scheme"), this); | 46 | m_colorLabel = new QLabel(tr("Color scheme"), this); |
45 | m_colorCmb = new QComboBox(this ); | 47 | m_colorCmb = new QComboBox(this ); |
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 | ||
52 | m_groupConv = new QHGroupBox( tr("Line-break conversions"), this ); | 57 | m_groupConv = new QHGroupBox( tr("Line-break conversions"), this ); |
53 | m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv ); | 58 | m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv ); |
54 | m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv ); | 59 | m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv ); |
55 | 60 | ||
61 | |||
56 | m_groupOptions = new QHGroupBox( tr("Options"), this ); | 62 | m_groupOptions = new QHGroupBox( tr("Options"), this ); |
57 | m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions ); | 63 | m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions ); |
58 | m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions ); | 64 | m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions ); |
@@ -110,7 +116,7 @@ TerminalWidget::~TerminalWidget() { | |||
110 | void TerminalWidget::load( const Profile& prof ) { | 116 | void TerminalWidget::load( const Profile& prof ) { |
111 | int term = prof.readNumEntry("Terminal"); | 117 | int term = prof.readNumEntry("Terminal"); |
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"); |
115 | int opt_wrap = prof.readNumEntry("Wrap"); | 121 | int opt_wrap = prof.readNumEntry("Wrap"); |
116 | int opt_inbound = prof.readNumEntry("Inbound"); | 122 | int opt_inbound = prof.readNumEntry("Inbound"); |
@@ -151,20 +157,23 @@ void TerminalWidget::load( const Profile& prof ) { | |||
151 | break; | 157 | break; |
152 | }; | 158 | }; |
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 | ||
169 | if (opt_echo) m_optionEcho->setChecked( true ); | 178 | if (opt_echo) m_optionEcho->setChecked( true ); |
170 | if (opt_wrap) m_optionWrap->setChecked( true ); | 179 | if (opt_wrap) m_optionWrap->setChecked( true ); |
@@ -211,13 +220,20 @@ void TerminalWidget::save( Profile& profile ) { | |||
211 | break; | 220 | break; |
212 | }; | 221 | }; |
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 | ||
222 | profile.writeEntry("Echo", m_optionEcho->isChecked() ); | 238 | profile.writeEntry("Echo", m_optionEcho->isChecked() ); |
223 | profile.writeEntry("Wrap", m_optionWrap->isChecked() ); | 239 | profile.writeEntry("Wrap", m_optionWrap->isChecked() ); |