Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index b36c7a0..6ee4106 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp @@ -1,2 +1,3 @@ #include <stdio.h> +#include <unistd.h> @@ -63,2 +64,6 @@ NetworkSettings::NetworkSettings( QWidget *parent, + connect( &(NSResources->system()), + SIGNAL( lineFromCommand(const QString &) ), + this, SLOT( SLOT_CmdMessage(const QString &) ) ); + UpdateTimer->start( 5000 ); @@ -93,2 +98,8 @@ NetworkSettings::~NetworkSettings() { +void NetworkSettings::SLOT_CmdMessage( const QString & S ) { + Messages_LB->insertItem( S ); + Messages_LB->setCurrentItem( Messages_LB->count()-1 ); + Messages_LB->ensureCurrentVisible(); +} + void NetworkSettings::SLOT_RefreshStates( void ) { @@ -136,2 +147,5 @@ void NetworkSettings::SLOT_RefreshStates( void ) { +void NetworkSettings::SLOT_NoLongerBusy( void ) { + NSResources->busy( FALSE ); +} void NetworkSettings::SLOT_AddNode( void ) { @@ -174,2 +188,4 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { UpdateTimer->stop(); + NSResources->busy( TRUE ); + QTimer::singleShot( 1000, this, SLOT( SLOT_NoLongerBusy() )); // we need to retry @@ -208,3 +224,3 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { NSResources->addConnection( NC ); - NC->setNumber( NC->maxConnectionNumber()+1 ); + NC->setNumber( NSResources->assignConnectionNumber() ); Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); @@ -259,2 +275,3 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { OnOn = 1; + Connect_TB->setPixmap( NSResources->getPixmap( "disconnected" ) ); DisabledOn = 0; @@ -263,2 +280,3 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { OnOn = ConnectOn = 1; + Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) ); DisabledOn = 0; @@ -267,2 +285,6 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { + if( ! OnOn ) { + Connect_TB->setPixmap( NSResources->getPixmap( "disconnected" ) ); + } + // set button state @@ -277,3 +299,3 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { if( NC->description().isEmpty() ) { - Description_LBL->setText( tr( "No description" ) ); + Description_LBL->setText( tr( "<<No description>>" ) ); } else { @@ -282,4 +304,3 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { - Profile_GB->setTitle( LBI->text() ); - State_LBL->setText( NC->stateName() ); + Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() ); } @@ -416,2 +437,3 @@ void NetworkSettings::SLOT_Connect( void ) { void NetworkSettings::SLOT_Disconnect( void ) { + QString S; QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); @@ -424,3 +446,7 @@ void NetworkSettings::SLOT_Disconnect( void ) { + Log(( "Force interface %s down\n", NC->name().latin1() )); NC->setState( Down, 1 ); + // remove 'up' file to make sure + S.sprintf( "/tmp/Profile-%d.up", NC->number() ); + unlink( S.latin1() ); } |