summaryrefslogtreecommitdiff
path: root/noncore/settings
Side-by-side diff
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp5
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index a9bef65..d948fb9 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -200,102 +200,103 @@ NetworkSetup * EditNetworkSetup::getTmpCollection( void ) {
// pass a NetworkSetup NetworkSetup to be edited
void EditNetworkSetup::setNetworkSetup( NetworkSetup * NC ) {
ANetNodeInstance * NNI;
ANetNode * NN;
SelectedNodes = NC;
Name_LE->setText( NC->name() );
NNI = NC->first();
// show configure tabl
Tab_TB->setCurrentPage( 1 );
// valid colledction
Tab_TB->setTabEnabled( Setup_FRM, FALSE );
Setup_FRM->setEnabled( FALSE );
// select items in collection
QListViewItem * it = Nodes_LV->firstChild();
bool Found;
TmpIsValid = 0;
while ( it ) {
NN = (*Mapping)[it];
if( NN == 0 ) {
// this item is a controller ->
// has radio items as children ->
// find selected one
it = it->firstChild();
Found = 0;
while( it ) {
if( NNI && it->text(0) == NNI->nodeClass()->name() ) {
// this radio is part of the collection
((QCheckListItem *)it)->setOn( 1 );
updateGUI( it, NNI->nodeClass() );
// check its children
Found = 1;
it = it->firstChild();
NNI = SelectedNodes->next();
// do not bother to check other items
break;
}
it = it->nextSibling();
}
if( ! Found ) {
// this means that this level is NOT present in collection
- // probably INCOMPATIBEL collection OR Missing plugin
+ // probably INCOMPATIBLE collection OR Missing plugin
+ QString pluginName = NNI ? NNI->nodeClass()->name() : "";
QMessageBox::warning(
0,
tr( "Error presentig NetworkSetup" ),
tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
- arg(NNI->nodeClass()->name()) );
+ arg(pluginName) );
return;
}
// it now contains selected radio
NN = (*Mapping)[it];
} else {
// automatic selection
if( NNI == 0 || it->text(0) != NNI->nodeClass()->name() ) {
// should exist and be the same
if( NNI ) {
QMessageBox::warning(
0,
tr( "Error presentig NetworkSetup" ),
tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
arg(NNI->nodeClass()->name()) );
} else {
QMessageBox::warning(
0,
tr( "Error presentig NetworkSetup" ),
tr( "<p>Missing NetworkSetup\"<i>%1</i>\"</p>" ).
arg(it->text(0)) );
}
return;
}
it = it->firstChild();
}
}
}
// get result of editing (either new OR updated collection
NetworkSetup * EditNetworkSetup::networkSetup( void ) {
if( SelectedNodes == 0 ) {
// new collection
SelectedNodes = new NetworkSetup;
}
// clean out old entries
SelectedNodes->clear();
// transfer
for( QListIterator<ANetNodeInstance> it(TmpCollection);
it.current();
++it ) {
SelectedNodes->append( it.current() );
}
if( TmpCollection.isModified() )
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
index fc30bf8..e23fc9c 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
@@ -399,97 +399,97 @@ OTScan::OTScan( QWidget * parent, OTIcons * _IC ) :
connect( OT,
SIGNAL( finishedDetecting()),
this,
SLOT( SLOT_FinishedDetecting())
);
// populate with peers we already know about
const PeerVector & P = OT->peers();
for( unsigned int i = 0;
i < P.count();
i ++ ) {
SLOT_NewPeer( P[i], TRUE );
}
// populate State fram
{ QHBoxLayout * H =new QHBoxLayout( State_Frm );
Paired_Led = new OLedBox( green, State_Frm );
QLabel * L1 = new QLabel( tr( "Paired" ), State_Frm );
H->addWidget( Paired_Led );
H->addWidget( L1 );
H->addStretch( 1 );
}
}
OTScan::~OTScan() {
if( MyIcons )
delete Icons;
OTGateway::releaseOTGateway();
// send all peers that we do not care about states
QListViewItem * Lit = DetectedPeers_LV->firstChild();
while( Lit ) {
((PeerLVI *)Lit)->peer()->stopFindingOutState( );
Lit = Lit->nextSibling();
}
}
// static scan dialog function
int OTScan::getDevice( OTPeer *& Peer,
int & Channel,
OTGateway * OT,
const UUIDVector & Filter,
QWidget* Parent ) {
bool IsUp = 0;
unsigned int i;
- if( ! OT->isEnabled() ) {
+ if( ! OT || ! OT->isEnabled() ) {
QMessageBox::warning( 0,
tr("Scanning problem"),
tr("Bluetooth not enabled" )
);
return QDialog::Rejected;
}
// check if bluetooth is up
OTDriverList & DL = OT->getDriverList();
for( i = 0;
i < DL.count();
i ++ ) {
if( DL[i]->isUp() ) {
// one device that is up found
IsUp = 1;
break;
}
}
// use this driver
OT->setScanWith( OT->driver(i) );
// create dialog
QDialog * Dlg = new QDialog( Parent, 0, TRUE );
QVBoxLayout * V = new QVBoxLayout( Dlg );
OTScan * Scn = new OTScan( Dlg );
connect( Scn,
SIGNAL( selected() ),
Dlg,
SLOT( accept() )
);
if( Filter ) {
Scn->setScanFilter( Filter );
}
V->addWidget( Scn );
Dlg->setCaption( tr("Scan Neighbourhood" ) );
Dlg->showMaximized();
int rv = Dlg->exec();
if( rv == QDialog::Accepted ) {
// get peer
Peer = Scn->selectedPeer();
if( Peer == 0 ) {
// no peer selected
rv = QDialog::Rejected;