summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp4
-rw-r--r--noncore/settings/networksettings2/profile/profileGUI.ui6
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp8
-rw-r--r--noncore/settings/networksettings2/profile/profiledata.h4
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.cpp4
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp18
6 files changed, 24 insertions, 20 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
@@ -1,510 +1,512 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <unistd.h> 2#include <unistd.h>
3#include <errno.h> 3#include <errno.h>
4 4
5#include <opie2/odebug.h> 5#include <opie2/odebug.h>
6#include <opie2/oledbox.h> 6#include <opie2/oledbox.h>
7 7
8#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
9#include <qlistbox.h> 9#include <qlistbox.h>
10#include <qlayout.h> 10#include <qlayout.h>
11#include <qgroupbox.h> 11#include <qgroupbox.h>
12#include <qtimer.h> 12#include <qtimer.h>
13#include <qlistbox.h> 13#include <qlistbox.h>
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qiconview.h> 16#include <qiconview.h>
17#include <qtimer.h> 17#include <qtimer.h>
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <qtoolbutton.h> 19#include <qtoolbutton.h>
20#include <qevent.h> 20#include <qevent.h>
21 21
22#include "networksettings.h" 22#include "networksettings.h"
23#include "netnode.h" 23#include "netnode.h"
24#include "editconnection.h" 24#include "editconnection.h"
25 25
26NetworkSettings::NetworkSettings( QWidget *parent, 26NetworkSettings::NetworkSettings( QWidget *parent,
27 const char *name, 27 const char *name,
28 WFlags fl ) : NetworkSettingsGUI(parent,name,fl), 28 WFlags fl ) : NetworkSettingsGUI(parent,name,fl),
29 NSD() { 29 NSD() {
30 30
31 UpdateTimer = new QTimer( this ); 31 UpdateTimer = new QTimer( this );
32 32
33 // set pixmaps 33 // set pixmaps
34 Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); 34 Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
35 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) ); 35 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) );
36 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) ); 36 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) );
37 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) ); 37 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) );
38 38
39 Disable_TB->setPixmap( NSResources->getPixmap( "disabled" ) ); 39 Disable_TB->setPixmap( NSResources->getPixmap( "disabled" ) );
40 Up_TB->setPixmap( NSResources->getPixmap( "more" ) ); 40 Up_TB->setPixmap( NSResources->getPixmap( "more" ) );
41 Down_TB->setPixmap( NSResources->getPixmap( "less" ) ); 41 Down_TB->setPixmap( NSResources->getPixmap( "less" ) );
42 42
43 QVBoxLayout* V = new QVBoxLayout( LED_Frm ); 43 QVBoxLayout* V = new QVBoxLayout( LED_Frm );
44 QHBoxLayout * H = new QHBoxLayout( 0 ); 44 QHBoxLayout * H = new QHBoxLayout( 0 );
45 V->addStretch(1); 45 V->addStretch(1);
46 V->addLayout( H ); 46 V->addLayout( H );
47 Leds[0] = new Opie::Ui::OLedBox( red, LED_Frm ); 47 Leds[0] = new Opie::Ui::OLedBox( red, LED_Frm );
48 H->addWidget( Leds[0], 0, Qt::AlignVCenter ); 48 H->addWidget( Leds[0], 0, Qt::AlignVCenter );
49 Leds[1] = new Opie::Ui::OLedBox( red, LED_Frm ); 49 Leds[1] = new Opie::Ui::OLedBox( red, LED_Frm );
50 H->addWidget( Leds[1], 0, Qt::AlignVCenter ); 50 H->addWidget( Leds[1], 0, Qt::AlignVCenter );
51 Leds[2] = new Opie::Ui::OLedBox( red, LED_Frm ); 51 Leds[2] = new Opie::Ui::OLedBox( red, LED_Frm );
52 H->addWidget( Leds[2], 0, Qt::AlignVCenter ); 52 H->addWidget( Leds[2], 0, Qt::AlignVCenter );
53 V->addStretch(1); 53 V->addStretch(1);
54 54
55 55
56 SLOT_ToProfile(); 56 SLOT_ToProfile();
57 57
58 // populate main Listbox 58 // populate main Listbox
59 Profiles_LB->clear(); 59 Profiles_LB->clear();
60 QPEApplication::setStylusOperation( 60 QPEApplication::setStylusOperation(
61 Profiles_LB->viewport(), QPEApplication::RightOnHold ); 61 Profiles_LB->viewport(), QPEApplication::RightOnHold );
62 62
63 connect( Profiles_LB, 63 connect( Profiles_LB,
64 SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), 64 SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)),
65 this, SLOT(SLOT_EditNode(QListBoxItem*)) ); 65 this, SLOT(SLOT_EditNode(QListBoxItem*)) );
66 66
67 { Name2NetworkSetup_t & M = NSResources->networkSetups(); 67 { Name2NetworkSetup_t & M = NSResources->networkSetups();
68 NetworkSetup * NC; 68 NetworkSetup * NC;
69 // for all NetworkSetups 69 // for all NetworkSetups
70 for( QDictIterator<NetworkSetup> it(M); 70 for( QDictIterator<NetworkSetup> it(M);
71 it.current(); 71 it.current();
72 ++it ) { 72 ++it ) {
73 NC = it.current(); 73 NC = it.current();
74 Profiles_LB->insertItem( NC->devicePixmap(), 74 Profiles_LB->insertItem( NC->devicePixmap(),
75 NC->name() ); 75 NC->name() );
76 } 76 }
77 } 77 }
78 78
79 if( Profiles_LB->count() ) { 79 if( Profiles_LB->count() ) {
80 Profiles_LB->setSelected( 0, TRUE ); 80 Profiles_LB->setSelected( 0, TRUE );
81 } 81 }
82 82
83 // if no profiles -> auto popup editing 83 // if no profiles -> auto popup editing
84 if( NSResources->networkSetups().count() == 0 ) { 84 if( NSResources->networkSetups().count() == 0 ) {
85 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); 85 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
86 } 86 }
87 87
88 connect( &(NSResources->system()), 88 connect( &(NSResources->system()),
89 SIGNAL( stdoutLine(const QString &) ), 89 SIGNAL( stdoutLine(const QString &) ),
90 this, SLOT( SLOT_CmdMessage(const QString &) ) ); 90 this, SLOT( SLOT_CmdMessage(const QString &) ) );
91 91
92 connect( &(NSResources->system()), 92 connect( &(NSResources->system()),
93 SIGNAL( stderrLine(const QString &) ), 93 SIGNAL( stderrLine(const QString &) ),
94 this, SLOT( SLOT_CmdMessage(const QString &) ) ); 94 this, SLOT( SLOT_CmdMessage(const QString &) ) );
95 95
96 connect( &(NSResources->system()), 96 connect( &(NSResources->system()),
97 SIGNAL( processEvent(const QString &) ), 97 SIGNAL( processEvent(const QString &) ),
98 this, SLOT( SLOT_CmdMessage(const QString &) ) ); 98 this, SLOT( SLOT_CmdMessage(const QString &) ) );
99 99
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
109NetworkSettings::~NetworkSettings() { 109NetworkSettings::~NetworkSettings() {
110 QString S; 110 QString S;
111 111
112 if( NSD.isModified() ) { 112 if( NSD.isModified() ) {
113 S = NSD.saveSettings(); 113 S = NSD.saveSettings();
114 if( ! S.isEmpty() ) { 114 if( ! S.isEmpty() ) {
115 S.insert( 0, "<p>" ); 115 S.insert( 0, "<p>" );
116 S.append( "</p>" ); 116 S.append( "</p>" );
117 // problem saving 117 // problem saving
118 QMessageBox::warning( 118 QMessageBox::warning(
119 0, 119 0,
120 tr( "Saving setup" ), S ); 120 tr( "Saving setup" ), S );
121 } 121 }
122 122
123 SLOT_GenerateConfig(); 123 SLOT_GenerateConfig();
124 NSD.setModified( 0 ); 124 NSD.setModified( 0 );
125 } 125 }
126 126
127} 127}
128 128
129void NetworkSettings::SLOT_CmdMessage( const QString & S ) { 129void NetworkSettings::SLOT_CmdMessage( const QString & S ) {
130 Messages_LB->insertItem( S ); 130 Messages_LB->insertItem( S );
131 Messages_LB->setCurrentItem( Messages_LB->count()-1 ); 131 Messages_LB->setCurrentItem( Messages_LB->count()-1 );
132 Messages_LB->ensureCurrentVisible(); 132 Messages_LB->ensureCurrentVisible();
133} 133}
134 134
135void NetworkSettings::SLOT_RefreshStates( void ) { 135void NetworkSettings::SLOT_RefreshStates( void ) {
136 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember 136 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
137 137
138 if( LBI ) { 138 if( LBI ) {
139 NetworkSetup * NC; 139 NetworkSetup * NC;
140 NSResources->system().probeInterfaces(); 140 NSResources->system().probeInterfaces();
141 // update current selection only 141 // update current selection only
142 NC = NSResources->findNetworkSetup( LBI->text() ); 142 NC = NSResources->findNetworkSetup( LBI->text() );
143 if( NC ) { 143 if( NC ) {
144 State_t OldS = NC->state(); 144 State_t OldS = NC->state();
145 State_t NewS = NC->state(1); 145 State_t NewS = NC->state(1);
146 if( OldS != NewS ) { 146 if( OldS != NewS ) {
147 updateProfileState( LBI ); 147 updateProfileState( LBI );
148 } 148 }
149 } 149 }
150 } 150 }
151 151
152 152
153 /* -> LATER !! 153 /* -> LATER !!
154 bool is; 154 bool is;
155 NetworkSetup * NC; 155 NetworkSetup * NC;
156 156
157 for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) { 157 for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) {
158 NC = NSResources->findNetworkSetup( Profiles_LB->text(i) ); 158 NC = NSResources->findNetworkSetup( Profiles_LB->text(i) );
159 if( NC ) { 159 if( NC ) {
160 State_t OldS = NC->state(); 160 State_t OldS = NC->state();
161 State_t NewS = NC->state(1); 161 State_t NewS = NC->state(1);
162 if( OldS != NewS ) { 162 if( OldS != NewS ) {
163 is = Profiles_LB->isSelected(i); 163 is = Profiles_LB->isSelected(i);
164 Profiles_LB->changeItem( NC->statePixmap(NewS), 164 Profiles_LB->changeItem( NC->statePixmap(NewS),
165 NC->name(), 165 NC->name(),
166 i ); 166 i );
167 if( is ) { 167 if( is ) {
168 Profiles_LB->setSelected( i, TRUE ); 168 Profiles_LB->setSelected( i, TRUE );
169 } 169 }
170 } 170 }
171 } 171 }
172 } 172 }
173 if( ci >= 0 ) 173 if( ci >= 0 )
174 Profiles_LB->setCurrentItem( ci ); 174 Profiles_LB->setCurrentItem( ci );
175 */ 175 */
176} 176}
177 177
178void NetworkSettings::SLOT_AddNode( void ) { 178void NetworkSettings::SLOT_AddNode( void ) {
179 SLOT_EditNode( 0 ); 179 SLOT_EditNode( 0 );
180} 180}
181 181
182void NetworkSettings::SLOT_DeleteNode( void ) { 182void NetworkSettings::SLOT_DeleteNode( void ) {
183 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 183 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
184 184
185 if ( ! LBI ) 185 if ( ! LBI )
186 return; 186 return;
187 187
188 if( QMessageBox::warning( 188 if( QMessageBox::warning(
189 0, 189 0,
190 tr( "Removing profile" ), 190 tr( "Removing profile" ),
191 tr( "Remove selected profile ?" ), 191 tr( "Remove selected profile ?" ),
192 1, 0 ) == 1 ) { 192 1, 0 ) == 1 ) {
193 NSResources->removeNetworkSetup( LBI->text() ); 193 NSResources->removeNetworkSetup( LBI->text() );
194 delete LBI; 194 delete LBI;
195 NSD.setModified( 1 ); 195 NSD.setModified( 1 );
196 } 196 }
197} 197}
198 198
199void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { 199void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
200 QString OldName = ""; 200 QString OldName = "";
201 201
202 EditNetworkSetup EC( this ); 202 EditNetworkSetup EC( this );
203 203
204 if( LBI ) { 204 if( LBI ) {
205 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); 205 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
206 if( ! NC ) { 206 if( ! NC ) {
207 return; 207 return;
208 } 208 }
209 OldName = NC->name(); 209 OldName = NC->name();
210 EC.setNetworkSetup( NC ); 210 EC.setNetworkSetup( NC );
211 } 211 }
212 212
213 EC.showMaximized(); 213 EC.showMaximized();
214 // disable refresh timer 214 // disable refresh timer
215 UpdateTimer->stop(); 215 UpdateTimer->stop();
216 216
217 // we need to retry 217 // we need to retry
218 while( 1 ) { 218 while( 1 ) {
219 if( EC.exec() == QDialog::Accepted ) { 219 if( EC.exec() == QDialog::Accepted ) {
220 // toplevel item -> store 220 // toplevel item -> store
221 NetworkSetup * NC = EC.networkSetup(); 221 NetworkSetup * NC = EC.networkSetup();
222 if( NC->isModified() ) { 222 if( NC->isModified() ) {
223 if( LBI ) { 223 if( LBI ) {
224 if( NC->name() != OldName ) { 224 if( NC->name() != OldName ) {
225 // find if new name is free 225 // find if new name is free
226 NetworkSetup * LCN = NSResources->findNetworkSetup( 226 NetworkSetup * LCN = NSResources->findNetworkSetup(
227 NC->name() ); 227 NC->name() );
228 if( LCN ) { 228 if( LCN ) {
229 QMessageBox::warning( 229 QMessageBox::warning(
230 0, 230 0,
231 tr( "In System Config" ), 231 tr( "In System Config" ),
232 tr( "Name %1 already exists" ).arg(NC->name()) 232 tr( "Name %1 already exists" ).arg(NC->name())
233 ); 233 );
234 continue; // restart exec 234 continue; // restart exec
235 } // else new name 235 } // else new name
236 // new name -> remove item 236 // new name -> remove item
237 NSResources->removeNetworkSetup( OldName ); 237 NSResources->removeNetworkSetup( OldName );
238 NSResources->addNetworkSetup( NC, 0 ); 238 NSResources->addNetworkSetup( NC, 0 );
239 } // else not changed 239 } // else not changed
240 240
241 // must add it here since change will trigger event 241 // no update (will come later)
242 Profiles_LB->blockSignals( TRUE );
242 Profiles_LB->changeItem( NC->devicePixmap(), 243 Profiles_LB->changeItem( NC->devicePixmap(),
243 NC->name(), 244 NC->name(),
244 Profiles_LB->index( LBI ) 245 Profiles_LB->index( LBI )
245 ); 246 );
247 Profiles_LB->blockSignals( FALSE );
246 } else { 248 } else {
247 // new item 249 // new item
248 int ci = Profiles_LB->count(); 250 int ci = Profiles_LB->count();
249 NSResources->addNetworkSetup( NC, 0 ); 251 NSResources->addNetworkSetup( NC, 0 );
250 NC->setNumber( NSResources->assignNetworkSetupNumber() ); 252 NC->setNumber( NSResources->assignNetworkSetupNumber() );
251 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); 253 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
252 Profiles_LB->setSelected( ci, TRUE ); 254 Profiles_LB->setSelected( ci, TRUE );
253 } 255 }
254 SLOT_RefreshStates(); 256 SLOT_RefreshStates();
255 } 257 }
256 } else { 258 } else {
257 // cancelled : reset NetworkSetup 259 // cancelled : reset NetworkSetup
258 if( LBI ) { 260 if( LBI ) {
259 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); 261 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
260 NC->reassign(); 262 NC->reassign();
261 } 263 }
262 } 264 }
263 break; 265 break;
264 } 266 }
265 // reenable 267 // reenable
266 UpdateTimer->start( 5000 ); 268 UpdateTimer->start( 5000 );
267} 269}
268 270
269void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { 271void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
270 if( LBI == 0 ) 272 if( LBI == 0 )
271 return; 273 return;
272 274
273 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); 275 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
274 276
275 if( NC->description().isEmpty() ) { 277 if( NC->description().isEmpty() ) {
276 Description_LBL->setText( tr( "<<No description>>" ) ); 278 Description_LBL->setText( tr( "<<No description>>" ) );
277 } else { 279 } else {
278 Description_LBL->setText( NC->description() ); 280 Description_LBL->setText( NC->description() );
279 } 281 }
280 282
281 Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() ); 283 Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() );
282 284
283 bool FrmActive = 1; 285 bool FrmActive = 1;
284 bool IsEnabled = 1; 286 bool IsEnabled = 1;
285 int leds = 0; 287 int leds = 0;
286 288
287 switch( NC->state() ) { 289 switch( NC->state() ) {
288 case Disabled : // no further work 290 case Disabled : // no further work
289 IsEnabled = 0; 291 IsEnabled = 0;
290 FrmActive = 0; 292 FrmActive = 0;
291 break; 293 break;
292 case Unknown : 294 case Unknown :
293 case Unchecked : 295 case Unchecked :
294 case Unavailable : 296 case Unavailable :
295 FrmActive = 0; 297 FrmActive = 0;
296 break; 298 break;
297 case Off : 299 case Off :
298 leds = 1; 300 leds = 1;
299 break; 301 break;
300 case Available : 302 case Available :
301 leds = 2; 303 leds = 2;
302 break; 304 break;
303 case IsUp : 305 case IsUp :
304 leds = 3; 306 leds = 3;
305 break; 307 break;
306 } 308 }
307 309
308 Disable_TB->setOn( ! IsEnabled ); 310 Disable_TB->setOn( ! IsEnabled );
309 LED_Frm->setEnabled( FrmActive ); 311 LED_Frm->setEnabled( FrmActive );
310 312
311 for( int i = 0 ; i < leds; i ++ ) { 313 for( int i = 0 ; i < leds; i ++ ) {
312 Leds[i]->setColor( red ); 314 Leds[i]->setColor( red );
313 Leds[i]->setOn( true ); 315 Leds[i]->setOn( true );
314 } 316 }
315 for( int i = leds ; i < 3; i ++ ) { 317 for( int i = leds ; i < 3; i ++ ) {
316 Leds[i]->setColor( red ); 318 Leds[i]->setColor( red );
317 Leds[i]->setOn( false ); 319 Leds[i]->setOn( false );
318 } 320 }
319 321
320 Up_TB->setEnabled( leds < 3 && leds != 0 ); 322 Up_TB->setEnabled( leds < 3 && leds != 0 );
321 Down_TB->setEnabled( leds > 0 ); 323 Down_TB->setEnabled( leds > 0 );
322} 324}
323 325
324void NetworkSettings::SLOT_CheckState( void ) { 326void NetworkSettings::SLOT_CheckState( void ) {
325 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 327 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
326 if ( ! LBI ) 328 if ( ! LBI )
327 return; 329 return;
328 updateProfileState( LBI ); 330 updateProfileState( LBI );
329} 331}
330 332
331void NetworkSettings::updateProfileState( QListBoxItem * LBI ) { 333void NetworkSettings::updateProfileState( QListBoxItem * LBI ) {
332 if( LBI == Profiles_LB->item( Profiles_LB->currentItem() ) ) { 334 if( LBI == Profiles_LB->item( Profiles_LB->currentItem() ) ) {
333 SLOT_ShowNode( LBI ); 335 SLOT_ShowNode( LBI );
334 } 336 }
335} 337}
336 338
337void NetworkSettings::SLOT_GenerateConfig( void ) { 339void NetworkSettings::SLOT_GenerateConfig( void ) {
338 QString S = NSD.generateSettings(); 340 QString S = NSD.generateSettings();
339 if( ! S.isEmpty() ) { 341 if( ! S.isEmpty() ) {
340 S.insert( 0, "<p>" ); 342 S.insert( 0, "<p>" );
341 S.append( "</p>" ); 343 S.append( "</p>" );
342 QMessageBox::warning( 344 QMessageBox::warning(
343 0, 345 0,
344 tr( "Generate config" ), 346 tr( "Generate config" ),
345 S); 347 S);
346 } 348 }
347} 349}
348 350
349void NetworkSettings::SLOT_Disable( bool T ) { 351void NetworkSettings::SLOT_Disable( bool T ) {
350 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 352 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
351 QString Msg; 353 QString Msg;
352 354
353 if ( ! LBI ) 355 if ( ! LBI )
354 return; 356 return;
355 357
356 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); 358 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
357 359
358 Log(( "Prepare to %sable\n", (T) ? "en" : "dis" )); 360 Log(( "Prepare to %sable\n", (T) ? "en" : "dis" ));
359 Msg = NC->setState( (T) ? Disable : Enable ); 361 Msg = NC->setState( (T) ? Disable : Enable );
360 if( ! Msg.isEmpty() ) { 362 if( ! Msg.isEmpty() ) {
361 Msg.insert( 0, "<p>" ); 363 Msg.insert( 0, "<p>" );
362 Msg.append( "</p>" ); 364 Msg.append( "</p>" );
363 QMessageBox::warning( 365 QMessageBox::warning(
364 0, 366 0,
365 tr( "Activating profile" ), 367 tr( "Activating profile" ),
366 Msg ); 368 Msg );
367 return; 369 return;
368 } 370 }
369 371
370 // reload new state 372 // reload new state
371 NC->state( true ); 373 NC->state( true );
372 updateProfileState( LBI ); 374 updateProfileState( LBI );
373} 375}
374 376
375void NetworkSettings::SLOT_Up( void ) { 377void NetworkSettings::SLOT_Up( void ) {
376 // bring more up 378 // bring more up
377 379
378 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 380 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
379 QString Msg; 381 QString Msg;
380 int led = -1; 382 int led = -1;
381 383
382 if ( ! LBI ) 384 if ( ! LBI )
383 return; 385 return;
384 386
385 NetworkSetup * NC = 387 NetworkSetup * NC =
386 NSResources->findNetworkSetup( LBI->text() ); 388 NSResources->findNetworkSetup( LBI->text() );
387 389
388 switch( NC->state() ) { 390 switch( NC->state() ) {
389 case Disabled : // cannot modify this state 391 case Disabled : // cannot modify this state
390 case Unknown : // cannot modify this state 392 case Unknown : // cannot modify this state
391 case Unchecked : // cannot modify this state 393 case Unchecked : // cannot modify this state
392 case Unavailable : // cannot modify this state 394 case Unavailable : // cannot modify this state
393 case IsUp : // highest UP state 395 case IsUp : // highest UP state
394 return; 396 return;
395 case Off : // -> activate 397 case Off : // -> activate
396 led = 1; 398 led = 1;
397 Down_TB->setEnabled( true ); 399 Down_TB->setEnabled( true );
398 Log(( "Activate interface %s\n", NC->name().latin1() )); 400 Log(( "Activate interface %s\n", NC->name().latin1() ));
399 Msg = NC->setState( Activate ); 401 Msg = NC->setState( Activate );
400 break; 402 break;
401 case Available : // -> up 403 case Available : // -> up
402 led = 2; 404 led = 2;
403 Log(( "Bring up interface %s\n", NC->name().latin1() )); 405 Log(( "Bring up interface %s\n", NC->name().latin1() ));
404 Msg = NC->setState( Up ); 406 Msg = NC->setState( Up );
405 if( Msg.isEmpty() ) { 407 if( Msg.isEmpty() ) {
406 Up_TB->setEnabled( false ); 408 Up_TB->setEnabled( false );
407 } 409 }
408 break; 410 break;
409 } 411 }
410 412
411 if( ! Msg.isEmpty() ) { 413 if( ! Msg.isEmpty() ) {
412 Msg.insert( 0, "<p>" ); 414 Msg.insert( 0, "<p>" );
413 Msg.append( "</p>" ); 415 Msg.append( "</p>" );
414 QMessageBox::warning( 416 QMessageBox::warning(
415 0, 417 0,
416 tr( "Increase availability" ), 418 tr( "Increase availability" ),
417 Msg ); 419 Msg );
418 return; 420 return;
419 } 421 }
420 422
421 updateProfileState( LBI ); 423 updateProfileState( LBI );
422 424
423 // set color of led we should change 425 // set color of led we should change
424 if( led > 0 ) { 426 if( led > 0 ) {
425 Leds[led]->setColor( blue ); 427 Leds[led]->setColor( blue );
426 Leds[led]->setOn( true ); 428 Leds[led]->setOn( true );
427 } 429 }
428 430
429} 431}
430 432
431void NetworkSettings::SLOT_Down( void ) { 433void NetworkSettings::SLOT_Down( void ) {
432 // bring more down 434 // bring more down
433 435
434 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 436 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
435 int led = -1; 437 int led = -1;
436 QString Msg; 438 QString Msg;
437 439
438 if ( ! LBI ) 440 if ( ! LBI )
439 return; 441 return;
440 442
441 NetworkSetup * NC = 443 NetworkSetup * NC =
442 NSResources->findNetworkSetup( LBI->text() ); 444 NSResources->findNetworkSetup( LBI->text() );
443 445
444 switch( NC->state() ) { 446 switch( NC->state() ) {
445 case Disabled : // cannot modify this state 447 case Disabled : // cannot modify this state
446 case Unknown : // cannot modify this state 448 case Unknown : // cannot modify this state
447 case Unchecked : // cannot modify this state 449 case Unchecked : // cannot modify this state
448 case Unavailable : // cannot modify this state 450 case Unavailable : // cannot modify this state
449 case Off : // highest DOWN state 451 case Off : // highest DOWN state
450 break; 452 break;
451 case Available : // -> down 453 case Available : // -> down
452 led = 0; 454 led = 0;
453 Log(( "Deactivate interface %s\n", NC->name().latin1() )); 455 Log(( "Deactivate interface %s\n", NC->name().latin1() ));
454 Msg = NC->setState( Deactivate ); 456 Msg = NC->setState( Deactivate );
455 Down_TB->setEnabled( false ); 457 Down_TB->setEnabled( false );
456 break; 458 break;
457 case IsUp : // highest UP state 459 case IsUp : // highest UP state
458 led = 1; 460 led = 1;
459 Up_TB->setEnabled( true ); 461 Up_TB->setEnabled( true );
460 Log(( "Bring down interface %s\n", NC->name().latin1() )); 462 Log(( "Bring down interface %s\n", NC->name().latin1() ));
461 Msg = NC->setState( Down, 1 ); 463 Msg = NC->setState( Down, 1 );
462 if( Msg.isEmpty() ) { 464 if( Msg.isEmpty() ) {
463 // remove 'up' file to make sure 465 // remove 'up' file to make sure
464 unlink ( QString().sprintf( "/tmp/Profile-%d.up", NC->number() ).latin1() );; 466 unlink ( QString().sprintf( "/tmp/Profile-%d.up", NC->number() ).latin1() );;
465 } 467 }
466 break; 468 break;
467 } 469 }
468 470
469 if( ! Msg.isEmpty() ) { 471 if( ! Msg.isEmpty() ) {
470 Msg.insert( 0, "<p>" ); 472 Msg.insert( 0, "<p>" );
471 Msg.append( "</p>" ); 473 Msg.append( "</p>" );
472 QMessageBox::warning( 474 QMessageBox::warning(
473 0, 475 0,
474 tr( "Decrease availability" ), 476 tr( "Decrease availability" ),
475 Msg ); 477 Msg );
476 return; 478 return;
477 } 479 }
478 480
479 updateProfileState( LBI ); 481 updateProfileState( LBI );
480 482
481 // set color of led we should change 483 // set color of led we should change
482 if( led >= 0 ) { 484 if( led >= 0 ) {
483 Leds[led]->setColor( blue ); 485 Leds[led]->setColor( blue );
484 } 486 }
485} 487}
486 488
487void NetworkSettings::SLOT_ToMessages( void ) { 489void NetworkSettings::SLOT_ToMessages( void ) {
488 Profiles_LB->hide(); 490 Profiles_LB->hide();
489 Profile_GB->hide(); 491 Profile_GB->hide();
490 Messages_GB->show(); 492 Messages_GB->show();
491} 493}
492 494
493void NetworkSettings::SLOT_ToProfile( void ) { 495void NetworkSettings::SLOT_ToProfile( void ) {
494 Profiles_LB->show(); 496 Profiles_LB->show();
495 Profile_GB->show(); 497 Profile_GB->show();
496 Messages_GB->hide(); 498 Messages_GB->hide();
497} 499}
498 500
499void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) { 501void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) {
500 QDataStream stream( data, IO_ReadOnly ); 502 QDataStream stream( data, IO_ReadOnly );
501 503
502 if( msg == "raise" ) { 504 if( msg == "raise" ) {
503 raise(); 505 raise();
504 return; 506 return;
505 } /* if ( msg == "someMessage(int,int,int)" ) { 507 } /* if ( msg == "someMessage(int,int,int)" ) {
506 int a,b,c; 508 int a,b,c;
507 stream >> a >> b >> c; 509 stream >> a >> b >> c;
508 ... 510 ...
509 } */ 511 } */
510} 512}
diff --git a/noncore/settings/networksettings2/profile/profileGUI.ui b/noncore/settings/networksettings2/profile/profileGUI.ui
index 8b421e8..eeb2e75 100644
--- a/noncore/settings/networksettings2/profile/profileGUI.ui
+++ b/noncore/settings/networksettings2/profile/profileGUI.ui
@@ -1,655 +1,655 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>ProfileGUI</class> 2<class>ProfileGUI</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>Profile_FRM</cstring> 7 <cstring>Profile_FRM</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>551</width> 14 <width>547</width>
15 <height>547</height> 15 <height>547</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Profile</string> 20 <string>Profile</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>1</number> 31 <number>1</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>3</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>TabWidget6</cstring> 41 <cstring>TabWidget6</cstring>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <widget> 49 <widget>
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>tab</cstring> 53 <cstring>tab</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>Setup</string> 57 <string>Setup</string>
58 </attribute> 58 </attribute>
59 <vbox> 59 <vbox>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>1</number> 62 <number>1</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>2</number> 66 <number>2</number>
67 </property> 67 </property>
68 <widget> 68 <widget>
69 <class>QLayoutWidget</class> 69 <class>QLayoutWidget</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>Layout8</cstring> 72 <cstring>Layout8</cstring>
73 </property> 73 </property>
74 <grid> 74 <grid>
75 <property stdset="1"> 75 <property stdset="1">
76 <name>margin</name> 76 <name>margin</name>
77 <number>0</number> 77 <number>0</number>
78 </property> 78 </property>
79 <property stdset="1"> 79 <property stdset="1">
80 <name>spacing</name> 80 <name>spacing</name>
81 <number>6</number> 81 <number>6</number>
82 </property> 82 </property>
83 <widget row="0" column="0" rowspan="2" colspan="1" > 83 <widget row="0" column="0" rowspan="2" colspan="1" >
84 <class>QGroupBox</class> 84 <class>QGroupBox</class>
85 <property stdset="1"> 85 <property stdset="1">
86 <name>name</name> 86 <name>name</name>
87 <cstring>GroupBox1</cstring> 87 <cstring>GroupBox1</cstring>
88 </property> 88 </property>
89 <property stdset="1"> 89 <property stdset="1">
90 <name>title</name> 90 <name>title</name>
91 <string>Start</string> 91 <string>Start</string>
92 </property> 92 </property>
93 <vbox> 93 <vbox>
94 <property stdset="1"> 94 <property stdset="1">
95 <name>margin</name> 95 <name>margin</name>
96 <number>11</number> 96 <number>11</number>
97 </property> 97 </property>
98 <property stdset="1"> 98 <property stdset="1">
99 <name>spacing</name> 99 <name>spacing</name>
100 <number>6</number> 100 <number>6</number>
101 </property> 101 </property>
102 <widget> 102 <widget>
103 <class>QCheckBox</class> 103 <class>QCheckBox</class>
104 <property stdset="1"> 104 <property stdset="1">
105 <name>name</name> 105 <name>name</name>
106 <cstring>Automatic_CB</cstring> 106 <cstring>Automatic_CB</cstring>
107 </property> 107 </property>
108 <property stdset="1"> 108 <property stdset="1">
109 <name>text</name> 109 <name>text</name>
110 <string>Automatically</string> 110 <string>Automatically</string>
111 </property> 111 </property>
112 </widget> 112 </widget>
113 <widget> 113 <widget>
114 <class>QCheckBox</class> 114 <class>QCheckBox</class>
115 <property stdset="1"> 115 <property stdset="1">
116 <name>name</name> 116 <name>name</name>
117 <cstring>Confirm_CB</cstring> 117 <cstring>Confirm_CB</cstring>
118 </property> 118 </property>
119 <property stdset="1"> 119 <property stdset="1">
120 <name>enabled</name> 120 <name>enabled</name>
121 <bool>true</bool> 121 <bool>true</bool>
122 </property> 122 </property>
123 <property stdset="1"> 123 <property stdset="1">
124 <name>text</name> 124 <name>text</name>
125 <string>Ask</string> 125 <string>Ask</string>
126 </property> 126 </property>
127 <property> 127 <property>
128 <name>layoutMargin</name> 128 <name>layoutMargin</name>
129 </property> 129 </property>
130 </widget> 130 </widget>
131 <widget> 131 <widget>
132 <class>QCheckBox</class> 132 <class>QCheckBox</class>
133 <property stdset="1"> 133 <property stdset="1">
134 <name>name</name> 134 <name>name</name>
135 <cstring>Disabled_CB</cstring> 135 <cstring>Enabled_CB</cstring>
136 </property> 136 </property>
137 <property stdset="1"> 137 <property stdset="1">
138 <name>enabled</name> 138 <name>enabled</name>
139 <bool>true</bool> 139 <bool>true</bool>
140 </property> 140 </property>
141 <property stdset="1"> 141 <property stdset="1">
142 <name>text</name> 142 <name>text</name>
143 <string>Disabled</string> 143 <string>Enabled</string>
144 </property> 144 </property>
145 <property> 145 <property>
146 <name>layoutMargin</name> 146 <name>layoutMargin</name>
147 </property> 147 </property>
148 </widget> 148 </widget>
149 </vbox> 149 </vbox>
150 </widget> 150 </widget>
151 <widget row="0" column="1" > 151 <widget row="0" column="1" >
152 <class>QCheckBox</class> 152 <class>QCheckBox</class>
153 <property stdset="1"> 153 <property stdset="1">
154 <name>name</name> 154 <name>name</name>
155 <cstring>TriggersVPN_CB</cstring> 155 <cstring>TriggersVPN_CB</cstring>
156 </property> 156 </property>
157 <property stdset="1"> 157 <property stdset="1">
158 <name>text</name> 158 <name>text</name>
159 <string>Trigger VPN</string> 159 <string>Trigger VPN</string>
160 </property> 160 </property>
161 </widget> 161 </widget>
162 <spacer row="1" column="1" > 162 <spacer row="1" column="1" >
163 <property> 163 <property>
164 <name>name</name> 164 <name>name</name>
165 <cstring>Spacer8</cstring> 165 <cstring>Spacer8</cstring>
166 </property> 166 </property>
167 <property stdset="1"> 167 <property stdset="1">
168 <name>orientation</name> 168 <name>orientation</name>
169 <enum>Vertical</enum> 169 <enum>Vertical</enum>
170 </property> 170 </property>
171 <property stdset="1"> 171 <property stdset="1">
172 <name>sizeType</name> 172 <name>sizeType</name>
173 <enum>Expanding</enum> 173 <enum>Expanding</enum>
174 </property> 174 </property>
175 <property> 175 <property>
176 <name>sizeHint</name> 176 <name>sizeHint</name>
177 <size> 177 <size>
178 <width>20</width> 178 <width>20</width>
179 <height>20</height> 179 <height>20</height>
180 </size> 180 </size>
181 </property> 181 </property>
182 </spacer> 182 </spacer>
183 </grid> 183 </grid>
184 </widget> 184 </widget>
185 <widget> 185 <widget>
186 <class>QLabel</class> 186 <class>QLabel</class>
187 <property stdset="1"> 187 <property stdset="1">
188 <name>name</name> 188 <name>name</name>
189 <cstring>TextLabel3</cstring> 189 <cstring>TextLabel3</cstring>
190 </property> 190 </property>
191 <property stdset="1"> 191 <property stdset="1">
192 <name>text</name> 192 <name>text</name>
193 <string>Description</string> 193 <string>Description</string>
194 </property> 194 </property>
195 </widget> 195 </widget>
196 <widget> 196 <widget>
197 <class>QMultiLineEdit</class> 197 <class>QMultiLineEdit</class>
198 <property stdset="1"> 198 <property stdset="1">
199 <name>name</name> 199 <name>name</name>
200 <cstring>Description_LE</cstring> 200 <cstring>Description_LE</cstring>
201 </property> 201 </property>
202 </widget> 202 </widget>
203 </vbox> 203 </vbox>
204 </widget> 204 </widget>
205 <widget> 205 <widget>
206 <class>QWidget</class> 206 <class>QWidget</class>
207 <property stdset="1"> 207 <property stdset="1">
208 <name>name</name> 208 <name>name</name>
209 <cstring>tab</cstring> 209 <cstring>tab</cstring>
210 </property> 210 </property>
211 <attribute> 211 <attribute>
212 <name>title</name> 212 <name>title</name>
213 <string>State</string> 213 <string>State</string>
214 </attribute> 214 </attribute>
215 <vbox> 215 <vbox>
216 <property stdset="1"> 216 <property stdset="1">
217 <name>margin</name> 217 <name>margin</name>
218 <number>0</number> 218 <number>0</number>
219 </property> 219 </property>
220 <property stdset="1"> 220 <property stdset="1">
221 <name>spacing</name> 221 <name>spacing</name>
222 <number>2</number> 222 <number>2</number>
223 </property> 223 </property>
224 <widget> 224 <widget>
225 <class>QFrame</class> 225 <class>QFrame</class>
226 <property stdset="1"> 226 <property stdset="1">
227 <name>name</name> 227 <name>name</name>
228 <cstring>Frame73</cstring> 228 <cstring>Frame73</cstring>
229 </property> 229 </property>
230 <property stdset="1"> 230 <property stdset="1">
231 <name>sizePolicy</name> 231 <name>sizePolicy</name>
232 <sizepolicy> 232 <sizepolicy>
233 <hsizetype>7</hsizetype> 233 <hsizetype>7</hsizetype>
234 <vsizetype>5</vsizetype> 234 <vsizetype>5</vsizetype>
235 </sizepolicy> 235 </sizepolicy>
236 </property> 236 </property>
237 <property stdset="1"> 237 <property stdset="1">
238 <name>frameShape</name> 238 <name>frameShape</name>
239 <enum>NoFrame</enum> 239 <enum>NoFrame</enum>
240 </property> 240 </property>
241 <property stdset="1"> 241 <property stdset="1">
242 <name>frameShadow</name> 242 <name>frameShadow</name>
243 <enum>Plain</enum> 243 <enum>Plain</enum>
244 </property> 244 </property>
245 <property> 245 <property>
246 <name>layoutMargin</name> 246 <name>layoutMargin</name>
247 </property> 247 </property>
248 <property> 248 <property>
249 <name>layoutSpacing</name> 249 <name>layoutSpacing</name>
250 </property> 250 </property>
251 <hbox> 251 <hbox>
252 <property stdset="1"> 252 <property stdset="1">
253 <name>margin</name> 253 <name>margin</name>
254 <number>2</number> 254 <number>2</number>
255 </property> 255 </property>
256 <property stdset="1"> 256 <property stdset="1">
257 <name>spacing</name> 257 <name>spacing</name>
258 <number>0</number> 258 <number>0</number>
259 </property> 259 </property>
260 <widget> 260 <widget>
261 <class>QLabel</class> 261 <class>QLabel</class>
262 <property stdset="1"> 262 <property stdset="1">
263 <name>name</name> 263 <name>name</name>
264 <cstring>InterfaceName_LBL</cstring> 264 <cstring>InterfaceName_LBL</cstring>
265 </property> 265 </property>
266 <property stdset="1"> 266 <property stdset="1">
267 <name>font</name> 267 <name>font</name>
268 <font> 268 <font>
269 <underline>1</underline> 269 <underline>1</underline>
270 </font> 270 </font>
271 </property> 271 </property>
272 <property stdset="1"> 272 <property stdset="1">
273 <name>text</name> 273 <name>text</name>
274 <string>eth0</string> 274 <string>eth0</string>
275 </property> 275 </property>
276 </widget> 276 </widget>
277 <widget> 277 <widget>
278 <class>QLabel</class> 278 <class>QLabel</class>
279 <property stdset="1"> 279 <property stdset="1">
280 <name>name</name> 280 <name>name</name>
281 <cstring>InterfaceOptions_LBL</cstring> 281 <cstring>InterfaceOptions_LBL</cstring>
282 </property> 282 </property>
283 <property stdset="1"> 283 <property stdset="1">
284 <name>sizePolicy</name> 284 <name>sizePolicy</name>
285 <sizepolicy> 285 <sizepolicy>
286 <hsizetype>7</hsizetype> 286 <hsizetype>7</hsizetype>
287 <vsizetype>1</vsizetype> 287 <vsizetype>1</vsizetype>
288 </sizepolicy> 288 </sizepolicy>
289 </property> 289 </property>
290 <property stdset="1"> 290 <property stdset="1">
291 <name>font</name> 291 <name>font</name>
292 <font> 292 <font>
293 <underline>1</underline> 293 <underline>1</underline>
294 </font> 294 </font>
295 </property> 295 </property>
296 <property stdset="1"> 296 <property stdset="1">
297 <name>text</name> 297 <name>text</name>
298 <string>(Multicast, Up)</string> 298 <string>(Multicast, Up)</string>
299 </property> 299 </property>
300 <property stdset="1"> 300 <property stdset="1">
301 <name>indent</name> 301 <name>indent</name>
302 <number>0</number> 302 <number>0</number>
303 </property> 303 </property>
304 </widget> 304 </widget>
305 </hbox> 305 </hbox>
306 </widget> 306 </widget>
307 <widget> 307 <widget>
308 <class>QFrame</class> 308 <class>QFrame</class>
309 <property stdset="1"> 309 <property stdset="1">
310 <name>name</name> 310 <name>name</name>
311 <cstring>Interface_GB</cstring> 311 <cstring>Interface_GB</cstring>
312 </property> 312 </property>
313 <property stdset="1"> 313 <property stdset="1">
314 <name>enabled</name> 314 <name>enabled</name>
315 <bool>true</bool> 315 <bool>true</bool>
316 </property> 316 </property>
317 <property stdset="1"> 317 <property stdset="1">
318 <name>sizePolicy</name> 318 <name>sizePolicy</name>
319 <sizepolicy> 319 <sizepolicy>
320 <hsizetype>7</hsizetype> 320 <hsizetype>7</hsizetype>
321 <vsizetype>5</vsizetype> 321 <vsizetype>5</vsizetype>
322 </sizepolicy> 322 </sizepolicy>
323 </property> 323 </property>
324 <property stdset="1"> 324 <property stdset="1">
325 <name>frameShape</name> 325 <name>frameShape</name>
326 <enum>NoFrame</enum> 326 <enum>NoFrame</enum>
327 </property> 327 </property>
328 <property stdset="1"> 328 <property stdset="1">
329 <name>frameShadow</name> 329 <name>frameShadow</name>
330 <enum>Raised</enum> 330 <enum>Raised</enum>
331 </property> 331 </property>
332 <property> 332 <property>
333 <name>layoutMargin</name> 333 <name>layoutMargin</name>
334 </property> 334 </property>
335 <property> 335 <property>
336 <name>layoutSpacing</name> 336 <name>layoutSpacing</name>
337 </property> 337 </property>
338 <grid> 338 <grid>
339 <property stdset="1"> 339 <property stdset="1">
340 <name>margin</name> 340 <name>margin</name>
341 <number>2</number> 341 <number>2</number>
342 </property> 342 </property>
343 <property stdset="1"> 343 <property stdset="1">
344 <name>spacing</name> 344 <name>spacing</name>
345 <number>1</number> 345 <number>1</number>
346 </property> 346 </property>
347 <widget row="0" column="2" > 347 <widget row="0" column="2" >
348 <class>QLabel</class> 348 <class>QLabel</class>
349 <property stdset="1"> 349 <property stdset="1">
350 <name>name</name> 350 <name>name</name>
351 <cstring>TextLabel4_2_3</cstring> 351 <cstring>TextLabel4_2_3</cstring>
352 </property> 352 </property>
353 <property stdset="1"> 353 <property stdset="1">
354 <name>enabled</name> 354 <name>enabled</name>
355 <bool>true</bool> 355 <bool>true</bool>
356 </property> 356 </property>
357 <property stdset="1"> 357 <property stdset="1">
358 <name>sizePolicy</name> 358 <name>sizePolicy</name>
359 <sizepolicy> 359 <sizepolicy>
360 <hsizetype>0</hsizetype> 360 <hsizetype>0</hsizetype>
361 <vsizetype>1</vsizetype> 361 <vsizetype>1</vsizetype>
362 </sizepolicy> 362 </sizepolicy>
363 </property> 363 </property>
364 <property stdset="1"> 364 <property stdset="1">
365 <name>frameShape</name> 365 <name>frameShape</name>
366 <enum>NoFrame</enum> 366 <enum>NoFrame</enum>
367 </property> 367 </property>
368 <property stdset="1"> 368 <property stdset="1">
369 <name>frameShadow</name> 369 <name>frameShadow</name>
370 <enum>Raised</enum> 370 <enum>Raised</enum>
371 </property> 371 </property>
372 <property stdset="1"> 372 <property stdset="1">
373 <name>text</name> 373 <name>text</name>
374 <string>Subnet Mask</string> 374 <string>Subnet Mask</string>
375 </property> 375 </property>
376 </widget> 376 </widget>
377 <widget row="0" column="3" > 377 <widget row="0" column="3" >
378 <class>QLabel</class> 378 <class>QLabel</class>
379 <property stdset="1"> 379 <property stdset="1">
380 <name>name</name> 380 <name>name</name>
381 <cstring>TextLabel1_3_3</cstring> 381 <cstring>TextLabel1_3_3</cstring>
382 </property> 382 </property>
383 <property stdset="1"> 383 <property stdset="1">
384 <name>enabled</name> 384 <name>enabled</name>
385 <bool>true</bool> 385 <bool>true</bool>
386 </property> 386 </property>
387 <property stdset="1"> 387 <property stdset="1">
388 <name>sizePolicy</name> 388 <name>sizePolicy</name>
389 <sizepolicy> 389 <sizepolicy>
390 <hsizetype>0</hsizetype> 390 <hsizetype>0</hsizetype>
391 <vsizetype>1</vsizetype> 391 <vsizetype>1</vsizetype>
392 </sizepolicy> 392 </sizepolicy>
393 </property> 393 </property>
394 <property stdset="1"> 394 <property stdset="1">
395 <name>frameShape</name> 395 <name>frameShape</name>
396 <enum>NoFrame</enum> 396 <enum>NoFrame</enum>
397 </property> 397 </property>
398 <property stdset="1"> 398 <property stdset="1">
399 <name>frameShadow</name> 399 <name>frameShadow</name>
400 <enum>Raised</enum> 400 <enum>Raised</enum>
401 </property> 401 </property>
402 <property stdset="1"> 402 <property stdset="1">
403 <name>text</name> 403 <name>text</name>
404 <string>Broadcast</string> 404 <string>Broadcast</string>
405 </property> 405 </property>
406 </widget> 406 </widget>
407 <widget row="3" column="0" > 407 <widget row="3" column="0" >
408 <class>QLabel</class> 408 <class>QLabel</class>
409 <property stdset="1"> 409 <property stdset="1">
410 <name>name</name> 410 <name>name</name>
411 <cstring>TextLabel1_5</cstring> 411 <cstring>TextLabel1_5</cstring>
412 </property> 412 </property>
413 <property stdset="1"> 413 <property stdset="1">
414 <name>enabled</name> 414 <name>enabled</name>
415 <bool>true</bool> 415 <bool>true</bool>
416 </property> 416 </property>
417 <property stdset="1"> 417 <property stdset="1">
418 <name>sizePolicy</name> 418 <name>sizePolicy</name>
419 <sizepolicy> 419 <sizepolicy>
420 <hsizetype>1</hsizetype> 420 <hsizetype>1</hsizetype>
421 <vsizetype>1</vsizetype> 421 <vsizetype>1</vsizetype>
422 </sizepolicy> 422 </sizepolicy>
423 </property> 423 </property>
424 <property stdset="1"> 424 <property stdset="1">
425 <name>text</name> 425 <name>text</name>
426 <string>MAC</string> 426 <string>MAC</string>
427 </property> 427 </property>
428 <property stdset="1"> 428 <property stdset="1">
429 <name>indent</name> 429 <name>indent</name>
430 <number>0</number> 430 <number>0</number>
431 </property> 431 </property>
432 </widget> 432 </widget>
433 <widget row="2" column="0" > 433 <widget row="2" column="0" >
434 <class>QLabel</class> 434 <class>QLabel</class>
435 <property stdset="1"> 435 <property stdset="1">
436 <name>name</name> 436 <name>name</name>
437 <cstring>TextLabel1_5_2</cstring> 437 <cstring>TextLabel1_5_2</cstring>
438 </property> 438 </property>
439 <property stdset="1"> 439 <property stdset="1">
440 <name>enabled</name> 440 <name>enabled</name>
441 <bool>true</bool> 441 <bool>true</bool>
442 </property> 442 </property>
443 <property stdset="1"> 443 <property stdset="1">
444 <name>sizePolicy</name> 444 <name>sizePolicy</name>
445 <sizepolicy> 445 <sizepolicy>
446 <hsizetype>1</hsizetype> 446 <hsizetype>1</hsizetype>
447 <vsizetype>1</vsizetype> 447 <vsizetype>1</vsizetype>
448 </sizepolicy> 448 </sizepolicy>
449 </property> 449 </property>
450 <property stdset="1"> 450 <property stdset="1">
451 <name>text</name> 451 <name>text</name>
452 <string>P-t-P</string> 452 <string>P-t-P</string>
453 </property> 453 </property>
454 <property stdset="1"> 454 <property stdset="1">
455 <name>indent</name> 455 <name>indent</name>
456 <number>0</number> 456 <number>0</number>
457 </property> 457 </property>
458 </widget> 458 </widget>
459 <widget row="0" column="0" rowspan="1" colspan="2" > 459 <widget row="0" column="0" rowspan="1" colspan="2" >
460 <class>QLabel</class> 460 <class>QLabel</class>
461 <property stdset="1"> 461 <property stdset="1">
462 <name>name</name> 462 <name>name</name>
463 <cstring>TextLabel3_2_3</cstring> 463 <cstring>TextLabel3_2_3</cstring>
464 </property> 464 </property>
465 <property stdset="1"> 465 <property stdset="1">
466 <name>enabled</name> 466 <name>enabled</name>
467 <bool>true</bool> 467 <bool>true</bool>
468 </property> 468 </property>
469 <property stdset="1"> 469 <property stdset="1">
470 <name>sizePolicy</name> 470 <name>sizePolicy</name>
471 <sizepolicy> 471 <sizepolicy>
472 <hsizetype>0</hsizetype> 472 <hsizetype>0</hsizetype>
473 <vsizetype>1</vsizetype> 473 <vsizetype>1</vsizetype>
474 </sizepolicy> 474 </sizepolicy>
475 </property> 475 </property>
476 <property stdset="1"> 476 <property stdset="1">
477 <name>text</name> 477 <name>text</name>
478 <string>IP Address</string> 478 <string>IP Address</string>
479 </property> 479 </property>
480 </widget> 480 </widget>
481 <widget row="1" column="0" rowspan="1" colspan="2" > 481 <widget row="1" column="0" rowspan="1" colspan="2" >
482 <class>QLabel</class> 482 <class>QLabel</class>
483 <property stdset="1"> 483 <property stdset="1">
484 <name>name</name> 484 <name>name</name>
485 <cstring>IPAddress_LBL</cstring> 485 <cstring>IPAddress_LBL</cstring>
486 </property> 486 </property>
487 <property stdset="1"> 487 <property stdset="1">
488 <name>enabled</name> 488 <name>enabled</name>
489 <bool>true</bool> 489 <bool>true</bool>
490 </property> 490 </property>
491 <property stdset="1"> 491 <property stdset="1">
492 <name>sizePolicy</name> 492 <name>sizePolicy</name>
493 <sizepolicy> 493 <sizepolicy>
494 <hsizetype>7</hsizetype> 494 <hsizetype>7</hsizetype>
495 <vsizetype>1</vsizetype> 495 <vsizetype>1</vsizetype>
496 </sizepolicy> 496 </sizepolicy>
497 </property> 497 </property>
498 <property stdset="1"> 498 <property stdset="1">
499 <name>frameShape</name> 499 <name>frameShape</name>
500 <enum>Panel</enum> 500 <enum>Panel</enum>
501 </property> 501 </property>
502 <property stdset="1"> 502 <property stdset="1">
503 <name>frameShadow</name> 503 <name>frameShadow</name>
504 <enum>Sunken</enum> 504 <enum>Sunken</enum>
505 </property> 505 </property>
506 <property stdset="1"> 506 <property stdset="1">
507 <name>text</name> 507 <name>text</name>
508 <string>0.0.0.0</string> 508 <string>0.0.0.0</string>
509 </property> 509 </property>
510 <property stdset="1"> 510 <property stdset="1">
511 <name>alignment</name> 511 <name>alignment</name>
512 <set>AlignCenter</set> 512 <set>AlignCenter</set>
513 </property> 513 </property>
514 <property stdset="1"> 514 <property stdset="1">
515 <name>indent</name> 515 <name>indent</name>
516 <number>0</number> 516 <number>0</number>
517 </property> 517 </property>
518 <property> 518 <property>
519 <name>hAlign</name> 519 <name>hAlign</name>
520 </property> 520 </property>
521 </widget> 521 </widget>
522 <widget row="1" column="2" > 522 <widget row="1" column="2" >
523 <class>QLabel</class> 523 <class>QLabel</class>
524 <property stdset="1"> 524 <property stdset="1">
525 <name>name</name> 525 <name>name</name>
526 <cstring>SubnetMask_LBL</cstring> 526 <cstring>SubnetMask_LBL</cstring>
527 </property> 527 </property>
528 <property stdset="1"> 528 <property stdset="1">
529 <name>enabled</name> 529 <name>enabled</name>
530 <bool>true</bool> 530 <bool>true</bool>
531 </property> 531 </property>
532 <property stdset="1"> 532 <property stdset="1">
533 <name>sizePolicy</name> 533 <name>sizePolicy</name>
534 <sizepolicy> 534 <sizepolicy>
535 <hsizetype>7</hsizetype> 535 <hsizetype>7</hsizetype>
536 <vsizetype>1</vsizetype> 536 <vsizetype>1</vsizetype>
537 </sizepolicy> 537 </sizepolicy>
538 </property> 538 </property>
539 <property stdset="1"> 539 <property stdset="1">
540 <name>frameShape</name> 540 <name>frameShape</name>
541 <enum>Panel</enum> 541 <enum>Panel</enum>
542 </property> 542 </property>
543 <property stdset="1"> 543 <property stdset="1">
544 <name>frameShadow</name> 544 <name>frameShadow</name>
545 <enum>Sunken</enum> 545 <enum>Sunken</enum>
546 </property> 546 </property>
547 <property stdset="1"> 547 <property stdset="1">
548 <name>text</name> 548 <name>text</name>
549 <string>0.0.0.0</string> 549 <string>0.0.0.0</string>
550 </property> 550 </property>
551 <property stdset="1"> 551 <property stdset="1">
552 <name>alignment</name> 552 <name>alignment</name>
553 <set>AlignCenter</set> 553 <set>AlignCenter</set>
554 </property> 554 </property>
555 <property stdset="1"> 555 <property stdset="1">
556 <name>indent</name> 556 <name>indent</name>
557 <number>0</number> 557 <number>0</number>
558 </property> 558 </property>
559 <property> 559 <property>
560 <name>hAlign</name> 560 <name>hAlign</name>
561 </property> 561 </property>
562 </widget> 562 </widget>
563 <widget row="1" column="3" > 563 <widget row="1" column="3" >
564 <class>QLabel</class> 564 <class>QLabel</class>
565 <property stdset="1"> 565 <property stdset="1">
566 <name>name</name> 566 <name>name</name>
567 <cstring>Broadcast_LBL</cstring> 567 <cstring>Broadcast_LBL</cstring>
568 </property> 568 </property>
569 <property stdset="1"> 569 <property stdset="1">
570 <name>enabled</name> 570 <name>enabled</name>
571 <bool>true</bool> 571 <bool>true</bool>
572 </property> 572 </property>
573 <property stdset="1"> 573 <property stdset="1">
574 <name>sizePolicy</name> 574 <name>sizePolicy</name>
575 <sizepolicy> 575 <sizepolicy>
576 <hsizetype>7</hsizetype> 576 <hsizetype>7</hsizetype>
577 <vsizetype>1</vsizetype> 577 <vsizetype>1</vsizetype>
578 </sizepolicy> 578 </sizepolicy>
579 </property> 579 </property>
580 <property stdset="1"> 580 <property stdset="1">
581 <name>frameShape</name> 581 <name>frameShape</name>
582 <enum>StyledPanel</enum> 582 <enum>StyledPanel</enum>
583 </property> 583 </property>
584 <property stdset="1"> 584 <property stdset="1">
585 <name>frameShadow</name> 585 <name>frameShadow</name>
586 <enum>Sunken</enum> 586 <enum>Sunken</enum>
587 </property> 587 </property>
588 <property stdset="1"> 588 <property stdset="1">
589 <name>alignment</name> 589 <name>alignment</name>
590 <set>AlignCenter</set> 590 <set>AlignCenter</set>
591 </property> 591 </property>
592 <property stdset="1"> 592 <property stdset="1">
593 <name>indent</name> 593 <name>indent</name>
594 <number>0</number> 594 <number>0</number>
595 </property> 595 </property>
596 <property> 596 <property>
597 <name>hAlign</name> 597 <name>hAlign</name>
598 </property> 598 </property>
599 </widget> 599 </widget>
600 <widget row="2" column="1" rowspan="1" colspan="3" > 600 <widget row="2" column="1" rowspan="1" colspan="3" >
601 <class>QLabel</class> 601 <class>QLabel</class>
602 <property stdset="1"> 602 <property stdset="1">
603 <name>name</name> 603 <name>name</name>
604 <cstring>PointToPoint_LBL</cstring> 604 <cstring>PointToPoint_LBL</cstring>
605 </property> 605 </property>
606 <property stdset="1"> 606 <property stdset="1">
607 <name>enabled</name> 607 <name>enabled</name>
608 <bool>true</bool> 608 <bool>true</bool>
609 </property> 609 </property>
610 <property stdset="1"> 610 <property stdset="1">
611 <name>sizePolicy</name> 611 <name>sizePolicy</name>
612 <sizepolicy> 612 <sizepolicy>
613 <hsizetype>5</hsizetype> 613 <hsizetype>5</hsizetype>
614 <vsizetype>0</vsizetype> 614 <vsizetype>0</vsizetype>
615 </sizepolicy> 615 </sizepolicy>
616 </property> 616 </property>
617 <property stdset="1"> 617 <property stdset="1">
618 <name>frameShape</name> 618 <name>frameShape</name>
619 <enum>Panel</enum> 619 <enum>Panel</enum>
620 </property> 620 </property>
621 <property stdset="1"> 621 <property stdset="1">
622 <name>frameShadow</name> 622 <name>frameShadow</name>
623 <enum>Sunken</enum> 623 <enum>Sunken</enum>
624 </property> 624 </property>
625 <property stdset="1"> 625 <property stdset="1">
626 <name>indent</name> 626 <name>indent</name>
627 <number>0</number> 627 <number>0</number>
628 </property> 628 </property>
629 </widget> 629 </widget>
630 <widget row="3" column="1" rowspan="1" colspan="3" > 630 <widget row="3" column="1" rowspan="1" colspan="3" >
631 <class>QLabel</class> 631 <class>QLabel</class>
632 <property stdset="1"> 632 <property stdset="1">
633 <name>name</name> 633 <name>name</name>
634 <cstring>MACAddress_LBL</cstring> 634 <cstring>MACAddress_LBL</cstring>
635 </property> 635 </property>
636 <property stdset="1"> 636 <property stdset="1">
637 <name>enabled</name> 637 <name>enabled</name>
638 <bool>true</bool> 638 <bool>true</bool>
639 </property> 639 </property>
640 <property stdset="1"> 640 <property stdset="1">
641 <name>sizePolicy</name> 641 <name>sizePolicy</name>
642 <sizepolicy> 642 <sizepolicy>
643 <hsizetype>5</hsizetype> 643 <hsizetype>5</hsizetype>
644 <vsizetype>0</vsizetype> 644 <vsizetype>0</vsizetype>
645 </sizepolicy> 645 </sizepolicy>
646 </property> 646 </property>
647 <property stdset="1"> 647 <property stdset="1">
648 <name>frameShape</name> 648 <name>frameShape</name>
649 <enum>Panel</enum> 649 <enum>Panel</enum>
650 </property> 650 </property>
651 <property stdset="1"> 651 <property stdset="1">
652 <name>frameShadow</name> 652 <name>frameShadow</name>
653 <enum>Sunken</enum> 653 <enum>Sunken</enum>
654 </property> 654 </property>
655 <property stdset="1"> 655 <property stdset="1">
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp
index fc2d809..0bc13d1 100644
--- a/noncore/settings/networksettings2/profile/profile_NNI.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp
@@ -1,81 +1,83 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <opie2/odebug.h> 2#include <opie2/odebug.h>
3#include "profileedit.h" 3#include "profileedit.h"
4#include "profile_NNI.h" 4#include "profile_NNI.h"
5#include "profile_NN.h" 5#include "profile_NN.h"
6 6
7AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { 7AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) {
8 Data.Automatic = 1; 8 Data.Automatic = 1;
9 Data.Confirm = 0; 9 Data.Confirm = 0;
10 Data.Description = ""; 10 Data.Description = "";
11 Data.Disabled = 0; 11 Data.Enabled = 1;
12 Data.TriggerVPN = 0; 12 Data.TriggerVPN = 0;
13 GUI = 0; 13 GUI = 0;
14 RT = 0; 14 RT = 0;
15} 15}
16 16
17void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { 17void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) {
18 18
19 if ( Attr == "automatic" ) { 19 if ( Attr == "automatic" ) {
20 Data.Automatic = (Value=="yes"); 20 Data.Automatic = (Value=="yes");
21 } else if ( Attr == "preconfirm" ) { 21 } else if ( Attr == "preconfirm" ) {
22 Data.Confirm = (Value=="yes"); 22 Data.Confirm = (Value=="yes");
23 } else if ( Attr == "disabled" ) { 23 } else if ( Attr == "disabled" ) {
24 Data.Disabled = (Value=="yes"); 24 Data.Enabled = (Value=="no");
25 } else if ( Attr == "enabled" ) {
26 Data.Enabled = (Value=="yes");
25 } else if ( Attr == "triggervpn" ) { 27 } else if ( Attr == "triggervpn" ) {
26 Data.TriggerVPN = (Value=="yes"); 28 Data.TriggerVPN = (Value=="yes");
27 } else if ( Attr == "description" ) { 29 } else if ( Attr == "description" ) {
28 Data.Description = Value; 30 Data.Description = Value;
29 } 31 }
30} 32}
31 33
32void AProfile::saveSpecificAttribute( QTextStream & TS ) { 34void AProfile::saveSpecificAttribute( QTextStream & TS ) {
33 TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; 35 TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl;
34 TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; 36 TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl;
35 TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; 37 TS << "enabled=" << ((Data.Enabled) ? "yes" : "no") << endl;
36 TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; 38 TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl;
37 TS << "description=" << Data.Description << endl; 39 TS << "description=" << Data.Description << endl;
38} 40}
39 41
40QWidget * AProfile::edit( QWidget * parent ) { 42QWidget * AProfile::edit( QWidget * parent ) {
41 GUI = new ProfileEdit( parent, this ); 43 GUI = new ProfileEdit( parent, this );
42 GUI->showData( Data ); 44 GUI->showData( Data );
43 return GUI; 45 return GUI;
44} 46}
45 47
46QString AProfile::acceptable( void ) { 48QString AProfile::acceptable( void ) {
47 return ( GUI ) ? GUI->acceptable( ) : QString(); 49 return ( GUI ) ? GUI->acceptable( ) : QString();
48} 50}
49 51
50void AProfile::commit( void ) { 52void AProfile::commit( void ) {
51 if( GUI && GUI->commit( Data ) ) 53 if( GUI && GUI->commit( Data ) )
52 setModified( 1 ); 54 setModified( 1 );
53} 55}
54 56
55short AProfile::generateFileEmbedded( SystemFile & SF, 57short AProfile::generateFileEmbedded( SystemFile & SF,
56 long DevNr ) { 58 long DevNr ) {
57 59
58 short rvl, rvd; 60 short rvl, rvd;
59 61
60 rvl = 1; 62 rvl = 1;
61 63
62 if( SF.name() == "interfaces" ) { 64 if( SF.name() == "interfaces" ) {
63 Log(("Generate Profile for %s\n", SF.name().latin1() )); 65 Log(("Generate Profile for %s\n", SF.name().latin1() ));
64 if( Data.TriggerVPN ) { 66 if( Data.TriggerVPN ) {
65 // this profile triggers VPN -> insert trigger 67 // this profile triggers VPN -> insert trigger
66 SF << " up " 68 SF << " up "
67 << QPEApplication::qpeDir() 69 << QPEApplication::qpeDir()
68 << "bin/networksettings2 --triggervpn " 70 << "bin/networksettings2 --triggervpn "
69 << runtime()->device()->netNode()->nodeClass()->genNic( DevNr ) 71 << runtime()->device()->netNode()->nodeClass()->genNic( DevNr )
70 << " || true" 72 << " || true"
71 << endl; 73 << endl;
72 rvl = 0; 74 rvl = 0;
73 } 75 }
74 } 76 }
75 rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr ); 77 rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr );
76 return (rvd == 2 || rvl == 2 ) ? 2 : 78 return (rvd == 2 || rvl == 2 ) ? 2 :
77 (rvd == 0 || rvl == 0 ) ? 0 : 1; 79 (rvd == 0 || rvl == 0 ) ? 0 : 1;
78} 80}
79 81
80 82
81 83
diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h
index 2f7060d..376b393 100644
--- a/noncore/settings/networksettings2/profile/profiledata.h
+++ b/noncore/settings/networksettings2/profile/profiledata.h
@@ -1,17 +1,17 @@
1#ifndef PROFILE_DATA_H 1#ifndef PROFILE_DATA_H
2#define PROFILE_DATA_H 2#define PROFILE_DATA_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5class ProfileData { 5class ProfileData {
6public : 6public :
7 QString Description; 7 QString Description;
8 // start up automatically 8 // start up automatically
9 bool Automatic; 9 bool Automatic;
10 // if started up automatically, ask user for confirmation 10 // if started up automatically, ask user for confirmation
11 bool Confirm; 11 bool Confirm;
12 // Do not bring this networkSetup up 12 // bring this networkSetup up
13 bool Disabled; 13 bool Enabled;
14 bool TriggerVPN; 14 bool TriggerVPN;
15} ; 15} ;
16 16
17#endif 17#endif
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp
index 1713f0c..818bad6 100644
--- a/noncore/settings/networksettings2/profile/profileedit.cpp
+++ b/noncore/settings/networksettings2/profile/profileedit.cpp
@@ -1,125 +1,125 @@
1#include <qlabel.h> 1#include <qlabel.h>
2#include <qgroupbox.h> 2#include <qgroupbox.h>
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qframe.h> 4#include <qframe.h>
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qmultilineedit.h> 6#include <qmultilineedit.h>
7#include <qcheckbox.h> 7#include <qcheckbox.h>
8 8
9#include <GUIUtils.h> 9#include <GUIUtils.h>
10#include <netnode.h> 10#include <netnode.h>
11#include <resources.h> 11#include <resources.h>
12 12
13#include "profileedit.h" 13#include "profileedit.h"
14 14
15ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : 15ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
16 ProfileGUI( Parent ), RefreshTimer(this) { 16 ProfileGUI( Parent ), RefreshTimer(this) {
17 InterfaceInfo * II; 17 InterfaceInfo * II;
18 18
19 II = TNNI->networkSetup()->assignedInterface(); 19 II = TNNI->networkSetup()->assignedInterface();
20 Log(( "Interface %p %p %p: %d\n", II, 20 Log(( "Interface %p %p %p: %d\n", II,
21 TNNI, TNNI->networkSetup(), (II) ? II->IsUp : 0 )); 21 TNNI, TNNI->networkSetup(), (II) ? II->IsUp : 0 ));
22 22
23 NNI = TNNI; 23 NNI = TNNI;
24 Dev = NNI->runtime()->device(); 24 Dev = NNI->runtime()->device();
25 if( ( II = NNI->networkSetup()->assignedInterface() ) ) { 25 if( ( II = NNI->networkSetup()->assignedInterface() ) ) {
26 26
27 Refresh_CB->setEnabled( TRUE ); 27 Refresh_CB->setEnabled( TRUE );
28 ResetODO_But->setEnabled( TRUE ); 28 ResetODO_But->setEnabled( TRUE );
29 Sending_GB->setEnabled( TRUE ); 29 Sending_GB->setEnabled( TRUE );
30 Receiving_GB->setEnabled( TRUE ); 30 Receiving_GB->setEnabled( TRUE );
31 Misc_GB->setEnabled( TRUE ); 31 Misc_GB->setEnabled( TRUE );
32 32
33 // show current content 33 // show current content
34 SLOT_Refresh(); 34 SLOT_Refresh();
35 35
36 // initialize ODO 36 // initialize ODO
37 SLOT_ResetODO(); 37 SLOT_ResetODO();
38 38
39 // fill in static data 39 // fill in static data
40 InterfaceName_LBL->setText( II->Name ); 40 InterfaceName_LBL->setText( II->Name );
41 IPAddress_LBL->setText( II->Address ); 41 IPAddress_LBL->setText( II->Address );
42 SubnetMask_LBL->setText( II->Netmask ); 42 SubnetMask_LBL->setText( II->Netmask );
43 Broadcast_LBL->setText( II->BCastAddress ); 43 Broadcast_LBL->setText( II->BCastAddress );
44 MACAddress_LBL->setText( II->MACAddress ); 44 MACAddress_LBL->setText( II->MACAddress );
45 if( II->IsPointToPoint ) { 45 if( II->IsPointToPoint ) {
46 PointToPoint_LBL->setText( II->DstAddress ); 46 PointToPoint_LBL->setText( II->DstAddress );
47 } 47 }
48 QString S; 48 QString S;
49 InterfaceName_LBL->setText( II->Name ); 49 InterfaceName_LBL->setText( II->Name );
50 if( II->HasMulticast ) { 50 if( II->HasMulticast ) {
51 S += "Multicast"; 51 S += "Multicast";
52 } 52 }
53 if( ! S.isEmpty() ) { 53 if( ! S.isEmpty() ) {
54 S.prepend( " : " ); 54 S.prepend( " : " );
55 } 55 }
56 InterfaceOptions_LBL->setText( S ); 56 InterfaceOptions_LBL->setText( S );
57 57
58 connect( &RefreshTimer, SIGNAL( timeout() ), 58 connect( &RefreshTimer, SIGNAL( timeout() ),
59 this, SLOT( SLOT_Refresh() ) ); 59 this, SLOT( SLOT_Refresh() ) );
60 } 60 }
61 61
62} 62}
63 63
64QString ProfileEdit::acceptable( void ) { 64QString ProfileEdit::acceptable( void ) {
65 return QString(); 65 return QString();
66} 66}
67 67
68void ProfileEdit::showData( ProfileData & Data ) { 68void ProfileEdit::showData( ProfileData & Data ) {
69 Description_LE->setText( Data.Description ); 69 Description_LE->setText( Data.Description );
70 Automatic_CB->setChecked( Data.Automatic ); 70 Automatic_CB->setChecked( Data.Automatic );
71 TriggersVPN_CB->setChecked( Data.TriggerVPN ); 71 TriggersVPN_CB->setChecked( Data.TriggerVPN );
72 Confirm_CB->setChecked( Data.Confirm ); 72 Confirm_CB->setChecked( Data.Confirm );
73 Disabled_CB->setChecked( Data.Disabled ); 73 Enabled_CB->setChecked( Data.Enabled );
74} 74}
75 75
76 76
77bool ProfileEdit::commit( ProfileData & Data ) { 77bool ProfileEdit::commit( ProfileData & Data ) {
78 bool SM = 0; 78 bool SM = 0;
79 TXTM( Data.Description, Description_LE, SM ); 79 TXTM( Data.Description, Description_LE, SM );
80 80
81 CBM( Data.Automatic, Automatic_CB, SM ); 81 CBM( Data.Automatic, Automatic_CB, SM );
82 CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); 82 CBM( Data.TriggerVPN, TriggersVPN_CB, SM );
83 CBM( Data.Disabled, Disabled_CB, SM ); 83 CBM( Data.Enabled, Enabled_CB, SM );
84 CBM( Data.Confirm, Confirm_CB, SM ); 84 CBM( Data.Confirm, Confirm_CB, SM );
85 85
86 return SM; 86 return SM;
87} 87}
88 88
89void ProfileEdit::SLOT_Refresh( void ) { 89void ProfileEdit::SLOT_Refresh( void ) {
90 InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); 90 InterfaceInfo * II = NNI->networkSetup()->assignedInterface();
91 QString S; 91 QString S;
92 NSResources->system().refreshStatistics( *II ); 92 NSResources->system().refreshStatistics( *II );
93 93
94 RcvBytes_LBL->setText( II->RcvBytes ); 94 RcvBytes_LBL->setText( II->RcvBytes );
95 RcvPackets_LBL->setText( II->RcvPackets ); 95 RcvPackets_LBL->setText( II->RcvPackets );
96 RcvErrors_LBL->setText( II->RcvErrors ); 96 RcvErrors_LBL->setText( II->RcvErrors );
97 RcvDropped_LBL->setText( II->RcvDropped ); 97 RcvDropped_LBL->setText( II->RcvDropped );
98 S.setNum( II->RcvBytes.toLong() - RcvODO ); 98 S.setNum( II->RcvBytes.toLong() - RcvODO );
99 RcvODO_LBL->setText( S ); 99 RcvODO_LBL->setText( S );
100 100
101 SndBytes_LBL->setText( II->SndBytes ); 101 SndBytes_LBL->setText( II->SndBytes );
102 SndPackets_LBL->setText( II->SndPackets ); 102 SndPackets_LBL->setText( II->SndPackets );
103 SndErrors_LBL->setText( II->SndErrors ); 103 SndErrors_LBL->setText( II->SndErrors );
104 SndDropped_LBL->setText( II->SndDropped ); 104 SndDropped_LBL->setText( II->SndDropped );
105 S.setNum( II->SndBytes.toLong() - SndODO ); 105 S.setNum( II->SndBytes.toLong() - SndODO );
106 SndODO_LBL->setText( S ); 106 SndODO_LBL->setText( S );
107 107
108 Collisions_LBL->setText( II->Collisions ); 108 Collisions_LBL->setText( II->Collisions );
109} 109}
110 110
111void ProfileEdit::SLOT_AutoRefresh( bool ar ) { 111void ProfileEdit::SLOT_AutoRefresh( bool ar ) {
112 if( ar ) { 112 if( ar ) {
113 RefreshTimer.start( 1000 ); 113 RefreshTimer.start( 1000 );
114 SLOT_Refresh(); 114 SLOT_Refresh();
115 } else { 115 } else {
116 RefreshTimer.stop(); 116 RefreshTimer.stop();
117 } 117 }
118} 118}
119 119
120void ProfileEdit::SLOT_ResetODO( void ) { 120void ProfileEdit::SLOT_ResetODO( void ) {
121 InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); 121 InterfaceInfo * II = NNI->networkSetup()->assignedInterface();
122 RcvODO = II->RcvBytes.toLong(); 122 RcvODO = II->RcvBytes.toLong();
123 SndODO = II->SndBytes.toLong(); 123 SndODO = II->SndBytes.toLong();
124 SLOT_Refresh(); 124 SLOT_Refresh();
125} 125}
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
index 77bf9ac..faa7d66 100644
--- a/noncore/settings/networksettings2/profile/profilerun.cpp
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -1,30 +1,30 @@
1#include <resources.h> 1#include <resources.h>
2 2
3#include "profilerun.h" 3#include "profilerun.h"
4 4
5State_t ProfileRun::detectState( void ) { 5State_t ProfileRun::detectState( void ) {
6 6
7 Log(( "Profile %sabled\n", (Data->Disabled) ? "dis" : "en" )); 7 Log(( "Profile %sabled\n", (Data->Enabled) ? "en" : "dis" ));
8 8
9 if( Data->Disabled ) { 9 if( Data->Enabled ) {
10 return Disabled; 10 return Unknown;
11 } 11 }
12 return Unknown; 12 return Disabled;
13} 13}
14 14
15QString ProfileRun::setMyState( NetworkSetup * NC, Action_t A, bool ) { 15QString ProfileRun::setMyState( NetworkSetup * NC, Action_t A, bool ) {
16 odebug << "Profile " << Data->Disabled << oendl; 16 odebug << "Profile " << Data->Enabled << oendl;
17 if( A == Disable ) { 17 if( A == Disable ) {
18 if( ! Data->Disabled ) { 18 if( Data->Enabled ) {
19 Data->Disabled = 1; 19 Data->Enabled = 0;
20 NC->setModified( 1 ); 20 NC->setModified( 1 );
21 } 21 }
22 } else if( A == Enable ) { 22 } else if( A == Enable ) {
23 if( Data->Disabled ) { 23 if( ! Data->Enabled ) {
24 Data->Disabled = 0; 24 Data->Enabled = 1;
25 NC->setModified( 1 ); 25 NC->setModified( 1 );
26 } 26 }
27 } 27 }
28 28
29 return QString(); 29 return QString();
30} 30}