summaryrefslogtreecommitdiff
path: root/noncore/settings
authorbenmeyer <benmeyer>2002-11-11 20:45:27 (UTC)
committer benmeyer <benmeyer>2002-11-11 20:45:27 (UTC)
commitb11baff926843bfa4fa3177dc919be8754fb6d4d (patch) (unidiff)
treeca428f4e8549b98a10f3139538fe6e5464e4553e /noncore/settings
parentda541da2e5cec28acb36cbd6e9c04a76375b4ac7 (diff)
downloadopie-b11baff926843bfa4fa3177dc919be8754fb6d4d.zip
opie-b11baff926843bfa4fa3177dc919be8754fb6d4d.tar.gz
opie-b11baff926843bfa4fa3177dc919be8754fb6d4d.tar.bz2
Initial framework for the ppp module
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/ppp.pro12
-rw-r--r--noncore/settings/networksettings/ppp/ppp.ui20
-rw-r--r--noncore/settings/networksettings/ppp/pppimp.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/pppimp.h17
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp104
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.h41
6 files changed, 188 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro
new file mode 100644
index 0000000..075cc5f
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/ppp.pro
@@ -0,0 +1,12 @@
1TEMPLATE = lib
2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug
4DESTDIR = $(OPIEDIR)/plugins/networksetup
5 HEADERS = pppimp.h pppmodule.h
6 SOURCES = pppimp.cpp pppmodule.cpp
7 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe -L../interfaces/ -linterfaces
10 INTERFACES= ppp.ui
11 TARGET = pppplugin
12 VERSION = 1.0.0
diff --git a/noncore/settings/networksettings/ppp/ppp.ui b/noncore/settings/networksettings/ppp/ppp.ui
index d08eda0..67d6735 100644
--- a/noncore/settings/networksettings/ppp/ppp.ui
+++ b/noncore/settings/networksettings/ppp/ppp.ui
@@ -1,17 +1,17 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>DialupBase</class> 2<class>PPP</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>Form1</cstring> 7 <cstring>PPP</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>273</width> 14 <width>277</width>
15 <height>340</height> 15 <height>340</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -346,7 +346,7 @@
346 </property> 346 </property>
347 <property stdset="1"> 347 <property stdset="1">
348 <name>text</name> 348 <name>text</name>
349 <string>1</string> 349 <string>6</string>
350 </property> 350 </property>
351 <property stdset="1"> 351 <property stdset="1">
352 <name>alignment</name> 352 <name>alignment</name>
@@ -735,17 +735,17 @@
735 <slot>setDisabled(bool)</slot> 735 <slot>setDisabled(bool)</slot>
736 </connection> 736 </connection>
737 <connection> 737 <connection>
738 <sender>connectdelay</sender>
739 <signal>valueChanged(int)</signal>
740 <receiver>connectdelay_text</receiver>
741 <slot>setNum(int)</slot>
742 </connection>
743 <connection>
744 <sender>dial_manual</sender> 738 <sender>dial_manual</sender>
745 <signal>toggled(bool)</signal> 739 <signal>toggled(bool)</signal>
746 <receiver>idletime</receiver> 740 <receiver>idletime</receiver>
747 <slot>setDisabled(bool)</slot> 741 <slot>setDisabled(bool)</slot>
748 </connection> 742 </connection>
743 <connection>
744 <sender>connectdelay</sender>
745 <signal>valueChanged(int)</signal>
746 <receiver>connectdelay_text</receiver>
747 <slot>setNum(int)</slot>
748 </connection>
749</connections> 749</connections>
750<tabstops> 750<tabstops>
751 <tabstop>TabWidget2</tabstop> 751 <tabstop>TabWidget2</tabstop>
diff --git a/noncore/settings/networksettings/ppp/pppimp.cpp b/noncore/settings/networksettings/ppp/pppimp.cpp
new file mode 100644
index 0000000..e3a7481
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/pppimp.cpp
@@ -0,0 +1,4 @@
1#include "pppimp.h"
2
3// pppconfigureimp.h
4
diff --git a/noncore/settings/networksettings/ppp/pppimp.h b/noncore/settings/networksettings/ppp/pppimp.h
new file mode 100644
index 0000000..60d29b5
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/pppimp.h
@@ -0,0 +1,17 @@
1#ifndef PPPIMP_H
2#define PPPIMP_H
3
4#include "ppp.h"
5
6class PPPConfigureImp : public PPP {
7
8public:
9 PPPConfigureImp();
10 ~PPPConfigureImp();
11
12};
13
14#endif
15
16// pppconfigureimp.h
17
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
new file mode 100644
index 0000000..68bb0a0
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -0,0 +1,104 @@
1#include "pppmodule.h"
2#include "interfaceinformationimp.h"
3
4/**
5 * Constructor, find all of the possible interfaces
6 */
7PPPModule::PPPModule() : Module() {
8}
9
10/**
11 * Delete any interfaces that we own.
12 */
13PPPModule::~PPPModule(){
14 Interface *i;
15 for ( i=list.first(); i != 0; i=list.next() )
16 delete i;
17}
18
19/**
20 * Change the current profile
21 */
22void PPPModule::setProfile(const QString &newProfile){
23 profile = newProfile;
24}
25
26/**
27 * get the icon name for this device.
28 * @param Interface* can be used in determining the icon.
29 * @return QString the icon name (minus .png, .gif etc)
30 */
31QString PPPModule::getPixmapName(Interface* ){
32 return "ppp";
33}
34
35/**
36 * Check to see if the interface i is owned by this module.
37 * @param Interface* interface to check against
38 * @return bool true if i is owned by this module, false otherwise.
39 */
40bool PPPModule::isOwner(Interface *i){
41 // Scan the ppp database
42 return false;
43
44 i->setHardwareName("PPP");
45 list.append(i);
46 return true;
47}
48
49/**
50 * Create, and return the WLANConfigure Module
51 * @return QWidget* pointer to this modules configure.
52 */
53QWidget *PPPModule::configure(Interface *i){
54 return NULL;
55 //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose);
56 //pppconfig->setProfile(profile);
57 //return wlanconfig;
58}
59
60/**
61 * Create, and return the Information Module
62 * @return QWidget* pointer to this modules info.
63 */
64QWidget *PPPModule::information(Interface *i){
65 return NULL;
66
67 //WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
68 //InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
69 //info->tabWidget->insertTab(information, "TCP/IP");
70 //return info;
71}
72
73/**
74 * Get all active (up or down) interfaces
75 * @return QList<Interface> A list of interfaces that exsist that havn't
76 * been called by isOwner()
77 */
78QList<Interface> PPPModule::getInterfaces(){
79 return list;
80}
81
82/**
83 * Attempt to add a new interface as defined by name
84 * @param name the name of the type of interface that should be created given
85 * by possibleNewInterfaces();
86 * @return Interface* NULL if it was unable to be created.
87 */
88Interface *PPPModule::addNewInterface(const QString &newInterface){
89 // We can't add a 802.11 interface, either the hardware will be there
90 // or it wont.
91 return NULL;
92}
93
94/**
95 * Attempts to remove the interface, doesn't delete i
96 * @return bool true if successfull, false otherwise.
97 */
98bool PPPModule::remove(Interface*){
99 // Can't remove a hardware device, you can stop it though.
100 return false;
101}
102
103// pppmodule.cpp
104
diff --git a/noncore/settings/networksettings/ppp/pppmodule.h b/noncore/settings/networksettings/ppp/pppmodule.h
new file mode 100644
index 0000000..c8e77e2
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/pppmodule.h
@@ -0,0 +1,41 @@
1#ifndef PPP_MODULE_H
2#define PPP_MODULE_H
3
4#include "module.h"
5
6class PPPModule : Module {
7
8signals:
9 void updateInterface(Interface *i);
10
11public:
12 PPPModule();
13 ~PPPModule();
14
15 virtual void setProfile(const QString &newProfile);
16 virtual bool isOwner(Interface *);
17 virtual QWidget *configure(Interface *i);
18 virtual QWidget *information(Interface *i);
19 virtual QList<Interface> getInterfaces();
20 virtual void possibleNewInterfaces(QMap<QString, QString> &){};
21 virtual Interface *addNewInterface(const QString &name);
22 virtual bool remove(Interface* i);
23 virtual QString getPixmapName(Interface* i);
24
25private:
26 QList<Interface> list;
27 QString profile;
28
29};
30
31extern "C"
32{
33 void* create_plugin() {
34 return new PPPModule();
35 }
36};
37
38#endif
39
40// pppmodule.h
41