Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index 9680a96..78b6cce 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp | |||
@@ -100,27 +100,25 @@ NetworkSettings::NetworkSettings( QWidget *parent, | |||
100 | UpdateTimer->start( 5000 ); | 100 | UpdateTimer->start( 5000 ); |
101 | connect( UpdateTimer, SIGNAL( timeout() ), | 101 | connect( UpdateTimer, SIGNAL( timeout() ), |
102 | this, SLOT( SLOT_RefreshStates() ) ); | 102 | this, SLOT( SLOT_RefreshStates() ) ); |
103 | 103 | ||
104 | /* Add QCopChannel */ | 104 | /* Add QCopChannel */ |
105 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), | 105 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), |
106 | this, SLOT(SLOT_QCopMessage(const QCString&,const QByteArray&)) ); | 106 | this, SLOT(SLOT_QCopMessage(const QCString&,const QByteArray&)) ); |
107 | } | 107 | } |
108 | 108 | ||
109 | NetworkSettings::~NetworkSettings() { | 109 | NetworkSettings::~NetworkSettings() { |
110 | QString S; | 110 | QString S; |
111 | 111 | ||
112 | owarn << "Dispose NS" << oendl; | ||
113 | if( NSD.isModified() ) { | 112 | if( NSD.isModified() ) { |
114 | owarn << "Modified" << oendl; | ||
115 | S = NSD.saveSettings(); | 113 | S = NSD.saveSettings(); |
116 | if( ! S.isEmpty() ) { | 114 | if( ! S.isEmpty() ) { |
117 | S.insert( 0, "<p>" ); | 115 | S.insert( 0, "<p>" ); |
118 | S.append( "</p>" ); | 116 | S.append( "</p>" ); |
119 | // problem saving | 117 | // problem saving |
120 | QMessageBox::warning( | 118 | QMessageBox::warning( |
121 | 0, | 119 | 0, |
122 | tr( "Saving setup" ), S ); | 120 | tr( "Saving setup" ), S ); |
123 | } | 121 | } |
124 | 122 | ||
125 | SLOT_GenerateConfig(); | 123 | SLOT_GenerateConfig(); |
126 | NSD.setModified( 0 ); | 124 | NSD.setModified( 0 ); |
@@ -277,30 +275,28 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { | |||
277 | if( NC->description().isEmpty() ) { | 275 | if( NC->description().isEmpty() ) { |
278 | Description_LBL->setText( tr( "<<No description>>" ) ); | 276 | Description_LBL->setText( tr( "<<No description>>" ) ); |
279 | } else { | 277 | } else { |
280 | Description_LBL->setText( NC->description() ); | 278 | Description_LBL->setText( NC->description() ); |
281 | } | 279 | } |
282 | 280 | ||
283 | Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() ); | 281 | Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() ); |
284 | 282 | ||
285 | bool FrmActive = 1; | 283 | bool FrmActive = 1; |
286 | bool IsEnabled = 1; | 284 | bool IsEnabled = 1; |
287 | int leds = 0; | 285 | int leds = 0; |
288 | 286 | ||
289 | owarn << "State " << NC->state() << oendl; | ||
290 | switch( NC->state() ) { | 287 | switch( NC->state() ) { |
291 | case Disabled : // no further work | 288 | case Disabled : // no further work |
292 | IsEnabled = 0; | 289 | IsEnabled = 0; |
293 | FrmActive = 0; | 290 | FrmActive = 0; |
294 | owarn << "LEds " << leds << oendl; | ||
295 | break; | 291 | break; |
296 | case Unknown : | 292 | case Unknown : |
297 | case Unchecked : | 293 | case Unchecked : |
298 | case Unavailable : | 294 | case Unavailable : |
299 | FrmActive = 0; | 295 | FrmActive = 0; |
300 | break; | 296 | break; |
301 | case Off : | 297 | case Off : |
302 | leds = 1; | 298 | leds = 1; |
303 | break; | 299 | break; |
304 | case Available : | 300 | case Available : |
305 | leds = 2; | 301 | leds = 2; |
306 | break; | 302 | break; |
@@ -350,25 +346,25 @@ void NetworkSettings::SLOT_GenerateConfig( void ) { | |||
350 | } | 346 | } |
351 | } | 347 | } |
352 | 348 | ||
353 | void NetworkSettings::SLOT_Disable( bool T ) { | 349 | void NetworkSettings::SLOT_Disable( bool T ) { |
354 | QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); | 350 | QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); |
355 | QString Msg; | 351 | QString Msg; |
356 | 352 | ||
357 | if ( ! LBI ) | 353 | if ( ! LBI ) |
358 | return; | 354 | return; |
359 | 355 | ||
360 | NodeCollection * NC = NSResources->findConnection( LBI->text() ); | 356 | NodeCollection * NC = NSResources->findConnection( LBI->text() ); |
361 | 357 | ||
362 | owarn << "Prepare to disable" << oendl; | 358 | Log(( "Prepare to %sable\n", (T) ? "en" : "dis" )); |
363 | Msg = NC->setState( (T) ? Disable : Enable ); | 359 | Msg = NC->setState( (T) ? Disable : Enable ); |
364 | if( ! Msg.isEmpty() ) { | 360 | if( ! Msg.isEmpty() ) { |
365 | Msg.insert( 0, "<p>" ); | 361 | Msg.insert( 0, "<p>" ); |
366 | Msg.append( "</p>" ); | 362 | Msg.append( "</p>" ); |
367 | QMessageBox::warning( | 363 | QMessageBox::warning( |
368 | 0, | 364 | 0, |
369 | tr( "Activating profile" ), | 365 | tr( "Activating profile" ), |
370 | Msg ); | 366 | Msg ); |
371 | return; | 367 | return; |
372 | } | 368 | } |
373 | 369 | ||
374 | // reload new state | 370 | // reload new state |