summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp41
-rw-r--r--noncore/apps/opie-console/btconfigwidget.h6
-rw-r--r--noncore/apps/opie-console/io_bt.cpp14
-rw-r--r--noncore/apps/opie-console/io_serial.cpp1
4 files changed, 57 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index 7673d0b..6246f92 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -4,2 +4,4 @@
#include <qcombobox.h>
+#include <qhbox.h>
+#include <qradiobutton.h>
@@ -28,4 +30,8 @@ BTConfigWidget::BTConfigWidget( const QString& name,
m_lay = new QVBoxLayout(this );
+
m_device = new QLabel(tr("Device"), this );
- m_deviceCmb = new QComboBox(this );
+ QHBox *deviceBox = new QHBox( this );
+ m_devRadio = new QRadioButton( deviceBox );
+ connect( m_devRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotDevRadio( bool ) ) );
+ m_deviceCmb = new QComboBox( deviceBox );
m_deviceCmb->setEditable( TRUE );
@@ -33,4 +39,7 @@ BTConfigWidget::BTConfigWidget( const QString& name,
QLabel *macLabel = new QLabel( this );
- macLabel->setText( tr("Enter peer mac address here:") );
- m_mac = new QLineEdit( this );
+ macLabel->setText( tr( "Or peer mac address" ) );
+ QHBox *macBox = new QHBox( this );
+ m_macRadio = new QRadioButton( macBox );
+ connect( m_macRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotMacRadio( bool ) ) );
+ m_mac = new QLineEdit( macBox );
@@ -39,5 +48,5 @@ BTConfigWidget::BTConfigWidget( const QString& name,
m_lay->addWidget( m_device );
- m_lay->addWidget( m_deviceCmb );
+ m_lay->addWidget( deviceBox );
m_lay->addWidget( macLabel );
- m_lay->addWidget( m_mac );
+ m_lay->addWidget( macBox );
m_lay->addWidget( m_base );
@@ -59,2 +68,4 @@ void BTConfigWidget::load( const Profile& prof ) {
m_mac->setText( mac );
+ } else {
+ m_devRadio->setChecked( true );
}
@@ -157 +168,21 @@ void BTConfigWidget::save( Profile& prof ) {
}
+
+void BTConfigWidget::slotMacRadio( bool on ) {
+ if ( on ) {
+ m_devRadio->setChecked( false );
+ m_deviceCmb->setEnabled( false );
+ m_mac->setEnabled( true );
+ } else {
+ m_devRadio->setChecked( true );
+ }
+}
+
+void BTConfigWidget::slotDevRadio( bool on ) {
+ if ( on ) {
+ m_macRadio->setChecked( false );
+ m_deviceCmb->setEnabled( true );
+ m_mac->setEnabled( false );
+ } else {
+ m_macRadio->setChecked( true );
+ }
+}
diff --git a/noncore/apps/opie-console/btconfigwidget.h b/noncore/apps/opie-console/btconfigwidget.h
index ceb13ee..d60d8a2 100644
--- a/noncore/apps/opie-console/btconfigwidget.h
+++ b/noncore/apps/opie-console/btconfigwidget.h
@@ -9,2 +9,3 @@ class QComboBox;
class QLineEdit;
+class QRadioButton;
class IOLayerBase;
@@ -26,3 +27,8 @@ private:
QLineEdit* m_mac;
+ QRadioButton *m_macRadio;
+ QRadioButton *m_devRadio;
+private slots:
+ void slotMacRadio( bool on );
+ void slotDevRadio( bool on );
};
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 0831faf..d71aacc 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -19,3 +19,6 @@ void IOBt::close() {
// still need error handling
+ if ( m_attach ) {
delete m_attach;
+ m_attach = 0;
+ }
}
@@ -24,2 +27,7 @@ bool IOBt::open() {
+ // only set up bt stuff if mac address was set, otherwise use the device set
+ if ( !m_mac.isEmpty() ) {
+
+ // now it should also be checked, if there is a connection to the device with that mac allready
+
// hciattach here
@@ -40,2 +48,8 @@ bool IOBt::open() {
}
+ } else {
+ // directly to the normal serial
+ // TODO: look first if the connection really exists. ( is set up )
+
+ IOSerial::open();
+ }
}
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index cc63c58..e6d1688 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -1 +1,2 @@
+
#include <fcntl.h>