-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.h | 6 |
2 files changed, 11 insertions, 9 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,21 +1,23 @@ | |||
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 | ||
13 | namespace { | 15 | namespace { |
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 { |
@@ -32,56 +34,54 @@ namespace { | |||
32 | }; | 34 | }; |
33 | }; | 35 | }; |
34 | 36 | ||
35 | TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | 37 | TerminalWidget::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 ); |
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 | |||
@@ -2,39 +2,41 @@ | |||
2 | #define OPIE_TERMINAL_WIDGET_H | 2 | #define OPIE_TERMINAL_WIDGET_H |
3 | 3 | ||
4 | #include "profiledialogwidget.h" | 4 | #include "profiledialogwidget.h" |
5 | 5 | ||
6 | class QComboBox; | 6 | class QComboBox; |
7 | class QLabel; | 7 | class QLabel; |
8 | class QVBoxLayout; | 8 | class QVBoxLayout; |
9 | class QHBoxLayout; | 9 | class QHBoxLayout; |
10 | class QButtonGroup; | 10 | class QButtonGroup; |
11 | class QRadioButton; | 11 | class QRadioButton; |
12 | class QCheckBox; | 12 | class QCheckBox; |
13 | class QHGroupBox; | 13 | class QHGroupBox; |
14 | class QHBox; | ||
14 | 15 | ||
15 | class TerminalWidget : public ProfileDialogTerminalWidget { | 16 | class TerminalWidget : public ProfileDialogTerminalWidget { |
17 | |||
16 | Q_OBJECT | 18 | Q_OBJECT |
19 | |||
17 | public: | 20 | public: |
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 | |||
24 | private: | 28 | private: |
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, |