summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/terminalwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/terminalwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index 80627c4..2d37be2 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -4,25 +4,25 @@
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qradiobutton.h> 5#include <qradiobutton.h>
6#include <qgroupbox.h> 6#include <qgroupbox.h>
7#include <qvbox.h> 7#include <qvbox.h>
8#include <qhgroupbox.h> 8#include <qhgroupbox.h>
9#include <qlayout.h> 9#include <qlayout.h>
10 10
11#include "terminalwidget.h" 11#include "terminalwidget.h"
12 12
13namespace { 13namespace {
14 enum TermIds { 14 enum TermIds {
15 id_term_vt100, 15 id_term_vt100,
16 id_term_vt220, 16 id_term_vt102,
17 id_term_ansi 17 id_term_ansi
18 }; 18 };
19 19
20 enum ColourIds { 20 enum ColourIds {
21 id_term_black, 21 id_term_black,
22 id_term_white 22 id_term_white
23 }; 23 };
24 24
25 enum FontIds { 25 enum FontIds {
26 id_size_small, 26 id_size_small,
27 id_size_medium, 27 id_size_medium,
28 id_size_large 28 id_size_large
@@ -64,26 +64,26 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
64 m_hbox->add(m_sizeMedium ); 64 m_hbox->add(m_sizeMedium );
65 m_hbox->add(m_sizeLarge ); 65 m_hbox->add(m_sizeLarge );
66 m_lroot->add(m_groupSize ); 66 m_lroot->add(m_groupSize );
67 67
68 m_colorBox->add( m_colorLabel ); 68 m_colorBox->add( m_colorLabel );
69 m_colorBox->add( m_colorCmb ); 69 m_colorBox->add( m_colorCmb );
70 70
71 m_lroot->add(m_groupConv ); 71 m_lroot->add(m_groupConv );
72 m_lroot->add(m_groupOptions ); 72 m_lroot->add(m_groupOptions );
73 73
74 // Fill in some options 74 // Fill in some options
75 m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); 75 m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 );
76 m_terminalBox->insertItem( tr("VT 220"), id_term_vt220 ); 76 m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 );
77 m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); 77 //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi );
78 78
79 m_colorCmb->insertItem( tr("black on white"), id_term_black ); 79 m_colorCmb->insertItem( tr("black on white"), id_term_black );
80 m_colorCmb->insertItem( tr("white on black"), id_term_white ); 80 m_colorCmb->insertItem( tr("white on black"), id_term_white );
81 81
82 // signals + slots 82 // signals + slots
83 /* 83 /*
84 connect(m_terminalBox, SIGNAL(activated(int) ), 84 connect(m_terminalBox, SIGNAL(activated(int) ),
85 this, SLOT(slotTermTerm(int) ) ); 85 this, SLOT(slotTermTerm(int) ) );
86 connect(m_colorBox, SIGNAL(activated(int) ), 86 connect(m_colorBox, SIGNAL(activated(int) ),
87 tis, SLOT(slotTermColor(int) ) ); 87 tis, SLOT(slotTermColor(int) ) );
88 connect(m_groupSize, SIGNAL(activated(int) ), 88 connect(m_groupSize, SIGNAL(activated(int) ),
89 this, SLOT(slotTermFont(int) ) ); 89 this, SLOT(slotTermFont(int) ) );
@@ -101,27 +101,30 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
101TerminalWidget::~TerminalWidget() { 101TerminalWidget::~TerminalWidget() {
102} 102}
103void TerminalWidget::load( const Profile& prof ) { 103void TerminalWidget::load( const Profile& prof ) {
104 int term = prof.readNumEntry("Terminal"); 104 int term = prof.readNumEntry("Terminal");
105 int color = prof.readNumEntry("Color"); 105 int color = prof.readNumEntry("Color");
106 int fontsize = prof.readNumEntry("Font"); 106 int fontsize = prof.readNumEntry("Font");
107 int opt_echo = prof.readNumEntry("Echo"); 107 int opt_echo = prof.readNumEntry("Echo");
108 int opt_wrap = prof.readNumEntry("Wrap"); 108 int opt_wrap = prof.readNumEntry("Wrap");
109 int opt_inbound = prof.readNumEntry("Inbound"); 109 int opt_inbound = prof.readNumEntry("Inbound");
110 int opt_outbound = prof.readNumEntry("Outbound"); 110 int opt_outbound = prof.readNumEntry("Outbound");
111 111
112 switch( term ) { 112 switch( term ) {
113 case Profile::VT102: 113 case Profile::VT100:
114 m_terminalBox->setCurrentItem(id_term_vt100 ); 114 m_terminalBox->setCurrentItem(id_term_vt100 );
115 break; 115 break;
116 case Profile::VT102:
117 m_terminalBox->setCurrentItem(id_term_vt102 );
118 break;
116 default: 119 default:
117 break; 120 break;
118 }; 121 };
119 122
120 switch( color ) { 123 switch( color ) {
121 case Profile::Black: 124 case Profile::Black:
122 m_colorCmb->setCurrentItem(id_term_black ); 125 m_colorCmb->setCurrentItem(id_term_black );
123 break; 126 break;
124 case Profile::White: 127 case Profile::White:
125 m_colorCmb->setCurrentItem(id_term_white ); 128 m_colorCmb->setCurrentItem(id_term_white );
126 break; 129 break;
127 default: 130 default:
@@ -143,32 +146,32 @@ void TerminalWidget::load( const Profile& prof ) {
143 break; 146 break;
144 }; 147 };
145 148
146 if (opt_echo) m_optionEcho->setChecked( true ); 149 if (opt_echo) m_optionEcho->setChecked( true );
147 if (opt_wrap) m_optionWrap->setChecked( true ); 150 if (opt_wrap) m_optionWrap->setChecked( true );
148 if (opt_inbound) m_convInbound->setChecked( true ); 151 if (opt_inbound) m_convInbound->setChecked( true );
149 if (opt_outbound) m_convOutbound->setChecked( true ); 152 if (opt_outbound) m_convOutbound->setChecked( true );
150 153
151} 154}
152void TerminalWidget::save( Profile& profile ) { 155void TerminalWidget::save( Profile& profile ) {
153 switch(m_terminalBox->currentItem() ) { 156 switch(m_terminalBox->currentItem() ) {
154 case id_term_vt100: 157 case id_term_vt100:
155 profile.writeEntry("Terminal", Profile::VT102 ); 158 profile.writeEntry("Terminal", Profile::VT100 );
156 break;
157 case id_term_vt220:
158 profile.writeEntry("Terminal", Profile::VT102 );
159 break; 159 break;
160 case id_term_ansi: 160 case id_term_vt102:
161 profile.writeEntry("Terminal", Profile::VT102 ); 161 profile.writeEntry("Terminal", Profile::VT102 );
162 break; 162 break;
163 //case id_term_ansi:
164 // profile.writeEntry("Terminal", Profile::VT102 );
165 // break;
163 default: 166 default:
164 break; 167 break;
165 }; 168 };
166 169
167 // color 170 // color
168 switch(m_colorCmb->currentItem() ) { 171 switch(m_colorCmb->currentItem() ) {
169 case id_term_black: 172 case id_term_black:
170 profile.writeEntry("Color", Profile::Black ); 173 profile.writeEntry("Color", Profile::Black );
171 break; 174 break;
172 case id_term_white: 175 case id_term_white:
173 profile.writeEntry("Color", Profile::White ); 176 profile.writeEntry("Color", Profile::White );
174 break; 177 break;