summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/editconnection.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp5
1 files changed, 3 insertions, 2 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 ) {
200 200
201// pass a NetworkSetup NetworkSetup to be edited 201// pass a NetworkSetup NetworkSetup to be edited
202void EditNetworkSetup::setNetworkSetup( NetworkSetup * NC ) { 202void EditNetworkSetup::setNetworkSetup( NetworkSetup * NC ) {
203 ANetNodeInstance * NNI; 203 ANetNodeInstance * NNI;
204 ANetNode * NN; 204 ANetNode * NN;
205 205
206 SelectedNodes = NC; 206 SelectedNodes = NC;
207 Name_LE->setText( NC->name() ); 207 Name_LE->setText( NC->name() );
208 NNI = NC->first(); 208 NNI = NC->first();
209 209
210 // show configure tabl 210 // show configure tabl
211 Tab_TB->setCurrentPage( 1 ); 211 Tab_TB->setCurrentPage( 1 );
212 212
213 // valid colledction 213 // valid colledction
214 Tab_TB->setTabEnabled( Setup_FRM, FALSE ); 214 Tab_TB->setTabEnabled( Setup_FRM, FALSE );
215 Setup_FRM->setEnabled( FALSE ); 215 Setup_FRM->setEnabled( FALSE );
216 216
217 // select items in collection 217 // select items in collection
218 QListViewItem * it = Nodes_LV->firstChild(); 218 QListViewItem * it = Nodes_LV->firstChild();
219 bool Found; 219 bool Found;
220 220
221 TmpIsValid = 0; 221 TmpIsValid = 0;
222 222
223 while ( it ) { 223 while ( it ) {
224 NN = (*Mapping)[it]; 224 NN = (*Mapping)[it];
225 if( NN == 0 ) { 225 if( NN == 0 ) {
226 // this item is a controller -> 226 // this item is a controller ->
227 // has radio items as children -> 227 // has radio items as children ->
228 // find selected one 228 // find selected one
229 it = it->firstChild(); 229 it = it->firstChild();
230 Found = 0; 230 Found = 0;
231 while( it ) { 231 while( it ) {
232 if( NNI && it->text(0) == NNI->nodeClass()->name() ) { 232 if( NNI && it->text(0) == NNI->nodeClass()->name() ) {
233 // this radio is part of the collection 233 // this radio is part of the collection
234 ((QCheckListItem *)it)->setOn( 1 ); 234 ((QCheckListItem *)it)->setOn( 1 );
235 updateGUI( it, NNI->nodeClass() ); 235 updateGUI( it, NNI->nodeClass() );
236 // check its children 236 // check its children
237 Found = 1; 237 Found = 1;
238 it = it->firstChild(); 238 it = it->firstChild();
239 NNI = SelectedNodes->next(); 239 NNI = SelectedNodes->next();
240 // do not bother to check other items 240 // do not bother to check other items
241 break; 241 break;
242 } 242 }
243 it = it->nextSibling(); 243 it = it->nextSibling();
244 } 244 }
245 245
246 if( ! Found ) { 246 if( ! Found ) {
247 // this means that this level is NOT present in collection 247 // this means that this level is NOT present in collection
248 // probably INCOMPATIBEL collection OR Missing plugin 248 // probably INCOMPATIBLE collection OR Missing plugin
249 QString pluginName = NNI ? NNI->nodeClass()->name() : "";
249 QMessageBox::warning( 250 QMessageBox::warning(
250 0, 251 0,
251 tr( "Error presentig NetworkSetup" ), 252 tr( "Error presentig NetworkSetup" ),
252 tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ). 253 tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
253 arg(NNI->nodeClass()->name()) ); 254 arg(pluginName) );
254 return; 255 return;
255 } 256 }
256 257
257 // it now contains selected radio 258 // it now contains selected radio
258 NN = (*Mapping)[it]; 259 NN = (*Mapping)[it];
259 } else { 260 } else {
260 // automatic selection 261 // automatic selection
261 if( NNI == 0 || it->text(0) != NNI->nodeClass()->name() ) { 262 if( NNI == 0 || it->text(0) != NNI->nodeClass()->name() ) {
262 // should exist and be the same 263 // should exist and be the same
263 if( NNI ) { 264 if( NNI ) {
264 QMessageBox::warning( 265 QMessageBox::warning(
265 0, 266 0,
266 tr( "Error presentig NetworkSetup" ), 267 tr( "Error presentig NetworkSetup" ),
267 tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ). 268 tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
268 arg(NNI->nodeClass()->name()) ); 269 arg(NNI->nodeClass()->name()) );
269 } else { 270 } else {
270 QMessageBox::warning( 271 QMessageBox::warning(
271 0, 272 0,
272 tr( "Error presentig NetworkSetup" ), 273 tr( "Error presentig NetworkSetup" ),
273 tr( "<p>Missing NetworkSetup\"<i>%1</i>\"</p>" ). 274 tr( "<p>Missing NetworkSetup\"<i>%1</i>\"</p>" ).
274 arg(it->text(0)) ); 275 arg(it->text(0)) );
275 } 276 }
276 return; 277 return;
277 } 278 }
278 it = it->firstChild(); 279 it = it->firstChild();
279 } 280 }
280 } 281 }
281} 282}
282 283
283// get result of editing (either new OR updated collection 284// get result of editing (either new OR updated collection
284NetworkSetup * EditNetworkSetup::networkSetup( void ) { 285NetworkSetup * EditNetworkSetup::networkSetup( void ) {
285 286
286 if( SelectedNodes == 0 ) { 287 if( SelectedNodes == 0 ) {
287 // new collection 288 // new collection
288 SelectedNodes = new NetworkSetup; 289 SelectedNodes = new NetworkSetup;
289 } 290 }
290 291
291 // clean out old entries 292 // clean out old entries
292 SelectedNodes->clear(); 293 SelectedNodes->clear();
293 294
294 // transfer 295 // transfer
295 for( QListIterator<ANetNodeInstance> it(TmpCollection); 296 for( QListIterator<ANetNodeInstance> it(TmpCollection);
296 it.current(); 297 it.current();
297 ++it ) { 298 ++it ) {
298 SelectedNodes->append( it.current() ); 299 SelectedNodes->append( it.current() );
299 } 300 }
300 301
301 if( TmpCollection.isModified() ) 302 if( TmpCollection.isModified() )