Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 4 |
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, | |||
52 | Profiles_LB->setSelected( 0, TRUE ); | 52 | Profiles_LB->setSelected( 0, TRUE ); |
53 | } | 53 | } |
54 | 54 | ||
55 | // if no profiles -> auto popup editing | 55 | // if no profiles -> auto popup editing |
56 | if( NSResources->connections().count() == 0 ) { | 56 | if( NSResources->connections().count() == 0 ) { |
57 | QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); | 57 | QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); |
58 | } | 58 | } |
59 | 59 | ||
60 | UpdateTimer->start( 5000 ); | 60 | UpdateTimer->start( 5000 ); |
61 | connect( UpdateTimer, SIGNAL( timeout() ), | 61 | connect( UpdateTimer, SIGNAL( timeout() ), |
62 | this, SLOT( SLOT_RefreshStates() ) ); | 62 | this, SLOT( SLOT_RefreshStates() ) ); |
63 | 63 | ||
64 | /* Add QCopChannel */ | 64 | /* Add QCopChannel */ |
65 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), | 65 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), |
66 | this, SLOT(SLOT_QCopMessage(const QCString&,const QByteArray&)) ); | 66 | this, SLOT(SLOT_QCopMessage(const QCString&,const QByteArray&)) ); |
67 | } | 67 | } |
68 | 68 | ||
69 | NetworkSettings::~NetworkSettings() { | 69 | NetworkSettings::~NetworkSettings() { |
70 | QString S; | 70 | QString S; |
71 | 71 | ||
72 | S = NSD.generateSettings(); | 72 | S = NSD.generateSettings(); |
73 | if( ! S.isEmpty() ) { | 73 | if( ! S.isEmpty() ) { |
74 | QMessageBox::warning( | 74 | QMessageBox::warning( |
75 | 0, | 75 | 0, |
76 | tr( "Generating system configuration" ), | 76 | tr( "In System Config" ), |
77 | S | 77 | S |
78 | ); | 78 | ); |
79 | } | 79 | } |
80 | 80 | ||
81 | S = NSD.saveSettings(); | 81 | S = NSD.saveSettings(); |
82 | if( ! S.isEmpty() ) { | 82 | if( ! S.isEmpty() ) { |
83 | // problem saving | 83 | // problem saving |
84 | QMessageBox::warning( | 84 | QMessageBox::warning( |
85 | 0, | 85 | 0, |
86 | tr( "Saving setup" ), S ); | 86 | tr( "Saving setup" ), S ); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | void NetworkSettings::SLOT_RefreshStates( void ) { | 90 | void NetworkSettings::SLOT_RefreshStates( void ) { |
91 | QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember | 91 | QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember |
92 | 92 | ||
93 | if( LBI ) { | 93 | if( LBI ) { |
94 | NodeCollection * NC; | 94 | NodeCollection * NC; |
95 | NSResources->system().probeInterfaces(); | 95 | NSResources->system().probeInterfaces(); |
96 | // update current selection only | 96 | // update current selection only |
97 | NC = NSResources->findConnection( LBI->text() ); | 97 | NC = NSResources->findConnection( LBI->text() ); |
98 | if( NC ) { | 98 | if( NC ) { |
99 | State_t OldS = NC->state(); | 99 | State_t OldS = NC->state(); |
100 | State_t NewS = NC->state(1); | 100 | State_t NewS = NC->state(1); |
@@ -162,49 +162,49 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { | |||
162 | return; | 162 | return; |
163 | } | 163 | } |
164 | OldName = NC->name(); | 164 | OldName = NC->name(); |
165 | EC.setConnection( NC ); | 165 | EC.setConnection( NC ); |
166 | } | 166 | } |
167 | 167 | ||
168 | EC.showMaximized(); | 168 | EC.showMaximized(); |
169 | // disable refresh timer | 169 | // disable refresh timer |
170 | UpdateTimer->stop(); | 170 | UpdateTimer->stop(); |
171 | // we need to retry | 171 | // we need to retry |
172 | while( 1 ) { | 172 | while( 1 ) { |
173 | if( EC.exec() == QDialog::Accepted ) { | 173 | if( EC.exec() == QDialog::Accepted ) { |
174 | // toplevel item -> store | 174 | // toplevel item -> store |
175 | NodeCollection * NC = EC.connection(); | 175 | NodeCollection * NC = EC.connection(); |
176 | if( NC->isModified() ) { | 176 | if( NC->isModified() ) { |
177 | setModified( 1 ); | 177 | setModified( 1 ); |
178 | if( LBI ) { | 178 | if( LBI ) { |
179 | if( NC->name() != OldName ) { | 179 | if( NC->name() != OldName ) { |
180 | // find if new name is free | 180 | // find if new name is free |
181 | NodeCollection * LCN = NSResources->findConnection( | 181 | NodeCollection * LCN = NSResources->findConnection( |
182 | NC->name() ); | 182 | NC->name() ); |
183 | if( LCN ) { | 183 | if( LCN ) { |
184 | QMessageBox::warning( | 184 | QMessageBox::warning( |
185 | 0, | 185 | 0, |
186 | tr( "Generating system configuration" ), | 186 | tr( "In System Config" ), |
187 | tr( "Name %1 already exists" ).arg(NC->name()) | 187 | tr( "Name %1 already exists" ).arg(NC->name()) |
188 | ); | 188 | ); |
189 | continue; // restart exec | 189 | continue; // restart exec |
190 | } // else new name | 190 | } // else new name |
191 | // new name -> remove item | 191 | // new name -> remove item |
192 | NSResources->removeConnection( OldName ); | 192 | NSResources->removeConnection( OldName ); |
193 | NSResources->addConnection( NC ); | 193 | NSResources->addConnection( NC ); |
194 | } // else not changed | 194 | } // else not changed |
195 | 195 | ||
196 | // must add it here since change will trigger event | 196 | // must add it here since change will trigger event |
197 | Profiles_LB->changeItem( NC->devicePixmap(), | 197 | Profiles_LB->changeItem( NC->devicePixmap(), |
198 | NC->name(), | 198 | NC->name(), |
199 | Profiles_LB->index( LBI ) | 199 | Profiles_LB->index( LBI ) |
200 | ); | 200 | ); |
201 | } else { | 201 | } else { |
202 | // new item | 202 | // new item |
203 | int ci = Profiles_LB->count(); | 203 | int ci = Profiles_LB->count(); |
204 | NSResources->addConnection( NC ); | 204 | NSResources->addConnection( NC ); |
205 | NC->setNumber( NC->maxConnectionNumber()+1 ); | 205 | NC->setNumber( NC->maxConnectionNumber()+1 ); |
206 | Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); | 206 | Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); |
207 | Profiles_LB->setSelected( ci, TRUE ); | 207 | Profiles_LB->setSelected( ci, TRUE ); |
208 | } | 208 | } |
209 | updateProfileState( LBI ); | 209 | updateProfileState( LBI ); |
210 | } | 210 | } |