Diffstat (limited to 'noncore/settings/networksettings2/modem') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/modem/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modem.pro | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modemGUI.ui | 131 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modem_NN.cpp | 60 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modem_NN.h | 44 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modem_NNI.cpp | 31 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modem_NNI.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modemdata.h | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modemedit.cpp | 18 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modemedit.h | 12 | ||||
-rw-r--r-- | noncore/settings/networksettings2/modem/modemrun.h | 22 |
11 files changed, 399 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/modem/config.in b/noncore/settings/networksettings2/modem/config.in new file mode 100644 index 0000000..77a1c77 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config NS2MODEM | ||
2 | boolean "opie-networksettings2plugin-modem (set up DIALUP)" | ||
3 | default "n" if NS2 | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE | ||
diff --git a/noncore/settings/networksettings2/modem/modem.pro b/noncore/settings/networksettings2/modem/modem.pro new file mode 100644 index 0000000..945486b --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem.pro | |||
@@ -0,0 +1,17 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | ||
4 | HEADERS = modem_NN.h \ | ||
5 | modem_NNI.h \ | ||
6 | modemedit.h | ||
7 | SOURCES = modem_NN.cpp \ | ||
8 | modem_NNI.cpp \ | ||
9 | modemedit.cpp | ||
10 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
11 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
12 | LIBS += -lqpe | ||
13 | INTERFACES= modemGUI.ui | ||
14 | TARGET = modem | ||
15 | VERSION = 1.0.0 | ||
16 | |||
17 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/settings/networksettings2/modem/modemGUI.ui b/noncore/settings/networksettings2/modem/modemGUI.ui new file mode 100644 index 0000000..328f95c --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemGUI.ui | |||
@@ -0,0 +1,131 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>ModemGUI</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>Modem_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>Modem</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/modem/modem_NN.cpp b/noncore/settings/networksettings2/modem/modem_NN.cpp new file mode 100644 index 0000000..48e1ad8 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NN.cpp | |||
@@ -0,0 +1,60 @@ | |||
1 | #include "modem_NN.h" | ||
2 | #include "modem_NNI.h" | ||
3 | |||
4 | static const char * ModemNeeds[] = | ||
5 | { "line" | ||
6 | }; | ||
7 | |||
8 | /** | ||
9 | * Constructor, find all of the possible interfaces | ||
10 | */ | ||
11 | ModemNetNode::ModemNetNode() : ANetNode() { | ||
12 | } | ||
13 | |||
14 | /** | ||
15 | * Delete any interfaces that we own. | ||
16 | */ | ||
17 | ModemNetNode::~ModemNetNode(){ | ||
18 | } | ||
19 | |||
20 | const QString ModemNetNode::nodeDescription(){ | ||
21 | return tr("\ | ||
22 | <p>Sets up a dialing procedures.</p>\ | ||
23 | <p>Use this to dial up over modems, ISDN, GSM, ...</p>\ | ||
24 | " | ||
25 | ); | ||
26 | } | ||
27 | |||
28 | ANetNodeInstance * ModemNetNode::createInstance( void ) { | ||
29 | return new AModem( this ); | ||
30 | } | ||
31 | |||
32 | const char ** ModemNetNode::needs( void ) { | ||
33 | return ModemNeeds; | ||
34 | } | ||
35 | |||
36 | const char * ModemNetNode::provides( void ) { | ||
37 | return "line"; | ||
38 | } | ||
39 | |||
40 | bool ModemNetNode::generateProperFilesFor( | ||
41 | ANetNodeInstance * ) { | ||
42 | return 1; | ||
43 | } | ||
44 | |||
45 | bool ModemNetNode::hasDataFor( const QString & ) { | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | bool ModemNetNode::generateDataForCommonFile( | ||
50 | SystemFile & , | ||
51 | long , | ||
52 | ANetNodeInstance * ) { | ||
53 | return 1; | ||
54 | } | ||
55 | |||
56 | extern "C" { | ||
57 | void create_plugin( QList<ANetNode> & PNN ) { | ||
58 | PNN.append( new ModemNetNode() ); | ||
59 | } | ||
60 | } | ||
diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h new file mode 100644 index 0000000..0f4c124 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NN.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef MODEM_NETNODE_H | ||
2 | #define MODEM_NETNODE_H | ||
3 | |||
4 | #include "netnode.h" | ||
5 | |||
6 | class AModem; | ||
7 | |||
8 | class ModemNetNode : public ANetNode{ | ||
9 | |||
10 | Q_OBJECT | ||
11 | |||
12 | public: | ||
13 | |||
14 | ModemNetNode(); | ||
15 | virtual ~ModemNetNode(); | ||
16 | |||
17 | virtual const QString pixmapName() | ||
18 | { return "modem"; } | ||
19 | |||
20 | virtual const QString nodeName() | ||
21 | { return tr("Dialup modem"); } | ||
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/modem/modem_NNI.cpp b/noncore/settings/networksettings2/modem/modem_NNI.cpp new file mode 100644 index 0000000..91df22b --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NNI.cpp | |||
@@ -0,0 +1,31 @@ | |||
1 | #include "modemedit.h" | ||
2 | #include "modem_NNI.h" | ||
3 | #include "modem_NN.h" | ||
4 | |||
5 | AModem::AModem( ModemNetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | |||
7 | GUI = 0; | ||
8 | RT = 0; | ||
9 | } | ||
10 | |||
11 | void AModem::setSpecificAttribute( QString & , QString & ) { | ||
12 | } | ||
13 | |||
14 | void AModem::saveSpecificAttribute( QTextStream & ) { | ||
15 | } | ||
16 | |||
17 | QWidget * AModem::edit( QWidget * parent ) { | ||
18 | GUI = new ModemEdit( parent ); | ||
19 | GUI->showData( Data ); | ||
20 | return GUI; | ||
21 | } | ||
22 | |||
23 | QString AModem::acceptable( void ) { | ||
24 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
25 | } | ||
26 | |||
27 | void AModem::commit( void ) { | ||
28 | if( GUI && GUI->commit( Data ) ) | ||
29 | setModified( 1 ); | ||
30 | } | ||
31 | |||
diff --git a/noncore/settings/networksettings2/modem/modem_NNI.h b/noncore/settings/networksettings2/modem/modem_NNI.h new file mode 100644 index 0000000..7543e7d --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NNI.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef Modem_H | ||
2 | #define Modem_H | ||
3 | |||
4 | #include <netnode.h> | ||
5 | #include "modemdata.h" | ||
6 | #include "modemrun.h" | ||
7 | |||
8 | class ModemNetNode; | ||
9 | class ModemEdit; | ||
10 | |||
11 | class AModem : public ANetNodeInstance { | ||
12 | |||
13 | public : | ||
14 | |||
15 | AModem( ModemNetNode * 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 ModemRun( 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 | ModemEdit * GUI; | ||
38 | ModemData Data; | ||
39 | ModemRun * RT; | ||
40 | |||
41 | }; | ||
42 | |||
43 | #endif | ||
diff --git a/noncore/settings/networksettings2/modem/modemdata.h b/noncore/settings/networksettings2/modem/modemdata.h new file mode 100644 index 0000000..773cb77 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemdata.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef MODEM_DATA_H | ||
2 | #define MODEM_DATA_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | typedef struct ModemData { | ||
6 | QString Device; | ||
7 | QString LockFile; | ||
8 | long Speed; | ||
9 | short Parity; | ||
10 | short DataBits; | ||
11 | short StopBits; | ||
12 | bool HardwareControl; | ||
13 | bool SoftwareControl; | ||
14 | |||
15 | } ModemData_t; | ||
16 | |||
17 | #endif | ||
diff --git a/noncore/settings/networksettings2/modem/modemedit.cpp b/noncore/settings/networksettings2/modem/modemedit.cpp new file mode 100644 index 0000000..fd3d694 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemedit.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <GUIUtils.h> | ||
2 | #include "modemedit.h" | ||
3 | |||
4 | ModemEdit::ModemEdit( QWidget * Parent ) : ModemGUI( Parent ){ | ||
5 | |||
6 | } | ||
7 | |||
8 | QString ModemEdit::acceptable( void ) { | ||
9 | return QString(); | ||
10 | } | ||
11 | |||
12 | bool ModemEdit::commit( ModemData_t & Data ) { | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | void ModemEdit::showData( ModemData_t & Data ) { | ||
17 | } | ||
18 | |||
diff --git a/noncore/settings/networksettings2/modem/modemedit.h b/noncore/settings/networksettings2/modem/modemedit.h new file mode 100644 index 0000000..56e2a82 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemedit.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #include "modemdata.h" | ||
2 | #include "modemGUI.h" | ||
3 | |||
4 | class ModemEdit : public ModemGUI { | ||
5 | |||
6 | public : | ||
7 | |||
8 | ModemEdit( QWidget * parent ); | ||
9 | QString acceptable( void ); | ||
10 | bool commit( ModemData_t & Data ); | ||
11 | void showData( ModemData_t & Data ); | ||
12 | }; | ||
diff --git a/noncore/settings/networksettings2/modem/modemrun.h b/noncore/settings/networksettings2/modem/modemrun.h new file mode 100644 index 0000000..719ab2f --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemrun.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #include <asline.h> | ||
2 | #include "modemdata.h" | ||
3 | |||
4 | class ModemRun : public AsLine { | ||
5 | |||
6 | public : | ||
7 | |||
8 | ModemRun( ANetNodeInstance * NNI, | ||
9 | ModemData & 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 | }; | ||