summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/modemconfigwidget.cpp
authorharlekin <harlekin>2002-10-13 21:10:15 (UTC)
committer harlekin <harlekin>2002-10-13 21:10:15 (UTC)
commit5a6ecdac2e62708b55300ca6eef8441fea0a7b05 (patch) (unidiff)
tree003577346dc8f9c73f1d86d8dd9d5038d6995662 /noncore/apps/opie-console/modemconfigwidget.cpp
parent03c81e6d55d1a837e543a00f6e0a7334e96f1eef (diff)
downloadopie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.zip
opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.gz
opie-5a6ecdac2e62708b55300ca6eef8441fea0a7b05.tar.bz2
fixes to modem stuff
Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 0968f62..ac62e45 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -2,15 +2,14 @@
2#include <qlayout.h> 2#include <qlayout.h>
3#include <qcombobox.h> 3#include <qcombobox.h>
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qpushbutton.h> 5#include <qpushbutton.h>
6#include <qhbox.h> 6#include <qhbox.h>
7 7
8#include "iolayerbase.h" 8
9#include "modemconfigwidget.h" 9#include "modemconfigwidget.h"
10#include "atconfigdialog.h"
11#include "dialdialog.h" 10#include "dialdialog.h"
12 11
13namespace { 12namespace {
14 void setCurrent( const QString& str, QComboBox* bo ) { 13 void setCurrent( const QString& str, QComboBox* bo ) {
15 uint b = bo->count(); 14 uint b = bo->count();
16 for (uint i = 0; i < bo->count(); i++ ) { 15 for (uint i = 0; i < bo->count(); i++ ) {
@@ -21,14 +20,13 @@ namespace {
21 } 20 }
22 bo->insertItem( str ); 21 bo->insertItem( str );
23 bo->setCurrentItem( b ); 22 bo->setCurrentItem( b );
24 } 23 }
25} 24}
26 25
27ModemConfigWidget::ModemConfigWidget( const QString& name, 26ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent,
28 QWidget* parent,
29 const char* na ) 27 const char* na )
30 : ProfileDialogConnectionWidget( name, parent, na ) { 28 : ProfileDialogConnectionWidget( name, parent, na ) {
31 29
32 m_lay = new QVBoxLayout(this ); 30 m_lay = new QVBoxLayout(this );
33 m_device = new QLabel(tr("Modem is attached to:"), this ); 31 m_device = new QLabel(tr("Modem is attached to:"), this );
34 m_deviceCmb = new QComboBox(this ); 32 m_deviceCmb = new QComboBox(this );
@@ -57,13 +55,13 @@ ModemConfigWidget::ModemConfigWidget( const QString& name,
57 m_lay->addWidget( m_base ); 55 m_lay->addWidget( m_base );
58 56
59 m_deviceCmb->insertItem( "/dev/ttyS0" ); 57 m_deviceCmb->insertItem( "/dev/ttyS0" );
60 m_deviceCmb->insertItem( "/dev/ttyS1" ); 58 m_deviceCmb->insertItem( "/dev/ttyS1" );
61 m_deviceCmb->insertItem( "/dev/ttyS2" ); 59 m_deviceCmb->insertItem( "/dev/ttyS2" );
62 60
63 61 atConf = new ATConfigDialog( this, "ATConfig", true );
64} 62}
65 63
66ModemConfigWidget::~ModemConfigWidget() { 64ModemConfigWidget::~ModemConfigWidget() {
67 65
68} 66}
69void ModemConfigWidget::load( const Profile& prof ) { 67void ModemConfigWidget::load( const Profile& prof ) {
@@ -107,16 +105,20 @@ void ModemConfigWidget::load( const Profile& prof ) {
107 case 9600: 105 case 9600:
108 default: 106 default:
109 m_base->setSpeed(IOLayerBase::Baud_9600 ); 107 m_base->setSpeed(IOLayerBase::Baud_9600 );
110 break; 108 break;
111 } 109 }
112 110
113 if ( prof.readEntry("Device").isEmpty() ) return; 111 if ( prof.readEntry( "Device" ).isEmpty() ) {
112 return;
113 }
114 setCurrent( prof.readEntry("Device"), m_deviceCmb ); 114 setCurrent( prof.readEntry("Device"), m_deviceCmb );
115 115
116 atConf->readConfig( prof );
116} 117}
118
117/* 119/*
118 * save speed, 120 * save speed,
119 * flow, 121 * flow,
120 * parity 122 * parity
121 */ 123 */
122void ModemConfigWidget::save( Profile& prof ) { 124void ModemConfigWidget::save( Profile& prof ) {
@@ -167,17 +169,16 @@ void ModemConfigWidget::save( Profile& prof ) {
167 prof.writeEntry("Parity", parity); 169 prof.writeEntry("Parity", parity);
168 prof.writeEntry("Speed", speed); 170 prof.writeEntry("Speed", speed);
169 prof.writeEntry("Number", m_telNumber->text() ); 171 prof.writeEntry("Number", m_telNumber->text() );
170} 172}
171 173
172void ModemConfigWidget::slotAT() { 174void ModemConfigWidget::slotAT() {
173 ATConfigDialog conf( this, "ATConfig", true ); 175 // ATConfigDialog conf( this, "ATConfig", true );
174 conf.readConfig(); 176 atConf->showMaximized();
175 conf.showMaximized(); 177 if ( atConf->exec() == QDialog::Accepted ) {
176 if ( conf.exec() == QDialog::Accepted ) { 178 // atConf->writeConfig();
177 conf.writeConfig();
178 } 179 }
179} 180}
180 181
181void ModemConfigWidget::slotDial() { 182void ModemConfigWidget::slotDial() {
182 DialDialog dial( this, "DialConfig", true ); 183 DialDialog dial( this, "DialConfig", true );
183 dial.showMaximized(); 184 dial.showMaximized();