summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/btconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/btconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index 232e497..f2ed558 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -1,35 +1,25 @@
+#include "btconfigwidget.h"
+#include "iolayerbase.h"
+#include "comboboxhelper.h"
+
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qhbox.h>
#include <qradiobutton.h>
-#include "iolayerbase.h"
-#include "btconfigwidget.h"
-namespace {
- void setCurrent( const QString& str, QComboBox* bo ) {
- uint b = bo->count();
- for (int i = 0; i < bo->count(); i++ ) {
- if ( bo->text(i) == str ) {
- bo->setCurrentItem( i );
- return;
- }
- }
- bo->insertItem( str );
- bo->setCurrentItem( b );
- }
-}
+
BTConfigWidget::BTConfigWidget( const QString& name,
QWidget* parent,
const char* na )
: ProfileDialogConnectionWidget( name, parent, na ) {
m_lay = new QVBoxLayout( this );
m_device = new QLabel( tr( "Device" ), this );
QHBox *deviceBox = new QHBox( this );
m_devRadio = new QRadioButton( deviceBox );
connect( m_devRadio, SIGNAL( toggled(bool) ), this, SLOT( slotDevRadio(bool) ) );
@@ -106,25 +96,25 @@ void BTConfigWidget::load( const Profile& prof ) {
m_base->setSpeed( IOLayerBase::Baud_2400 );
break;
case 1200:
m_base->setSpeed( IOLayerBase::Baud_1200 );
break;
case 9600:
default:
m_base->setSpeed(IOLayerBase::Baud_9600 );
break;
}
if ( prof.readEntry("Device").isEmpty() ) return;
- setCurrent( prof.readEntry("Device"), m_deviceCmb );
+ ComboboxHelper::setCurrent( prof.readEntry("Device"), m_deviceCmb );
}
/*
* save speed,
* flow,
* parity
*/
void BTConfigWidget::save( Profile& prof ) {
int flow, parity, speed;
flow = parity = speed = 0;
prof.writeEntry("Device", m_deviceCmb->currentText() );