Diffstat (limited to 'noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp index 9a3156b..195dbae 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp @@ -1,2 +1,4 @@ #include <qtopia/qcopenvelope_qws.h> +#include <qlistview.h> +#include <qcheckbox.h> @@ -11,2 +13,7 @@ BluetoothBNEPEdit::BluetoothBNEPEdit( QWidget * Parent ) : BluetoothBNEPGUI( Par QString BluetoothBNEPEdit::acceptable( void ) { + if( ( ! AnyPAN_CB->isChecked() ) && + BTPANServers_LV->firstChild() == 0 ) { + return tr("<p>No bluetooth device addresses specified</p>"); + } + return QString(); @@ -14,3 +21,9 @@ QString BluetoothBNEPEdit::acceptable( void ) { -bool BluetoothBNEPEdit::commit( BluetoothBNEPData & ) { +bool BluetoothBNEPEdit::commit( BluetoothBNEPData & Data ) { + QListViewItem * it = BTPANServers_LV->firstChild(); + Data.BDAddress.clear(); + while( it ) { + Data.BDAddress << it->text(0); + it = it->nextSibling(); + } return 0; @@ -18,3 +31,12 @@ bool BluetoothBNEPEdit::commit( BluetoothBNEPData & ) { -void BluetoothBNEPEdit::showData( BluetoothBNEPData & ) { +void BluetoothBNEPEdit::showData( BluetoothBNEPData & Data ) { + QListViewItem * lvit; + BTPANServers_LV->clear(); + + for ( QStringList::Iterator it = Data.BDAddress.begin(); + it != Data.BDAddress.end(); + ++it ) { + lvit = new QListViewItem(BTPANServers_LV); + lvit->setText( 0, (*it) ); + } } |