summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interface.cpp2
-rw-r--r--noncore/net/networksetup/interface.h7
-rw-r--r--noncore/net/networksetup/interfacesetup.ui258
-rw-r--r--noncore/net/networksetup/mainwindow.ui74
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp59
-rw-r--r--noncore/net/networksetup/mainwindowimp.h1
-rw-r--r--noncore/net/networksetup/module.h7
-rw-r--r--noncore/net/networksetup/networksetup.pro4
8 files changed, 265 insertions, 147 deletions
diff --git a/noncore/net/networksetup/interface.cpp b/noncore/net/networksetup/interface.cpp
index f6eed00..5b21364 100644
--- a/noncore/net/networksetup/interface.cpp
+++ b/noncore/net/networksetup/interface.cpp
@@ -12,3 +12,3 @@
12 12
13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner("Default"), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){ 13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner(NULL), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){
14 refresh(); 14 refresh();
diff --git a/noncore/net/networksetup/interface.h b/noncore/net/networksetup/interface.h
index 1ad71eb..5dc95a4 100644
--- a/noncore/net/networksetup/interface.h
+++ b/noncore/net/networksetup/interface.h
@@ -5,2 +5,3 @@
5 5
6class Module;
6class Interface { 7class Interface {
@@ -23,4 +24,4 @@ public:
23 24
24 virtual QString getModuleOwner(){ return moduleOwner; }; 25 virtual Module* getModuleOwner(){ return moduleOwner; };
25 virtual void setModuleOwner(QString owner="Default"){ moduleOwner = owner; }; 26 virtual void setModuleOwner(Module *owner=NULL){ moduleOwner = owner; };
26 27
@@ -47,3 +48,3 @@ private:
47 QString hardareName; 48 QString hardareName;
48 QString moduleOwner; 49 Module *moduleOwner;
49 50
diff --git a/noncore/net/networksetup/interfacesetup.ui b/noncore/net/networksetup/interfacesetup.ui
index ff9810e..d367608 100644
--- a/noncore/net/networksetup/interfacesetup.ui
+++ b/noncore/net/networksetup/interfacesetup.ui
@@ -13,4 +13,4 @@
13 <y>0</y> 13 <y>0</y>
14 <width>177</width> 14 <width>271</width>
15 <height>320</height> 15 <height>280</height>
16 </rect> 16 </rect>
@@ -21,3 +21,3 @@
21 </property> 21 </property>
22 <grid> 22 <vbox>
23 <property stdset="1"> 23 <property stdset="1">
@@ -30,14 +30,3 @@
30 </property> 30 </property>
31 <widget row="1" column="0" rowspan="1" colspan="2" > 31 <widget>
32 <class>Line</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Line1</cstring>
36 </property>
37 <property stdset="1">
38 <name>orientation</name>
39 <enum>Horizontal</enum>
40 </property>
41 </widget>
42 <widget row="0" column="0" rowspan="1" colspan="2" >
43 <class>QCheckBox</class> 32 <class>QCheckBox</class>
@@ -52,97 +41,131 @@
52 </widget> 41 </widget>
53 <widget row="2" column="1" > 42 <widget>
54 <class>QComboBox</class> 43 <class>QLayoutWidget</class>
55 <item>
56 <property>
57 <name>text</name>
58 <string>All</string>
59 </property>
60 </item>
61 <property stdset="1"> 44 <property stdset="1">
62 <name>name</name> 45 <name>name</name>
63 <cstring>profileCombo</cstring> 46 <cstring>Layout8</cstring>
64 </property>
65 </widget>
66 <widget row="4" column="0" >
67 <class>QLabel</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>leaseHoursLabel</cstring>
71 </property>
72 <property stdset="1">
73 <name>text</name>
74 <string>Requested Lease</string>
75 </property>
76 </widget>
77 <widget row="3" column="0" rowspan="1" colspan="2" >
78 <class>QCheckBox</class>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>dhcpCheckBox</cstring>
82 </property>
83 <property stdset="1">
84 <name>text</name>
85 <string>DHCP</string>
86 </property>
87 <property stdset="1">
88 <name>checked</name>
89 <bool>true</bool>
90 </property>
91 </widget>
92 <widget row="2" column="0" >
93 <class>QLabel</class>
94 <property stdset="1">
95 <name>name</name>
96 <cstring>TextLabel1</cstring>
97 </property>
98 <property stdset="1">
99 <name>text</name>
100 <string>Profile:</string>
101 </property> 47 </property>
48 <hbox>
49 <property stdset="1">
50 <name>margin</name>
51 <number>0</number>
52 </property>
53 <property stdset="1">
54 <name>spacing</name>
55 <number>6</number>
56 </property>
57 <widget>
58 <class>QLabel</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>TextLabel1</cstring>
62 </property>
63 <property stdset="1">
64 <name>text</name>
65 <string>Profile</string>
66 </property>
67 </widget>
68 <widget>
69 <class>QComboBox</class>
70 <item>
71 <property>
72 <name>text</name>
73 <string>All</string>
74 </property>
75 </item>
76 <property stdset="1">
77 <name>name</name>
78 <cstring>profileCombo</cstring>
79 </property>
80 </widget>
81 <spacer>
82 <property>
83 <name>name</name>
84 <cstring>Spacer20</cstring>
85 </property>
86 <property stdset="1">
87 <name>orientation</name>
88 <enum>Horizontal</enum>
89 </property>
90 <property stdset="1">
91 <name>sizeType</name>
92 <enum>Expanding</enum>
93 </property>
94 <property>
95 <name>sizeHint</name>
96 <size>
97 <width>20</width>
98 <height>20</height>
99 </size>
100 </property>
101 </spacer>
102 </hbox>
102 </widget> 103 </widget>
103 <widget row="4" column="1" > 104 <widget>
104 <class>QSpinBox</class> 105 <class>QLayoutWidget</class>
105 <property stdset="1"> 106 <property stdset="1">
106 <name>name</name> 107 <name>name</name>
107 <cstring>leaseTime</cstring> 108 <cstring>Layout9</cstring>
108 </property>
109 <property stdset="1">
110 <name>suffix</name>
111 <string> hours</string>
112 </property>
113 <property stdset="1">
114 <name>maxValue</name>
115 <number>336</number>
116 </property>
117 <property stdset="1">
118 <name>minValue</name>
119 <number>1</number>
120 </property>
121 <property stdset="1">
122 <name>value</name>
123 <number>24</number>
124 </property> 109 </property>
110 <hbox>
111 <property stdset="1">
112 <name>margin</name>
113 <number>0</number>
114 </property>
115 <property stdset="1">
116 <name>spacing</name>
117 <number>6</number>
118 </property>
119 <widget>
120 <class>QCheckBox</class>
121 <property stdset="1">
122 <name>name</name>
123 <cstring>dhcpCheckBox</cstring>
124 </property>
125 <property stdset="1">
126 <name>text</name>
127 <string>DHCP</string>
128 </property>
129 <property stdset="1">
130 <name>checked</name>
131 <bool>true</bool>
132 </property>
133 </widget>
134 <widget>
135 <class>QLabel</class>
136 <property stdset="1">
137 <name>name</name>
138 <cstring>leaseHoursLabel</cstring>
139 </property>
140 <property stdset="1">
141 <name>text</name>
142 <string>Requested Lease</string>
143 </property>
144 </widget>
145 <widget>
146 <class>QSpinBox</class>
147 <property stdset="1">
148 <name>name</name>
149 <cstring>leaseTime</cstring>
150 </property>
151 <property stdset="1">
152 <name>suffix</name>
153 <string> hours</string>
154 </property>
155 <property stdset="1">
156 <name>maxValue</name>
157 <number>336</number>
158 </property>
159 <property stdset="1">
160 <name>minValue</name>
161 <number>1</number>
162 </property>
163 <property stdset="1">
164 <name>value</name>
165 <number>24</number>
166 </property>
167 </widget>
168 </hbox>
125 </widget> 169 </widget>
126 <spacer row="6" column="1" > 170 <widget>
127 <property>
128 <name>name</name>
129 <cstring>Spacer9</cstring>
130 </property>
131 <property stdset="1">
132 <name>orientation</name>
133 <enum>Vertical</enum>
134 </property>
135 <property stdset="1">
136 <name>sizeType</name>
137 <enum>Expanding</enum>
138 </property>
139 <property>
140 <name>sizeHint</name>
141 <size>
142 <width>20</width>
143 <height>20</height>
144 </size>
145 </property>
146 </spacer>
147 <widget row="5" column="0" rowspan="1" colspan="2" >
148 <class>QGroupBox</class> 171 <class>QGroupBox</class>
@@ -157,2 +180,10 @@
157 <property stdset="1"> 180 <property stdset="1">
181 <name>frameShape</name>
182 <enum>Box</enum>
183 </property>
184 <property stdset="1">
185 <name>frameShadow</name>
186 <enum>Sunken</enum>
187 </property>
188 <property stdset="1">
158 <name>title</name> 189 <name>title</name>
@@ -261,3 +292,24 @@
261 </widget> 292 </widget>
262 </grid> 293 <spacer>
294 <property>
295 <name>name</name>
296 <cstring>Spacer9</cstring>
297 </property>
298 <property stdset="1">
299 <name>orientation</name>
300 <enum>Vertical</enum>
301 </property>
302 <property stdset="1">
303 <name>sizeType</name>
304 <enum>Expanding</enum>
305 </property>
306 <property>
307 <name>sizeHint</name>
308 <size>
309 <width>20</width>
310 <height>20</height>
311 </size>
312 </property>
313 </spacer>
314 </vbox>
263</widget> 315</widget>
diff --git a/noncore/net/networksetup/mainwindow.ui b/noncore/net/networksetup/mainwindow.ui
index c1fa101..a3f7bb1 100644
--- a/noncore/net/networksetup/mainwindow.ui
+++ b/noncore/net/networksetup/mainwindow.ui
@@ -13,3 +13,3 @@
13 <y>0</y> 13 <y>0</y>
14 <width>218</width> 14 <width>217</width>
15 <height>289</height> 15 <height>289</height>
@@ -196,3 +196,14 @@
196 </property> 196 </property>
197 <widget row="0" column="0" rowspan="1" colspan="2" > 197 <widget row="1" column="0" rowspan="1" colspan="3" >
198 <class>Line</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>Line1</cstring>
202 </property>
203 <property stdset="1">
204 <name>orientation</name>
205 <enum>Horizontal</enum>
206 </property>
207 </widget>
208 <widget row="0" column="0" >
198 <class>QLabel</class> 209 <class>QLabel</class>
@@ -207,3 +218,3 @@
207 </widget> 218 </widget>
208 <widget row="0" column="2" > 219 <widget row="0" column="1" >
209 <class>QLabel</class> 220 <class>QLabel</class>
@@ -226,14 +237,24 @@
226 </widget> 237 </widget>
227 <widget row="1" column="0" > 238 <spacer row="0" column="2" >
228 <class>QLabel</class> 239 <property>
229 <property stdset="1">
230 <name>name</name> 240 <name>name</name>
231 <cstring>TextLabel1_2</cstring> 241 <cstring>Spacer2</cstring>
232 </property> 242 </property>
233 <property stdset="1"> 243 <property stdset="1">
234 <name>text</name> 244 <name>orientation</name>
235 <string>Profiles</string> 245 <enum>Horizontal</enum>
246 </property>
247 <property stdset="1">
248 <name>sizeType</name>
249 <enum>Expanding</enum>
236 </property> 250 </property>
237 </widget> 251 <property>
238 <spacer row="5" column="2" > 252 <name>sizeHint</name>
253 <size>
254 <width>20</width>
255 <height>20</height>
256 </size>
257 </property>
258 </spacer>
259 <spacer row="6" column="2" >
239 <property> 260 <property>
@@ -258,10 +279,3 @@
258 </spacer> 279 </spacer>
259 <widget row="2" column="0" rowspan="3" colspan="1" > 280 <widget row="5" column="2" >
260 <class>QListBox</class>
261 <property stdset="1">
262 <name>name</name>
263 <cstring>profilesList</cstring>
264 </property>
265 </widget>
266 <widget row="4" column="1" rowspan="1" colspan="2" >
267 <class>QPushButton</class> 281 <class>QPushButton</class>
@@ -276,3 +290,3 @@
276 </widget> 290 </widget>
277 <widget row="3" column="1" rowspan="1" colspan="2" > 291 <widget row="4" column="2" >
278 <class>QPushButton</class> 292 <class>QPushButton</class>
@@ -287,3 +301,3 @@
287 </widget> 301 </widget>
288 <widget row="2" column="1" rowspan="1" colspan="2" > 302 <widget row="3" column="2" >
289 <class>QPushButton</class> 303 <class>QPushButton</class>
@@ -298,2 +312,20 @@
298 </widget> 312 </widget>
313 <widget row="2" column="0" >
314 <class>QLabel</class>
315 <property stdset="1">
316 <name>name</name>
317 <cstring>TextLabel1_2</cstring>
318 </property>
319 <property stdset="1">
320 <name>text</name>
321 <string>Profiles</string>
322 </property>
323 </widget>
324 <widget row="3" column="0" rowspan="3" colspan="2" >
325 <class>QListBox</class>
326 <property stdset="1">
327 <name>name</name>
328 <cstring>profilesList</cstring>
329 </property>
330 </widget>
299 </grid> 331 </grid>
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index 0f48a4b..89dac6f 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -153,3 +153,3 @@ void MainWindowImp::removeClicked(){
153 153
154 if(modules.find(interfaceItems[item]) == modules.end()){ 154 if((interfaceItems[item])->getModuleOwner() == NULL){
155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); 155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok");
@@ -173,3 +173,3 @@ void MainWindowImp::configureClicked(){
173 173
174 if(modules.find(interfaceItems[item]) == modules.end()){ 174 if((interfaceItems[item])->getModuleOwner() == NULL){
175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]); 175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]);
@@ -179,4 +179,19 @@ void MainWindowImp::configureClicked(){
179 else{ 179 else{
180 InterfaceSetupImp *conf = new InterfaceSetupImp(this, "InterfaceConfiguration"); 180 QTabWidget *t = NULL;
181 conf->show(); 181 QWidget *conf = (interfaceItems[item])->getModuleOwner()->configure(&t);
182 if(conf != NULL){
183 qDebug("Conf found");
184 if(t != NULL){
185 qDebug("Adding Interface");
186 InterfaceSetupImp *i = new InterfaceSetupImp(t, "TCPIPInformation", interfaceItems[item], true);
187 t->insertTab(i, "TCP/IP");
188 }
189 conf->showMaximized();
190 conf->show();
191 }
192 else{
193 InterfaceSetupImp *i = new InterfaceSetupImp(0, "TCPIPInformation", interfaceItems[item], true);
194 i->showMaximized();
195 i->show();
196 }
182 } 197 }
@@ -195,3 +210,3 @@ void MainWindowImp::informationClicked(){
195 210
196 if(modules.find(interfaceItems[item]) == modules.end()){ 211 if( (interfaceItems[item])->getModuleOwner() == NULL){
197 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]); 212 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]);
@@ -201,6 +216,18 @@ void MainWindowImp::informationClicked(){
201 else{ 216 else{
202 QTabWidget *t = new QTabWidget(this, "InterfaceInformationTAB"); 217 QTabWidget *t = NULL;
203 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true); 218 QWidget *conf = (interfaceItems[item])->getModuleOwner()->information(&t);
204 t->insertTab(i, "TCP/IP"); 219 if(conf != NULL){
205 t->show(); 220 if(t){
221 qDebug("Adding Interface");
222 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true);
223 t->insertTab(i, "TCP/IP");
224 }
225 conf->showMaximized();
226 conf->show();
227 }
228 else{
229 InterfaceInformationImp *i = new InterfaceInformationImp(0, "TCPIPInformation", interfaceItems[item], true);
230 i->showMaximized();
231 i->show();
232 }
206 } 233 }
@@ -288,6 +315,8 @@ void MainWindowImp::updateInterface(Interface *i){
288 // See if you can't find a module owner for this interface 315 // See if you can't find a module owner for this interface
289 //EmployeeMap::Iterator it; 316 QMap<Module*, QLibrary*>::Iterator it;
290 //for( it = map.begin(); it != map.end(); ++it ) 317 for( it = libraries.begin(); it != libraries.end(); ++it ){
291 // printf( "%s, %s earns %d\n", it.key().latin1(), it.data().name().latin1(), it.data().salary() ); 318 if(it.key()->isOwner(i))
292 319 i->setModuleOwner(it.key());
320 }
321
293 items.insert(i, item); 322 items.insert(i, item);
@@ -311,2 +340,6 @@ void MainWindowImp::updateInterface(Interface *i){
311 typeName = "wlan"; 340 typeName = "wlan";
341 // Actually try to use the Module
342 if(i->getModuleOwner() != NULL){
343 typeName = i->getModuleOwner()->getPixmapName(i);
344 }
312 QPixmap type = (Resource::loadPixmap(typeName)); 345 QPixmap type = (Resource::loadPixmap(typeName));
diff --git a/noncore/net/networksetup/mainwindowimp.h b/noncore/net/networksetup/mainwindowimp.h
index 8e300bf..19ebaf2 100644
--- a/noncore/net/networksetup/mainwindowimp.h
+++ b/noncore/net/networksetup/mainwindowimp.h
@@ -44,3 +44,2 @@ private:
44 QMap<Module*, QLibrary*> libraries; 44 QMap<Module*, QLibrary*> libraries;
45 QMap<Interface*, Module*> modules;
46 QMap<Interface*, QListViewItem*> items; 45 QMap<Interface*, QListViewItem*> items;
diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h
index 13fd523..c1e9488 100644
--- a/noncore/net/networksetup/module.h
+++ b/noncore/net/networksetup/module.h
@@ -9,2 +9,3 @@
9class QWidget; 9class QWidget;
10class QTabWidget;
10 11
@@ -19,4 +20,4 @@ public:
19 virtual bool isOwner(Interface *){ return false; }; 20 virtual bool isOwner(Interface *){ return false; };
20 virtual QWidget *configure(){ return NULL; } ; 21 virtual QWidget *configure(QTabWidget **tabWidget){ return NULL; } ;
21 virtual QWidget *information(){ return NULL; }; 22 virtual QWidget *information(QTabWidget **tabWidget){ return NULL; };
22 virtual QList<Interface> getInterfaces() = 0; 23 virtual QList<Interface> getInterfaces() = 0;
@@ -25,3 +26,3 @@ public:
25 virtual bool remove(Interface* i) = 0; 26 virtual bool remove(Interface* i) = 0;
26 27 virtual QString getPixmapName(Interface* i) = 0;
27 28
diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro
index a01b050..0d48790 100644
--- a/noncore/net/networksetup/networksetup.pro
+++ b/noncore/net/networksetup/networksetup.pro
@@ -1,4 +1,4 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on debug 2 #CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release 3 CONFIG = qt warn_on release
4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h 4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h