summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index c3e6572..3ddcbde 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -52,49 +52,49 @@ NetworkSettings::NetworkSettings( QWidget *parent,
Profiles_LB->setSelected( 0, TRUE );
}
// if no profiles -> auto popup editing
if( NSResources->connections().count() == 0 ) {
QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
}
UpdateTimer->start( 5000 );
connect( UpdateTimer, SIGNAL( timeout() ),
this, SLOT( SLOT_RefreshStates() ) );
/* Add QCopChannel */
connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
this, SLOT(SLOT_QCopMessage(const QCString&,const QByteArray&)) );
}
NetworkSettings::~NetworkSettings() {
QString S;
S = NSD.generateSettings();
if( ! S.isEmpty() ) {
QMessageBox::warning(
0,
- tr( "Generating system configuration" ),
+ tr( "In System Config" ),
S
);
}
S = NSD.saveSettings();
if( ! S.isEmpty() ) {
// problem saving
QMessageBox::warning(
0,
tr( "Saving setup" ), S );
}
}
void NetworkSettings::SLOT_RefreshStates( void ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
if( LBI ) {
NodeCollection * NC;
NSResources->system().probeInterfaces();
// update current selection only
NC = NSResources->findConnection( LBI->text() );
if( NC ) {
State_t OldS = NC->state();
State_t NewS = NC->state(1);
@@ -162,49 +162,49 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
return;
}
OldName = NC->name();
EC.setConnection( NC );
}
EC.showMaximized();
// disable refresh timer
UpdateTimer->stop();
// we need to retry
while( 1 ) {
if( EC.exec() == QDialog::Accepted ) {
// toplevel item -> store
NodeCollection * NC = EC.connection();
if( NC->isModified() ) {
setModified( 1 );
if( LBI ) {
if( NC->name() != OldName ) {
// find if new name is free
NodeCollection * LCN = NSResources->findConnection(
NC->name() );
if( LCN ) {
QMessageBox::warning(
0,
- tr( "Generating system configuration" ),
+ tr( "In System Config" ),
tr( "Name %1 already exists" ).arg(NC->name())
);
continue; // restart exec
} // else new name
// new name -> remove item
NSResources->removeConnection( OldName );
NSResources->addConnection( NC );
} // else not changed
// must add it here since change will trigger event
Profiles_LB->changeItem( NC->devicePixmap(),
NC->name(),
Profiles_LB->index( LBI )
);
} else {
// new item
int ci = Profiles_LB->count();
NSResources->addConnection( NC );
NC->setNumber( NC->maxConnectionNumber()+1 );
Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
Profiles_LB->setSelected( ci, TRUE );
}
updateProfileState( LBI );
}