Diffstat (limited to 'noncore/settings/networksettings2/networksettings2') (more/less context) (ignore whitespace changes)
7 files changed, 127 insertions, 115 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/asconnection.h b/noncore/settings/networksettings2/networksettings2/asconnection.h index 1ed7e74..eeb0939 100644 --- a/noncore/settings/networksettings2/networksettings2/asconnection.h +++ b/noncore/settings/networksettings2/networksettings2/asconnection.h | |||
@@ -4,12 +4,12 @@ | |||
4 | #include <resources.h> | 4 | #include <resources.h> |
5 | 5 | ||
6 | // pure virtual (component oriented) interface of any | 6 | // pure virtual (component oriented) interface of any |
7 | // plugin that offers a connection | 7 | // plugin that offers a networkSetup |
8 | class AsConnection : public RuntimeInfo { | 8 | class AsNetworkSetup : public RuntimeInfo { |
9 | 9 | ||
10 | public : | 10 | public : |
11 | 11 | ||
12 | AsConnection( ANetNodeInstance * NNI ) : | 12 | AsNetworkSetup( ANetNodeInstance * NNI ) : |
13 | RuntimeInfo( NNI ) { | 13 | RuntimeInfo( NNI ) { |
14 | } | 14 | } |
15 | 15 | ||
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp index f00e0b3..0ab0e5b 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.cpp +++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp | |||
@@ -125,7 +125,7 @@ void ANetNodeInstance::saveAttributes( QTextStream & TS ) { | |||
125 | } | 125 | } |
126 | 126 | ||
127 | ANetNodeInstance * ANetNodeInstance::nextNode( void ) { | 127 | ANetNodeInstance * ANetNodeInstance::nextNode( void ) { |
128 | return connection()->findNext( this ); | 128 | return networkSetup()->findNext( this ); |
129 | } | 129 | } |
130 | 130 | ||
131 | // | 131 | // |
@@ -134,7 +134,7 @@ ANetNodeInstance * ANetNodeInstance::nextNode( void ) { | |||
134 | // | 134 | // |
135 | // | 135 | // |
136 | 136 | ||
137 | NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() { | 137 | NetworkSetup::NetworkSetup( void ) : QList<ANetNodeInstance>() { |
138 | IsModified = 0; | 138 | IsModified = 0; |
139 | Index = -1; | 139 | Index = -1; |
140 | Name=""; | 140 | Name=""; |
@@ -145,7 +145,7 @@ NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() { | |||
145 | Done = 0; | 145 | Done = 0; |
146 | } | 146 | } |
147 | 147 | ||
148 | NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) : | 148 | NetworkSetup::NetworkSetup( QTextStream & TS, bool & Dangling ) : |
149 | QList<ANetNodeInstance>() { | 149 | QList<ANetNodeInstance>() { |
150 | long idx; | 150 | long idx; |
151 | QString S, A, N; | 151 | QString S, A, N; |
@@ -187,7 +187,7 @@ NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) : | |||
187 | append( NNI ); | 187 | append( NNI ); |
188 | } else { | 188 | } else { |
189 | // could not find a node type -> collection invalid | 189 | // could not find a node type -> collection invalid |
190 | Log(( "Node %s missing -> connection dangling\n", | 190 | Log(( "Node %s missing -> NetworkSetup dangling\n", |
191 | N.latin1() )); | 191 | N.latin1() )); |
192 | // create placeholder for this dangling NNI | 192 | // create placeholder for this dangling NNI |
193 | NNI = new ErrorNNI( N ); | 193 | NNI = new ErrorNNI( N ); |
@@ -200,20 +200,20 @@ NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) : | |||
200 | Name.latin1(), count() )); | 200 | Name.latin1(), count() )); |
201 | } | 201 | } |
202 | 202 | ||
203 | NodeCollection::~NodeCollection( void ) { | 203 | NetworkSetup::~NetworkSetup( void ) { |
204 | } | 204 | } |
205 | 205 | ||
206 | const QString & NodeCollection::description( void ) { | 206 | const QString & NetworkSetup::description( void ) { |
207 | ANetNodeInstance * NNI = getToplevel(); | 207 | ANetNodeInstance * NNI = getToplevel(); |
208 | return (NNI) ? NNI->runtime()->description() : Name; | 208 | return (NNI) ? NNI->runtime()->description() : Name; |
209 | } | 209 | } |
210 | 210 | ||
211 | void NodeCollection::append( ANetNodeInstance * NNI ) { | 211 | void NetworkSetup::append( ANetNodeInstance * NNI ) { |
212 | NNI->setConnection( this ); | 212 | NNI->setNetworkSetup( this ); |
213 | QList<ANetNodeInstance>::append( NNI ); | 213 | QList<ANetNodeInstance>::append( NNI ); |
214 | } | 214 | } |
215 | 215 | ||
216 | void NodeCollection::save( QTextStream & TS ) { | 216 | void NetworkSetup::save( QTextStream & TS ) { |
217 | 217 | ||
218 | TS << "name=" << quote( Name ) << endl; | 218 | TS << "name=" << quote( Name ) << endl; |
219 | TS << "number=" << number() << endl; | 219 | TS << "number=" << number() << endl; |
@@ -228,7 +228,7 @@ void NodeCollection::save( QTextStream & TS ) { | |||
228 | IsNew = 0; | 228 | IsNew = 0; |
229 | } | 229 | } |
230 | 230 | ||
231 | ANetNodeInstance * NodeCollection::getToplevel( void ) { | 231 | ANetNodeInstance * NetworkSetup::getToplevel( void ) { |
232 | ANetNodeInstance * NNI = 0; | 232 | ANetNodeInstance * NNI = 0; |
233 | for( QListIterator<ANetNodeInstance> it(*this); | 233 | for( QListIterator<ANetNodeInstance> it(*this); |
234 | it.current(); | 234 | it.current(); |
@@ -241,7 +241,7 @@ ANetNodeInstance * NodeCollection::getToplevel( void ) { | |||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | ANetNodeInstance * NodeCollection::findByName( const QString & S ) { | 244 | ANetNodeInstance * NetworkSetup::findByName( const QString & S ) { |
245 | ANetNodeInstance * NNI = 0; | 245 | ANetNodeInstance * NNI = 0; |
246 | for( QListIterator<ANetNodeInstance> it(*this); | 246 | for( QListIterator<ANetNodeInstance> it(*this); |
247 | it.current(); | 247 | it.current(); |
@@ -254,7 +254,7 @@ ANetNodeInstance * NodeCollection::findByName( const QString & S ) { | |||
254 | return 0; | 254 | return 0; |
255 | } | 255 | } |
256 | 256 | ||
257 | ANetNodeInstance * NodeCollection::findNext( ANetNodeInstance * NNI ) { | 257 | ANetNodeInstance * NetworkSetup::findNext( ANetNodeInstance * NNI ) { |
258 | ANetNodeInstance * NNNI; | 258 | ANetNodeInstance * NNNI; |
259 | 259 | ||
260 | if( ! NNI ) | 260 | if( ! NNI ) |
@@ -272,7 +272,7 @@ ANetNodeInstance * NodeCollection::findNext( ANetNodeInstance * NNI ) { | |||
272 | return 0; // no more next | 272 | return 0; // no more next |
273 | } | 273 | } |
274 | 274 | ||
275 | int NodeCollection::compareItems( QCollection::Item I1, | 275 | int NetworkSetup::compareItems( QCollection::Item I1, |
276 | QCollection::Item I2 ) { | 276 | QCollection::Item I2 ) { |
277 | ANetNodeInstance * NNI1, * NNI2; | 277 | ANetNodeInstance * NNI1, * NNI2; |
278 | NNI1 = (ANetNodeInstance *)I1; | 278 | NNI1 = (ANetNodeInstance *)I1; |
@@ -290,7 +290,7 @@ static char * State2PixmapTbl[] = { | |||
290 | "connected" // up | 290 | "connected" // up |
291 | }; | 291 | }; |
292 | 292 | ||
293 | QPixmap NodeCollection::devicePixmap( void ) { | 293 | QPixmap NetworkSetup::devicePixmap( void ) { |
294 | QPixmap pm = NSResources->getPixmap( | 294 | QPixmap pm = NSResources->getPixmap( |
295 | getToplevel()->nextNode()->pixmapName()+"-large"); | 295 | getToplevel()->nextNode()->pixmapName()+"-large"); |
296 | 296 | ||
@@ -308,11 +308,11 @@ QPixmap NodeCollection::devicePixmap( void ) { | |||
308 | return pm; | 308 | return pm; |
309 | } | 309 | } |
310 | 310 | ||
311 | QPixmap NodeCollection::statePixmap( State_t S) { | 311 | QPixmap NetworkSetup::statePixmap( State_t S) { |
312 | return NSResources->getPixmap( State2PixmapTbl[S] ); | 312 | return NSResources->getPixmap( State2PixmapTbl[S] ); |
313 | } | 313 | } |
314 | 314 | ||
315 | QString NodeCollection::stateName( State_t S) { | 315 | QString NetworkSetup::stateName( State_t S) { |
316 | switch( S ) { | 316 | switch( S ) { |
317 | case Unknown : | 317 | case Unknown : |
318 | return qApp->translate( "networksettings2", "Unknown"); | 318 | return qApp->translate( "networksettings2", "Unknown"); |
@@ -333,23 +333,23 @@ QString NodeCollection::stateName( State_t S) { | |||
333 | return QString(""); | 333 | return QString(""); |
334 | } | 334 | } |
335 | 335 | ||
336 | void NodeCollection::reassign( void ) { | 336 | void NetworkSetup::reassign( void ) { |
337 | for( QListIterator<ANetNodeInstance> it(*this); | 337 | for( QListIterator<ANetNodeInstance> it(*this); |
338 | it.current(); | 338 | it.current(); |
339 | ++it ) { | 339 | ++it ) { |
340 | it.current()->setConnection( this ); | 340 | it.current()->setNetworkSetup( this ); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
344 | const QStringList & NodeCollection::triggers() { | 344 | const QStringList & NetworkSetup::triggers() { |
345 | return getToplevel()->runtime()->triggers(); | 345 | return getToplevel()->runtime()->triggers(); |
346 | } | 346 | } |
347 | 347 | ||
348 | bool NodeCollection::hasDataForFile( SystemFile & S ) { | 348 | bool NetworkSetup::hasDataForFile( SystemFile & S ) { |
349 | return ( firstWithDataForFile( S ) != 0 ); | 349 | return ( firstWithDataForFile( S ) != 0 ); |
350 | } | 350 | } |
351 | 351 | ||
352 | ANetNodeInstance * NodeCollection::firstWithDataForFile( SystemFile & S ) { | 352 | ANetNodeInstance * NetworkSetup::firstWithDataForFile( SystemFile & S ) { |
353 | for( QListIterator<ANetNodeInstance> it(*this); | 353 | for( QListIterator<ANetNodeInstance> it(*this); |
354 | it.current(); | 354 | it.current(); |
355 | ++it ) { | 355 | ++it ) { |
@@ -360,14 +360,14 @@ ANetNodeInstance * NodeCollection::firstWithDataForFile( SystemFile & S ) { | |||
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
362 | 362 | ||
363 | State_t NodeCollection::state( bool Update ) { | 363 | State_t NetworkSetup::state( bool Update ) { |
364 | State_t NodeState; | 364 | State_t NodeState; |
365 | 365 | ||
366 | if( CurrentState == Unchecked || Update ) { | 366 | if( CurrentState == Unchecked || Update ) { |
367 | // collect states of all nodes until with get the 'higest' | 367 | // collect states of all nodes until with get the 'higest' |
368 | // state possible | 368 | // state possible |
369 | 369 | ||
370 | Log(( "Connection %s state %s\n", | 370 | Log(( "NetworkSetup %s state %s\n", |
371 | Name.latin1(), StateName[CurrentState] )); | 371 | Name.latin1(), StateName[CurrentState] )); |
372 | 372 | ||
373 | CurrentState = Unknown; | 373 | CurrentState = Unknown; |
@@ -395,7 +395,7 @@ State_t NodeCollection::state( bool Update ) { | |||
395 | return CurrentState; | 395 | return CurrentState; |
396 | } | 396 | } |
397 | 397 | ||
398 | QString NodeCollection::setState( Action_t A, bool Force ) { | 398 | QString NetworkSetup::setState( Action_t A, bool Force ) { |
399 | 399 | ||
400 | QString msg; | 400 | QString msg; |
401 | Action_t Actions[10]; | 401 | Action_t Actions[10]; |
@@ -492,13 +492,22 @@ QString NodeCollection::setState( Action_t A, bool Force ) { | |||
492 | return QString(); | 492 | return QString(); |
493 | } | 493 | } |
494 | 494 | ||
495 | void NetworkSetup::copyFrom( const NetworkSetup & N ) { | ||
496 | Number = N.Number; | ||
497 | CurrentState = N.CurrentState; | ||
498 | Name = N.Name; | ||
499 | IsNew = N.IsNew; | ||
500 | Index = N.Index; | ||
501 | AssignedInterface = N.AssignedInterface; | ||
502 | } | ||
503 | |||
495 | // | 504 | // |
496 | // | 505 | // |
497 | // RuntimeInfo | 506 | // RuntimeInfo |
498 | // | 507 | // |
499 | // | 508 | // |
500 | 509 | ||
501 | QString RuntimeInfo::setState( NodeCollection * NC, | 510 | QString RuntimeInfo::setState( NetworkSetup * NC, |
502 | Action_t A, | 511 | Action_t A, |
503 | bool Force ) { | 512 | bool Force ) { |
504 | QString M; | 513 | QString M; |
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h index 151d546..8aebdc0 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.h +++ b/noncore/settings/networksettings2/networksettings2/netnode.h | |||
@@ -15,7 +15,7 @@ | |||
15 | // difference feature interfaces | 15 | // difference feature interfaces |
16 | class AsDevice; | 16 | class AsDevice; |
17 | class AsLine; | 17 | class AsLine; |
18 | class AsConnection; | 18 | class AsNetworkSetup; |
19 | class AsFullSetup; | 19 | class AsFullSetup; |
20 | 20 | ||
21 | // needed for plugin creation function | 21 | // needed for plugin creation function |
@@ -23,7 +23,7 @@ class AsFullSetup; | |||
23 | 23 | ||
24 | class ANetNode; | 24 | class ANetNode; |
25 | class ANetNodeInstance; | 25 | class ANetNodeInstance; |
26 | class NodeCollection; | 26 | class NetworkSetup; |
27 | class QTextStream; | 27 | class QTextStream; |
28 | class RuntimeInfo; | 28 | class RuntimeInfo; |
29 | class InterfaceInfo; | 29 | class InterfaceInfo; |
@@ -39,20 +39,20 @@ typedef enum State { | |||
39 | Unchecked = 0, | 39 | Unchecked = 0, |
40 | // if we cannot determine the state | 40 | // if we cannot determine the state |
41 | Unknown = 1, | 41 | Unknown = 1, |
42 | // if connection cannot be established e.g. because | 42 | // if networkSetup cannot be established e.g. because |
43 | // the hardware is not available | 43 | // the hardware is not available |
44 | Unavailable = 2, | 44 | Unavailable = 2, |
45 | // if the connection cannot be establishec but NOT | 45 | // if the networkSetup cannot be establishec but NOT |
46 | // because it is physically impossible but because | 46 | // because it is physically impossible but because |
47 | // it has been disabled for FUNCTIONAL reasons | 47 | // it has been disabled for FUNCTIONAL reasons |
48 | Disabled = 3, | 48 | Disabled = 3, |
49 | // if connection is available to is currently down | 49 | // if networkSetup is available to is currently down |
50 | // i.e. the corresponding hardware is not activated | 50 | // i.e. the corresponding hardware is not activated |
51 | Off = 4, | 51 | Off = 4, |
52 | // if connection is available to be used (i.e. the | 52 | // if networkSetup is available to be used (i.e. the |
53 | // devices if fully ready to be used | 53 | // devices if fully ready to be used |
54 | Available = 5, | 54 | Available = 5, |
55 | // if connection is being used | 55 | // if networkSetup is being used |
56 | IsUp = 6 | 56 | IsUp = 6 |
57 | } State_t; | 57 | } State_t; |
58 | 58 | ||
@@ -65,9 +65,9 @@ typedef enum Action { | |||
65 | Activate = 2, | 65 | Activate = 2, |
66 | // bring the hardware down -> to off | 66 | // bring the hardware down -> to off |
67 | Deactivate = 3, | 67 | Deactivate = 3, |
68 | // bring the connection up -> to IsUp | 68 | // bring the networkSetup up -> to IsUp |
69 | Up = 4, | 69 | Up = 4, |
70 | // bring the connection down -> to Available | 70 | // bring the networkSetup down -> to Available |
71 | Down = 5 | 71 | Down = 5 |
72 | } Action_t; | 72 | } Action_t; |
73 | 73 | ||
@@ -91,7 +91,7 @@ public: | |||
91 | inline void setDone( int D ) | 91 | inline void setDone( int D ) |
92 | { Done = D; } | 92 | { Done = D; } |
93 | 93 | ||
94 | // does this Node provide a Connection | 94 | // does this Node provide a NetworkSetup |
95 | bool isToplevel( void ); | 95 | bool isToplevel( void ); |
96 | 96 | ||
97 | // set the value of an attribute | 97 | // set the value of an attribute |
@@ -245,10 +245,10 @@ public: | |||
245 | inline const char ** needs( void ) | 245 | inline const char ** needs( void ) |
246 | { return NodeType->needs(); } | 246 | { return NodeType->needs(); } |
247 | 247 | ||
248 | inline void setConnection( NodeCollection * NC ) | 248 | inline void setNetworkSetup( NetworkSetup * NC ) |
249 | { Connection = NC; } | 249 | { TheNetworkSetup = NC; } |
250 | inline NodeCollection * connection( void ) | 250 | inline NetworkSetup * networkSetup( void ) |
251 | { return Connection; } | 251 | { return TheNetworkSetup; } |
252 | 252 | ||
253 | // | 253 | // |
254 | // | 254 | // |
@@ -315,8 +315,8 @@ protected : | |||
315 | virtual void saveSpecificAttribute( QTextStream & ) = 0; | 315 | virtual void saveSpecificAttribute( QTextStream & ) = 0; |
316 | 316 | ||
317 | ANetNode * NodeType; | 317 | ANetNode * NodeType; |
318 | // connection to which this node belongs to | 318 | // networkSetup to which this node belongs to |
319 | NodeCollection * Connection; | 319 | NetworkSetup * TheNetworkSetup; |
320 | QString Description; | 320 | QString Description; |
321 | bool IsModified; | 321 | bool IsModified; |
322 | // true if this nodeinstance was just created (and not | 322 | // true if this nodeinstance was just created (and not |
@@ -378,7 +378,7 @@ public : | |||
378 | 378 | ||
379 | // | 379 | // |
380 | // | 380 | // |
381 | // methods to be overloaded by connection capable | 381 | // methods to be overloaded by networkSetup capable |
382 | // runtimes | 382 | // runtimes |
383 | // | 383 | // |
384 | // | 384 | // |
@@ -475,12 +475,12 @@ public : | |||
475 | inline ANetNodeInstance * netNode() | 475 | inline ANetNodeInstance * netNode() |
476 | { return NNI; } | 476 | { return NNI; } |
477 | 477 | ||
478 | inline NodeCollection * nodeCollection() | 478 | inline NetworkSetup * networkSetup() |
479 | { return NNI->connection(); } | 479 | { return NNI->networkSetup(); } |
480 | 480 | ||
481 | virtual State_t detectState( void ) = 0; | 481 | virtual State_t detectState( void ) = 0; |
482 | // public API to set the state | 482 | // public API to set the state |
483 | virtual QString setState( NodeCollection * NC, | 483 | virtual QString setState( NetworkSetup * NC, |
484 | Action_t A, | 484 | Action_t A, |
485 | bool Force = 0 ); | 485 | bool Force = 0 ); |
486 | 486 | ||
@@ -497,21 +497,24 @@ signals : | |||
497 | protected : | 497 | protected : |
498 | 498 | ||
499 | // set state of this node (private API) | 499 | // set state of this node (private API) |
500 | virtual QString setMyState( NodeCollection * NC, | 500 | virtual QString setMyState( NetworkSetup * NC, |
501 | Action_t A, | 501 | Action_t A, |
502 | bool Force = 0 ) = 0; | 502 | bool Force = 0 ) = 0; |
503 | 503 | ||
504 | // connection this runtime info belongs to | 504 | // networkSetup this runtime info belongs to |
505 | ANetNodeInstance * NNI; | 505 | ANetNodeInstance * NNI; |
506 | }; | 506 | }; |
507 | 507 | ||
508 | class NodeCollection : public QList<ANetNodeInstance> { | 508 | class NetworkSetup : public QList<ANetNodeInstance> { |
509 | 509 | ||
510 | public : | 510 | public : |
511 | 511 | ||
512 | NodeCollection( void ); | 512 | NetworkSetup( void ); |
513 | NodeCollection( QTextStream & TS, bool & Dangling ); | 513 | NetworkSetup( QTextStream & TS, bool & Dangling ); |
514 | ~NodeCollection( void ); | 514 | ~NetworkSetup( void ); |
515 | |||
516 | // copy settings from NC to this | ||
517 | void copyFrom( const NetworkSetup & NC ); | ||
515 | 518 | ||
516 | inline int done( void ) | 519 | inline int done( void ) |
517 | { return Done; } | 520 | { return Done; } |
@@ -543,15 +546,15 @@ public : | |||
543 | 546 | ||
544 | // assign the interface to this device | 547 | // assign the interface to this device |
545 | inline void assignInterface( InterfaceInfo * NI ) { | 548 | inline void assignInterface( InterfaceInfo * NI ) { |
546 | if( NI == 0 ) { | 549 | // cleanup previous |
547 | if( AssignedInterface ) { | ||
548 | AssignedInterface->assignConnection( 0 ); | ||
549 | } | ||
550 | } | ||
551 | AssignedInterface = NI; | ||
552 | if( AssignedInterface ) { | 550 | if( AssignedInterface ) { |
553 | AssignedInterface->assignConnection( this ); | 551 | AssignedInterface->assignToNetworkSetup( 0 ); |
554 | } | 552 | } |
553 | if( NI ) { | ||
554 | // assign new | ||
555 | NI->assignToNetworkSetup( this ); | ||
556 | } | ||
557 | AssignedInterface = NI; | ||
555 | } | 558 | } |
556 | 559 | ||
557 | inline RuntimeInfo * device() { | 560 | inline RuntimeInfo * device() { |
@@ -577,7 +580,7 @@ public : | |||
577 | 580 | ||
578 | void append( ANetNodeInstance * NNI ); | 581 | void append( ANetNodeInstance * NNI ); |
579 | 582 | ||
580 | // makes sure that all items in the connection point to | 583 | // makes sure that all items in the networkSetup point to |
581 | // that connectoin | 584 | // that connectoin |
582 | void reassign( void ); | 585 | void reassign( void ); |
583 | 586 | ||
@@ -619,7 +622,7 @@ private : | |||
619 | 622 | ||
620 | long Number; | 623 | long Number; |
621 | 624 | ||
622 | // state of this connection | 625 | // state of this networkSetup |
623 | State_t CurrentState; | 626 | State_t CurrentState; |
624 | 627 | ||
625 | QString Name; | 628 | QString Name; |
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp index b81dcaa..0e72c25 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.cpp +++ b/noncore/settings/networksettings2/networksettings2/resources.cpp | |||
@@ -25,7 +25,7 @@ | |||
25 | TheNSResources * _NSResources = 0; | 25 | TheNSResources * _NSResources = 0; |
26 | 26 | ||
27 | TheNSResources::TheNSResources( void ) : NodeTypeNameMap(), | 27 | TheNSResources::TheNSResources( void ) : NodeTypeNameMap(), |
28 | ConnectionsMap(), DanglingConnectionsMap() { | 28 | NetworkSetupsMap(), DanglingNetworkSetupsMap() { |
29 | 29 | ||
30 | _NSResources = this; | 30 | _NSResources = this; |
31 | 31 | ||
@@ -80,12 +80,12 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(), | |||
80 | tr( "<p>Devices that can handle IP packets</p>" ) ); | 80 | tr( "<p>Devices that can handle IP packets</p>" ) ); |
81 | addNodeType( "line", tr( "Character device" ), | 81 | addNodeType( "line", tr( "Character device" ), |
82 | tr( "<p>Devices that can handle single bytes</p>" ) ); | 82 | tr( "<p>Devices that can handle single bytes</p>" ) ); |
83 | addNodeType( "connection", tr( "IP Connection" ), | 83 | addNodeType( "NetworkSetup", tr( "IP NetworkSetup" ), |
84 | tr( "<p>Nodes that provide working IP connections</p>" ) ); | 84 | tr( "<p>Nodes that provide working IP NetworkSetups</p>" ) ); |
85 | addNodeType( "fullsetup", tr( "Connection Profile" ), | 85 | addNodeType( "fullsetup", tr( "NetworkSetup Profile" ), |
86 | tr( "<p>Fully configured connection profile</p>" ) ); | 86 | tr( "<p>Fully configured NetworkSetup profile</p>" ) ); |
87 | addNodeType( "GPRS", tr( "Connection to GPRS device" ), | 87 | addNodeType( "GPRS", tr( "NetworkSetup to GPRS device" ), |
88 | tr( "<p>Connection to a GPRS capable device</p>" ) ); | 88 | tr( "<p>NetworkSetup to a GPRS capable device</p>" ) ); |
89 | 89 | ||
90 | // get access to the system | 90 | // get access to the system |
91 | TheSystem = new System(); | 91 | TheSystem = new System(); |
@@ -201,12 +201,12 @@ void TheNSResources::findAvailableNetNodes( void ){ | |||
201 | 201 | ||
202 | } | 202 | } |
203 | 203 | ||
204 | // used to find unique connection number | 204 | // used to find unique NetworkSetup number |
205 | int TheNSResources::assignConnectionNumber( void ) { | 205 | int TheNSResources::assignNetworkSetupNumber( void ) { |
206 | bool found = 1; | 206 | bool found = 1; |
207 | for( int trial = 0; ; trial ++ ) { | 207 | for( int trial = 0; ; trial ++ ) { |
208 | found = 1; | 208 | found = 1; |
209 | for( QDictIterator<NodeCollection> it(ConnectionsMap); | 209 | for( QDictIterator<NetworkSetup> it(NetworkSetupsMap); |
210 | it.current(); | 210 | it.current(); |
211 | ++it ) { | 211 | ++it ) { |
212 | if( it.current()->number() == trial ) { | 212 | if( it.current()->number() == trial ) { |
@@ -245,14 +245,14 @@ const QString & TheNSResources::netNode2Description( const char * s ) { | |||
245 | return NodeTypeDescriptionMap[s]; | 245 | return NodeTypeDescriptionMap[s]; |
246 | } | 246 | } |
247 | 247 | ||
248 | void TheNSResources::addConnection( NodeCollection * NC, bool Dangling ) { | 248 | void TheNSResources::addNetworkSetup( NetworkSetup * NC, bool Dangling ) { |
249 | ANetNodeInstance * NNI; | 249 | ANetNodeInstance * NNI; |
250 | Log(( "Add Connection %s, Dangling %d\n", | 250 | Log(( "Add NetworkSetup %s, Dangling %d\n", |
251 | NC->name().latin1(), Dangling )); | 251 | NC->name().latin1(), Dangling )); |
252 | if( Dangling ) { | 252 | if( Dangling ) { |
253 | DanglingConnectionsMap.insert( NC->name(), NC ); | 253 | DanglingNetworkSetupsMap.insert( NC->name(), NC ); |
254 | } else { | 254 | } else { |
255 | ConnectionsMap.insert( NC->name(), NC ); | 255 | NetworkSetupsMap.insert( NC->name(), NC ); |
256 | } | 256 | } |
257 | 257 | ||
258 | // add (new) nodes to NodeList | 258 | // add (new) nodes to NodeList |
@@ -267,31 +267,31 @@ void TheNSResources::addConnection( NodeCollection * NC, bool Dangling ) { | |||
267 | } | 267 | } |
268 | } | 268 | } |
269 | 269 | ||
270 | void TheNSResources::removeConnection( const QString & N ) { | 270 | void TheNSResources::removeNetworkSetup( const QString & N ) { |
271 | NodeCollection * NC = findConnection( N ); | 271 | NetworkSetup * NC = findNetworkSetup( N ); |
272 | if( ! NC ) | 272 | if( ! NC ) |
273 | return; | 273 | return; |
274 | 274 | ||
275 | // delete netnodes in this connection | 275 | // delete netnodes in this NetworkSetup |
276 | ANetNodeInstance * NNI; | 276 | ANetNodeInstance * NNI; |
277 | for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) { | 277 | for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) { |
278 | removeNodeInstance( NNI->name() ); | 278 | removeNodeInstance( NNI->name() ); |
279 | } | 279 | } |
280 | if( ConnectionsMap.find( N ) ) { | 280 | if( NetworkSetupsMap.find( N ) ) { |
281 | ConnectionsMap.remove( N ); | 281 | NetworkSetupsMap.remove( N ); |
282 | } else { | 282 | } else { |
283 | DanglingConnectionsMap.remove( N ); | 283 | DanglingNetworkSetupsMap.remove( N ); |
284 | } | 284 | } |
285 | 285 | ||
286 | } | 286 | } |
287 | 287 | ||
288 | // dangling connections are filtered out | 288 | // dangling NetworkSetups are filtered out |
289 | NodeCollection * TheNSResources::findConnection( const QString & S ) { | 289 | NetworkSetup * TheNSResources::findNetworkSetup( const QString & S ) { |
290 | return ConnectionsMap[ S ]; | 290 | return NetworkSetupsMap[ S ]; |
291 | } | 291 | } |
292 | 292 | ||
293 | NodeCollection * TheNSResources::getConnection( int nr ) { | 293 | NetworkSetup * TheNSResources::getNetworkSetup( int nr ) { |
294 | for( QDictIterator<NodeCollection> it(ConnectionsMap); | 294 | for( QDictIterator<NetworkSetup> it(NetworkSetupsMap); |
295 | it.current(); | 295 | it.current(); |
296 | ++it ) { | 296 | ++it ) { |
297 | if( it.current()->number() == nr ) { | 297 | if( it.current()->number() == nr ) { |
@@ -301,17 +301,17 @@ NodeCollection * TheNSResources::getConnection( int nr ) { | |||
301 | return 0; | 301 | return 0; |
302 | } | 302 | } |
303 | /* | 303 | /* |
304 | void TheNSResources::renumberConnections( void ) { | 304 | void TheNSResources::renumberNetworkSetups( void ) { |
305 | Name2Connection_t & M = NSResources->connections(); | 305 | Name2NetworkSetup_t & M = NSResources->NetworkSetups(); |
306 | NodeCollection * NC; | 306 | NetworkSetup * NC; |
307 | 307 | ||
308 | // for all connections | 308 | // for all NetworkSetups |
309 | NodeCollection::resetMaxNr(); | 309 | NetworkSetup::resetMaxNr(); |
310 | for( QDictIterator<NodeCollection> it(M); | 310 | for( QDictIterator<NetworkSetup> it(M); |
311 | it.current(); | 311 | it.current(); |
312 | ++it ) { | 312 | ++it ) { |
313 | NC = it.current(); | 313 | NC = it.current(); |
314 | NC->setNumber( NC->maxConnectionNumber()+1 ); | 314 | NC->setNumber( NC->maxNetworkSetupNumber()+1 ); |
315 | NC->setModified( 1 ); | 315 | NC->setModified( 1 ); |
316 | } | 316 | } |
317 | } | 317 | } |
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h index 51c4250..f7393d3 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.h +++ b/noncore/settings/networksettings2/networksettings2/resources.h | |||
@@ -40,7 +40,7 @@ public : | |||
40 | 40 | ||
41 | typedef QDict<ANetNode> Name2NetNode_t; | 41 | typedef QDict<ANetNode> Name2NetNode_t; |
42 | typedef QDict<ANetNodeInstance > Name2Instance_t; | 42 | typedef QDict<ANetNodeInstance > Name2Instance_t; |
43 | typedef QDict<NodeCollection> Name2Connection_t; | 43 | typedef QDict<NetworkSetup> Name2NetworkSetup_t; |
44 | typedef QDict<SystemFile> Name2SystemFile_t; | 44 | typedef QDict<SystemFile> Name2SystemFile_t; |
45 | 45 | ||
46 | class TheNSResources { | 46 | class TheNSResources { |
@@ -56,7 +56,7 @@ public : | |||
56 | System & system() | 56 | System & system() |
57 | { return *TheSystem; } | 57 | { return *TheSystem; } |
58 | 58 | ||
59 | int assignConnectionNumber(void); | 59 | int assignNetworkSetupNumber(void); |
60 | QPixmap getPixmap( const QString & Name ); | 60 | QPixmap getPixmap( const QString & Name ); |
61 | 61 | ||
62 | Name2NetNode_t & netNodes( void ) | 62 | Name2NetNode_t & netNodes( void ) |
@@ -103,14 +103,14 @@ public : | |||
103 | const QString & netNode2Name( const char * Type ); | 103 | const QString & netNode2Name( const char * Type ); |
104 | const QString & netNode2Description( const char * Type ); | 104 | const QString & netNode2Description( const char * Type ); |
105 | 105 | ||
106 | void addConnection( NodeCollection * NC, bool Dangling ); | 106 | void addNetworkSetup( NetworkSetup * NC, bool Dangling ); |
107 | void removeConnection( const QString & N ); | 107 | void removeNetworkSetup( const QString & N ); |
108 | NodeCollection * findConnection( const QString & N ); | 108 | NetworkSetup * findNetworkSetup( const QString & N ); |
109 | NodeCollection * getConnection( int nr ); | 109 | NetworkSetup * getNetworkSetup( int nr ); |
110 | Name2Connection_t & connections( void ) | 110 | Name2NetworkSetup_t & networkSetups( void ) |
111 | { return ConnectionsMap; } | 111 | { return NetworkSetupsMap; } |
112 | Name2Connection_t & danglingConnections( void ) | 112 | Name2NetworkSetup_t & danglingNetworkSetups( void ) |
113 | { return DanglingConnectionsMap; } | 113 | { return DanglingNetworkSetupsMap; } |
114 | 114 | ||
115 | inline bool userKnown( void ) | 115 | inline bool userKnown( void ) |
116 | { return CurrentUser.known(); } | 116 | { return CurrentUser.known(); } |
@@ -126,11 +126,11 @@ private : | |||
126 | 126 | ||
127 | QMap< QString, QString> NodeTypeNameMap; | 127 | QMap< QString, QString> NodeTypeNameMap; |
128 | QMap< QString, QString> NodeTypeDescriptionMap; | 128 | QMap< QString, QString> NodeTypeDescriptionMap; |
129 | // list of connections that are valid | 129 | // list of networkSetups that are valid |
130 | Name2Connection_t ConnectionsMap; | 130 | Name2NetworkSetup_t NetworkSetupsMap; |
131 | // list of connection configurations that are not valid | 131 | // list of networkSetup configurations that are not valid |
132 | // e.g. because plugins are missing | 132 | // e.g. because plugins are missing |
133 | Name2Connection_t DanglingConnectionsMap; | 133 | Name2NetworkSetup_t DanglingNetworkSetupsMap; |
134 | System * TheSystem; | 134 | System * TheSystem; |
135 | Name2SystemFile_t SystemFiles; | 135 | Name2SystemFile_t SystemFiles; |
136 | 136 | ||
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp index a290f08..33cc5bd 100644 --- a/noncore/settings/networksettings2/networksettings2/system.cpp +++ b/noncore/settings/networksettings2/networksettings2/system.cpp | |||
@@ -453,13 +453,13 @@ void System::probeInterfaces( void ) { | |||
453 | 453 | ||
454 | InterfaceInfo * System::findInterface( const QString & N ) { | 454 | InterfaceInfo * System::findInterface( const QString & N ) { |
455 | InterfaceInfo * Run; | 455 | InterfaceInfo * Run; |
456 | // has PAN connection UP interface ? | 456 | // has PAN NetworkSetup UP interface ? |
457 | for( QDictIterator<InterfaceInfo> It(ProbedInterfaces); | 457 | for( QDictIterator<InterfaceInfo> It(ProbedInterfaces); |
458 | It.current(); | 458 | It.current(); |
459 | ++It ) { | 459 | ++It ) { |
460 | Run = It.current(); | 460 | Run = It.current(); |
461 | if( N == Run->Name ) { | 461 | if( N == Run->Name ) { |
462 | // this PAN connection is up | 462 | // this PAN NetworkSetup is up |
463 | return Run; | 463 | return Run; |
464 | } | 464 | } |
465 | } | 465 | } |
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h index ebee0d5..794b868 100644 --- a/noncore/settings/networksettings2/networksettings2/system.h +++ b/noncore/settings/networksettings2/networksettings2/system.h | |||
@@ -13,7 +13,7 @@ using namespace Opie::Core; | |||
13 | #include <qobject.h> | 13 | #include <qobject.h> |
14 | #include <stdio.h> | 14 | #include <stdio.h> |
15 | 15 | ||
16 | class NodeCollection; | 16 | class NetworkSetup; |
17 | class ANetNodeInstance; | 17 | class ANetNodeInstance; |
18 | class QFile; | 18 | class QFile; |
19 | 19 | ||
@@ -66,13 +66,13 @@ public : | |||
66 | DstAddress() { | 66 | DstAddress() { |
67 | } | 67 | } |
68 | 68 | ||
69 | NodeCollection * assignedConnection() | 69 | NetworkSetup * assignedToNetworkSetup() |
70 | { return Collection; } | 70 | { return Collection; } |
71 | 71 | ||
72 | void assignConnection( NodeCollection * NNI ) | 72 | void assignToNetworkSetup( NetworkSetup * NNI ) |
73 | { Collection = NNI; } | 73 | { Collection = NNI; } |
74 | 74 | ||
75 | NodeCollection * Collection; // connection taking care of me | 75 | NetworkSetup * Collection; // networkSetup taking care of me |
76 | QString Name; // name of interface | 76 | QString Name; // name of interface |
77 | int CardType; // type of card | 77 | int CardType; // type of card |
78 | QString MACAddress; // MAC address | 78 | QString MACAddress; // MAC address |