author | wimpie <wimpie> | 2004-04-02 18:30:55 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-02 18:30:55 (UTC) |
commit | 4ea2f227d3fb0d9591bb4f18555420ac47f3397d (patch) (unidiff) | |
tree | 4fdd216cf7af4a747e2ca71e35d15f3d9e646333 /noncore/settings/networksettings2/irda | |
parent | 5334b639c9f97793bcae4f50f7b47c7a2ada4e2f (diff) | |
download | opie-4ea2f227d3fb0d9591bb4f18555420ac47f3397d.zip opie-4ea2f227d3fb0d9591bb4f18555420ac47f3397d.tar.gz opie-4ea2f227d3fb0d9591bb4f18555420ac47f3397d.tar.bz2 |
first import of NS2 app
Diffstat (limited to 'noncore/settings/networksettings2/irda') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/irda/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda.pro | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaGUI.ui | 131 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.cpp | 59 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.h | 44 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdadata.h | 18 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaedit.cpp | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaedit.h | 12 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdarun.h | 22 |
11 files changed, 397 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/irda/config.in b/noncore/settings/networksettings2/irda/config.in new file mode 100644 index 0000000..997cf55 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config NS2IRDA | ||
2 | boolean "opie-networksettings2plugin-irda (set up IRDA)" | ||
3 | default "n" if NS2 | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE | ||
diff --git a/noncore/settings/networksettings2/irda/irda.pro b/noncore/settings/networksettings2/irda/irda.pro new file mode 100644 index 0000000..a7573b8 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda.pro | |||
@@ -0,0 +1,17 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | ||
4 | HEADERS = irda_NN.h \ | ||
5 | irda_NNI.h \ | ||
6 | irdaedit.h | ||
7 | SOURCES = irda_NN.cpp \ | ||
8 | irda_NNI.cpp \ | ||
9 | irdaedit.cpp | ||
10 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
11 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
12 | LIBS += -lqpe | ||
13 | INTERFACES= irdaGUI.ui | ||
14 | TARGET = irda | ||
15 | VERSION = 1.0.0 | ||
16 | |||
17 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/settings/networksettings2/irda/irdaGUI.ui b/noncore/settings/networksettings2/irda/irdaGUI.ui new file mode 100644 index 0000000..f8a7020 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaGUI.ui | |||
@@ -0,0 +1,131 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>IRDAGUI</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>IRDA_FRM</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>283</width> | ||
15 | <height>199</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>IRDA</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>2</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>2</number> | ||
36 | </property> | ||
37 | <widget> | ||
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout4</cstring> | ||
42 | </property> | ||
43 | <hbox> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>6</number> | ||
51 | </property> | ||
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>TextLabel4</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>Name</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QLineEdit</class> | ||
65 | <property stdset="1"> | ||
66 | <name>name</name> | ||
67 | <cstring>Name_LE</cstring> | ||
68 | </property> | ||
69 | </widget> | ||
70 | </hbox> | ||
71 | </widget> | ||
72 | <widget> | ||
73 | <class>QLabel</class> | ||
74 | <property stdset="1"> | ||
75 | <name>name</name> | ||
76 | <cstring>TextLabel3</cstring> | ||
77 | </property> | ||
78 | <property stdset="1"> | ||
79 | <name>text</name> | ||
80 | <string>Description</string> | ||
81 | </property> | ||
82 | </widget> | ||
83 | <widget> | ||
84 | <class>QMultiLineEdit</class> | ||
85 | <property stdset="1"> | ||
86 | <name>name</name> | ||
87 | <cstring>Description_LE</cstring> | ||
88 | </property> | ||
89 | </widget> | ||
90 | <widget> | ||
91 | <class>QLayoutWidget</class> | ||
92 | <property stdset="1"> | ||
93 | <name>name</name> | ||
94 | <cstring>Layout5</cstring> | ||
95 | </property> | ||
96 | <hbox> | ||
97 | <property stdset="1"> | ||
98 | <name>margin</name> | ||
99 | <number>0</number> | ||
100 | </property> | ||
101 | <property stdset="1"> | ||
102 | <name>spacing</name> | ||
103 | <number>6</number> | ||
104 | </property> | ||
105 | <widget> | ||
106 | <class>QCheckBox</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>Automatic_CB</cstring> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>text</name> | ||
113 | <string>Start automatically</string> | ||
114 | </property> | ||
115 | </widget> | ||
116 | <widget> | ||
117 | <class>QCheckBox</class> | ||
118 | <property stdset="1"> | ||
119 | <name>name</name> | ||
120 | <cstring>Confirm_CB</cstring> | ||
121 | </property> | ||
122 | <property stdset="1"> | ||
123 | <name>text</name> | ||
124 | <string>Confirm before start</string> | ||
125 | </property> | ||
126 | </widget> | ||
127 | </hbox> | ||
128 | </widget> | ||
129 | </vbox> | ||
130 | </widget> | ||
131 | </UI> | ||
diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp new file mode 100644 index 0000000..3b9c938 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NN.cpp | |||
@@ -0,0 +1,59 @@ | |||
1 | #include "irda_NN.h" | ||
2 | #include "irda_NNI.h" | ||
3 | |||
4 | static const char * IRDANeeds[] = | ||
5 | { 0 | ||
6 | }; | ||
7 | |||
8 | /** | ||
9 | * Constructor, find all of the possible interfaces | ||
10 | */ | ||
11 | IRDANetNode::IRDANetNode() : ANetNode() { | ||
12 | } | ||
13 | |||
14 | /** | ||
15 | * Delete any interfaces that we own. | ||
16 | */ | ||
17 | IRDANetNode::~IRDANetNode(){ | ||
18 | } | ||
19 | |||
20 | const QString IRDANetNode::nodeDescription(){ | ||
21 | return tr("\ | ||
22 | <p>Sets up a infra red serial link.</p>\ | ||
23 | " | ||
24 | ); | ||
25 | } | ||
26 | |||
27 | ANetNodeInstance * IRDANetNode::createInstance( void ) { | ||
28 | return new AIRDA( this ); | ||
29 | } | ||
30 | |||
31 | const char ** IRDANetNode::needs( void ) { | ||
32 | return IRDANeeds; | ||
33 | } | ||
34 | |||
35 | const char * IRDANetNode::provides( void ) { | ||
36 | return "line"; | ||
37 | } | ||
38 | |||
39 | bool IRDANetNode::generateProperFilesFor( | ||
40 | ANetNodeInstance * ) { | ||
41 | return 1; | ||
42 | } | ||
43 | |||
44 | bool IRDANetNode::hasDataFor( const QString & ) { | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | bool IRDANetNode::generateDataForCommonFile( | ||
49 | SystemFile & , | ||
50 | long , | ||
51 | ANetNodeInstance * ) { | ||
52 | return 1; | ||
53 | } | ||
54 | |||
55 | extern "C" { | ||
56 | void create_plugin( QList<ANetNode> & PNN ) { | ||
57 | PNN.append( new IRDANetNode() ); | ||
58 | } | ||
59 | } | ||
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h new file mode 100644 index 0000000..82811a4 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NN.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef IRDA_NETNODE_H | ||
2 | #define IRDA_NETNODE_H | ||
3 | |||
4 | #include "netnode.h" | ||
5 | |||
6 | class AIRDA; | ||
7 | |||
8 | class IRDANetNode : public ANetNode { | ||
9 | |||
10 | Q_OBJECT | ||
11 | |||
12 | public: | ||
13 | |||
14 | IRDANetNode(); | ||
15 | virtual ~IRDANetNode(); | ||
16 | |||
17 | virtual const QString pixmapName() | ||
18 | { return "irda"; } | ||
19 | |||
20 | virtual const QString nodeName() | ||
21 | { return tr("Infrared link"); } | ||
22 | |||
23 | virtual const QString nodeDescription() ; | ||
24 | |||
25 | virtual ANetNodeInstance * createInstance( void ); | ||
26 | |||
27 | virtual const char ** needs( void ); | ||
28 | virtual const char * provides( void ); | ||
29 | |||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | ||
31 | virtual bool hasDataFor( const QString & S ); | ||
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | |||
35 | private: | ||
36 | |||
37 | }; | ||
38 | |||
39 | extern "C" | ||
40 | { | ||
41 | void create_plugin( QList<ANetNode> & PNN ); | ||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.cpp b/noncore/settings/networksettings2/irda/irda_NNI.cpp new file mode 100644 index 0000000..78d6ff9 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NNI.cpp | |||
@@ -0,0 +1,30 @@ | |||
1 | #include "irdaedit.h" | ||
2 | #include "irda_NNI.h" | ||
3 | #include "irda_NN.h" | ||
4 | |||
5 | AIRDA::AIRDA( IRDANetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | |||
7 | GUI = 0; | ||
8 | RT = 0; | ||
9 | } | ||
10 | |||
11 | void AIRDA::setSpecificAttribute( QString & , QString & ) { | ||
12 | } | ||
13 | |||
14 | void AIRDA::saveSpecificAttribute( QTextStream & ) { | ||
15 | } | ||
16 | |||
17 | QWidget * AIRDA::edit( QWidget * parent ) { | ||
18 | GUI = new IRDAEdit( parent ); | ||
19 | GUI->showData( Data ); | ||
20 | return GUI; | ||
21 | } | ||
22 | |||
23 | QString AIRDA::acceptable( void ) { | ||
24 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
25 | } | ||
26 | |||
27 | void AIRDA::commit( void ) { | ||
28 | if( GUI && GUI->commit( Data ) ) | ||
29 | setModified( 1 ); | ||
30 | } | ||
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.h b/noncore/settings/networksettings2/irda/irda_NNI.h new file mode 100644 index 0000000..c2d6875 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NNI.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef IRDA_H | ||
2 | #define IRDA_H | ||
3 | |||
4 | #include <netnode.h> | ||
5 | #include "irdadata.h" | ||
6 | #include "irdarun.h" | ||
7 | |||
8 | class IRDANetNode; | ||
9 | class IRDAEdit; | ||
10 | |||
11 | class AIRDA : public ANetNodeInstance { | ||
12 | |||
13 | public : | ||
14 | |||
15 | AIRDA( IRDANetNode * PNN ); | ||
16 | |||
17 | QWidget * edit( QWidget * parent ); | ||
18 | QString acceptable( void ); | ||
19 | void commit( void ); | ||
20 | |||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT == 0 ) | ||
23 | RT = new IRDARun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | ||
28 | { return (void *)&Data; } | ||
29 | |||
30 | protected : | ||
31 | |||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | ||
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | ||
34 | |||
35 | private : | ||
36 | |||
37 | IRDAEdit * GUI; | ||
38 | IRDAData Data; | ||
39 | IRDARun * RT; | ||
40 | |||
41 | }; | ||
42 | |||
43 | #endif | ||
diff --git a/noncore/settings/networksettings2/irda/irdadata.h b/noncore/settings/networksettings2/irda/irdadata.h new file mode 100644 index 0000000..c3c683e --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdadata.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef IRDA_DATA_H | ||
2 | #define IRDA_DATA_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | typedef struct IRDAData { | ||
7 | QString Device; | ||
8 | QString LockFile; | ||
9 | long Speed; | ||
10 | short Parity; | ||
11 | short DataBits; | ||
12 | short StopBits; | ||
13 | bool HardwareControl; | ||
14 | bool SoftwareControl; | ||
15 | |||
16 | } IRDAData_t; | ||
17 | |||
18 | #endif | ||
diff --git a/noncore/settings/networksettings2/irda/irdaedit.cpp b/noncore/settings/networksettings2/irda/irdaedit.cpp new file mode 100644 index 0000000..2dfdce5 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaedit.cpp | |||
@@ -0,0 +1,17 @@ | |||
1 | #include <GUIUtils.h> | ||
2 | #include "irdaedit.h" | ||
3 | |||
4 | IRDAEdit::IRDAEdit( QWidget * Parent ) : IRDAGUI( Parent ){ | ||
5 | |||
6 | } | ||
7 | |||
8 | QString IRDAEdit::acceptable( void ) { | ||
9 | return QString(); | ||
10 | } | ||
11 | |||
12 | bool IRDAEdit::commit( IRDAData & Data ) { | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | void IRDAEdit::showData( IRDAData & Data ) { | ||
17 | } | ||
diff --git a/noncore/settings/networksettings2/irda/irdaedit.h b/noncore/settings/networksettings2/irda/irdaedit.h new file mode 100644 index 0000000..5131126 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaedit.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #include "irdadata.h" | ||
2 | #include "irdaGUI.h" | ||
3 | |||
4 | class IRDAEdit : public IRDAGUI { | ||
5 | |||
6 | public : | ||
7 | |||
8 | IRDAEdit( QWidget * parent ); | ||
9 | QString acceptable( void ); | ||
10 | bool commit( IRDAData & Data ); | ||
11 | void showData( IRDAData & Data ); | ||
12 | }; | ||
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h new file mode 100644 index 0000000..adc9c24 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdarun.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #include <asline.h> | ||
2 | #include "irdadata.h" | ||
3 | |||
4 | class IRDARun : public AsLine { | ||
5 | |||
6 | public : | ||
7 | |||
8 | IRDARun( ANetNodeInstance * NNI, | ||
9 | IRDAData & Data ) : AsLine( NNI ) | ||
10 | { } | ||
11 | |||
12 | protected : | ||
13 | |||
14 | void detectState( NodeCollection * ) | ||
15 | { } | ||
16 | |||
17 | bool setState( NodeCollection * , Action_t ) | ||
18 | { return 0; } | ||
19 | |||
20 | bool canSetState( State_t , Action_t ) | ||
21 | { return 0; } | ||
22 | }; | ||