author | josef <josef> | 2002-10-18 17:14:27 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-18 17:14:27 (UTC) |
commit | 0f230c7120d49a1718fe3e442e1559968a21f00d (patch) (unidiff) | |
tree | b27ddd04c385d6c0eef4a91f010017fb9cfa6598 | |
parent | 12851a09a2761ca6e189f080e9ca69bf4974302f (diff) | |
download | opie-0f230c7120d49a1718fe3e442e1559968a21f00d.zip opie-0f230c7120d49a1718fe3e442e1559968a21f00d.tar.gz opie-0f230c7120d49a1718fe3e442e1559968a21f00d.tar.bz2 |
- save at modem configuration when closing dialog
This is not ideal yet, but better than nothing.
We might actually use the configured values rather than hardcoded defaults now
:)
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 878b0cf..c0ab0fc 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -130,68 +130,71 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
130 | 130 | ||
131 | 131 | ||
132 | switch( m_base->flow() ) { | 132 | switch( m_base->flow() ) { |
133 | case IOLayerBase::None: | 133 | case IOLayerBase::None: |
134 | flow = 0; | 134 | flow = 0; |
135 | break; | 135 | break; |
136 | case IOLayerBase::Software: | 136 | case IOLayerBase::Software: |
137 | flow = 2; | 137 | flow = 2; |
138 | break; | 138 | break; |
139 | case IOLayerBase::Hardware: | 139 | case IOLayerBase::Hardware: |
140 | flow = 1; | 140 | flow = 1; |
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | 143 | ||
144 | switch( m_base->parity() ) { | 144 | switch( m_base->parity() ) { |
145 | case IOLayerBase::Odd: | 145 | case IOLayerBase::Odd: |
146 | parity = 2; | 146 | parity = 2; |
147 | break; | 147 | break; |
148 | case IOLayerBase::Even: | 148 | case IOLayerBase::Even: |
149 | parity = 1; | 149 | parity = 1; |
150 | break; | 150 | break; |
151 | case IOLayerBase::NonePar: | 151 | case IOLayerBase::NonePar: |
152 | parity = 0; | 152 | parity = 0; |
153 | break; | 153 | break; |
154 | } | 154 | } |
155 | 155 | ||
156 | switch( m_base->speed() ) { | 156 | switch( m_base->speed() ) { |
157 | case IOLayerBase::Baud_115200: | 157 | case IOLayerBase::Baud_115200: |
158 | speed = 115200; | 158 | speed = 115200; |
159 | break; | 159 | break; |
160 | case IOLayerBase::Baud_57600: | 160 | case IOLayerBase::Baud_57600: |
161 | speed = 57600; | 161 | speed = 57600; |
162 | break; | 162 | break; |
163 | case IOLayerBase::Baud_38400: | 163 | case IOLayerBase::Baud_38400: |
164 | speed = 38400; | 164 | speed = 38400; |
165 | break; | 165 | break; |
166 | case IOLayerBase::Baud_19200: | 166 | case IOLayerBase::Baud_19200: |
167 | speed = 19200; | 167 | speed = 19200; |
168 | break; | 168 | break; |
169 | case IOLayerBase::Baud_9600: | 169 | case IOLayerBase::Baud_9600: |
170 | speed = 9600; | 170 | speed = 9600; |
171 | break; | 171 | break; |
172 | } | 172 | } |
173 | 173 | ||
174 | prof.writeEntry( "Flow", flow ); | 174 | prof.writeEntry( "Flow", flow ); |
175 | prof.writeEntry( "Parity", parity ); | 175 | prof.writeEntry( "Parity", parity ); |
176 | prof.writeEntry( "Speed", speed ); | 176 | prof.writeEntry( "Speed", speed ); |
177 | prof.writeEntry( "Number", m_telNumber->text() ); | 177 | prof.writeEntry( "Number", m_telNumber->text() ); |
178 | |||
179 | |||
180 | atConf->writeConfig(prof); | ||
178 | } | 181 | } |
179 | 182 | ||
180 | void ModemConfigWidget::slotAT() { | 183 | void ModemConfigWidget::slotAT() { |
181 | // ATConfigDialog conf( this, "ATConfig", true ); | 184 | // ATConfigDialog conf( this, "ATConfig", true ); |
182 | atConf->showMaximized(); | 185 | atConf->showMaximized(); |
183 | if ( atConf->exec() == QDialog::Accepted ) { | 186 | if ( atConf->exec() != QDialog::Accepted ) { |
184 | // atConf->writeConfig(); | 187 | // reload old settings |
185 | } | 188 | } |
186 | } | 189 | } |
187 | 190 | ||
188 | void ModemConfigWidget::slotDial() { | 191 | void ModemConfigWidget::slotDial() { |
189 | DialDialog dial( this, "DialConfig", true ); | 192 | DialDialog dial( this, "DialConfig", true ); |
190 | if(!m_telNumber->text().isEmpty()) { | 193 | if(!m_telNumber->text().isEmpty()) { |
191 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt()); | 194 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt()); |
192 | } | 195 | } |
193 | dial.showMaximized(); | 196 | dial.showMaximized(); |
194 | if ( dial.exec() == QDialog::Accepted ) { | 197 | if ( dial.exec() == QDialog::Accepted ) { |
195 | m_telNumber->setText( dial.number() ); | 198 | m_telNumber->setText( dial.number() ); |
196 | } | 199 | } |
197 | } | 200 | } |