Diffstat (limited to 'noncore/settings/networksettings2/usb/usb_NNI.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NNI.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp index 6fcd6d5..e90204c 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.cpp +++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp | |||
@@ -23,35 +23,30 @@ QWidget * AUSB::edit( QWidget * parent ) { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | QString AUSB::acceptable( void ) { | 25 | QString AUSB::acceptable( void ) { |
26 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 26 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
27 | } | 27 | } |
28 | 28 | ||
29 | void AUSB::commit( void ) { | 29 | void AUSB::commit( void ) { |
30 | if( GUI && GUI->commit( Data ) ) { | 30 | if( GUI && GUI->commit( Data ) ) { |
31 | setModified( 1 ); | 31 | setModified( 1 ); |
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
35 | bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { | 35 | bool AUSB::hasDataFor( const QString & S ) { |
36 | AsDevice * Dev = runtime()->device(); | 36 | return (S== "interfaces"); |
37 | QString NIC = Dev->genNic( DevNr ); | ||
38 | |||
39 | if( S.name() == "interfaces" ) { | ||
40 | // generate mapping stanza for this interface | ||
41 | S << " pre-up " << QPEApplication::qpeDir() << "bin/setmacaddress.sh " << NIC << " || true" << endl; | ||
42 | } | ||
43 | return 0; | ||
44 | } | 37 | } |
45 | 38 | ||
46 | bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { | 39 | bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { |
47 | AsDevice * Dev = runtime()->device(); | 40 | QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); |
48 | QString NIC = Dev->genNic( DevNr ); | ||
49 | 41 | ||
50 | if( S.name() == "interfaces" ) { | 42 | if( S.name() == "interfaces" ) { |
51 | // generate mapping stanza for this interface | 43 | // generate mapping stanza for this interface |
52 | S << "# check if " << NIC << " can be brought UP" << endl; | 44 | S << " pre-up " |
53 | S << "mapping " << NIC << endl; | 45 | << QPEApplication::qpeDir() |
54 | S << " script networksettings2-request" << endl << endl; | 46 | << "bin/setmacaddress.sh " |
47 | << NIC | ||
48 | << " || true" | ||
49 | << endl; | ||
55 | } | 50 | } |
56 | return 0; | 51 | return 0; |
57 | } | 52 | } |