summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index eae94c3..fc0f3ce 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -38,189 +38,190 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
38 38
39 m_terminal = new QLabel(tr("Terminal Type"), this ); 39 m_terminal = new QLabel(tr("Terminal Type"), this );
40 m_terminalBox = new QComboBox(this); 40 m_terminalBox = new QComboBox(this);
41 m_colorLabel = new QLabel(tr("Color scheme"), this); 41 m_colorLabel = new QLabel(tr("Color scheme"), this);
42 m_colorCmb = new QComboBox(this ); 42 m_colorCmb = new QComboBox(this );
43 43
44 m_groupSize = new QButtonGroup(tr("Font size"), this ); 44 m_groupSize = new QButtonGroup(tr("Font size"), this );
45 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize ); 45 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
46 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize ); 46 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
47 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize ); 47 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
48 48
49 m_groupConv = new QHGroupBox(tr("Line-break conversions"), this ); 49 m_groupConv = new QHGroupBox(tr("Line-break conversions"), this );
50 m_convInbound = new QCheckBox(tr("Inbound"), m_groupConv ); 50 m_convInbound = new QCheckBox(tr("Inbound"), m_groupConv );
51 m_convOutbound = new QCheckBox(tr("Outbound"), m_groupConv ); 51 m_convOutbound = new QCheckBox(tr("Outbound"), m_groupConv );
52 52
53 m_groupOptions = new QHGroupBox( tr("Options"), this ); 53 m_groupOptions = new QHGroupBox( tr("Options"), this );
54 m_optionEcho = new QCheckBox(tr("Local echo"), m_groupOptions ); 54 m_optionEcho = new QCheckBox(tr("Local echo"), m_groupOptions );
55 m_optionWrap = new QCheckBox(tr("Line wrap"), m_groupOptions ); 55 m_optionWrap = new QCheckBox(tr("Line wrap"), m_groupOptions );
56 56
57 m_lroot = new QVBoxLayout(this, 2 ); 57 m_lroot = new QVBoxLayout(this, 2 );
58 m_typeBox = new QVBoxLayout( m_lroot ); 58 m_typeBox = new QVBoxLayout( m_lroot );
59 m_hbox = new QHBoxLayout( m_groupSize, 2 ); 59 m_hbox = new QHBoxLayout( m_groupSize, 2 );
60 m_colorBox = new QVBoxLayout( m_lroot ); 60 m_colorBox = new QVBoxLayout( m_lroot );
61 61
62 // Layout 62 // Layout
63 m_typeBox->add(m_terminal ); 63 m_typeBox->add(m_terminal );
64 m_typeBox->add(m_terminalBox ); 64 m_typeBox->add(m_terminalBox );
65 65
66 m_hbox->add(m_sizeSmall ); 66 m_hbox->add(m_sizeSmall );
67 m_hbox->add(m_sizeMedium ); 67 m_hbox->add(m_sizeMedium );
68 m_hbox->add(m_sizeLarge ); 68 m_hbox->add(m_sizeLarge );
69 m_lroot->add(m_groupSize ); 69 m_lroot->add(m_groupSize );
70 70
71 m_colorBox->add( m_colorLabel ); 71 m_colorBox->add( m_colorLabel );
72 m_colorBox->add( m_colorCmb ); 72 m_colorBox->add( m_colorCmb );
73 73
74 m_lroot->add(m_groupConv ); 74 m_lroot->add(m_groupConv );
75 m_lroot->add(m_groupOptions ); 75 m_lroot->add(m_groupOptions );
76 76
77 // Fill in some options 77 // Fill in some options
78 qWarning("Options for terminal box"); 78 qWarning("Options for terminal box");
79 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); 79 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ );
80 m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); 80 m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */);
81 m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); 81 m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux );
82 m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); 82 m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm );
83 //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); 83 //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi );
84 84
85 m_colorCmb->insertItem( tr("black on white"), id_term_black ); 85 m_colorCmb->insertItem( tr("black on white"), id_term_black );
86 m_colorCmb->insertItem( tr("white on black"), id_term_white ); 86 m_colorCmb->insertItem( tr("white on black"), id_term_white );
87 m_colorCmb->insertItem( tr("green on black"), id_term_green ); 87 m_colorCmb->insertItem( tr("green on black"), id_term_green );
88 m_colorCmb->insertItem( tr("orange on black"), id_term_orange ); 88 m_colorCmb->insertItem( tr("orange on black"), id_term_orange );
89 89
90 // signals + slots 90 // signals + slots
91 /* 91 /*
92 connect(m_terminalBox, SIGNAL(activated(int) ), 92 connect(m_terminalBox, SIGNAL(activated(int) ),
93 this, SLOT(slotTermTerm(int) ) ); 93 this, SLOT(slotTermTerm(int) ) );
94 connect(m_colorBox, SIGNAL(activated(int) ), 94 connect(m_colorBox, SIGNAL(activated(int) ),
95 tis, SLOT(slotTermColor(int) ) ); 95 tis, SLOT(slotTermColor(int) ) );
96 connect(m_groupSize, SIGNAL(activated(int) ), 96 connect(m_groupSize, SIGNAL(activated(int) ),
97 this, SLOT(slotTermFont(int) ) ); 97 this, SLOT(slotTermFont(int) ) );
98 98
99 connect(m_optionEcho, SIGNAL(toggled(bool) ), 99 connect(m_optionEcho, SIGNAL(toggled(bool) ),
100 this, SLOT(slotTermEcho(bool) ) ); 100 this, SLOT(slotTermEcho(bool) ) );
101 connect(m_optionWrap, SIGNAL(toggled(bool) ), 101 connect(m_optionWrap, SIGNAL(toggled(bool) ),
102 this, SLOT(slotTermWrap(bool) ) ); 102 this, SLOT(slotTermWrap(bool) ) );
103 connect(m_convInbound, SIGNAL(toggled(bool) ), 103 connect(m_convInbound, SIGNAL(toggled(bool) ),
104 this, SLOT(slotTermInbound(bool) ) ); 104 this, SLOT(slotTermInbound(bool) ) );
105 connect(m_convOutbound, SIGNAL(toggled(bool) ), 105 connect(m_convOutbound, SIGNAL(toggled(bool) ),
106 this, SLOT(slotTermOutbound(bool) ) ); 106 this, SLOT(slotTermOutbound(bool) ) );
107*/ 107*/
108} 108}
109TerminalWidget::~TerminalWidget() { 109TerminalWidget::~TerminalWidget() {
110} 110}
111void TerminalWidget::load( const Profile& prof ) { 111void TerminalWidget::load( const Profile& prof ) {
112 int term = prof.readNumEntry("Terminal"); 112 int term = prof.readNumEntry("Terminal");
113 int color = prof.readNumEntry("Color"); 113 int color = prof.readNumEntry("Color");
114 int fontsize = prof.readNumEntry("Font"); 114 int fontsize = prof.readNumEntry("Font");
115 int opt_echo = prof.readNumEntry("Echo"); 115 int opt_echo = prof.readNumEntry("Echo");
116 int opt_wrap = prof.readNumEntry("Wrap"); 116 int opt_wrap = prof.readNumEntry("Wrap");
117 int opt_inbound = prof.readNumEntry("Inbound"); 117 int opt_inbound = prof.readNumEntry("Inbound");
118 int opt_outbound = prof.readNumEntry("Outbound"); 118 int opt_outbound = prof.readNumEntry("Outbound");
119 119
120 switch( term ) { 120 switch( term ) {
121 case Profile::VT100: 121 case Profile::VT100:
122 m_terminalBox->setCurrentItem(id_term_vt100 ); 122 m_terminalBox->setCurrentItem(id_term_vt100 );
123 break; 123 break;
124 case Profile::VT102: 124 case Profile::VT102:
125 m_terminalBox->setCurrentItem(id_term_vt102 ); 125 m_terminalBox->setCurrentItem(id_term_vt102 );
126 break; 126 break;
127 case Profile::Linux: 127 case Profile::Linux:
128 m_terminalBox->setCurrentItem(id_term_linux ); 128 m_terminalBox->setCurrentItem(id_term_linux );
129 break; 129 break;
130 case Profile::XTerm: 130 case Profile::XTerm:
131 m_terminalBox->setCurrentItem(id_term_xterm ); 131 m_terminalBox->setCurrentItem(id_term_xterm );
132 break; 132 break;
133 default: 133 default:
134 m_terminalBox->setCurrentItem(id_term_vt102 );
134 break; 135 break;
135 }; 136 };
136 137
137 switch( color ) { 138 switch( color ) {
138 case Profile::Black: 139 case Profile::Black:
139 m_colorCmb->setCurrentItem(id_term_black ); 140 m_colorCmb->setCurrentItem(id_term_black );
140 break; 141 break;
141 case Profile::White: 142 case Profile::White:
142 m_colorCmb->setCurrentItem(id_term_white ); 143 m_colorCmb->setCurrentItem(id_term_white );
143 break; 144 break;
144 case Profile::Green: 145 case Profile::Green:
145 m_colorCmb->setCurrentItem(id_term_green ); 146 m_colorCmb->setCurrentItem(id_term_green );
146 break; 147 break;
147 case Profile::Orange: 148 case Profile::Orange:
148 m_colorCmb->setCurrentItem(id_term_orange ); 149 m_colorCmb->setCurrentItem(id_term_orange );
149 break; 150 break;
150 default: 151 default:
151 break; 152 break;
152 }; 153 };
153 154
154 switch( fontsize ) { 155 switch( fontsize ) {
155 case Profile::Micro: 156 case Profile::Micro:
156 m_sizeSmall->setChecked(true ); 157 m_sizeSmall->setChecked(true );
157 break; 158 break;
158 case Profile::Small: 159 case Profile::Small:
159 m_sizeMedium->setChecked(true ); 160 m_sizeMedium->setChecked(true );
160 break; 161 break;
161 case Profile::Medium: 162 case Profile::Medium:
162 m_sizeLarge->setChecked( true ); 163 m_sizeLarge->setChecked( true );
163 break; 164 break;
164 m_sizeSmall->setChecked(true);
165 default: 165 default:
166 m_sizeMedium->setChecked(true );
166 break; 167 break;
167 }; 168 };
168 169
169 if (opt_echo) m_optionEcho->setChecked( true ); 170 if (opt_echo) m_optionEcho->setChecked( true );
170 if (opt_wrap) m_optionWrap->setChecked( true ); 171 if (opt_wrap) m_optionWrap->setChecked( true );
171 if (opt_inbound) m_convInbound->setChecked( true ); 172 if (opt_inbound) m_convInbound->setChecked( true );
172 if (opt_outbound) m_convOutbound->setChecked( true ); 173 if (opt_outbound) m_convOutbound->setChecked( true );
173 174
174} 175}
175void TerminalWidget::save( Profile& profile ) { 176void TerminalWidget::save( Profile& profile ) {
176 switch(m_terminalBox->currentItem() ) { 177 switch(m_terminalBox->currentItem() ) {
177 case id_term_vt100: 178 case id_term_vt100:
178 profile.writeEntry("Terminal", Profile::VT100 ); 179 profile.writeEntry("Terminal", Profile::VT100 );
179 break; 180 break;
180 case id_term_vt102: 181 case id_term_vt102:
181 profile.writeEntry("Terminal", Profile::VT102 ); 182 profile.writeEntry("Terminal", Profile::VT102 );
182 break; 183 break;
183 case id_term_linux: 184 case id_term_linux:
184 profile.writeEntry("Terminal", Profile::Linux ); 185 profile.writeEntry("Terminal", Profile::Linux );
185 break; 186 break;
186 case id_term_xterm: 187 case id_term_xterm:
187 profile.writeEntry("Terminal", Profile::XTerm ); 188 profile.writeEntry("Terminal", Profile::XTerm );
188 break; 189 break;
189 //case id_term_ansi: 190 //case id_term_ansi:
190 // profile.writeEntry("Terminal", Profile::VT102 ); 191 // profile.writeEntry("Terminal", Profile::VT102 );
191 // break; 192 // break;
192 default: 193 default:
193 break; 194 break;
194 }; 195 };
195 196
196 // color 197 // color
197 switch(m_colorCmb->currentItem() ) { 198 switch(m_colorCmb->currentItem() ) {
198 case id_term_black: 199 case id_term_black:
199 profile.writeEntry("Color", Profile::Black ); 200 profile.writeEntry("Color", Profile::Black );
200 break; 201 break;
201 case id_term_white: 202 case id_term_white:
202 profile.writeEntry("Color", Profile::White ); 203 profile.writeEntry("Color", Profile::White );
203 break; 204 break;
204 case id_term_green: 205 case id_term_green:
205 profile.writeEntry("Color", Profile::Green ); 206 profile.writeEntry("Color", Profile::Green );
206 break; 207 break;
207 case id_term_orange: 208 case id_term_orange:
208 profile.writeEntry("Color", Profile::Orange ); 209 profile.writeEntry("Color", Profile::Orange );
209 break; 210 break;
210 default: 211 default:
211 break; 212 break;
212 }; 213 };
213 214
214 if (m_sizeSmall->isChecked() ) { 215 if (m_sizeSmall->isChecked() ) {
215 profile.writeEntry("Font", Profile::Micro ); 216 profile.writeEntry("Font", Profile::Micro );
216 }else if (m_sizeMedium->isChecked() ) { 217 }else if (m_sizeMedium->isChecked() ) {
217 profile.writeEntry("Font", Profile::Small ); 218 profile.writeEntry("Font", Profile::Small );
218 }else { 219 }else {
219 profile.writeEntry("Font", Profile::Medium ); 220 profile.writeEntry("Font", Profile::Medium );
220 } 221 }
221 222
222 profile.writeEntry("Echo", m_optionEcho->isChecked() ); 223 profile.writeEntry("Echo", m_optionEcho->isChecked() );
223 profile.writeEntry("Wrap", m_optionWrap->isChecked() ); 224 profile.writeEntry("Wrap", m_optionWrap->isChecked() );
224 profile.writeEntry("Inbound", m_convInbound->isChecked() ); 225 profile.writeEntry("Inbound", m_convInbound->isChecked() );
225 profile.writeEntry("Outbound",m_convOutbound->isChecked() ); 226 profile.writeEntry("Outbound",m_convOutbound->isChecked() );
226} 227}