author | wimpie <wimpie> | 2005-01-12 01:55:32 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-12 01:55:32 (UTC) |
commit | c48160f6ac67b2f2fc4b6f982b641861ad078237 (patch) (side-by-side diff) | |
tree | 2922ac7b627091ef32f36d4e8b32630c255b00e1 /noncore/settings/networksettings2/networksettings.cpp | |
parent | f9a83585111afa08a47176097a150d9f468bfcdf (diff) | |
download | opie-c48160f6ac67b2f2fc4b6f982b641861ad078237.zip opie-c48160f6ac67b2f2fc4b6f982b641861ad078237.tar.gz opie-c48160f6ac67b2f2fc4b6f982b641861ad078237.tar.bz2 |
Fixed problem with enabling profile from edit environment
rename disable to enable (much more clear)
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index 2714dd5..469cec5 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp @@ -193,101 +193,103 @@ void NetworkSettings::SLOT_DeleteNode( void ) { NSResources->removeNetworkSetup( LBI->text() ); delete LBI; NSD.setModified( 1 ); } } void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { QString OldName = ""; EditNetworkSetup EC( this ); if( LBI ) { NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); if( ! NC ) { return; } OldName = NC->name(); EC.setNetworkSetup( NC ); } EC.showMaximized(); // disable refresh timer UpdateTimer->stop(); // we need to retry while( 1 ) { if( EC.exec() == QDialog::Accepted ) { // toplevel item -> store NetworkSetup * NC = EC.networkSetup(); if( NC->isModified() ) { if( LBI ) { if( NC->name() != OldName ) { // find if new name is free NetworkSetup * LCN = NSResources->findNetworkSetup( NC->name() ); if( LCN ) { QMessageBox::warning( 0, tr( "In System Config" ), tr( "Name %1 already exists" ).arg(NC->name()) ); continue; // restart exec } // else new name // new name -> remove item NSResources->removeNetworkSetup( OldName ); NSResources->addNetworkSetup( NC, 0 ); } // else not changed - // must add it here since change will trigger event + // no update (will come later) + Profiles_LB->blockSignals( TRUE ); Profiles_LB->changeItem( NC->devicePixmap(), NC->name(), Profiles_LB->index( LBI ) ); + Profiles_LB->blockSignals( FALSE ); } else { // new item int ci = Profiles_LB->count(); NSResources->addNetworkSetup( NC, 0 ); NC->setNumber( NSResources->assignNetworkSetupNumber() ); Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); Profiles_LB->setSelected( ci, TRUE ); } SLOT_RefreshStates(); } } else { // cancelled : reset NetworkSetup if( LBI ) { NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); NC->reassign(); } } break; } // reenable UpdateTimer->start( 5000 ); } void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { if( LBI == 0 ) return; NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); if( NC->description().isEmpty() ) { Description_LBL->setText( tr( "<<No description>>" ) ); } else { Description_LBL->setText( NC->description() ); } Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() ); bool FrmActive = 1; bool IsEnabled = 1; int leds = 0; switch( NC->state() ) { case Disabled : // no further work IsEnabled = 0; FrmActive = 0; break; case Unknown : case Unchecked : |