summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-24 18:41:09 (UTC)
committer harlekin <harlekin>2002-10-24 18:41:09 (UTC)
commit94573faf2e89723a49bbaf3630f1d19f80ba6b27 (patch) (unidiff)
tree52a5258e3ba595179fc240ee883effb05417c88a
parent3773cd825129f1cc6fa7a4ecb4129634f5189984 (diff)
downloadopie-94573faf2e89723a49bbaf3630f1d19f80ba6b27.zip
opie-94573faf2e89723a49bbaf3630f1d19f80ba6b27.tar.gz
opie-94573faf2e89723a49bbaf3630f1d19f80ba6b27.tar.bz2
fixed layout and disabled advanced options since htey are not all implemented
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp20
-rw-r--r--noncore/apps/opie-console/terminalwidget.h6
2 files changed, 14 insertions, 12 deletions
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index fc0f3ce..eb14a3f 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -1,227 +1,227 @@
1#include <qbuttongroup.h> 1#include <qbuttongroup.h>
2#include <qlabel.h> 2#include <qlabel.h>
3#include <qcheckbox.h> 3#include <qcheckbox.h>
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 <qhbuttongroup.h>
9#include <qlayout.h> 10#include <qlayout.h>
11#include <qhbox.h>
10 12
11#include "terminalwidget.h" 13#include "terminalwidget.h"
12 14
13namespace { 15namespace {
14 enum TermIds { 16 enum TermIds {
15 id_term_vt100 = 0, 17 id_term_vt100 = 0,
16 id_term_vt102, 18 id_term_vt102,
17 id_term_linux, 19 id_term_linux,
18 id_term_xterm 20 id_term_xterm
19 }; 21 };
20 22
21 enum ColourIds { 23 enum ColourIds {
22 id_term_black, 24 id_term_black,
23 id_term_white, 25 id_term_white,
24 id_term_green, 26 id_term_green,
25 id_term_orange 27 id_term_orange
26 }; 28 };
27 29
28 enum FontIds { 30 enum FontIds {
29 id_size_small, 31 id_size_small,
30 id_size_medium, 32 id_size_medium,
31 id_size_large 33 id_size_large
32 }; 34 };
33}; 35};
34 36
35TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, 37TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
36 const char* na ) 38 const char* na )
37 : ProfileDialogTerminalWidget( name, parent, na ) { 39 : ProfileDialogTerminalWidget( name, parent, na ) {
38 40
39 m_terminal = new QLabel(tr("Terminal Type"), this ); 41 m_terminal = new QLabel(tr("Terminal Type"), this );
40 m_terminalBox = new QComboBox(this); 42 m_terminalBox = new QComboBox(this);
41 m_colorLabel = new QLabel(tr("Color scheme"), this); 43 m_colorLabel = new QLabel(tr("Color scheme"), this);
42 m_colorCmb = new QComboBox(this ); 44 m_colorCmb = new QComboBox(this );
43 45
44 m_groupSize = new QButtonGroup(tr("Font size"), this ); 46 m_groupSize = new QHButtonGroup(tr("Font size"), this );
45 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize ); 47 m_sizeSmall = new QRadioButton(tr("small"), m_groupSize );
46 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize ); 48 m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize );
47 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize ); 49 m_sizeLarge = new QRadioButton(tr("large"), m_groupSize );
48 50
49 m_groupConv = new QHGroupBox(tr("Line-break conversions"), this ); 51 m_groupConv = new QHGroupBox(tr("Line-break conversions"), this );
50 m_convInbound = new QCheckBox(tr("Inbound"), m_groupConv ); 52 m_convInbound = new QCheckBox(tr("Inbound"), m_groupConv );
51 m_convOutbound = new QCheckBox(tr("Outbound"), m_groupConv ); 53 m_convOutbound = new QCheckBox(tr("Outbound"), m_groupConv );
54 m_groupConv->hide();
52 55
53 m_groupOptions = new QHGroupBox( tr("Options"), this ); 56 m_groupOptions = new QHGroupBox( tr("Options"), this );
54 m_optionEcho = new QCheckBox(tr("Local echo"), m_groupOptions ); 57 m_optionEcho = new QCheckBox(tr("Local echo"), m_groupOptions );
55 m_optionWrap = new QCheckBox(tr("Line wrap"), m_groupOptions ); 58 m_optionWrap = new QCheckBox(tr("Line wrap"), m_groupOptions );
59 m_groupOptions->hide();
56 60
57 m_lroot = new QVBoxLayout(this, 2 ); 61 m_lroot = new QVBoxLayout( this );
58 m_typeBox = new QVBoxLayout( m_lroot ); 62 m_typeBox = new QVBoxLayout( m_lroot );
59 m_hbox = new QHBoxLayout( m_groupSize, 2 );
60 m_colorBox = new QVBoxLayout( m_lroot ); 63 m_colorBox = new QVBoxLayout( m_lroot );
61 64
62 // Layout 65 // Layout
63 m_typeBox->add(m_terminal ); 66 m_typeBox->add(m_terminal );
64 m_typeBox->add(m_terminalBox ); 67 m_typeBox->add(m_terminalBox );
65
66 m_hbox->add(m_sizeSmall );
67 m_hbox->add(m_sizeMedium );
68 m_hbox->add(m_sizeLarge );
69 m_lroot->add(m_groupSize ); 68 m_lroot->add(m_groupSize );
70 69
71 m_colorBox->add( m_colorLabel ); 70 m_colorBox->add( m_colorLabel );
72 m_colorBox->add( m_colorCmb ); 71 m_colorBox->add( m_colorCmb );
73 72
74 m_lroot->add(m_groupConv ); 73 m_lroot->add(m_groupConv );
75 m_lroot->add(m_groupOptions ); 74 m_lroot->add(m_groupOptions );
75 m_lroot->addStretch( 0 );
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 m_terminalBox->setCurrentItem(id_term_vt102 );
135 break; 135 break;
136 }; 136 };
137 137
138 switch( color ) { 138 switch( color ) {
139 case Profile::Black: 139 case Profile::Black:
140 m_colorCmb->setCurrentItem(id_term_black ); 140 m_colorCmb->setCurrentItem(id_term_black );
141 break; 141 break;
142 case Profile::White: 142 case Profile::White:
143 m_colorCmb->setCurrentItem(id_term_white ); 143 m_colorCmb->setCurrentItem(id_term_white );
144 break; 144 break;
145 case Profile::Green: 145 case Profile::Green:
146 m_colorCmb->setCurrentItem(id_term_green ); 146 m_colorCmb->setCurrentItem(id_term_green );
147 break; 147 break;
148 case Profile::Orange: 148 case Profile::Orange:
149 m_colorCmb->setCurrentItem(id_term_orange ); 149 m_colorCmb->setCurrentItem(id_term_orange );
150 break; 150 break;
151 default: 151 default:
152 break; 152 break;
153 }; 153 };
154 154
155 switch( fontsize ) { 155 switch( fontsize ) {
156 case Profile::Micro: 156 case Profile::Micro:
157 m_sizeSmall->setChecked(true ); 157 m_sizeSmall->setChecked(true );
158 break; 158 break;
159 case Profile::Small: 159 case Profile::Small:
160 m_sizeMedium->setChecked(true ); 160 m_sizeMedium->setChecked(true );
161 break; 161 break;
162 case Profile::Medium: 162 case Profile::Medium:
163 m_sizeLarge->setChecked( true ); 163 m_sizeLarge->setChecked( true );
164 break; 164 break;
165 default: 165 default:
166 m_sizeMedium->setChecked(true ); 166 m_sizeMedium->setChecked(true );
167 break; 167 break;
168 }; 168 };
169 169
170 if (opt_echo) m_optionEcho->setChecked( true ); 170 if (opt_echo) m_optionEcho->setChecked( true );
171 if (opt_wrap) m_optionWrap->setChecked( true ); 171 if (opt_wrap) m_optionWrap->setChecked( true );
172 if (opt_inbound) m_convInbound->setChecked( true ); 172 if (opt_inbound) m_convInbound->setChecked( true );
173 if (opt_outbound) m_convOutbound->setChecked( true ); 173 if (opt_outbound) m_convOutbound->setChecked( true );
174 174
175} 175}
176void TerminalWidget::save( Profile& profile ) { 176void TerminalWidget::save( Profile& profile ) {
177 switch(m_terminalBox->currentItem() ) { 177 switch(m_terminalBox->currentItem() ) {
178 case id_term_vt100: 178 case id_term_vt100:
179 profile.writeEntry("Terminal", Profile::VT100 ); 179 profile.writeEntry("Terminal", Profile::VT100 );
180 break; 180 break;
181 case id_term_vt102: 181 case id_term_vt102:
182 profile.writeEntry("Terminal", Profile::VT102 ); 182 profile.writeEntry("Terminal", Profile::VT102 );
183 break; 183 break;
184 case id_term_linux: 184 case id_term_linux:
185 profile.writeEntry("Terminal", Profile::Linux ); 185 profile.writeEntry("Terminal", Profile::Linux );
186 break; 186 break;
187 case id_term_xterm: 187 case id_term_xterm:
188 profile.writeEntry("Terminal", Profile::XTerm ); 188 profile.writeEntry("Terminal", Profile::XTerm );
189 break; 189 break;
190 //case id_term_ansi: 190 //case id_term_ansi:
191 // profile.writeEntry("Terminal", Profile::VT102 ); 191 // profile.writeEntry("Terminal", Profile::VT102 );
192 // break; 192 // break;
193 default: 193 default:
194 break; 194 break;
195 }; 195 };
196 196
197 // color 197 // color
198 switch(m_colorCmb->currentItem() ) { 198 switch(m_colorCmb->currentItem() ) {
199 case id_term_black: 199 case id_term_black:
200 profile.writeEntry("Color", Profile::Black ); 200 profile.writeEntry("Color", Profile::Black );
201 break; 201 break;
202 case id_term_white: 202 case id_term_white:
203 profile.writeEntry("Color", Profile::White ); 203 profile.writeEntry("Color", Profile::White );
204 break; 204 break;
205 case id_term_green: 205 case id_term_green:
206 profile.writeEntry("Color", Profile::Green ); 206 profile.writeEntry("Color", Profile::Green );
207 break; 207 break;
208 case id_term_orange: 208 case id_term_orange:
209 profile.writeEntry("Color", Profile::Orange ); 209 profile.writeEntry("Color", Profile::Orange );
210 break; 210 break;
211 default: 211 default:
212 break; 212 break;
213 }; 213 };
214 214
215 if (m_sizeSmall->isChecked() ) { 215 if (m_sizeSmall->isChecked() ) {
216 profile.writeEntry("Font", Profile::Micro ); 216 profile.writeEntry("Font", Profile::Micro );
217 }else if (m_sizeMedium->isChecked() ) { 217 }else if (m_sizeMedium->isChecked() ) {
218 profile.writeEntry("Font", Profile::Small ); 218 profile.writeEntry("Font", Profile::Small );
219 }else { 219 }else {
220 profile.writeEntry("Font", Profile::Medium ); 220 profile.writeEntry("Font", Profile::Medium );
221 } 221 }
222 222
223 profile.writeEntry("Echo", m_optionEcho->isChecked() ); 223 profile.writeEntry("Echo", m_optionEcho->isChecked() );
224 profile.writeEntry("Wrap", m_optionWrap->isChecked() ); 224 profile.writeEntry("Wrap", m_optionWrap->isChecked() );
225 profile.writeEntry("Inbound", m_convInbound->isChecked() ); 225 profile.writeEntry("Inbound", m_convInbound->isChecked() );
226 profile.writeEntry("Outbound",m_convOutbound->isChecked() ); 226 profile.writeEntry("Outbound",m_convOutbound->isChecked() );
227} 227}
diff --git a/noncore/apps/opie-console/terminalwidget.h b/noncore/apps/opie-console/terminalwidget.h
index c6c2be2..217fea7 100644
--- a/noncore/apps/opie-console/terminalwidget.h
+++ b/noncore/apps/opie-console/terminalwidget.h
@@ -1,46 +1,48 @@
1#ifndef OPIE_TERMINAL_WIDGET_H 1#ifndef OPIE_TERMINAL_WIDGET_H
2#define OPIE_TERMINAL_WIDGET_H 2#define OPIE_TERMINAL_WIDGET_H
3 3
4#include "profiledialogwidget.h" 4#include "profiledialogwidget.h"
5 5
6class QComboBox; 6class QComboBox;
7class QLabel; 7class QLabel;
8class QVBoxLayout; 8class QVBoxLayout;
9class QHBoxLayout; 9class QHBoxLayout;
10class QButtonGroup; 10class QButtonGroup;
11class QRadioButton; 11class QRadioButton;
12class QCheckBox; 12class QCheckBox;
13class QHGroupBox; 13class QHGroupBox;
14class QHBox;
14 15
15class TerminalWidget : public ProfileDialogTerminalWidget { 16class TerminalWidget : public ProfileDialogTerminalWidget {
17
16 Q_OBJECT 18 Q_OBJECT
19
17public: 20public:
18 TerminalWidget(const QString& name, QWidget* wid, 21 TerminalWidget(const QString& name, QWidget* wid,
19 const char* na ) ; 22 const char* na ) ;
20 ~TerminalWidget(); 23 ~TerminalWidget();
21 24
22 void load( const Profile& ); 25 void load( const Profile& );
23 void save( Profile& ); 26 void save( Profile& );
27
24private: 28private:
25 QVBoxLayout* m_lroot, *m_typeBox, *m_colorBox; 29 QVBoxLayout* m_lroot, *m_typeBox, *m_colorBox;
26 30
27 QHBoxLayout* m_hbox;
28
29 QLabel* m_terminal, *m_colorLabel; 31 QLabel* m_terminal, *m_colorLabel;
30 32
31 QComboBox* m_terminalBox, *m_colorCmb; 33 QComboBox* m_terminalBox, *m_colorCmb;
32 34
33 QButtonGroup* m_groupSize; 35 QButtonGroup* m_groupSize;
34 36
35 QRadioButton* m_sizeSmall, *m_sizeMedium, 37 QRadioButton* m_sizeSmall, *m_sizeMedium,
36 *m_sizeLarge; 38 *m_sizeLarge;
37 39
38 QHGroupBox *m_groupConv, *m_groupOptions; 40 QHGroupBox *m_groupConv, *m_groupOptions;
39 41
40 QCheckBox *m_convInbound, 42 QCheckBox *m_convInbound,
41 *m_convOutbound, *m_optionEcho, 43 *m_convOutbound, *m_optionEcho,
42 *m_optionWrap; 44 *m_optionWrap;
43 45
44}; 46};
45 47
46#endif 48#endif