author | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
commit | a7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (unidiff) | |
tree | b712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings/networksettings/interfaces | |
parent | beba0e73306815337bf04dee39502233595e9739 (diff) | |
download | opie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/networksettings/interfaces') (more/less context) (ignore whitespace changes)
8 files changed, 254 insertions, 185 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index cc45525..69b55d1 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp | |||
@@ -3,3 +3,3 @@ | |||
3 | * $Date$ | 3 | * $Date$ |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -26,3 +26,3 @@ Interface::Interface(QObject * parent, const char * name, bool newSatus): QObjec | |||
26 | * emit updateInterface | 26 | * emit updateInterface |
27 | */ | 27 | */ |
28 | void Interface::setStatus(bool newStatus){ | 28 | void Interface::setStatus(bool newStatus){ |
@@ -38,3 +38,3 @@ void Interface::setStatus(bool newStatus){ | |||
38 | * emit updateInterface | 38 | * emit updateInterface |
39 | */ | 39 | */ |
40 | void Interface::setAttached(bool isAttached){ | 40 | void Interface::setAttached(bool isAttached){ |
@@ -43,3 +43,3 @@ void Interface::setAttached(bool isAttached){ | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | /** | 45 | /** |
@@ -48,3 +48,3 @@ void Interface::setAttached(bool isAttached){ | |||
48 | * emit updateInterface | 48 | * emit updateInterface |
49 | */ | 49 | */ |
50 | void Interface::setHardwareName(const QString &name){ | 50 | void Interface::setHardwareName(const QString &name){ |
@@ -53,3 +53,3 @@ void Interface::setHardwareName(const QString &name){ | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | /** | 55 | /** |
@@ -58,3 +58,3 @@ void Interface::setHardwareName(const QString &name){ | |||
58 | * emit updateInterface | 58 | * emit updateInterface |
59 | */ | 59 | */ |
60 | void Interface::setModuleOwner(Module *owner){ | 60 | void Interface::setModuleOwner(Module *owner){ |
@@ -67,5 +67,5 @@ void Interface::setModuleOwner(Module *owner){ | |||
67 | * Try to start the interface. | 67 | * Try to start the interface. |
68 | */ | 68 | */ |
69 | void Interface::start(){ | 69 | void Interface::start(){ |
70 | // check to see if we are already running. | 70 | // check to see if we are already running. |
71 | if(true == status){ | 71 | if(true == status){ |
@@ -74,3 +74,3 @@ void Interface::start(){ | |||
74 | } | 74 | } |
75 | 75 | ||
76 | int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); | 76 | int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); |
@@ -91,3 +91,3 @@ void Interface::start(){ | |||
91 | void Interface::stop(){ | 91 | void Interface::stop(){ |
92 | // check to see if we are already stopped. | 92 | // check to see if we are already stopped. |
93 | if(false == status){ | 93 | if(false == status){ |
@@ -96,3 +96,3 @@ void Interface::stop(){ | |||
96 | } | 96 | } |
97 | 97 | ||
98 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); | 98 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); |
@@ -110,3 +110,3 @@ void Interface::stop(){ | |||
110 | * Try to restart the interface. | 110 | * Try to restart the interface. |
111 | */ | 111 | */ |
112 | void Interface::restart(){ | 112 | void Interface::restart(){ |
@@ -135,5 +135,5 @@ bool Interface::refresh(){ | |||
135 | } | 135 | } |
136 | 136 | ||
137 | QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name()); | 137 | QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name()); |
138 | int ret = system(QString("%1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1()); | 138 | int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1()); |
139 | if(ret != 0){ | 139 | if(ret != 0){ |
@@ -142,3 +142,3 @@ bool Interface::refresh(){ | |||
142 | } | 142 | } |
143 | 143 | ||
144 | QFile file(fileName); | 144 | QFile file(fileName); |
@@ -154,3 +154,3 @@ bool Interface::refresh(){ | |||
154 | broadcast = ""; | 154 | broadcast = ""; |
155 | 155 | ||
156 | QTextStream stream( &file ); | 156 | QTextStream stream( &file ); |
@@ -187,3 +187,3 @@ bool Interface::refresh(){ | |||
187 | dhcp = false; | 187 | dhcp = false; |
188 | 188 | ||
189 | QString dhcpDirectory(DHCP_INFO_DIR); | 189 | QString dhcpDirectory(DHCP_INFO_DIR); |
@@ -192,4 +192,4 @@ bool Interface::refresh(){ | |||
192 | dhcpDirectory = "/var/run"; | 192 | dhcpDirectory = "/var/run"; |
193 | 193 | ||
194 | // See if we have | 194 | // See if we have |
195 | QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name())); | 195 | QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name())); |
@@ -200,3 +200,3 @@ bool Interface::refresh(){ | |||
200 | } | 200 | } |
201 | 201 | ||
202 | file.setName(dhcpFile); | 202 | file.setName(dhcpFile); |
@@ -206,3 +206,3 @@ bool Interface::refresh(){ | |||
206 | } | 206 | } |
207 | 207 | ||
208 | // leaseTime and renewalTime and used if pid and deamon exe can be accessed. | 208 | // leaseTime and renewalTime and used if pid and deamon exe can be accessed. |
@@ -210,3 +210,3 @@ bool Interface::refresh(){ | |||
210 | int renewalTime = 0; | 210 | int renewalTime = 0; |
211 | 211 | ||
212 | stream.setDevice( &file ); | 212 | stream.setDevice( &file ); |
@@ -224,3 +224,3 @@ bool Interface::refresh(){ | |||
224 | //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1()); | 224 | //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1()); |
225 | 225 | ||
226 | // Get the pid of the deamond | 226 | // Get the pid of the deamond |
@@ -246,3 +246,3 @@ bool Interface::refresh(){ | |||
246 | 246 | ||
247 | // Get the start running time of the deamon | 247 | // Get the start running time of the deamon |
248 | fileName = (QString("/proc/%1/stat").arg(pid)); | 248 | fileName = (QString("/proc/%1/stat").arg(pid)); |
@@ -259,3 +259,3 @@ bool Interface::refresh(){ | |||
259 | long time = 0; | 259 | long time = 0; |
260 | // Grab the start time | 260 | // Grab the start time |
261 | // pid com state ppid pgrp session tty_nr tpgid flags | 261 | // pid com state ppid pgrp session tty_nr tpgid flags |
@@ -267,3 +267,3 @@ bool Interface::refresh(){ | |||
267 | time = time/100; | 267 | time = time/100; |
268 | 268 | ||
269 | QDateTime datetime(QDateTime::currentDateTime()); | 269 | QDateTime datetime(QDateTime::currentDateTime()); |
@@ -283,15 +283,15 @@ bool Interface::refresh(){ | |||
283 | } | 283 | } |
284 | 284 | ||
285 | datetime = datetime.addSecs(time); | 285 | datetime = datetime.addSecs(time); |
286 | //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1()); | 286 | //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1()); |
287 | 287 | ||
288 | // Calculate the start and renew times | 288 | // Calculate the start and renew times |
289 | leaseObtained= datetime.toString(); | 289 | leaseObtained= datetime.toString(); |
290 | 290 | ||
291 | // Calculate the start and renew times | 291 | // Calculate the start and renew times |
292 | datetime = datetime.addSecs(leaseTime); | 292 | datetime = datetime.addSecs(leaseTime); |
293 | leaseExpires = datetime.toString(); | 293 | leaseExpires = datetime.toString(); |
294 | 294 | ||
295 | dhcp = true; | 295 | dhcp = true; |
296 | 296 | ||
297 | emit(updateInterface(this)); | 297 | emit(updateInterface(this)); |
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h index 7e98deb..ec82851 100644 --- a/noncore/settings/networksettings/interfaces/interface.h +++ b/noncore/settings/networksettings/interfaces/interface.h | |||
@@ -14,9 +14,9 @@ signals: | |||
14 | void updateMessage(const QString &message); | 14 | void updateMessage(const QString &message); |
15 | 15 | ||
16 | public: | 16 | public: |
17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); | 17 | Interface(QObject * parent=0, const char * name= "unknown", bool status = false); |
18 | 18 | ||
19 | QString getInterfaceName() const { QString n(this->name()); return n; }; | 19 | QString getInterfaceName() const { QString n(this->name()); return n; }; |
20 | void setInterfaceName( const QString &n ) { this->setName(n); }; | 20 | void setInterfaceName( const QString &n ) { this->setName(n); }; |
21 | 21 | ||
22 | bool getStatus() const { return status; }; | 22 | bool getStatus() const { return status; }; |
@@ -26,6 +26,6 @@ public: | |||
26 | void setAttached(bool isAttached=false); | 26 | void setAttached(bool isAttached=false); |
27 | 27 | ||
28 | QString getHardwareName() const { return hardwareName; }; | 28 | QString getHardwareName() const { return hardwareName; }; |
29 | void setHardwareName(const QString &name="Unknown"); | 29 | void setHardwareName(const QString &name="Unknown"); |
30 | 30 | ||
31 | Module* getModuleOwner() const { return moduleOwner; }; | 31 | Module* getModuleOwner() const { return moduleOwner; }; |
@@ -49,3 +49,3 @@ public: | |||
49 | 49 | ||
50 | private: | 50 | protected: |
51 | // Interface information | 51 | // Interface information |
diff --git a/noncore/settings/networksettings/interfaces/interfaceadvanced.ui b/noncore/settings/networksettings/interfaces/interfaceadvanced.ui index 2e106cb..12dbb1d 100644 --- a/noncore/settings/networksettings/interfaces/interfaceadvanced.ui +++ b/noncore/settings/networksettings/interfaces/interfaceadvanced.ui | |||
@@ -20,3 +20,3 @@ | |||
20 | <size> | 20 | <size> |
21 | <width>240</width> | 21 | <width>32767</width> |
22 | <height>32767</height> | 22 | <height>32767</height> |
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformation.ui b/noncore/settings/networksettings/interfaces/interfaceinformation.ui index 763ad90..207200e 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformation.ui +++ b/noncore/settings/networksettings/interfaces/interfaceinformation.ui | |||
@@ -14,3 +14,3 @@ | |||
14 | <width>219</width> | 14 | <width>219</width> |
15 | <height>255</height> | 15 | <height>323</height> |
16 | </rect> | 16 | </rect> |
@@ -21,6 +21,12 @@ | |||
21 | </property> | 21 | </property> |
22 | <grid> | 22 | <property> |
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
23 | <property stdset="1"> | 29 | <property stdset="1"> |
24 | <name>margin</name> | 30 | <name>margin</name> |
25 | <number>11</number> | 31 | <number>4</number> |
26 | </property> | 32 | </property> |
@@ -28,77 +34,5 @@ | |||
28 | <name>spacing</name> | 34 | <name>spacing</name> |
29 | <number>6</number> | 35 | <number>3</number> |
30 | </property> | 36 | </property> |
31 | <widget row="4" column="0" rowspan="1" colspan="2" > | 37 | <widget> |
32 | <class>QLayoutWidget</class> | ||
33 | <property stdset="1"> | ||
34 | <name>name</name> | ||
35 | <cstring>Layout1</cstring> | ||
36 | </property> | ||
37 | <grid> | ||
38 | <property stdset="1"> | ||
39 | <name>margin</name> | ||
40 | <number>0</number> | ||
41 | </property> | ||
42 | <property stdset="1"> | ||
43 | <name>spacing</name> | ||
44 | <number>6</number> | ||
45 | </property> | ||
46 | <widget row="1" column="0" > | ||
47 | <class>QPushButton</class> | ||
48 | <property stdset="1"> | ||
49 | <name>name</name> | ||
50 | <cstring>refreshButton</cstring> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>text</name> | ||
54 | <string>&Refresh</string> | ||
55 | </property> | ||
56 | </widget> | ||
57 | <widget row="0" column="1" > | ||
58 | <class>QPushButton</class> | ||
59 | <property stdset="1"> | ||
60 | <name>name</name> | ||
61 | <cstring>stopButton</cstring> | ||
62 | </property> | ||
63 | <property stdset="1"> | ||
64 | <name>text</name> | ||
65 | <string>S&top</string> | ||
66 | </property> | ||
67 | </widget> | ||
68 | <widget row="1" column="1" > | ||
69 | <class>QPushButton</class> | ||
70 | <property stdset="1"> | ||
71 | <name>name</name> | ||
72 | <cstring>restartButton</cstring> | ||
73 | </property> | ||
74 | <property stdset="1"> | ||
75 | <name>text</name> | ||
76 | <string>R&estart</string> | ||
77 | </property> | ||
78 | </widget> | ||
79 | <widget row="0" column="0" > | ||
80 | <class>QPushButton</class> | ||
81 | <property stdset="1"> | ||
82 | <name>name</name> | ||
83 | <cstring>startButton</cstring> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>text</name> | ||
87 | <string>&Start</string> | ||
88 | </property> | ||
89 | </widget> | ||
90 | </grid> | ||
91 | </widget> | ||
92 | <widget row="0" column="0" > | ||
93 | <class>Line</class> | ||
94 | <property stdset="1"> | ||
95 | <name>name</name> | ||
96 | <cstring>Line1</cstring> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>orientation</name> | ||
100 | <enum>Horizontal</enum> | ||
101 | </property> | ||
102 | </widget> | ||
103 | <widget row="0" column="0" > | ||
104 | <class>QLabel</class> | 38 | <class>QLabel</class> |
@@ -113,3 +47,3 @@ | |||
113 | </widget> | 47 | </widget> |
114 | <widget row="1" column="0" > | 48 | <widget> |
115 | <class>QLabel</class> | 49 | <class>QLabel</class> |
@@ -117,14 +51,11 @@ | |||
117 | <name>name</name> | 51 | <name>name</name> |
118 | <cstring>TextLabel23</cstring> | 52 | <cstring>ipAddressLabel</cstring> |
119 | </property> | 53 | </property> |
120 | <property stdset="1"> | 54 | <property stdset="1"> |
121 | <name>text</name> | 55 | <name>frameShape</name> |
122 | <string>Subnet Mask</string> | 56 | <enum>Panel</enum> |
123 | </property> | 57 | </property> |
124 | </widget> | ||
125 | <widget row="2" column="0" > | ||
126 | <class>QLabel</class> | ||
127 | <property stdset="1"> | 58 | <property stdset="1"> |
128 | <name>name</name> | 59 | <name>frameShadow</name> |
129 | <cstring>TextLabel21</cstring> | 60 | <enum>Sunken</enum> |
130 | </property> | 61 | </property> |
@@ -132,18 +63,21 @@ | |||
132 | <name>text</name> | 63 | <name>text</name> |
133 | <string>MAC Address</string> | 64 | <string>0.0.0.0</string> |
134 | </property> | 65 | </property> |
135 | </widget> | 66 | </widget> |
136 | <widget row="3" column="0" > | 67 | <widget> |
137 | <class>QLabel</class> | 68 | <class>Line</class> |
138 | <property stdset="1"> | 69 | <property stdset="1"> |
139 | <name>name</name> | 70 | <name>name</name> |
140 | <cstring>TextLabel24</cstring> | 71 | <cstring>Line1</cstring> |
141 | </property> | 72 | </property> |
142 | <property stdset="1"> | 73 | <property stdset="1"> |
143 | <name>frameShape</name> | 74 | <name>orientation</name> |
144 | <enum>MShape</enum> | 75 | <enum>Horizontal</enum> |
145 | </property> | 76 | </property> |
77 | </widget> | ||
78 | <widget> | ||
79 | <class>QLabel</class> | ||
146 | <property stdset="1"> | 80 | <property stdset="1"> |
147 | <name>frameShadow</name> | 81 | <name>name</name> |
148 | <enum>MShadow</enum> | 82 | <cstring>TextLabel23</cstring> |
149 | </property> | 83 | </property> |
@@ -151,6 +85,6 @@ | |||
151 | <name>text</name> | 85 | <name>text</name> |
152 | <string>Broadcast</string> | 86 | <string>Subnet Mask</string> |
153 | </property> | 87 | </property> |
154 | </widget> | 88 | </widget> |
155 | <widget row="1" column="1" > | 89 | <widget> |
156 | <class>QLabel</class> | 90 | <class>QLabel</class> |
@@ -173,3 +107,3 @@ | |||
173 | </widget> | 107 | </widget> |
174 | <widget row="2" column="1" > | 108 | <widget> |
175 | <class>QLabel</class> | 109 | <class>QLabel</class> |
@@ -192,3 +126,14 @@ | |||
192 | </widget> | 126 | </widget> |
193 | <widget row="3" column="1" > | 127 | <widget> |
128 | <class>QLabel</class> | ||
129 | <property stdset="1"> | ||
130 | <name>name</name> | ||
131 | <cstring>TextLabel21</cstring> | ||
132 | </property> | ||
133 | <property stdset="1"> | ||
134 | <name>text</name> | ||
135 | <string>MAC Address</string> | ||
136 | </property> | ||
137 | </widget> | ||
138 | <widget> | ||
194 | <class>QLabel</class> | 139 | <class>QLabel</class> |
@@ -211,3 +156,3 @@ | |||
211 | </widget> | 156 | </widget> |
212 | <widget row="0" column="1" > | 157 | <widget> |
213 | <class>QLabel</class> | 158 | <class>QLabel</class> |
@@ -215,3 +160,3 @@ | |||
215 | <name>name</name> | 160 | <name>name</name> |
216 | <cstring>ipAddressLabel</cstring> | 161 | <cstring>TextLabel24</cstring> |
217 | </property> | 162 | </property> |
@@ -219,3 +164,3 @@ | |||
219 | <name>frameShape</name> | 164 | <name>frameShape</name> |
220 | <enum>Panel</enum> | 165 | <enum>MShape</enum> |
221 | </property> | 166 | </property> |
@@ -223,3 +168,3 @@ | |||
223 | <name>frameShadow</name> | 168 | <name>frameShadow</name> |
224 | <enum>Sunken</enum> | 169 | <enum>MShadow</enum> |
225 | </property> | 170 | </property> |
@@ -227,27 +172,78 @@ | |||
227 | <name>text</name> | 172 | <name>text</name> |
228 | <string>0.0.0.0</string> | 173 | <string>Broadcast</string> |
229 | </property> | 174 | </property> |
230 | </widget> | 175 | </widget> |
231 | <spacer row="7" column="1" > | 176 | <widget> |
232 | <property> | 177 | <class>QLayoutWidget</class> |
178 | <property stdset="1"> | ||
233 | <name>name</name> | 179 | <name>name</name> |
234 | <cstring>Spacer18</cstring> | 180 | <cstring>Layout1</cstring> |
235 | </property> | 181 | </property> |
182 | <grid> | ||
183 | <property stdset="1"> | ||
184 | <name>margin</name> | ||
185 | <number>0</number> | ||
186 | </property> | ||
187 | <property stdset="1"> | ||
188 | <name>spacing</name> | ||
189 | <number>6</number> | ||
190 | </property> | ||
191 | <widget row="1" column="0" > | ||
192 | <class>QPushButton</class> | ||
193 | <property stdset="1"> | ||
194 | <name>name</name> | ||
195 | <cstring>refreshButton</cstring> | ||
196 | </property> | ||
197 | <property stdset="1"> | ||
198 | <name>text</name> | ||
199 | <string>&Refresh</string> | ||
200 | </property> | ||
201 | </widget> | ||
202 | <widget row="0" column="1" > | ||
203 | <class>QPushButton</class> | ||
204 | <property stdset="1"> | ||
205 | <name>name</name> | ||
206 | <cstring>stopButton</cstring> | ||
207 | </property> | ||
208 | <property stdset="1"> | ||
209 | <name>text</name> | ||
210 | <string>S&top</string> | ||
211 | </property> | ||
212 | </widget> | ||
213 | <widget row="1" column="1" > | ||
214 | <class>QPushButton</class> | ||
215 | <property stdset="1"> | ||
216 | <name>name</name> | ||
217 | <cstring>restartButton</cstring> | ||
218 | </property> | ||
219 | <property stdset="1"> | ||
220 | <name>text</name> | ||
221 | <string>R&estart</string> | ||
222 | </property> | ||
223 | </widget> | ||
224 | <widget row="0" column="0" > | ||
225 | <class>QPushButton</class> | ||
226 | <property stdset="1"> | ||
227 | <name>name</name> | ||
228 | <cstring>startButton</cstring> | ||
229 | </property> | ||
230 | <property stdset="1"> | ||
231 | <name>text</name> | ||
232 | <string>&Start</string> | ||
233 | </property> | ||
234 | </widget> | ||
235 | </grid> | ||
236 | </widget> | ||
237 | <widget> | ||
238 | <class>Line</class> | ||
236 | <property stdset="1"> | 239 | <property stdset="1"> |
237 | <name>orientation</name> | 240 | <name>name</name> |
238 | <enum>Vertical</enum> | 241 | <cstring>Line5</cstring> |
239 | </property> | 242 | </property> |
240 | <property stdset="1"> | 243 | <property stdset="1"> |
241 | <name>sizeType</name> | 244 | <name>orientation</name> |
242 | <enum>Expanding</enum> | 245 | <enum>Horizontal</enum> |
243 | </property> | ||
244 | <property> | ||
245 | <name>sizeHint</name> | ||
246 | <size> | ||
247 | <width>20</width> | ||
248 | <height>20</height> | ||
249 | </size> | ||
250 | </property> | 246 | </property> |
251 | </spacer> | 247 | </widget> |
252 | <widget row="6" column="0" rowspan="1" colspan="2" > | 248 | <widget> |
253 | <class>QLayoutWidget</class> | 249 | <class>QLayoutWidget</class> |
@@ -300,7 +296,6 @@ | |||
300 | </widget> | 296 | </widget> |
301 | <widget row="5" column="0" rowspan="1" colspan="2" > | 297 | <spacer> |
302 | <class>Line</class> | 298 | <property> |
303 | <property stdset="1"> | ||
304 | <name>name</name> | 299 | <name>name</name> |
305 | <cstring>Line5</cstring> | 300 | <cstring>Spacer18</cstring> |
306 | </property> | 301 | </property> |
@@ -308,6 +303,28 @@ | |||
308 | <name>orientation</name> | 303 | <name>orientation</name> |
309 | <enum>Horizontal</enum> | 304 | <enum>Vertical</enum> |
305 | </property> | ||
306 | <property stdset="1"> | ||
307 | <name>sizeType</name> | ||
308 | <enum>Expanding</enum> | ||
309 | </property> | ||
310 | <property> | ||
311 | <name>sizeHint</name> | ||
312 | <size> | ||
313 | <width>20</width> | ||
314 | <height>20</height> | ||
315 | </size> | ||
316 | </property> | ||
317 | </spacer> | ||
318 | <widget> | ||
319 | <class>QCheckBox</class> | ||
320 | <property stdset="1"> | ||
321 | <name>name</name> | ||
322 | <cstring>CheckBoxSilent</cstring> | ||
323 | </property> | ||
324 | <property stdset="1"> | ||
325 | <name>text</name> | ||
326 | <string>be &silent</string> | ||
310 | </property> | 327 | </property> |
311 | </widget> | 328 | </widget> |
312 | </grid> | 329 | </vbox> |
313 | </widget> | 330 | </widget> |
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp index e00dcce..37c3a91 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | |||
@@ -3,2 +3,3 @@ | |||
3 | 3 | ||
4 | #include <qcheckbox.h> | ||
4 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
@@ -8,3 +9,5 @@ | |||
8 | 9 | ||
9 | #ifdef QWS | 10 | #include <qpe/config.h> |
11 | |||
12 | #ifdef QWS | ||
10 | #else | 13 | #else |
@@ -16,3 +19,3 @@ | |||
16 | * just display's information about the interface that is passed to it. | 19 | * just display's information about the interface that is passed to it. |
17 | */ | 20 | */ |
18 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ | 21 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ |
@@ -26,2 +29,12 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
26 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 29 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
30 | Config cfg("networksettings", Config::User); | ||
31 | cfg.setGroup("interface"); | ||
32 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); | ||
33 | } | ||
34 | |||
35 | InterfaceInformationImp::~InterfaceInformationImp() | ||
36 | { | ||
37 | Config cfg("networksettings", Config::User); | ||
38 | cfg.setGroup("interface"); | ||
39 | cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); | ||
27 | } | 40 | } |
@@ -32,3 +45,3 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
32 | * know about). | 45 | * know about). |
33 | */ | 46 | */ |
34 | void InterfaceInformationImp::updateInterface(Interface *){ | 47 | void InterfaceInformationImp::updateInterface(Interface *){ |
@@ -53,3 +66,3 @@ void InterfaceInformationImp::updateInterface(Interface *){ | |||
53 | * Display it. | 66 | * Display it. |
54 | */ | 67 | */ |
55 | void InterfaceInformationImp::advanced(){ | 68 | void InterfaceInformationImp::advanced(){ |
@@ -72,4 +85,5 @@ void InterfaceInformationImp::advanced(){ | |||
72 | * @param message the message to display. | 85 | * @param message the message to display. |
73 | */ | 86 | */ |
74 | void InterfaceInformationImp::showMessage(const QString &message){ | 87 | void InterfaceInformationImp::showMessage(const QString &message){ |
88 | if (CheckBoxSilent->isChecked()) return; | ||
75 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | 89 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); |
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h index 65cdfe0..9c93d1d 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h | |||
@@ -12,3 +12,3 @@ public: | |||
12 | InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0); | 12 | InterfaceInformationImp(QWidget *parent=0, const char *name=0, Interface *i=0, WFlags f=0); |
13 | ~InterfaceInformationImp(){}; | 13 | ~InterfaceInformationImp(); |
14 | 14 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp index 71d0cf5..436e449 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces/interfaces.cpp | |||
@@ -2,2 +2,3 @@ | |||
2 | 2 | ||
3 | #include <qcheckbox.h> | ||
3 | #include <qfile.h> | 4 | #include <qfile.h> |
@@ -153,2 +154,3 @@ bool Interfaces::isInterfaceSet() const { | |||
153 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ | 154 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ |
155 | qDebug("Interfaces::addInterface(%s)",interface.latin1()); | ||
154 | if(0 == acceptedFamily.contains(family)) | 156 | if(0 == acceptedFamily.contains(family)) |
@@ -168,2 +170,3 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c | |||
168 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ | 170 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ |
171 | qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1()); | ||
169 | if(!setInterface(interface)) | 172 | if(!setInterface(interface)) |
@@ -274,2 +277,3 @@ QString Interfaces::getInterfaceMethod(bool &error){ | |||
274 | bool Interfaces::setInterfaceName(const QString &newName){ | 277 | bool Interfaces::setInterfaceName(const QString &newName){ |
278 | qDebug("setInterfaceName %s", newName.latin1()); | ||
275 | if(currentIface == interfaces.end()) | 279 | if(currentIface == interfaces.end()) |
@@ -279,3 +283,6 @@ bool Interfaces::setInterfaceName(const QString &newName){ | |||
279 | bool returnValue = false; | 283 | bool returnValue = false; |
280 | (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); | 284 | QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); |
285 | qDebug("setting %s",tmp.latin1()); | ||
286 | |||
287 | (*currentIface) = tmp; | ||
281 | return !returnValue; | 288 | return !returnValue; |
@@ -329,2 +336,4 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){ | |||
329 | * doesn't exist then it is added along with the value. | 336 | * doesn't exist then it is added along with the value. |
337 | * If value isEmpty() then we will remove the option | ||
338 | * | ||
330 | * @param option the options to set the value. | 339 | * @param option the options to set the value. |
@@ -335,3 +344,7 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){ | |||
335 | bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ | 344 | bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ |
336 | return setOption(currentIface, option, value); | 345 | if( value.stripWhiteSpace().isEmpty() ) |
346 | return removeInterfaceOption( option ); | ||
347 | |||
348 | qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1()); | ||
349 | return setOption(currentIface, option, value); | ||
337 | } | 350 | } |
@@ -494,15 +507,27 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
494 | return false; | 507 | return false; |
495 | 508 | qDebug("setting option"); | |
496 | bool found = false; | 509 | bool found = false; |
510 | bool replaced = false; | ||
511 | QStringList::Iterator insertAt = NULL; | ||
497 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { | 512 | for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { |
498 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ | 513 | qDebug(" Interfaces::setOption got line >%s<",(*it).latin1()); |
499 | if(!found && value != ""){ | 514 | // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line |
500 | // Got to the end of the stanza without finding it, so append it. | 515 | // but since it works with an empty interfaces file I (tille) will not do anything more |
501 | interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); | 516 | if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){ |
502 | } | 517 | if (found) break; |
503 | found = true; | 518 | // && it != start){ |
504 | break; | 519 | // if(!found && value != ""){ |
505 | } | 520 | // // Got to the end of the stanza without finding it, so append it. |
521 | // qDebug(" Got to the end of the stanza without finding it, so append it."); | ||
522 | // interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); | ||
523 | // } | ||
524 | qDebug("found 1"); | ||
525 | // interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value)); | ||
526 | found = true; | ||
527 | insertAt = it; | ||
528 | |||
529 | } | ||
506 | if((*it).contains(option) && it != start && (*it).at(0) != '#'){ | 530 | if((*it).contains(option) && it != start && (*it).at(0) != '#'){ |
507 | // Found it in stanza so replace it. | 531 | // Found it in stanza so replace it. |
532 | qDebug("found 2"); | ||
508 | if(found) | 533 | if(found) |
@@ -510,2 +535,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
510 | found = true; | 535 | found = true; |
536 | replaced = true; | ||
511 | (*it) = QString("\t%1 %2").arg(option).arg(value); | 537 | (*it) = QString("\t%1 %2").arg(option).arg(value); |
@@ -514,2 +540,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
514 | if(!found){ | 540 | if(!found){ |
541 | qDebug("! found insert anyway"); | ||
515 | QStringList::Iterator p = start; | 542 | QStringList::Iterator p = start; |
@@ -518,2 +545,7 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
518 | } | 545 | } |
546 | |||
547 | if(found && !replaced){ | ||
548 | qDebug("found iface but not the option so insert it here..."); | ||
549 | interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value)); | ||
550 | } | ||
519 | return found; | 551 | return found; |
@@ -554,3 +586,4 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString | |||
554 | found = true; | 586 | found = true; |
555 | (*it) = ""; | 587 | it = interfaces.remove( it ); // we really want to remove the line |
588 | --it; // we do ++it later in the head of the for loop | ||
556 | } | 589 | } |
@@ -581,3 +614,4 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString | |||
581 | found = true; | 614 | found = true; |
582 | (*it) = ""; | 615 | it = interfaces.remove( it ); // we really want to remove the line |
616 | --it; // we do ++it later in the head of the for loop | ||
583 | } | 617 | } |
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index b40d101..e844d8a 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -46,2 +46,3 @@ bool InterfaceSetupImp::saveChanges(){ | |||
46 | QString iface = interfaces->getInterfaceName(error); | 46 | QString iface = interfaces->getInterfaceName(error); |
47 | qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); | ||
47 | if(!saveSettings()) | 48 | if(!saveSettings()) |
@@ -119,2 +120,5 @@ bool InterfaceSetupImp::saveSettings(){ | |||
119 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); | 120 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
121 | }else{ | ||
122 | interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); | ||
123 | interfaces->removeInterfaceOption("down "DNSSCRIPT" -r"); | ||
120 | } | 124 | } |