summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth.pro2
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp16
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp4
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h5
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h5
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp4
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h5
-rw-r--r--noncore/settings/networksettings2/cable/cable.pro2
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS.pro2
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/irda/irda.pro2
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/lancard/lancard.pro2
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/modem/modem.pro2
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/network/network.pro2
-rw-r--r--noncore/settings/networksettings2/network/network_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnodeinterface.h139
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp179
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.h65
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTDevice.h6
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTDeviceAddress.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTDriver.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTGateway.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTHCISocket.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTIcons.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTInquiry.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTPeer.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTSDPAttribute.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTSDPService.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTUUID.h2
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.h14
-rw-r--r--noncore/settings/networksettings2/ppp/ppp.pro2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/profile/profile.pro2
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/usb/usb.pro2
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.cpp2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn.pro2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp15
-rw-r--r--noncore/settings/networksettings2/wlan/wlan.pro2
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp15
45 files changed, 576 insertions, 77 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth.pro b/noncore/settings/networksettings2/bluetooth/bluetooth.pro
index 2e3b5bb..053a6cb 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth.pro
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = bluetoothBNEP_NN.h \ 4 HEADERS = bluetoothBNEP_NN.h \
5 bluetoothBNEP_NNI.h \ 5 bluetoothBNEP_NNI.h \
6 bluetoothRFCOMM_NN.h \ 6 bluetoothRFCOMM_NN.h \
7 bluetoothRFCOMM_NNI.h \ 7 bluetoothRFCOMM_NNI.h \
8 bluetoothBNEPedit.h \ 8 bluetoothBNEPedit.h \
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp
index ee3e92b..5e4d951 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp
@@ -1,10 +1,16 @@
1#include "bluetoothBNEP_NN.h" 1#include "bluetoothBNEP_NN.h"
2#include "bluetoothBNEP_NNI.h" 2#include "bluetoothBNEP_NNI.h"
3#include "bluetoothRFCOMM_NNI.h" 3#include "bluetoothRFCOMM_NNI.h"
4 4
5#ifndef MYPLUGIN
6
7#include "netnodeinterface.h"
8
9#endif
10
5// 11//
6// 12//
7// BLUETOOTH PAN/NAP node 13// BLUETOOTH PAN/NAP node
8// 14//
9// 15//
10 16
@@ -66,13 +72,23 @@ void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) {
66void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) { 72void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) {
67 TS << "interfacecount=" 73 TS << "interfacecount="
68 << InstanceCount 74 << InstanceCount
69 << endl; 75 << endl;
70} 76}
71 77
78#ifndef MYPLUGIN
79
72extern "C" { 80extern "C" {
73// create plugin registers both BT functions 81// create plugin registers both BT functions
74void create_plugin( QList<ANetNode> & PNN ) { 82void create_plugin( QList<ANetNode> & PNN ) {
75 PNN.append( new BluetoothBNEPNetNode() ); 83 PNN.append( new BluetoothBNEPNetNode() );
76 PNN.append( new BluetoothRFCOMMNetNode() ); 84 PNN.append( new BluetoothRFCOMMNetNode() );
77} 85}
86
87#else
88
89typedef Opie::Core::MakeTypelist<BluetoothBNEPNetNode, BluetoothRFCOMMNetNode>::Result BluetoothTypes;
90OPIE_NS2_PLUGIN( NetNodeInterface<BluetoothTypes> )
91
92#endif
93
78} 94}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
index 9d4ae97..5c937a1 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
@@ -1,12 +1,16 @@
1#include <qfile.h> 1#include <qfile.h>
2#include <qfileinfo.h> 2#include <qfileinfo.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <resources.h> 4#include <resources.h>
5#include "bluetoothBNEPrun.h" 5#include "bluetoothBNEPrun.h"
6 6
7using Opietooth2::OTGateway;
8using Opietooth2::OTPANConnection;
9using Opietooth2::PANConnectionVector;
10
7BluetoothBNEPRun::BluetoothBNEPRun( ANetNodeInstance * NNI, 11BluetoothBNEPRun::BluetoothBNEPRun( ANetNodeInstance * NNI,
8 BluetoothBNEPData & D ) : 12 BluetoothBNEPData & D ) :
9 RuntimeInfo( NNI ), 13 RuntimeInfo( NNI ),
10 Data( D), 14 Data( D),
11 Pat( "bnep[0-6]" ) { 15 Pat( "bnep[0-6]" ) {
12 OT = 0; 16 OT = 0;
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
index a05a7a2..8551a2e 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
@@ -1,11 +1,10 @@
1#include <netnode.h> 1#include <netnode.h>
2#include "bluetoothBNEPdata.h" 2#include "bluetoothBNEPdata.h"
3 3
4#include <OTGateway.h> 4#include <OTGateway.h>
5using namespace Opietooth2;
6 5
7class BluetoothBNEPRun : public RuntimeInfo { 6class BluetoothBNEPRun : public RuntimeInfo {
8 7
9public : 8public :
10 9
11 BluetoothBNEPRun( ANetNodeInstance * NNI, 10 BluetoothBNEPRun( ANetNodeInstance * NNI,
@@ -27,9 +26,9 @@ protected :
27 26
28private : 27private :
29 28
30 bool hasFreePANConnection( bool Grab = 0 ); 29 bool hasFreePANConnection( bool Grab = 0 );
31 30
32 BluetoothBNEPData & Data; 31 BluetoothBNEPData & Data;
33 OTGateway * OT; 32 Opietooth2::OTGateway * OT;
34 QRegExp Pat; 33 QRegExp Pat;
35}; 34};
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h
index 9ad8f2a..fe474fc 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h
@@ -1,25 +1,24 @@
1#include "bluetoothRFCOMMdata.h" 1#include "bluetoothRFCOMMdata.h"
2#include "bluetoothRFCOMMGUI.h" 2#include "bluetoothRFCOMMGUI.h"
3 3
4#include <Opietooth.h> 4#include <Opietooth.h>
5using namespace Opietooth2;
6 5
7class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI { 6class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI {
8 7
9public : 8public :
10 9
11 BluetoothRFCOMMEdit( QWidget * parent ); 10 BluetoothRFCOMMEdit( QWidget * parent );
12 virtual ~BluetoothRFCOMMEdit( void ); 11 virtual ~BluetoothRFCOMMEdit( void );
13 12
14 QString acceptable( void ); 13 QString acceptable( void );
15 void showData( BluetoothRFCOMMData & Data ); 14 void showData( BluetoothRFCOMMData & Data );
16 bool commit( BluetoothRFCOMMData & Data ); 15 bool commit( BluetoothRFCOMMData & Data );
17 16
18 bool Modified; 17 bool Modified;
19 OTGateway * OT; 18 Opietooth2::OTGateway * OT;
20 19
21public slots : 20public slots :
22 21
23 void SLOT_AddServer( void ); 22 void SLOT_AddServer( void );
24 void SLOT_RemoveServer( void ); 23 void SLOT_RemoveServer( void );
25 void SLOT_FindDevice( void ); 24 void SLOT_FindDevice( void );
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
index 1e91ed1..ef6878a 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
@@ -1,13 +1,15 @@
1#include <qapplication.h> 1#include <qapplication.h>
2#include <resources.h> 2#include <resources.h>
3#include <OTDevice.h> 3#include <OTDevice.h>
4#include <OTGateway.h> 4#include <OTGateway.h>
5#include "bluetoothRFCOMMrun.h" 5#include "bluetoothRFCOMMrun.h"
6 6
7using namespace Opietooth2; 7using Opietooth2::OTGateway;
8using Opietooth2::OTDevice;
9using Opietooth2::OTDeviceAddress;
8 10
9BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) { 11BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) {
10 if( OT ) { 12 if( OT ) {
11 OTGateway::releaseOTGateway(); 13 OTGateway::releaseOTGateway();
12 } 14 }
13} 15}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
index 24e3dae..5a31a94 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
@@ -1,11 +1,10 @@
1#include <netnode.h> 1#include <netnode.h>
2#include "bluetoothRFCOMMdata.h" 2#include "bluetoothRFCOMMdata.h"
3 3
4#include <OTGateway.h> 4#include <OTGateway.h>
5using namespace Opietooth2;
6 5
7class BluetoothRFCOMMRun : public RuntimeInfo { 6class BluetoothRFCOMMRun : public RuntimeInfo {
8 7
9public : 8public :
10 9
11 BluetoothRFCOMMRun( ANetNodeInstance * NNI, 10 BluetoothRFCOMMRun( ANetNodeInstance * NNI,
@@ -24,10 +23,10 @@ protected :
24 QString setMyState( NodeCollection * , Action_t, bool ); 23 QString setMyState( NodeCollection * , Action_t, bool );
25 24
26private : 25private :
27 26
28 int deviceNrOfConnection( void ); 27 int deviceNrOfConnection( void );
29 RFCOMMChannel * getChannel( void ); 28 RFCOMMChannel * getChannel( void );
30 BluetoothRFCOMMData * Data; 29 BluetoothRFCOMMData * Data;
31 Opietooth2::OTGateway * OT; 30 Opietooth2::OTGateway * OT;
32 int DeviceNr; // cached from detection 31 int DeviceNr; // cached from detection
33}; 32};
diff --git a/noncore/settings/networksettings2/cable/cable.pro b/noncore/settings/networksettings2/cable/cable.pro
index 8a046b7..660f95e 100644
--- a/noncore/settings/networksettings2/cable/cable.pro
+++ b/noncore/settings/networksettings2/cable/cable.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = cable_NN.h \ 4 HEADERS = cable_NN.h \
5 cable_NNI.h \ 5 cable_NNI.h \
6 cableedit.h 6 cableedit.h
7 SOURCES = cable_NN.cpp \ 7 SOURCES = cable_NN.cpp \
8 cable_NNI.cpp \ 8 cable_NNI.cpp \
diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp
index dc4205c..20299e4 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NN.cpp
@@ -1,9 +1,15 @@
1#include "cable_NN.h" 1#include "cable_NN.h"
2#include "cable_NNI.h" 2#include "cable_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h"
7
8#endif
9
4static const char * CableNeeds[] = 10static const char * CableNeeds[] =
5 { 0 11 { 0
6 }; 12 };
7 13
8static const char * CableProvides[] = 14static const char * CableProvides[] =
9 { "line", 15 { "line",
@@ -44,11 +50,20 @@ const char ** CableNetNode::provides( void ) {
44void CableNetNode::setSpecificAttribute( QString & , QString & ) { 50void CableNetNode::setSpecificAttribute( QString & , QString & ) {
45} 51}
46 52
47void CableNetNode::saveSpecificAttribute( QTextStream & ) { 53void CableNetNode::saveSpecificAttribute( QTextStream & ) {
48} 54}
49 55
56#ifdef MYPLUGIN
57
50extern "C" { 58extern "C" {
51void create_plugin( QList<ANetNode> & PNN ) { 59void create_plugin( QList<ANetNode> & PNN ) {
52 PNN.append( new CableNetNode() ); 60 PNN.append( new CableNetNode() );
53} 61}
62
63#else
64
65OPIE_NS2_PLUGIN( NetNodeInterface<CableNetNode> )
66
67#endif
68
54} 69}
diff --git a/noncore/settings/networksettings2/gprs/GPRS.pro b/noncore/settings/networksettings2/gprs/GPRS.pro
index 7818415..480c872 100644
--- a/noncore/settings/networksettings2/gprs/GPRS.pro
+++ b/noncore/settings/networksettings2/gprs/GPRS.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = GPRS_NN.h \ 4 HEADERS = GPRS_NN.h \
5 GPRS_NNI.h \ 5 GPRS_NNI.h \
6 GPRSedit.h 6 GPRSedit.h
7 SOURCES = GPRS_NN.cpp \ 7 SOURCES = GPRS_NN.cpp \
8 GPRS_NNI.cpp \ 8 GPRS_NNI.cpp \
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NN.cpp b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
index 5393324..4415739 100644
--- a/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
+++ b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
@@ -1,12 +1,18 @@
1#include <resources.h> 1#include <resources.h>
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <netnode.h> 3#include <netnode.h>
4#include "GPRS_NN.h" 4#include "GPRS_NN.h"
5#include "GPRS_NNI.h" 5#include "GPRS_NNI.h"
6 6
7#ifndef MYPLUGIN
8
9#include "netnodeinterface.h"
10
11#endif
12
7static const char * GPRSNeeds[] = 13static const char * GPRSNeeds[] =
8 { "GPRS", 14 { "GPRS",
9 0 15 0
10 }; 16 };
11 17
12static const char * GPRSProvides[] = 18static const char * GPRSProvides[] =
@@ -70,11 +76,20 @@ QStringList GPRSNetNode::properFiles( void ) {
70 SL << "peers"; 76 SL << "peers";
71 SL << "chatscripts"; 77 SL << "chatscripts";
72 SL << "extra"; 78 SL << "extra";
73 return SL; 79 return SL;
74} 80}
75 81
82#ifdef MYPLUGIN
83
76extern "C" { 84extern "C" {
77void create_plugin( QList<ANetNode> & PNN ) { 85void create_plugin( QList<ANetNode> & PNN ) {
78 PNN.append( new GPRSNetNode() ); 86 PNN.append( new GPRSNetNode() );
79} 87}
88
89#else
90
91OPIE_NS2_PLUGIN( NetNodeInterface<GPRSNetNode> )
92
93#endif
94
80} 95}
diff --git a/noncore/settings/networksettings2/irda/irda.pro b/noncore/settings/networksettings2/irda/irda.pro
index 4613abe..87f7a62 100644
--- a/noncore/settings/networksettings2/irda/irda.pro
+++ b/noncore/settings/networksettings2/irda/irda.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = irda_NN.h \ 4 HEADERS = irda_NN.h \
5 irda_NNI.h \ 5 irda_NNI.h \
6 irdaedit.h 6 irdaedit.h
7 SOURCES = irda_NN.cpp \ 7 SOURCES = irda_NN.cpp \
8 irda_NNI.cpp \ 8 irda_NNI.cpp \
diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp
index 485cad3..6858157 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.cpp
+++ b/noncore/settings/networksettings2/irda/irda_NN.cpp
@@ -1,9 +1,15 @@
1#include "irda_NN.h" 1#include "irda_NN.h"
2#include "irda_NNI.h" 2#include "irda_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h"
7
8#endif
9
4static const char * IRDANeeds[] = 10static const char * IRDANeeds[] =
5 { 0 11 { 0
6 }; 12 };
7 13
8static const char * IRDAProvides[] = 14static const char * IRDAProvides[] =
9 { "line", 15 { "line",
@@ -44,11 +50,20 @@ const char ** IRDANetNode::provides( void ) {
44void IRDANetNode::setSpecificAttribute( QString & , QString & ) { 50void IRDANetNode::setSpecificAttribute( QString & , QString & ) {
45} 51}
46 52
47void IRDANetNode::saveSpecificAttribute( QTextStream & ) { 53void IRDANetNode::saveSpecificAttribute( QTextStream & ) {
48} 54}
49 55
56#ifdef MYPLUGIN
57
50extern "C" { 58extern "C" {
51void create_plugin( QList<ANetNode> & PNN ) { 59void create_plugin( QList<ANetNode> & PNN ) {
52 PNN.append( new IRDANetNode() ); 60 PNN.append( new IRDANetNode() );
53} 61}
62
63#else
64
65OPIE_NS2_PLUGIN( NetNodeInterface<IRDANetNode> )
66
67#endif
68
54} 69}
diff --git a/noncore/settings/networksettings2/lancard/lancard.pro b/noncore/settings/networksettings2/lancard/lancard.pro
index 6f04e01..05f0fa0 100644
--- a/noncore/settings/networksettings2/lancard/lancard.pro
+++ b/noncore/settings/networksettings2/lancard/lancard.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = lancard_NN.h \ 4 HEADERS = lancard_NN.h \
5 lancard_NNI.h \ 5 lancard_NNI.h \
6 lancardedit.h 6 lancardedit.h
7 SOURCES = lancard_NN.cpp \ 7 SOURCES = lancard_NN.cpp \
8 lancard_NNI.cpp \ 8 lancard_NNI.cpp \
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index e36f757..fce3d29 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -1,9 +1,15 @@
1#include "lancard_NN.h" 1#include "lancard_NN.h"
2#include "lancard_NNI.h" 2#include "lancard_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h"
7
8#endif
9
4static const char * LanCardNeeds[] = 10static const char * LanCardNeeds[] =
5 { 0 11 { 0
6 }; 12 };
7 13
8static const char * LanCardProvides[] = 14static const char * LanCardProvides[] =
9 { "device", 15 { "device",
@@ -67,11 +73,20 @@ void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) {
67 TS << "macaddress=" 73 TS << "macaddress="
68 << (*it) 74 << (*it)
69 << endl; 75 << endl;
70 } 76 }
71} 77}
72 78
79#ifdef MYPLUGIN
80
73extern "C" { 81extern "C" {
74void create_plugin( QList<ANetNode> & PNN ) { 82void create_plugin( QList<ANetNode> & PNN ) {
75 PNN.append( new LanCardNetNode() ); 83 PNN.append( new LanCardNetNode() );
76} 84}
85
86#else
87
88OPIE_NS2_PLUGIN( NetNodeInterface<LanCardNetNode> )
89
90#endif
91
77} 92}
diff --git a/noncore/settings/networksettings2/modem/modem.pro b/noncore/settings/networksettings2/modem/modem.pro
index 25e29d4..4511e07 100644
--- a/noncore/settings/networksettings2/modem/modem.pro
+++ b/noncore/settings/networksettings2/modem/modem.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = modem_NN.h \ 4 HEADERS = modem_NN.h \
5 modem_NNI.h \ 5 modem_NNI.h \
6 modemedit.h 6 modemedit.h
7 SOURCES = modem_NN.cpp \ 7 SOURCES = modem_NN.cpp \
8 modem_NNI.cpp \ 8 modem_NNI.cpp \
diff --git a/noncore/settings/networksettings2/modem/modem_NN.cpp b/noncore/settings/networksettings2/modem/modem_NN.cpp
index 06f417c..c7f6e78 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.cpp
+++ b/noncore/settings/networksettings2/modem/modem_NN.cpp
@@ -1,9 +1,15 @@
1#include "modem_NN.h" 1#include "modem_NN.h"
2#include "modem_NNI.h" 2#include "modem_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h"
7
8#endif
9
4static const char * ModemNeeds[] = 10static const char * ModemNeeds[] =
5 { "line", 11 { "line",
6 0 12 0
7 }; 13 };
8static const char * ModemProvides[] = 14static const char * ModemProvides[] =
9 { "modem", 15 { "modem",
@@ -45,11 +51,20 @@ const char ** ModemNetNode::provides( void ) {
45void ModemNetNode::setSpecificAttribute( QString & , QString & ) { 51void ModemNetNode::setSpecificAttribute( QString & , QString & ) {
46} 52}
47 53
48void ModemNetNode::saveSpecificAttribute( QTextStream & ) { 54void ModemNetNode::saveSpecificAttribute( QTextStream & ) {
49} 55}
50 56
57#ifdef MYPLUGIN
58
51extern "C" { 59extern "C" {
52void create_plugin( QList<ANetNode> & PNN ) { 60void create_plugin( QList<ANetNode> & PNN ) {
53 PNN.append( new ModemNetNode() ); 61 PNN.append( new ModemNetNode() );
54} 62}
63
64#else
65
66OPIE_NS2_PLUGIN( NetNodeInterface<ModemNetNode> )
67
68#endif
69
55} 70}
diff --git a/noncore/settings/networksettings2/network/network.pro b/noncore/settings/networksettings2/network/network.pro
index 05df007..5ca78b9 100644
--- a/noncore/settings/networksettings2/network/network.pro
+++ b/noncore/settings/networksettings2/network/network.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = network_NN.h \ 4 HEADERS = network_NN.h \
5 network_NNI.h \ 5 network_NNI.h \
6 networkedit.h 6 networkedit.h
7 SOURCES = network_NN.cpp \ 7 SOURCES = network_NN.cpp \
8 network_NNI.cpp \ 8 network_NNI.cpp \
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
index 23b3d44..82d0c29 100644
--- a/noncore/settings/networksettings2/network/network_NN.cpp
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -1,12 +1,18 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <resources.h> 2#include <resources.h>
3#include <netnode.h> 3#include <netnode.h>
4#include "network_NN.h" 4#include "network_NN.h"
5#include "network_NNI.h" 5#include "network_NNI.h"
6 6
7#ifndef MYPLUGIN
8
9#include "netnodeinterface.h"
10
11#endif
12
7static const char * NetworkNeeds[] = 13static const char * NetworkNeeds[] =
8 { "device", 14 { "device",
9 0 15 0
10 }; 16 };
11 17
12static const char * NetworkProvides[] = 18static const char * NetworkProvides[] =
@@ -87,11 +93,20 @@ const char ** NetworkNetNode::provides( void ) {
87void NetworkNetNode::setSpecificAttribute( QString & , QString & ) { 93void NetworkNetNode::setSpecificAttribute( QString & , QString & ) {
88} 94}
89 95
90void NetworkNetNode::saveSpecificAttribute( QTextStream & ) { 96void NetworkNetNode::saveSpecificAttribute( QTextStream & ) {
91} 97}
92 98
99#ifdef MYPLUGIN
100
93extern "C" { 101extern "C" {
94void create_plugin( QList<ANetNode> & PNN ) { 102void create_plugin( QList<ANetNode> & PNN ) {
95 PNN.append( new NetworkNetNode() ); 103 PNN.append( new NetworkNetNode() );
96} 104}
105
106#else
107
108OPIE_NS2_PLUGIN( NetNodeInterface<NetworkNetNode> )
109
110#endif
111
97} 112}
diff --git a/noncore/settings/networksettings2/networksettings2/netnodeinterface.h b/noncore/settings/networksettings2/networksettings2/netnodeinterface.h
new file mode 100644
index 0000000..34f3bb5
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/netnodeinterface.h
@@ -0,0 +1,139 @@
1/*
2                 This file is part of the Opie Project
3
4 Copyright (C) 2005 Holger Hans Peter Freyther <freyther@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#ifndef ANET_NODE_INTERFACE_H
33#define ANET_NODE_INTERFACE_H
34
35#include <opie2/oapplicationfactory.h>
36#include <qpe/qcom.h>
37
38// {A215A785-FB73-4F74-84B0-053BCC77DB87}
39#ifndef IID_NetworkSettings2
40
41#define IID_NetworkSettings2 QUuid( 0xa215a785, 0xfb73, 0x4f74, 0x84, 0xb0, 0x05, 0x3b, 0xcc, 0x77, 0xdb, 0x87)
42
43#endif
44
45
46
47/**
48 * Multiple Types
49 */
50template <class Node >
51struct NS2PrivateFactory {
52
53 inline static void createPlugins( QList<ANetNode> & PNN) {
54 PNN.append( new Node());
55 }
56
57};
58
59/*
60 * Stop recursion here
61 */
62template <>
63struct NS2PrivateFactory<Opie::Core::NullType> {
64
65 inline static void createPlugins( QList<ANetNode> &) {
66
67 }
68
69};
70
71template <class Node, class Tail>
72struct NS2PrivateFactory<Opie::Core::Typelist<Node, Tail> > {
73
74 inline static void createPlugins( QList<ANetNode> & PNN ) {
75 NS2PrivateFactory<Node>::createPlugins(PNN);
76 NS2PrivateFactory<Tail>::createPlugins(PNN);
77 }
78
79};
80
81template<class Node>
82struct NetNodeInterface : public QUnknownInterface {
83
84 QRESULT queryInterface(const QUuid& uuid, QUnknownInterface **iface) {
85 *iface = 0;
86
87 if( uuid == IID_QUnknown )
88 *iface = this;
89 else if( uuid == IID_NetworkSettings2 )
90 *iface = this;
91 else
92 return QS_FALSE;
93
94 (*iface)->addRef();
95
96 return QS_OK;
97
98 }
99
100 void create_plugin( QList<ANetNode> & PNN ) {
101
102 PNN.append( new Node());
103
104 }
105
106 Q_REFCOUNT
107};
108
109template<class Node, class Tail>
110struct NetNodeInterface<Opie::Core::Typelist<Node, Tail> >
111 : public QUnknownInterface {
112
113 QRESULT queryInterface( const QUuid& uuid,
114 QUnknownInterface **iface) {
115
116 *iface = 0;
117
118 if( uuid == IID_QUnknown ) *iface = this;
119 else if( uuid == IID_NetworkSettings2 ) *iface = this;
120 else return QS_FALSE;
121
122 (*iface)->addRef();
123 return QS_OK;
124
125 }
126
127 void create_plugin( QList<ANetNode> & PNN ) {
128 NS2PrivateFactory<Opie::Core::Typelist<Node,Tail> >::createPlugin( PNN );
129 }
130
131 Q_REFCOUNT
132
133};
134
135#define OPIE_NS2_PLUGIN( factory ) \
136 Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( factory) }
137
138#endif
139
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index 50fb15a..79d41ea 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -1,19 +1,25 @@
1#include <unistd.h> 1#include <unistd.h>
2#include <errno.h> 2#include <errno.h>
3#include <fcntl.h> 3#include <fcntl.h>
4#include <pwd.h> 4#include <pwd.h>
5#include <qpixmap.h> 5#include <qpixmap.h>
6#include <qdir.h> 6#include <qdir.h>
7#include <qmessagebox.h>
8
7#include <qpe/qlibrary.h> 9#include <qpe/qlibrary.h>
8#include <qpe/qpeapplication.h> 10#include <qpe/qpeapplication.h>
11
9#include <opie2/odebug.h> 12#include <opie2/odebug.h>
13#include <opie2/opluginloader.h>
14
10#include <qtopia/resource.h> 15#include <qtopia/resource.h>
11 16
12#include "netnode.h" 17#include "netnode.h"
13#include "resources.h" 18#include "resources.h"
19#include "netnodeinterface.h"
14 20
15#define PLUGINDIR "plugins/networksettings2" 21#define PLUGINDIR "plugins/networksettings2"
16#define ICONDIR "/pics/networksettings2/" 22#define ICONDIR "/pics/networksettings2/"
17 23
18// single resources instance 24// single resources instance
19TheNSResources * _NSResources = 0; 25TheNSResources * _NSResources = 0;
@@ -23,12 +29,15 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
23 29
24 _NSResources = this; 30 _NSResources = this;
25 31
26 detectCurrentUser(); 32 detectCurrentUser();
27 33
28 // load available netnodes 34 // load available netnodes
35
36#ifdef MYPLUGIN
37
29 findAvailableNetNodes(QPEApplication::qpeDir() + PLUGINDIR ); 38 findAvailableNetNodes(QPEApplication::qpeDir() + PLUGINDIR );
30 39
31 // compile provides and needs lists 40 // compile provides and needs lists
32 { const char ** NeedsRun; 41 { const char ** NeedsRun;
33 QDictIterator<NetNode_t> OuterIt( AllNodeTypes ); 42 QDictIterator<NetNode_t> OuterIt( AllNodeTypes );
34 bool Done; 43 bool Done;
@@ -63,12 +72,58 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
63 } 72 }
64 } 73 }
65 OuterIt.current()->NetNode->setAlternatives( NNLP ); 74 OuterIt.current()->NetNode->setAlternatives( NNLP );
66 } 75 }
67 } 76 }
68 77
78#else
79
80 Plugins = 0;
81 findAvailableNetNodes();
82
83 // compile provides and needs lists
84 { const char ** NeedsRun;
85 QDictIterator<ANetNode> OuterIt( AllNodeTypes );
86 bool Done;
87
88 for ( ; OuterIt.current(); ++OuterIt ) {
89 // find needs list
90 ANetNode::NetNodeList * NNLP = new ANetNode::NetNodeList;
91 ANetNode::NetNodeList & NNL = *(NNLP);
92
93 // must iterate this way to avoid duplication pointers
94 for ( QDictIterator<ANetNode> InnerIt( AllNodeTypes );
95 InnerIt.current(); ++InnerIt ) {
96
97 if( InnerIt.current() == OuterIt.current() )
98 // avoid recursive
99 continue;
100
101 const char ** Provides = InnerIt.current()->provides();
102 NeedsRun = OuterIt.current()->needs();
103
104 for( ; *NeedsRun; NeedsRun ++ ) {
105 const char ** PRun;
106 PRun = Provides;
107 for( ; *PRun; PRun ++ ) {
108 if( strcmp( *PRun, *NeedsRun ) == 0 ) {
109 // inner provides what outer needs
110 NNL.resize( NNL.size() + 1 );
111 NNL[NNL.size()-1] = InnerIt.current();
112 Done = 1; // break from 2 loops
113 break;
114 }
115 }
116 }
117 }
118 OuterIt.current()->setAlternatives( NNLP );
119 }
120 }
121
122#endif
123
69 // define built in Node types to Description map 124 // define built in Node types to Description map
70 addNodeType( "device", tr( "Network Device" ), 125 addNodeType( "device", tr( "Network Device" ),
71 tr( "<p>Devices that can handle IP packets</p>" ) ); 126 tr( "<p>Devices that can handle IP packets</p>" ) );
72 addNodeType( "line", tr( "Character device" ), 127 addNodeType( "line", tr( "Character device" ),
73 tr( "<p>Devices that can handle single bytes</p>" ) ); 128 tr( "<p>Devices that can handle single bytes</p>" ) );
74 addNodeType( "connection", tr( "IP Connection" ), 129 addNodeType( "connection", tr( "IP Connection" ),
@@ -81,13 +136,21 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
81 // get access to the system 136 // get access to the system
82 TheSystem = new System(); 137 TheSystem = new System();
83 138
84} 139}
85 140
86TheNSResources::~TheNSResources( void ) { 141TheNSResources::~TheNSResources( void ) {
142
143#ifndef MYPLUGINS
144 if( Plugins ) {
145 delete Plugins;
146 delete PluginManager;
147 }
148#endif
87 delete TheSystem; 149 delete TheSystem;
150
88} 151}
89 152
90void TheNSResources::addNodeType( const QString & ID, 153void TheNSResources::addNodeType( const QString & ID,
91 const QString & Name, 154 const QString & Name,
92 const QString & Descr ) { 155 const QString & Descr ) {
93 if( NodeTypeNameMap[ID].isEmpty() ) { 156 if( NodeTypeNameMap[ID].isEmpty() ) {
@@ -113,12 +176,13 @@ void TheNSResources::busy( bool ) {
113 } else { 176 } else {
114 ShowWait->hide(); 177 ShowWait->hide();
115 } 178 }
116*/ 179*/
117} 180}
118 181
182#ifdef MYPLUGIN
119/** 183/**
120 * Load all modules that are found in the path 184 * Load all modules that are found in the path
121 * @param path a directory that is scaned for any plugins that can be loaded 185 * @param path a directory that is scaned for any plugins that can be loaded
122 * and attempts to load them 186 * and attempts to load them
123 */ 187 */
124void TheNSResources::findAvailableNetNodes(const QString &path){ 188void TheNSResources::findAvailableNetNodes(const QString &path){
@@ -157,33 +221,12 @@ void TheNSResources::findAvailableNetNodes(const QString &path){
157 } 221 }
158 } 222 }
159 ++it; 223 ++it;
160 } 224 }
161} 225}
162 226
163// used to find unique connection number
164int TheNSResources::assignConnectionNumber( void ) {
165 bool found = 1;
166 for( int trial = 0; ; trial ++ ) {
167 found = 1;
168 for( QDictIterator<NodeCollection> it(ConnectionsMap);
169 it.current();
170 ++it ) {
171 if( it.current()->number() == trial ) {
172 found = 0;
173 break;
174 }
175 }
176
177 if( found ) {
178 Log(("Assign profile number %d\n", trial ));
179 return trial;
180 }
181 }
182}
183
184/** 227/**
185 * Attempt to load a function and resolve a function. 228 * Attempt to load a function and resolve a function.
186 * @param pluginFileName - the name of the file in which to attempt to load 229 * @param pluginFileName - the name of the file in which to attempt to load
187 * @param resolveString - function pointer to resolve 230 * @param resolveString - function pointer to resolve
188 * @return true of loading is successful 231 * @return true of loading is successful
189 */ 232 */
@@ -224,12 +267,106 @@ bool TheNSResources::loadNetNode(
224 AllNodeTypes.insert( NN->NetNode->name(), NN ); 267 AllNodeTypes.insert( NN->NetNode->name(), NN );
225 } 268 }
226 269
227 return 1; 270 return 1;
228} 271}
229 272
273#else
274
275void TheNSResources::findAvailableNetNodes( void ){
276
277 Plugins = new OPluginLoader( "networksettings2" );
278 Plugins->setAutoDelete( true );
279
280 PluginManager = new OPluginManager( Plugins );
281 PluginManager->load();
282
283 if( Plugins->isInSafeMode() ) {
284 QMessageBox::information(
285 0,
286 tr( "Today Error"),
287 tr( "<qt>The plugin '%1' caused Today to crash."
288 " It could be that the plugin is not properly"
289 " installed.<br>Today tries to continue loading"
290 " plugins.</qt>" )
291 .arg( PluginManager->crashedPlugin().name()));
292 }
293
294 // Get All Plugins
295 OPluginLoader::List allplugins = Plugins->filtered();
296
297 for( OPluginLoader::List::Iterator it = allplugins.begin();
298 it != allplugins.end();
299 ++it ) {
300
301 // check if this plugin supports the proper interface
302 NetNodeInterface * interface =
303 Plugins->load<NetNodeInterface>( *it, IID_NetworkSettings2 );
304
305 if( ! interface ) {
306 Log(( "Plugin %s from %s does not support proper interface\n",
307 it->name().latin1(), it->path().latin1() ));
308 continue;
309 }
310
311 // add the nodes in this plugin to the dictionary
312 { QList<ANetNode> PNN;
313
314 interface->create_plugin( PNN );
315
316 if( PNN.isEmpty() ) {
317 Log(( "Plugin %s from %s does offer any nodes\n",
318 it->name().latin1(), it->path().latin1() ));
319 delete interface;
320 continue;
321 }
322
323 // merge this node with global node
324 for( QListIterator<ANetNode> it(PNN);
325 it.current();
326 ++it ) {
327 AllNodeTypes.insert( it->current()->name(), it->current() );
328 }
329 }
330
331 // load the translation
332 QTranslator *trans = new QTranslator(qApp);
333 QString fn = QPEApplication::qpeDir()+
334 "/i18n/"+lang+"/"+ it->name() + ".qm";
335
336 if( trans->load( fn ) )
337 qApp->installTranslator( trans );
338 else
339 delete trans;
340 }
341
342}
343
344#endif
345
346// used to find unique connection number
347int TheNSResources::assignConnectionNumber( void ) {
348 bool found = 1;
349 for( int trial = 0; ; trial ++ ) {
350 found = 1;
351 for( QDictIterator<NodeCollection> it(ConnectionsMap);
352 it.current();
353 ++it ) {
354 if( it.current()->number() == trial ) {
355 found = 0;
356 break;
357 }
358 }
359
360 if( found ) {
361 Log(("Assign profile number %d\n", trial ));
362 return trial;
363 }
364 }
365}
366
230QPixmap TheNSResources::getPixmap( const QString & QS ) { 367QPixmap TheNSResources::getPixmap( const QString & QS ) {
231 QPixmap P; 368 QPixmap P;
232 QString S("networksettings2/"); 369 QString S("networksettings2/");
233 S += QS; 370 S += QS;
234 P = Resource::loadPixmap( S ); 371 P = Resource::loadPixmap( S );
235 if( P.isNull() ) { 372 if( P.isNull() ) {
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h
index 5d90286..421a433 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.h
+++ b/noncore/settings/networksettings2/networksettings2/resources.h
@@ -11,19 +11,20 @@
11 11
12class QLibrary; 12class QLibrary;
13class QPixmap; 13class QPixmap;
14class ANetNode; 14class ANetNode;
15class ANetNodeInstance; 15class ANetNodeInstance;
16 16
17typedef void (*GetNetNodeListFt_t)(QList<ANetNode>& PNN ); 17namespace Opie {
18 namespace Core {
19 class OPluginLoader;
20 class OPluginManager;
21 }
22}
18 23
19typedef struct NetNode_S { 24typedef void (*GetNetNodeListFt_t)(QList<ANetNode>& PNN );
20 ANetNode * NetNode;
21 QLibrary * TheLibrary;
22 long NodeCountInLib;
23} NetNode_t;
24 25
25class CurrentQPEUser { 26class CurrentQPEUser {
26 27
27public : 28public :
28 CurrentQPEUser() : UserName(), HomeDir(), EnvList() {} 29 CurrentQPEUser() : UserName(), HomeDir(), EnvList() {}
29 30
@@ -34,13 +35,27 @@ public :
34 QString HomeDir; 35 QString HomeDir;
35 int Uid; 36 int Uid;
36 int Gid; 37 int Gid;
37 QArray<char *> EnvList; 38 QArray<char *> EnvList;
38}; 39};
39 40
41#ifdef MYPLUGIN
42
43typedef struct NetNode_S {
44 ANetNode * NetNode;
45 QLibrary * TheLibrary;
46 long NodeCountInLib;
47} NetNode_t;
40typedef QDict<NetNode_t> Name2NetNode_t; 48typedef QDict<NetNode_t> Name2NetNode_t;
49
50#else
51
52typedef QDict<ANetNode> Name2NetNode_t;
53
54#endif
55
41typedef QDict<ANetNodeInstance > Name2Instance_t; 56typedef QDict<ANetNodeInstance > Name2Instance_t;
42typedef QDict<NodeCollection> Name2Connection_t; 57typedef QDict<NodeCollection> Name2Connection_t;
43typedef QDict<SystemFile> Name2SystemFile_t; 58typedef QDict<SystemFile> Name2SystemFile_t;
44 59
45class TheNSResources { 60class TheNSResources {
46 61
@@ -59,17 +74,22 @@ public :
59 QPixmap getPixmap( const QString & Name ); 74 QPixmap getPixmap( const QString & Name );
60 75
61 Name2NetNode_t & netNodes( void ) 76 Name2NetNode_t & netNodes( void )
62 { return AllNodeTypes; } 77 { return AllNodeTypes; }
63 bool netNodeExists( const QString & X ) 78 bool netNodeExists( const QString & X )
64 { return AllNodeTypes.find(X)!=0; } 79 { return AllNodeTypes.find(X)!=0; }
80#ifdef MYPLUGIN
65 ANetNode * findNetNode( const QString & N ) 81 ANetNode * findNetNode( const QString & N )
66 { NetNode_t * NNT = AllNodeTypes.find(N); 82 { NetNode_t * NNT = AllNodeTypes.find(N);
67 return (NNT) ? NNT->NetNode : 0; 83 return (NNT) ? NNT->NetNode : 0;
68 } 84 }
69 85#else
86 ANetNode * findNetNode( const QString & N )
87 { return AllNodeTypes.find(N);
88 }
89#endif
70 // define new plugin (=node) 90 // define new plugin (=node)
71 void addNodeType( const QString & ID, 91 void addNodeType( const QString & ID,
72 const QString & LongName, 92 const QString & LongName,
73 const QString & Description ); 93 const QString & Description );
74 94
75 Name2SystemFile_t & systemFiles( void ) 95 Name2SystemFile_t & systemFiles( void )
@@ -78,17 +98,25 @@ public :
78 const QString & P, 98 const QString & P,
79 bool KDI ); 99 bool KDI );
80 100
81 ANetNodeInstance * createNodeInstance( const QString & S ) 101 ANetNodeInstance * createNodeInstance( const QString & S )
82 { ANetNodeInstance * NNI = 0; 102 { ANetNodeInstance * NNI = 0;
83 printf( "Find node type %s\n", S.latin1() ); 103 printf( "Find node type %s\n", S.latin1() );
104#ifdef MYPLUGIN
84 NetNode_t * NNT = AllNodeTypes[S]; 105 NetNode_t * NNT = AllNodeTypes[S];
85 if( ! NNT ) { 106 if( ! NNT ) {
86 return 0; 107 return 0;
87 } 108 }
88 NNI = NNT->NetNode->createInstance(); 109 NNI = NNT->NetNode->createInstance();
110#else
111 ANetNode * NNT = AllNodeTypes[S];
112 if( ! NNT ) {
113 return 0;
114 }
115 NNI = NNT->createInstance();
116#endif
89 NNI->initialize(); 117 NNI->initialize();
90 return NNI; 118 return NNI;
91 } 119 }
92 120
93 Name2Instance_t & netNodeInstances( void ) 121 Name2Instance_t & netNodeInstances( void )
94 { return AllNodes; } 122 { return AllNodes; }
@@ -115,30 +143,41 @@ public :
115 { return CurrentUser; } 143 { return CurrentUser; }
116 144
117private : 145private :
118 146
119 void detectCurrentUser( void ); 147 void detectCurrentUser( void );
120 QString tr( const char * path ); 148 QString tr( const char * path );
149
150#ifdef MYPLUGIN
121 void findAvailableNetNodes( const QString &path ); 151 void findAvailableNetNodes( const QString &path );
122 bool loadNetNode( 152 bool loadNetNode(
123 const QString &pluginFileName, 153 const QString &pluginFileName,
124 const QString &resolveString = "create_plugin"); 154 const QString &resolveString = "create_plugin");
155#else
156 void findAvailableNetNodes( void );
157#endif
125 158
126 QMap< QString, QString> NodeTypeNameMap; 159 QMap< QString, QString> NodeTypeNameMap;
127 QMap< QString, QString> NodeTypeDescriptionMap; 160 QMap< QString, QString> NodeTypeDescriptionMap;
128 Name2Connection_t ConnectionsMap; 161 Name2Connection_t ConnectionsMap;
129 System * TheSystem; 162 System * TheSystem;
130 Name2SystemFile_t SystemFiles; 163 Name2SystemFile_t SystemFiles;
131 164
132 // all node type classes 165 // all node type classes
133 Name2NetNode_t AllNodeTypes; 166 Name2NetNode_t AllNodeTypes;
134 167
135 // all nodes 168 // all nodes
136 Name2Instance_t AllNodes; 169 Name2Instance_t AllNodes;
170
171 CurrentQPEUser CurrentUser;
172
173#ifndef MYPLUGIN
174 Opie::Core::OPluginLoader * Plugins;
175 Opie::Core::OPluginManager * PluginManager;
176#endif
137 177
138 CurrentQPEUser CurrentUser;
139}; 178};
140 179
141extern TheNSResources * _NSResources; 180extern TheNSResources * _NSResources;
142#define NSResources _NSResources 181#define NSResources _NSResources
143 182
144#endif 183#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTDevice.h b/noncore/settings/networksettings2/opietooth2/OTDevice.h
index cf1c4b6..09de7ee 100644
--- a/noncore/settings/networksettings2/opietooth2/OTDevice.h
+++ b/noncore/settings/networksettings2/opietooth2/OTDevice.h
@@ -13,14 +13,14 @@
13 13
14class QTimerEvent; 14class QTimerEvent;
15 15
16namespace Opie { 16namespace Opie {
17 namespace Core { 17 namespace Core {
18 class OProcess; 18 class OProcess;
19 }; 19 }
20}; 20}
21 21
22namespace Opietooth2 { 22namespace Opietooth2 {
23 23
24 /** 24 /**
25 * Device takes care of attaching serial 25 * Device takes care of attaching serial
26 * devices to the blueZ stack. 26 * devices to the blueZ stack.
@@ -108,9 +108,9 @@ namespace Opietooth2 {
108 pid_t m_hciattachPid; // pid of hciattach program 108 pid_t m_hciattachPid; // pid of hciattach program
109 109
110 // backpointer 110 // backpointer
111 OTGateway * OT; 111 OTGateway * OT;
112 bool NeedsAttach; 112 bool NeedsAttach;
113 }; 113 };
114}; 114}
115 115
116#endif 116#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTDeviceAddress.h b/noncore/settings/networksettings2/opietooth2/OTDeviceAddress.h
index 50f28fc..8395f37 100644
--- a/noncore/settings/networksettings2/opietooth2/OTDeviceAddress.h
+++ b/noncore/settings/networksettings2/opietooth2/OTDeviceAddress.h
@@ -100,9 +100,9 @@ protected:
100 100
101 bdaddr_t BDaddr; 101 bdaddr_t BDaddr;
102 bool IsValid; 102 bool IsValid;
103 103
104}; 104};
105 105
106}; 106}
107 107
108#endif 108#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.h b/noncore/settings/networksettings2/opietooth2/OTDriver.h
index f249cf7..b54ffdf 100644
--- a/noncore/settings/networksettings2/opietooth2/OTDriver.h
+++ b/noncore/settings/networksettings2/opietooth2/OTDriver.h
@@ -225,8 +225,8 @@ private:
225 OTHCISocket * Socket; 225 OTHCISocket * Socket;
226 226
227 // backpointer to opietooth system 227 // backpointer to opietooth system
228 OTGateway * OT; 228 OTGateway * OT;
229}; 229};
230 230
231}; 231}
232#endif 232#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.h b/noncore/settings/networksettings2/opietooth2/OTGateway.h
index a47cefb..d97ef35 100644
--- a/noncore/settings/networksettings2/opietooth2/OTGateway.h
+++ b/noncore/settings/networksettings2/opietooth2/OTGateway.h
@@ -192,9 +192,9 @@ private :
192 int RefreshTimer; 192 int RefreshTimer;
193 OTInquiry * Scanning; 193 OTInquiry * Scanning;
194 bool AllPeersModified; 194 bool AllPeersModified;
195 PeerVector AllPeers; 195 PeerVector AllPeers;
196 LinkKeyArray AllKeys; 196 LinkKeyArray AllKeys;
197}; 197};
198}; 198}
199 199
200#endif 200#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTHCISocket.h b/noncore/settings/networksettings2/opietooth2/OTHCISocket.h
index d508078..a004989 100644
--- a/noncore/settings/networksettings2/opietooth2/OTHCISocket.h
+++ b/noncore/settings/networksettings2/opietooth2/OTHCISocket.h
@@ -108,9 +108,9 @@ private slots:
108 void slotSocketActivated(); 108 void slotSocketActivated();
109 void slotSocketError(int); 109 void slotSocketError(int);
110 void slotConnectionClosed(); 110 void slotConnectionClosed();
111 111
112}; 112};
113 113
114}; 114}
115 115
116#endif 116#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTIcons.h b/noncore/settings/networksettings2/opietooth2/OTIcons.h
index 966ed24..ee10831 100644
--- a/noncore/settings/networksettings2/opietooth2/OTIcons.h
+++ b/noncore/settings/networksettings2/opietooth2/OTIcons.h
@@ -46,9 +46,9 @@ private:
46 QMap<QString,QString> deviceIcons; 46 QMap<QString,QString> deviceIcons;
47 QMap<int,QString> serviceIcons; 47 QMap<int,QString> serviceIcons;
48 UUIDVector Modems; 48 UUIDVector Modems;
49 UUIDVector Networks; 49 UUIDVector Networks;
50 50
51}; 51};
52}; 52}
53 53
54#endif 54#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTInquiry.h b/noncore/settings/networksettings2/opietooth2/OTInquiry.h
index 2682499..f7bdeec 100644
--- a/noncore/settings/networksettings2/opietooth2/OTInquiry.h
+++ b/noncore/settings/networksettings2/opietooth2/OTInquiry.h
@@ -171,8 +171,8 @@ private slots:
171 171
172 void slotInquiryTimeout(); 172 void slotInquiryTimeout();
173 void slotHCIEvent(unsigned char eventCode, QByteArray buf); 173 void slotHCIEvent(unsigned char eventCode, QByteArray buf);
174 174
175}; 175};
176 176
177}; 177}
178#endif 178#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTPeer.h b/noncore/settings/networksettings2/opietooth2/OTPeer.h
index 9cd0dc7..c09af15 100644
--- a/noncore/settings/networksettings2/opietooth2/OTPeer.h
+++ b/noncore/settings/networksettings2/opietooth2/OTPeer.h
@@ -127,9 +127,9 @@ private:
127 127
128 int ProbeFD; 128 int ProbeFD;
129 int ProbePhase; // see OTDriver 129 int ProbePhase; // see OTDriver
130 long ProbeTimeout; 130 long ProbeTimeout;
131}; 131};
132 132
133}; 133}
134 134
135#endif 135#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.h b/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.h
index 86b5623..e79e33d 100644
--- a/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.h
+++ b/noncore/settings/networksettings2/opietooth2/OTSDPAttribute.h
@@ -132,9 +132,9 @@ private:
132 QString * stringVal; // strings and urls 132 QString * stringVal; // strings and urls
133 AttributeVector * sequenceVal; // sequences and alternatives 133 AttributeVector * sequenceVal; // sequences and alternatives
134 } Value; 134 } Value;
135 135
136}; 136};
137 137
138}; 138}
139 139
140#endif 140#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTSDPService.h b/noncore/settings/networksettings2/opietooth2/OTSDPService.h
index 21d7344..4831df0 100644
--- a/noncore/settings/networksettings2/opietooth2/OTSDPService.h
+++ b/noncore/settings/networksettings2/opietooth2/OTSDPService.h
@@ -67,9 +67,9 @@ private:
67 OTSDPAttribute * attr; 67 OTSDPAttribute * attr;
68 }; 68 };
69 69
70 QArray<AttributeEntry> attributeList; 70 QArray<AttributeEntry> attributeList;
71}; 71};
72 72
73}; 73}
74 74
75#endif 75#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTUUID.h b/noncore/settings/networksettings2/opietooth2/OTUUID.h
index 97df114..aebd9b9 100644
--- a/noncore/settings/networksettings2/opietooth2/OTUUID.h
+++ b/noncore/settings/networksettings2/opietooth2/OTUUID.h
@@ -51,8 +51,8 @@ public :
51 bool operator<( const OTUUID & other ) const; 51 bool operator<( const OTUUID & other ) const;
52 bool operator==(const OTUUID & uuid) const; 52 bool operator==(const OTUUID & uuid) const;
53 53
54 uint64_t hi; 54 uint64_t hi;
55 uint64_t lo; 55 uint64_t lo;
56}; 56};
57}; 57}
58#endif 58#endif
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.h b/noncore/settings/networksettings2/opietooth2/Opietooth.h
index e66787f..f077dd7 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.h
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.h
@@ -8,15 +8,15 @@ class MyProcess;
8namespace Opie { 8namespace Opie {
9 9
10 namespace Ui { 10 namespace Ui {
11 11
12 class OLedBox; 12 class OLedBox;
13 13
14 }; 14 }
15 15
16}; 16}
17 17
18#include <OTSniffGUI.h> 18#include <OTSniffGUI.h>
19namespace Opietooth2 { 19namespace Opietooth2 {
20 20
21class OTGateway; 21class OTGateway;
22class OTDriver; 22class OTDriver;
@@ -48,13 +48,13 @@ protected :
48 48
49private : 49private :
50 50
51 OTGateway * OT; 51 OTGateway * OT;
52 MyProcess * HciDump; 52 MyProcess * HciDump;
53}; 53};
54}; 54}
55 55
56#include <OTPairingGUI.h> 56#include <OTPairingGUI.h>
57 57
58namespace Opietooth2 { 58namespace Opietooth2 {
59class OTPairing : public OTPairingGUI { 59class OTPairing : public OTPairingGUI {
60 60
@@ -77,13 +77,13 @@ protected :
77private : 77private :
78 78
79 bool MyIcons; 79 bool MyIcons;
80 OTIcons * Icons; 80 OTIcons * Icons;
81 OTGateway * OT; 81 OTGateway * OT;
82}; 82};
83}; 83}
84 84
85#include <OTScanGUI.h> 85#include <OTScanGUI.h>
86 86
87namespace Opietooth2 { 87namespace Opietooth2 {
88 88
89class OTGateway; 89class OTGateway;
@@ -155,13 +155,13 @@ private :
155 QTimer * StrengthTimer; 155 QTimer * StrengthTimer;
156 PeerLVI * Current; 156 PeerLVI * Current;
157 157
158 OTPeer * SelectedPeer; 158 OTPeer * SelectedPeer;
159 int SelectedChannel; 159 int SelectedChannel;
160}; 160};
161}; 161}
162 162
163#include <OTManageGUI.h> 163#include <OTManageGUI.h>
164namespace Opietooth2 { 164namespace Opietooth2 {
165 165
166class OTManage : public OTManageGUI { 166class OTManage : public OTManageGUI {
167 167
@@ -193,13 +193,13 @@ private :
193 193
194 bool MyIcons; 194 bool MyIcons;
195 OTIcons * Icons; 195 OTIcons * Icons;
196 OTGateway * OT; 196 OTGateway * OT;
197 OTInquiry * Scanning; 197 OTInquiry * Scanning;
198}; 198};
199}; 199}
200 200
201#include <OTMainGUI.h> 201#include <OTMainGUI.h>
202 202
203namespace Opietooth2 { 203namespace Opietooth2 {
204class OTMain : public OTMainGUI { 204class OTMain : public OTMainGUI {
205 205
@@ -231,8 +231,8 @@ private :
231 231
232 // load scanned devices 232 // load scanned devices
233 OTIcons * Icons; 233 OTIcons * Icons;
234 OTGateway * OT; 234 OTGateway * OT;
235 QDialog * SnifWindow; 235 QDialog * SnifWindow;
236}; 236};
237}; 237}
238#endif 238#endif
diff --git a/noncore/settings/networksettings2/ppp/ppp.pro b/noncore/settings/networksettings2/ppp/ppp.pro
index dd3408c..10d0f1b 100644
--- a/noncore/settings/networksettings2/ppp/ppp.pro
+++ b/noncore/settings/networksettings2/ppp/ppp.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = ppp_NN.h \ 4 HEADERS = ppp_NN.h \
5 ppp_NNI.h \ 5 ppp_NNI.h \
6 PPPedit.h \ 6 PPPedit.h \
7 PPPAuthedit.h \ 7 PPPAuthedit.h \
8 PPPDNSedit.h \ 8 PPPDNSedit.h \
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 51ba27d..bd13ab9 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -1,12 +1,18 @@
1#include <qfile.h> 1#include <qfile.h>
2#include <resources.h> 2#include <resources.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include "ppp_NN.h" 4#include "ppp_NN.h"
5#include "ppp_NNI.h" 5#include "ppp_NNI.h"
6 6
7#ifndef MYPLUGIN
8
9#include "netnodeinterface.h"
10
11#endif
12
7QStringList * PPPNetNode::ProperFiles = 0; 13QStringList * PPPNetNode::ProperFiles = 0;
8 14
9static const char * PPPNeeds[] = 15static const char * PPPNeeds[] =
10 { "modem", 16 { "modem",
11 0 17 0
12 }; 18 };
@@ -75,11 +81,20 @@ QString PPPNetNode::genNic( long NicNr ) {
75void PPPNetNode::setSpecificAttribute( QString & , QString & ) { 81void PPPNetNode::setSpecificAttribute( QString & , QString & ) {
76} 82}
77 83
78void PPPNetNode::saveSpecificAttribute( QTextStream & ) { 84void PPPNetNode::saveSpecificAttribute( QTextStream & ) {
79} 85}
80 86
87#ifdef MYPLUGIN
88
81extern "C" { 89extern "C" {
82void create_plugin( QList<ANetNode> & PNN ) { 90void create_plugin( QList<ANetNode> & PNN ) {
83 PNN.append( new PPPNetNode() ); 91 PNN.append( new PPPNetNode() );
84} 92}
93
94#else
95
96OPIE_NS2_PLUGIN( NetNodeInterface<PPPNetNode> )
97
98#endif
99
85} 100}
diff --git a/noncore/settings/networksettings2/profile/profile.pro b/noncore/settings/networksettings2/profile/profile.pro
index f980034..4db7a5d 100644
--- a/noncore/settings/networksettings2/profile/profile.pro
+++ b/noncore/settings/networksettings2/profile/profile.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = profile_NN.h \ 4 HEADERS = profile_NN.h \
5 profile_NNI.h \ 5 profile_NNI.h \
6 profileedit.h 6 profileedit.h
7 SOURCES = profile_NN.cpp \ 7 SOURCES = profile_NN.cpp \
8 profile_NNI.cpp \ 8 profile_NNI.cpp \
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index b7d8aa0..6028ea5 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -1,10 +1,16 @@
1#include <resources.h> 1#include <resources.h>
2#include "profile_NN.h" 2#include "profile_NN.h"
3#include "profile_NNI.h" 3#include "profile_NNI.h"
4 4
5#ifndef MYPLUGIN
6
7#include "netnodeinterface.h"
8
9#endif
10
5static const char * ProfileNeeds[] = 11static const char * ProfileNeeds[] =
6 { "connection", 12 { "connection",
7 0 13 0
8 }; 14 };
9static const char * ProfileProvides[] = 15static const char * ProfileProvides[] =
10 { "fullsetup", 16 { "fullsetup",
@@ -50,11 +56,20 @@ const char ** ProfileNetNode::provides( void ) {
50void ProfileNetNode::setSpecificAttribute( QString & , QString & ) { 56void ProfileNetNode::setSpecificAttribute( QString & , QString & ) {
51} 57}
52 58
53void ProfileNetNode::saveSpecificAttribute( QTextStream & ) { 59void ProfileNetNode::saveSpecificAttribute( QTextStream & ) {
54} 60}
55 61
62#ifdef MYPLUGIN
63
56extern "C" { 64extern "C" {
57void create_plugin( QList<ANetNode> & PNN ) { 65void create_plugin( QList<ANetNode> & PNN ) {
58 PNN.append( new ProfileNetNode() ); 66 PNN.append( new ProfileNetNode() );
59} 67}
68
69#else
70
71OPIE_NS2_PLUGIN( NetNodeInterface<ProfileNetNode> )
72
73#endif
74
60} 75}
diff --git a/noncore/settings/networksettings2/usb/usb.pro b/noncore/settings/networksettings2/usb/usb.pro
index 37c1bde..d9890b6 100644
--- a/noncore/settings/networksettings2/usb/usb.pro
+++ b/noncore/settings/networksettings2/usb/usb.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = usb_NN.h \ 4 HEADERS = usb_NN.h \
5 usb_NNI.h \ 5 usb_NNI.h \
6 usbedit.h 6 usbedit.h
7 SOURCES = usb_NN.cpp \ 7 SOURCES = usb_NN.cpp \
8 usb_NNI.cpp \ 8 usb_NNI.cpp \
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
index bd9ae2b..9c07b82 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -1,10 +1,16 @@
1#include <resources.h> 1#include <resources.h>
2#include "usb_NN.h" 2#include "usb_NN.h"
3#include "usb_NNI.h" 3#include "usb_NNI.h"
4 4
5#ifndef MYPLUGIN
6
7#include "netnodeinterface.h"
8
9#endif
10
5static const char * USBNeeds[] = 11static const char * USBNeeds[] =
6 { 0 12 { 0
7 }; 13 };
8 14
9static const char * USBProvides[] = 15static const char * USBProvides[] =
10 { "device", 16 { "device",
@@ -52,11 +58,20 @@ QString USBNetNode::genNic( long ) {
52void USBNetNode::setSpecificAttribute( QString & , QString & ) { 58void USBNetNode::setSpecificAttribute( QString & , QString & ) {
53} 59}
54 60
55void USBNetNode::saveSpecificAttribute( QTextStream & ) { 61void USBNetNode::saveSpecificAttribute( QTextStream & ) {
56} 62}
57 63
64#ifdef MYPLUGIN
65
58extern "C" { 66extern "C" {
59void create_plugin( QList<ANetNode> & PNN ) { 67void create_plugin( QList<ANetNode> & PNN ) {
60 PNN.append( new USBNetNode() ); 68 PNN.append( new USBNetNode() );
61} 69}
70
71#else
72
73OPIE_NS2_PLUGIN( NetNodeInterface<USBNetNode> )
74
75#endif
76
62} 77}
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp
index 600b771..424845c 100644
--- a/noncore/settings/networksettings2/usb/usb_NNI.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp
@@ -42,13 +42,13 @@ short AUSB::generateFileEmbedded( SystemFile & SF,
42 42
43 if( SF.name() == "interfaces" ) { 43 if( SF.name() == "interfaces" ) {
44 Log(("Generate USB for %s\n", SF.name().latin1() )); 44 Log(("Generate USB for %s\n", SF.name().latin1() ));
45 // generate mapping stanza for this interface 45 // generate mapping stanza for this interface
46 SF << " pre-up " 46 SF << " pre-up "
47 << QPEApplication::qpeDir() 47 << QPEApplication::qpeDir()
48 << "bin/setmacaddress.sh " 48 << "bin/NS2SetMac.sh "
49 << NIC 49 << NIC
50 << " || true" 50 << " || true"
51 << endl; 51 << endl;
52 rvl = 0; 52 rvl = 0;
53 } 53 }
54 rvd = ANetNodeInstance::generateFileEmbedded(SF, DevNr ); 54 rvd = ANetNodeInstance::generateFileEmbedded(SF, DevNr );
diff --git a/noncore/settings/networksettings2/vpn/vpn.pro b/noncore/settings/networksettings2/vpn/vpn.pro
index a131a1f..349571e 100644
--- a/noncore/settings/networksettings2/vpn/vpn.pro
+++ b/noncore/settings/networksettings2/vpn/vpn.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = vpn_NN.h \ 4 HEADERS = vpn_NN.h \
5 vpn_NNI.h \ 5 vpn_NNI.h \
6 vpnedit.h 6 vpnedit.h
7 SOURCES = vpn_NN.cpp \ 7 SOURCES = vpn_NN.cpp \
8 vpn_NNI.cpp \ 8 vpn_NNI.cpp \
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
index 23ec04a..6dd5332 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -1,9 +1,15 @@
1#include "vpn_NN.h" 1#include "vpn_NN.h"
2#include "vpn_NNI.h" 2#include "vpn_NNI.h"
3 3
4#ifndef MYPLUGIN
5
6#include "netnodeinterface.h"
7
8#endif
9
4static const char * VPNNeeds[] = 10static const char * VPNNeeds[] =
5 { 0 11 { 0
6 }; 12 };
7 13
8static const char * VPNProvides[] = 14static const char * VPNProvides[] =
9 { "connection", 15 { "connection",
@@ -44,11 +50,20 @@ const char ** VPNNetNode::provides( void ) {
44void VPNNetNode::setSpecificAttribute( QString & , QString & ) { 50void VPNNetNode::setSpecificAttribute( QString & , QString & ) {
45} 51}
46 52
47void VPNNetNode::saveSpecificAttribute( QTextStream & ) { 53void VPNNetNode::saveSpecificAttribute( QTextStream & ) {
48} 54}
49 55
56#ifdef MYPLUGIN
57
50extern "C" { 58extern "C" {
51void create_plugin( QList<ANetNode> & PNN ) { 59void create_plugin( QList<ANetNode> & PNN ) {
52 PNN.append( new VPNNetNode() ); 60 PNN.append( new VPNNetNode() );
53} 61}
62
63#else
64
65OPIE_NS2_PLUGIN( NetNodeInterface<VPNNetNode> )
66
67#endif
68
54} 69}
diff --git a/noncore/settings/networksettings2/wlan/wlan.pro b/noncore/settings/networksettings2/wlan/wlan.pro
index f4c55df..a08cbbb 100644
--- a/noncore/settings/networksettings2/wlan/wlan.pro
+++ b/noncore/settings/networksettings2/wlan/wlan.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release plugin
3DESTDIR = $(OPIEDIR)/plugins/networksettings2 3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = wlan_NN.h \ 4 HEADERS = wlan_NN.h \
5 wlan_NNI.h \ 5 wlan_NNI.h \
6 wlanedit.h 6 wlanedit.h
7 SOURCES = wlan_NN.cpp \ 7 SOURCES = wlan_NN.cpp \
8 wlan_NNI.cpp \ 8 wlan_NNI.cpp \
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index 36a5c33..c56da06 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -1,10 +1,16 @@
1#include <resources.h> 1#include <resources.h>
2#include "wlan_NN.h" 2#include "wlan_NN.h"
3#include "wlan_NNI.h" 3#include "wlan_NNI.h"
4 4
5#ifndef MYPLUGIN
6
7#include "netnodeinterface.h"
8
9#endif
10
5static const char * WLanNeeds[] = 11static const char * WLanNeeds[] =
6 { 0 12 { 0
7 }; 13 };
8 14
9static const char * WLanProvides[] = 15static const char * WLanProvides[] =
10 { "device", 16 { "device",
@@ -60,11 +66,20 @@ void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) {
60void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) { 66void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) {
61 TS << "interfacecount=" 67 TS << "interfacecount="
62 << InstanceCount 68 << InstanceCount
63 << endl; 69 << endl;
64} 70}
65 71
72#ifdef MYPLUGIN
73
66extern "C" { 74extern "C" {
67void create_plugin( QList<ANetNode> & PNN ) { 75void create_plugin( QList<ANetNode> & PNN ) {
68 PNN.append( new WLanNetNode() ); 76 PNN.append( new WLanNetNode() );
69} 77}
78
79#else
80
81OPIE_NS2_PLUGIN( NetNodeInterface<WLanNetNode> )
82
83#endif
84
70} 85}