author | wimpie <wimpie> | 2005-01-11 21:42:31 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-11 21:42:31 (UTC) |
commit | 96678694f8952f60d0a895cede2b621404b4bfb8 (patch) (side-by-side diff) | |
tree | 7138e554e5ba200b8f9ca8b51c89b47531dc34f2 /noncore/settings/networksettings2/profile | |
parent | f89120a7a1a3d0bf9c0805456490906ca914e560 (diff) | |
download | opie-96678694f8952f60d0a895cede2b621404b4bfb8.zip opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.gz opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.bz2 |
Major rename of NodeCollection to NetworkSetup
this commit is broken (missing symbols)
Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (show whitespace changes)
5 files changed, 17 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp index 1e6912e..007f4a5 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.cpp +++ b/noncore/settings/networksettings2/profile/profile_NN.cpp @@ -1,58 +1,58 @@ #include <resources.h> #include "profile_NN.h" #include "profile_NNI.h" #include "netnodeinterface.h" static const char * ProfileNeeds[] = - { "connection", + { "NetworkSetup", 0 }; static const char * ProfileProvides[] = { "fullsetup", 0 }; /** * Constructor, find all of the possible interfaces */ -ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) { +ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular NetworkSetup profile")) { NSResources->addSystemFile( "interfaces", "/etc/network/interfaces", 1 ); } /** * Delete any interfaces that we own. */ ProfileNetNode::~ProfileNetNode(){ } const QString ProfileNetNode::nodeDescription(){ return tr("\ -<p>Define use of an IP connection.</p>\ -<p>Configure if and when this connection needs to be established</p>\ +<p>Define use of an IP NetworkSetup.</p>\ +<p>Configure if and when this NetworkSetup needs to be established</p>\ " ); } ANetNodeInstance * ProfileNetNode::createInstance( void ) { return new AProfile( this ); } const char ** ProfileNetNode::needs( void ) { return ProfileNeeds; } const char ** ProfileNetNode::provides( void ) { return ProfileProvides; } void ProfileNetNode::setSpecificAttribute( QString & , QString & ) { } void ProfileNetNode::saveSpecificAttribute( QTextStream & ) { } OPIE_NS2_PLUGIN( NetNodeInterface_T<ProfileNetNode> ) diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h index c9577e5..2f7060d 100644 --- a/noncore/settings/networksettings2/profile/profiledata.h +++ b/noncore/settings/networksettings2/profile/profiledata.h @@ -1,17 +1,17 @@ #ifndef PROFILE_DATA_H #define PROFILE_DATA_H #include <qstring.h> class ProfileData { public : QString Description; // start up automatically bool Automatic; // if started up automatically, ask user for confirmation bool Confirm; - // Do not bring this connection up + // Do not bring this networkSetup up bool Disabled; bool TriggerVPN; } ; #endif diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index 88aab15..ad943fe 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp @@ -1,43 +1,47 @@ #include <qlabel.h> #include <qframe.h> #include <qcheckbox.h> #include <qmultilineedit.h> #include <qcheckbox.h> #include <GUIUtils.h> #include <netnode.h> #include <resources.h> #include "profileedit.h" ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : ProfileGUI( Parent ), RefreshTimer(this) { InterfaceInfo * II; + II = TNNI->networkSetup()->assignedInterface(); + Log(( "Interface %p %p %p: %d\n", II, + TNNI, TNNI->networkSetup(), (II) ? II->IsUp : 0 )); + NNI = TNNI; Dev = NNI->runtime()->device(); - if( ( II = NNI->connection()->assignedInterface() ) ) { + if( ( II = NNI->networkSetup()->assignedInterface() ) ) { Refresh_CB->setEnabled( TRUE ); Snd_GB->setEnabled( TRUE ); Rcv_GB->setEnabled( TRUE ); Collisions_FRM->setEnabled( TRUE ); // show current content SLOT_Refresh(); // fill in static data InterfaceName_LBL->setText( II->Name ); IPAddress_LBL->setText( II->Address ); SubnetMask_LBL->setText( II->Netmask ); Broadcast_LBL->setText( II->BCastAddress ); MACAddress_LBL->setText( II->MACAddress ); if( II->IsPointToPoint ) { PointToPoint_LBL->setText( II->DstAddress ); } QString S; InterfaceName_LBL->setText( II->Name ); if( II->HasMulticast ) { S += "Multicast"; } if( ! S.isEmpty() ) { @@ -56,43 +60,43 @@ QString ProfileEdit::acceptable( void ) { } void ProfileEdit::showData( ProfileData & Data ) { Description_LE->setText( Data.Description ); Automatic_CB->setChecked( Data.Automatic ); TriggersVPN_CB->setChecked( Data.TriggerVPN ); Confirm_CB->setChecked( Data.Confirm ); Disabled_CB->setChecked( Data.Disabled ); } bool ProfileEdit::commit( ProfileData & Data ) { bool SM = 0; TXTM( Data.Description, Description_LE, SM ); CBM( Data.Automatic, Automatic_CB, SM ); CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); CBM( Data.Disabled, Disabled_CB, SM ); CBM( Data.Confirm, Confirm_CB, SM ); return SM; } void ProfileEdit::SLOT_Refresh( void ) { - InterfaceInfo * II = NNI->connection()->assignedInterface(); + InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); NSResources->system().refreshStatistics( *II ); RcvBytes_LBL->setText( II->RcvBytes ); SndBytes_LBL->setText( II->SndBytes ); RcvErrors_LBL->setText( II->RcvErrors ); SndErrors_LBL->setText( II->SndErrors ); RcvDropped_LBL->setText( II->RcvDropped ); SndDropped_LBL->setText( II->SndDropped ); Collisions_LBL->setText( II->Collisions ); } void ProfileEdit::SLOT_AutoRefresh( bool ar ) { if( ar ) { RefreshTimer.start( 1000 ); SLOT_Refresh(); } else { RefreshTimer.stop(); } } diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index acb67bd..48011ea 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp @@ -1,27 +1,31 @@ #include <resources.h> #include "profilerun.h" State_t ProfileRun::detectState( void ) { + InterfaceInfo * II = networkSetup()->assignedInterface(); + + Log(( "Interface %p %p %p: %d\n", II, + netNode(), netNode()->networkSetup(), (II) ? II->IsUp : 0 )); if( Data->Disabled ) { return Disabled; } return Unknown; } -QString ProfileRun::setMyState( NodeCollection * NC, Action_t A, bool ) { +QString ProfileRun::setMyState( NetworkSetup * NC, Action_t A, bool ) { odebug << "Profile " << Data->Disabled << oendl; if( A == Disable ) { if( ! Data->Disabled ) { Data->Disabled = 1; NC->setModified( 1 ); } } else if( A == Enable ) { if( Data->Disabled ) { Data->Disabled = 0; NC->setModified( 1 ); } } return QString(); } diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h index 2d48b15..9470c0f 100644 --- a/noncore/settings/networksettings2/profile/profilerun.h +++ b/noncore/settings/networksettings2/profile/profilerun.h @@ -2,32 +2,32 @@ #define PROFILERUN_H #include <netnode.h> #include "profiledata.h" class ProfileRun : public RuntimeInfo { public : ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) : RuntimeInfo( NNI ) { Data = &D; } virtual RuntimeInfo * fullSetup( void ) { return this; } virtual const QString & description( void ) { return Data->Description; } virtual bool triggersVPN( void ) { return Data->TriggerVPN; } State_t detectState( void ); protected : - QString setMyState( NodeCollection * , Action_t, bool ); + QString setMyState( NetworkSetup * , Action_t, bool ); private : ProfileData * Data; }; #endif |