summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/modemconfigwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index b2f5c68..eb4bd0d 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -1,34 +1,20 @@
1#include "modemconfigwidget.h" 1#include "modemconfigwidget.h"
2#include "dialdialog.h" 2#include "dialdialog.h"
3#include "comboboxhelper.h"
3 4
4/* OPIE */ 5/* OPIE */
5#include <opie2/odebug.h>
6#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7using namespace Opie::Core;
8 7
9/* QT */ 8/* QT */
10#include <qlabel.h> 9#include <qlabel.h>
11#include <qlayout.h> 10#include <qlayout.h>
12#include <qcombobox.h> 11#include <qcombobox.h>
13#include <qpushbutton.h> 12#include <qpushbutton.h>
14#include <qhbox.h> 13#include <qhbox.h>
15 14
16namespace {
17 void setCurrent( const QString& str, QComboBox* bo ) {
18 uint b = bo->count();
19 for (int i = 0; i < bo->count(); i++ ) {
20 if ( bo->text(i) == str ) {
21 bo->setCurrentItem( i );
22 return;
23 }
24 }
25 bo->insertItem( str );
26 bo->setCurrentItem( b );
27 }
28}
29 15
30ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, 16ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent,
31 const char* na ) 17 const char* na )
32 : ProfileDialogConnectionWidget( name, parent, na ) { 18 : ProfileDialogConnectionWidget( name, parent, na ) {
33 19
34 m_lay = new QVBoxLayout( this ); 20 m_lay = new QVBoxLayout( this );
@@ -143,16 +129,15 @@ void ModemConfigWidget::load( const Profile& prof ) {
143 m_base->setStop( IOLayerBase::Stop_One ); 129 m_base->setStop( IOLayerBase::Stop_One );
144 } 130 }
145 131
146 132
147 atConf->readConfig( prof ); 133 atConf->readConfig( prof );
148 if ( prof.readEntry( "Device" ).isEmpty() ) { 134 if ( prof.readEntry( "Device" ).isEmpty() ) {
149 owarn << "device empty!" << oendl;
150 return; 135 return;
151 } 136 }
152 setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); 137 ComboboxHelper::setCurrent( prof.readEntry( "Device" ), m_deviceCmb );
153 138
154 139
155} 140}
156 141
157/* 142/*
158 * save speed, 143 * save speed,