-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp index 08acb75..49ed284 100644 --- a/noncore/apps/opie-console/iolayerbase.cpp +++ b/noncore/apps/opie-console/iolayerbase.cpp | |||
@@ -21,103 +21,105 @@ namespace { | |||
21 | }; | 21 | }; |
22 | 22 | ||
23 | enum SpeedIds { | 23 | enum SpeedIds { |
24 | id_baud_115200, | 24 | id_baud_115200, |
25 | id_baud_57600, | 25 | id_baud_57600, |
26 | id_baud_38400, | 26 | id_baud_38400, |
27 | id_baud_19200, | 27 | id_baud_19200, |
28 | id_baud_9600 | 28 | id_baud_9600 |
29 | }; | 29 | }; |
30 | 30 | ||
31 | } | 31 | } |
32 | 32 | ||
33 | 33 | ||
34 | IOLayerBase::IOLayerBase( QWidget* par, const char* name ) | 34 | IOLayerBase::IOLayerBase( QWidget* par, const char* name ) |
35 | : QWidget( par, name ) | 35 | : QWidget( par, name ) |
36 | { | 36 | { |
37 | m_speedLabel = new QLabel(tr("Speed"), this ); | 37 | m_speedLabel = new QLabel(tr("Speed"), this ); |
38 | m_speedBox = new QComboBox(this ); | 38 | m_speedBox = new QComboBox(this ); |
39 | 39 | ||
40 | m_groupFlow = new QButtonGroup(tr("Flow control"),this ); | 40 | m_groupFlow = new QButtonGroup(tr("Flow control"),this ); |
41 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); | 41 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); |
42 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); | 42 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); |
43 | m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); | 43 | m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); |
44 | 44 | ||
45 | m_groupParity = new QButtonGroup(tr("Parity"), this ); | 45 | m_groupParity = new QButtonGroup(tr("Parity"), this ); |
46 | m_parityNone = new QRadioButton(tr("None"), m_groupParity ); | 46 | m_parityNone = new QRadioButton(tr("None"), m_groupParity ); |
47 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); | 47 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); |
48 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); | 48 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); |
49 | 49 | ||
50 | m_lroot = new QVBoxLayout( this ); | 50 | m_lroot = new QVBoxLayout( this ); |
51 | m_lroot->add(m_speedLabel ); | 51 | m_lroot->add(m_speedLabel ); |
52 | m_lroot->add(m_speedBox ); | 52 | m_lroot->add(m_speedBox ); |
53 | m_lroot->setStretchFactor(m_speedLabel, 1); | 53 | m_lroot->setStretchFactor(m_speedLabel, 1); |
54 | m_lroot->setStretchFactor(m_speedBox, 1 ); | 54 | m_lroot->setStretchFactor(m_speedBox, 1 ); |
55 | 55 | ||
56 | m_hbox = new QHBoxLayout(m_groupFlow, 2 ); | 56 | m_hbox = new QHBoxLayout(m_groupFlow, 2 ); |
57 | m_hbox->add(m_flowHw ); | 57 | m_hbox->add(m_flowHw ); |
58 | m_hbox->add(m_flowSw ); | 58 | m_hbox->add(m_flowSw ); |
59 | m_hbox->add(m_flowNone ); | 59 | m_hbox->add(m_flowNone ); |
60 | m_lroot->add(m_groupFlow ); | 60 | m_lroot->add(m_groupFlow ); |
61 | m_lroot->setStretchFactor(m_groupFlow, 2 ); | 61 | m_lroot->setStretchFactor(m_groupFlow, 2 ); |
62 | 62 | ||
63 | m_hboxPar = new QHBoxLayout( m_groupParity, 2 ); | 63 | m_hboxPar = new QHBoxLayout( m_groupParity, 2 ); |
64 | m_hboxPar->add(m_parityOdd ); | 64 | m_hboxPar->add(m_parityOdd ); |
65 | m_hboxPar->add(m_parityEven ); | 65 | m_hboxPar->add(m_parityEven ); |
66 | m_hboxPar->add(m_parityNone ); | 66 | m_hboxPar->add(m_parityNone ); |
67 | m_lroot->add(m_groupParity ); | 67 | m_lroot->add(m_groupParity ); |
68 | m_lroot->setStretchFactor(m_groupParity, 2 ); | 68 | m_lroot->setStretchFactor(m_groupParity, 2 ); |
69 | m_lroot->addStretch(2); | ||
69 | 70 | ||
70 | // profiles | 71 | // profiles |
71 | m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); | 72 | m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); |
72 | m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); | 73 | m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); |
73 | m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); | 74 | m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); |
74 | m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 ); | 75 | m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 ); |
75 | m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 ); | 76 | m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 ); |
77 | |||
76 | }; | 78 | }; |
77 | IOLayerBase::~IOLayerBase() { | 79 | IOLayerBase::~IOLayerBase() { |
78 | 80 | ||
79 | } | 81 | } |
80 | void IOLayerBase::setFlow( Flow flo ) { | 82 | void IOLayerBase::setFlow( Flow flo ) { |
81 | switch ( flo ) { | 83 | switch ( flo ) { |
82 | case Software: | 84 | case Software: |
83 | m_flowSw->setChecked( true ); | 85 | m_flowSw->setChecked( true ); |
84 | break; | 86 | break; |
85 | case Hardware: | 87 | case Hardware: |
86 | m_flowHw->setChecked( true ); | 88 | m_flowHw->setChecked( true ); |
87 | break; | 89 | break; |
88 | case None: | 90 | case None: |
89 | m_flowNone->setChecked( true ); | 91 | m_flowNone->setChecked( true ); |
90 | break; | 92 | break; |
91 | } | 93 | } |
92 | } | 94 | } |
93 | 95 | ||
94 | void IOLayerBase::setParity( Parity par ) { | 96 | void IOLayerBase::setParity( Parity par ) { |
95 | switch( par ) { | 97 | switch( par ) { |
96 | case NonePar: | 98 | case NonePar: |
97 | m_parityNone->setChecked( true ); | 99 | m_parityNone->setChecked( true ); |
98 | break; | 100 | break; |
99 | case Odd: | 101 | case Odd: |
100 | m_parityOdd->setChecked( true ); | 102 | m_parityOdd->setChecked( true ); |
101 | break; | 103 | break; |
102 | case Even: | 104 | case Even: |
103 | m_parityEven->setChecked( true ); | 105 | m_parityEven->setChecked( true ); |
104 | break; | 106 | break; |
105 | } | 107 | } |
106 | } | 108 | } |
107 | void IOLayerBase::setSpeed( Speed sp ) { | 109 | void IOLayerBase::setSpeed( Speed sp ) { |
108 | int index; | 110 | int index; |
109 | switch( sp ) { | 111 | switch( sp ) { |
110 | case Baud_115200: | 112 | case Baud_115200: |
111 | index = id_baud_115200; | 113 | index = id_baud_115200; |
112 | break; | 114 | break; |
113 | case Baud_57600: | 115 | case Baud_57600: |
114 | index = id_baud_57600; | 116 | index = id_baud_57600; |
115 | break; | 117 | break; |
116 | case Baud_38400: | 118 | case Baud_38400: |
117 | index = id_baud_38400; | 119 | index = id_baud_38400; |
118 | break; | 120 | break; |
119 | case Baud_19200: | 121 | case Baud_19200: |
120 | index = id_baud_19200; | 122 | index = id_baud_19200; |
121 | break; | 123 | break; |
122 | case Baud_9600: | 124 | case Baud_9600: |
123 | index = id_baud_9600; | 125 | index = id_baud_9600; |