author | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
commit | 205926ec86ffd582f795b649179291626e504830 (patch) (unidiff) | |
tree | 3a5759b98a1a263ade37dfb35cfd529a7bcafde9 /noncore/apps/opie-console/serialconfigwidget.cpp | |
parent | f696c6248824166f3ac025d23ac66b46c93b440c (diff) | |
download | opie-205926ec86ffd582f795b649179291626e504830.zip opie-205926ec86ffd582f795b649179291626e504830.tar.gz opie-205926ec86ffd582f795b649179291626e504830.tar.bz2 |
flow now has mode none too .-), irda config widget and beginning of layer, first sweep, rest later
Diffstat (limited to 'noncore/apps/opie-console/serialconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp index a427302..b1ec408 100644 --- a/noncore/apps/opie-console/serialconfigwidget.cpp +++ b/noncore/apps/opie-console/serialconfigwidget.cpp | |||
@@ -42,28 +42,31 @@ SerialConfigWidget::SerialConfigWidget( const QString& name, | |||
42 | m_deviceCmb->insertItem( "/dev/ttySA0"); | 42 | m_deviceCmb->insertItem( "/dev/ttySA0"); |
43 | m_deviceCmb->insertItem( "/dev/ttySA1"); | 43 | m_deviceCmb->insertItem( "/dev/ttySA1"); |
44 | 44 | ||
45 | } | 45 | } |
46 | SerialConfigWidget::~SerialConfigWidget() { | 46 | SerialConfigWidget::~SerialConfigWidget() { |
47 | 47 | ||
48 | } | 48 | } |
49 | void SerialConfigWidget::load( const Profile& prof ) { | 49 | void SerialConfigWidget::load( const Profile& prof ) { |
50 | int rad_flow = prof.readNumEntry("Flow"); | 50 | int rad_flow = prof.readNumEntry("Flow"); |
51 | int rad_parity = prof.readNumEntry("Parity"); | 51 | int rad_parity = prof.readNumEntry("Parity"); |
52 | int speed = prof.readNumEntry("Speed"); | 52 | int speed = prof.readNumEntry("Speed"); |
53 | 53 | ||
54 | if (rad_flow == 0) | 54 | if (rad_flow == 1) { |
55 | m_base->setFlow( IOLayerBase::Hardware ); | 55 | m_base->setFlow( IOLayerBase::Hardware ); |
56 | else | 56 | } else if (rad_flow == 2) { |
57 | m_base->setFlow( IOLayerBase::Software ); | 57 | m_base->setFlow( IOLayerBase::Software ); |
58 | } else if (rad_flow == 0) { | ||
59 | m_base->setFlow( IOLayerBase::None ); | ||
60 | } | ||
58 | 61 | ||
59 | if (rad_parity == 1) | 62 | if (rad_parity == 1) |
60 | m_base->setParity( IOLayerBase::Even ); | 63 | m_base->setParity( IOLayerBase::Even ); |
61 | else | 64 | else |
62 | m_base->setParity( IOLayerBase::Odd ); | 65 | m_base->setParity( IOLayerBase::Odd ); |
63 | 66 | ||
64 | switch( speed ) { | 67 | switch( speed ) { |
65 | case 115200: | 68 | case 115200: |
66 | m_base->setSpeed(IOLayerBase::Baud_115200 ); | 69 | m_base->setSpeed(IOLayerBase::Baud_115200 ); |
67 | break; | 70 | break; |
68 | case 57600: | 71 | case 57600: |
69 | m_base->setSpeed( IOLayerBase::Baud_57600 ); | 72 | m_base->setSpeed( IOLayerBase::Baud_57600 ); |
@@ -85,29 +88,32 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
85 | 88 | ||
86 | } | 89 | } |
87 | /* | 90 | /* |
88 | * save speed, | 91 | * save speed, |
89 | * flow, | 92 | * flow, |
90 | * parity | 93 | * parity |
91 | */ | 94 | */ |
92 | void SerialConfigWidget::save( Profile& prof ) { | 95 | void SerialConfigWidget::save( Profile& prof ) { |
93 | int flow, parity, speed; | 96 | int flow, parity, speed; |
94 | prof.writeEntry("Device", m_deviceCmb->currentText() ); | 97 | prof.writeEntry("Device", m_deviceCmb->currentText() ); |
95 | 98 | ||
96 | switch( m_base->flow() ) { | 99 | switch( m_base->flow() ) { |
100 | case IOLayerBase::None: | ||
101 | flow = 0; | ||
102 | break; | ||
97 | case IOLayerBase::Software: | 103 | case IOLayerBase::Software: |
98 | flow = 1; | 104 | flow = 2; |
99 | break; | 105 | break; |
100 | case IOLayerBase::Hardware: | 106 | case IOLayerBase::Hardware: |
101 | flow = 0; | 107 | flow = 1; |
102 | break; | 108 | break; |
103 | } | 109 | } |
104 | 110 | ||
105 | switch( m_base->parity() ) { | 111 | switch( m_base->parity() ) { |
106 | case IOLayerBase::Odd: | 112 | case IOLayerBase::Odd: |
107 | parity = 2; | 113 | parity = 2; |
108 | break; | 114 | break; |
109 | case IOLayerBase::Even: | 115 | case IOLayerBase::Even: |
110 | parity = 1; | 116 | parity = 1; |
111 | break; | 117 | break; |
112 | } | 118 | } |
113 | 119 | ||