3 files changed, 26 insertions, 4 deletions
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogbase.ui b/noncore/net/opietooth/manager/rfcommassigndialogbase.ui index ac574a7..04bda8f 100644 --- a/noncore/net/opietooth/manager/rfcommassigndialogbase.ui +++ b/noncore/net/opietooth/manager/rfcommassigndialogbase.ui @@ -1,44 +1,64 @@ <!DOCTYPE UI><UI> <class>RfcommAssignDialogBase</class> <widget> <class>QDialog</class> <property stdset="1"> <name>name</name> <cstring>RfcommAssignDialogBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>289</width> + <width>361</width> <height>343</height> </rect> </property> <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> <name>caption</name> <string>Rfcomm Bind</string> </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> <vbox> <property stdset="1"> <name>margin</name> - <number>11</number> + <number>4</number> </property> <property stdset="1"> <name>spacing</name> - <number>6</number> + <number>4</number> </property> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1</cstring> </property> <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> <name>text</name> <string>Bind device to a interface</string> </property> </widget> </vbox> </widget> </UI> diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp index 3fe2ea6..be720b8 100644 --- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp +++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp @@ -15,96 +15,98 @@ using namespace Opie::Core; using namespace OpieTooth; // TODO: write only the file in bluebase? // muss rfcommd dann neu gestartet werden // sollte rfcomm bind all nicht eh default config sein ( polled das? - d.h. sobald nen gerät in der nähe ist bindet es? RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : RfcommAssignDialogBase( parent, name, modal, fl ) { m_range = 5; m_scrollView = new QScrollView( this ); m_scrollView->setResizePolicy( QScrollView::AutoOneFit ); m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff ); RfcommAssignDialogBaseLayout->addWidget( m_scrollView ); m_box = new QVBox( m_scrollView->viewport() ); m_scrollView->addChild( m_box ); confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" ); loadConfig(); } RfcommAssignDialog::~RfcommAssignDialog() { if ( confHandler ) { delete confHandler; } } void RfcommAssignDialog::newDevice( const QString & mac ) { for ( int i = 0 ; i < m_range; i++ ) { QMap<QString, RfCommConfObject*>::Iterator it; it = confHandler->foundEntries().find( QString("%1").arg( i ) ); // make sure that rfcommX is not assigned yet if ( it == confHandler->foundEntries().end() ) { QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); + dialog.setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, + (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth())); RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); newDev->setIdent( i ); newDev->setMac( mac ); if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) { RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); m_itemList.insert( i , rfcomm ); rfcomm->setIdent( i ); rfcomm->setMac( mac ); rfcomm->setChannel( newDev->channel() ); rfcomm->setComment( newDev->comment() ); odebug << "New device set up" << oendl; } } } } void RfcommAssignDialog::loadConfig() { //Config cfg( "bluetoothmanager-rfcommbind" ); for ( int i = 0 ; i < m_range; i++ ) { // cfg.setGroup( QString("%1").arg( i ) ); RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); m_itemList.insert( i , rfcomm ); rfcomm->setIdent( i ); QMap<QString, RfCommConfObject*>::Iterator it; it = confHandler->foundEntries().find( QString("%1").arg( i ) ); if ( it != confHandler->foundEntries().end() ) { odebug << "Found key in foundEntries() " << oendl; rfcomm->setMac( it.data()->mac() ); rfcomm->setChannel( it.data()->channel() ); rfcomm->setComment( it.data()->comment() ); } /* Use rfcomm.conf directly for now * rfcomm->setMac( cfg.readEntry( "mac", "" ) ); * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) ); * rfcomm->setComment( cfg.readEntry( "comment", "" ) ); */ } } diff --git a/noncore/net/opietooth/manager/rfcommdialogitembase.ui b/noncore/net/opietooth/manager/rfcommdialogitembase.ui index f9817df..dd8f121 100644 --- a/noncore/net/opietooth/manager/rfcommdialogitembase.ui +++ b/noncore/net/opietooth/manager/rfcommdialogitembase.ui @@ -1,62 +1,62 @@ <!DOCTYPE UI><UI> <class>RfcommDialogItemBase</class> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>RfcommDialogItemBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>289</width> + <width>239</width> <height>95</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Form2</string> </property> <vbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>0</number> </property> <widget> <class>QGroupBox</class> <property stdset="1"> <name>name</name> <cstring>m_identLabel</cstring> </property> <property stdset="1"> <name>title</name> <string></string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <grid> <property stdset="1"> <name>margin</name> <number>5</number> </property> <property stdset="1"> <name>spacing</name> <number>5</number> </property> <widget row="0" column="0" > <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout3</cstring> </property> <hbox> |