summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index 3ddcbde..b36c7a0 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -20,23 +20,27 @@
20NetworkSettings::NetworkSettings( QWidget *parent, 20NetworkSettings::NetworkSettings( QWidget *parent,
21 const char *name, 21 const char *name,
22 WFlags fl ) : NetworkSettingsGUI(parent,name,fl), 22 WFlags fl ) : NetworkSettingsGUI(parent,name,fl),
23 NSD() { 23 NSD() {
24 24
25 UpdateTimer = new QTimer( this ); 25 UpdateTimer = new QTimer( this );
26
26 // set pixmaps 27 // set pixmaps
27 Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); 28 Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
28 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) ); 29 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) );
29 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) ); 30 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) );
30 Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) ); 31 Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) );
31 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) ); 32 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) );
32 33
33 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) ); 34 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
35 Disconnect_TB->setPixmap( NSResources->getPixmap( "disconnected" ) );
34 36
35 On_TB->setPixmap( NSResources->getPixmap( "off" ) ); 37 On_TB->setPixmap( NSResources->getPixmap( "off" ) );
36 38
39 SLOT_ToProfile();
40
37 // populate main Listbox 41 // populate main Listbox
38 Profiles_LB->clear(); 42 Profiles_LB->clear();
39 { Name2Connection_t & M = NSResources->connections(); 43 { Name2Connection_t & M = NSResources->connections();
40 NodeCollection * NC; 44 NodeCollection * NC;
41 // for all connections 45 // for all connections
42 for( QDictIterator<NodeCollection> it(M); 46 for( QDictIterator<NodeCollection> it(M);
@@ -273,13 +277,13 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
273 if( NC->description().isEmpty() ) { 277 if( NC->description().isEmpty() ) {
274 Description_LBL->setText( tr( "No description" ) ); 278 Description_LBL->setText( tr( "No description" ) );
275 } else { 279 } else {
276 Description_LBL->setText( NC->description() ); 280 Description_LBL->setText( NC->description() );
277 } 281 }
278 282
279 CurProfile_GB->setTitle( LBI->text() ); 283 Profile_GB->setTitle( LBI->text() );
280 State_LBL->setText( NC->stateName() ); 284 State_LBL->setText( NC->stateName() );
281} 285}
282 286
283void NetworkSettings::SLOT_CheckState( void ) { 287void NetworkSettings::SLOT_CheckState( void ) {
284 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 288 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
285 if ( ! LBI ) 289 if ( ! LBI )
@@ -406,12 +410,34 @@ void NetworkSettings::SLOT_Connect( void ) {
406 tr( "Cannot enable profile" ) ); 410 tr( "Cannot enable profile" ) );
407 } 411 }
408 412
409 // we do not update the GUI but wait for the REAL upping of the device 413 // we do not update the GUI but wait for the REAL upping of the device
410} 414}
411 415
416void NetworkSettings::SLOT_Disconnect( void ) {
417 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
418
419 if ( ! LBI )
420 return;
421
422 NodeCollection * NC =
423 NSResources->findConnection( LBI->text() );
424
425 NC->setState( Down, 1 );
426}
427
428void NetworkSettings::SLOT_ToMessages( void ) {
429 Profile_GB->hide();
430 Messages_GB->show();
431}
432
433void NetworkSettings::SLOT_ToProfile( void ) {
434 Profile_GB->show();
435 Messages_GB->hide();
436}
437
412void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) { 438void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) {
413 QDataStream stream( data, IO_ReadOnly ); 439 QDataStream stream( data, IO_ReadOnly );
414 440
415 if( msg == "raise" ) { 441 if( msg == "raise" ) {
416 raise(); 442 raise();
417 return; 443 return;