author | drw <drw> | 2004-03-02 15:33:53 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-02 15:33:53 (UTC) |
commit | e31fe9d73c6cd9be80bb18ca45ad3618192f718f (patch) (unidiff) | |
tree | fb01d7baef88f29a19795caa7b69813871b3edff | |
parent | b48c5437e9631094d15ec7280a9d1cf212b3eb28 (diff) | |
download | opie-e31fe9d73c6cd9be80bb18ca45ad3618192f718f.zip opie-e31fe9d73c6cd9be80bb18ca45ad3618192f718f.tar.gz opie-e31fe9d73c6cd9be80bb18ca45ad3618192f718f.tar.bz2 |
Fix missed libopie include
-rw-r--r-- | noncore/settings/appearance2/main.cpp | 3 | ||||
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/noncore/settings/appearance2/main.cpp b/noncore/settings/appearance2/main.cpp index 5595429..8ac45d8 100644 --- a/noncore/settings/appearance2/main.cpp +++ b/noncore/settings/appearance2/main.cpp | |||
@@ -1,34 +1,33 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "appearance.h" | 28 | #include "appearance.h" |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | 30 | #include <opie2/oapplicationfactory.h> |
31 | #include <opie/oapplicationfactory.h> | ||
32 | 31 | ||
33 | 32 | ||
34 | OPIE_EXPORT_APP( OApplicationFactory<Appearance> ) | 33 | OPIE_EXPORT_APP( OApplicationFactory<Appearance> ) |
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index ab0e4cc..05340e4 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -1,204 +1,204 @@ | |||
1 | #include "interfacesetupimp.h" | 1 | #include "interfacesetupimp.h" |
2 | #include "interface.h" | 2 | #include "interface.h" |
3 | 3 | ||
4 | #include <qcheckbox.h> | 4 | #include <qcheckbox.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <qspinbox.h> | 6 | #include <qspinbox.h> |
7 | #include <qgroupbox.h> | 7 | #include <qgroupbox.h> |
8 | #include <qlabel.h> | 8 | #include <qlabel.h> |
9 | 9 | ||
10 | #include <qmessagebox.h> | 10 | #include <qmessagebox.h> |
11 | 11 | ||
12 | #include <opie/oprocess.h> | 12 | #include <opie2/oprocess.h> |
13 | 13 | ||
14 | #ifdef QWS | 14 | #ifdef QWS |
15 | #include <opie2/owait.h> | 15 | #include <opie2/owait.h> |
16 | #include <qpe/global.h> | 16 | #include <qpe/global.h> |
17 | #include <qapplication.h> | 17 | #include <qapplication.h> |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | #define DNSSCRIPT "changedns" | 20 | #define DNSSCRIPT "changedns" |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * Constuctor. Set up the connection. A profile must be set. | 23 | * Constuctor. Set up the connection. A profile must be set. |
24 | */ | 24 | */ |
25 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ | 25 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ |
26 | if (j == 0) { | 26 | if (j == 0) { |
27 | delInterfaces = true; | 27 | delInterfaces = true; |
28 | interfaces = new Interfaces; | 28 | interfaces = new Interfaces; |
29 | } | 29 | } |
30 | } | 30 | } |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Destructor | 33 | * Destructor |
34 | */ | 34 | */ |
35 | InterfaceSetupImp::~InterfaceSetupImp(){ | 35 | InterfaceSetupImp::~InterfaceSetupImp(){ |
36 | if(delInterfaces) { | 36 | if(delInterfaces) { |
37 | delete interfaces; | 37 | delete interfaces; |
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Save the current settings, then write out the interfaces file and close. | 42 | * Save the current settings, then write out the interfaces file and close. |
43 | */ | 43 | */ |
44 | bool InterfaceSetupImp::saveChanges(){ | 44 | bool InterfaceSetupImp::saveChanges(){ |
45 | bool error; | 45 | bool error; |
46 | QString iface = interfaces->getInterfaceName(error); | 46 | QString iface = interfaces->getInterfaceName(error); |
47 | qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); | 47 | qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); |
48 | if(!saveSettings()) | 48 | if(!saveSettings()) |
49 | return false; | 49 | return false; |
50 | 50 | ||
51 | interfaces->write(); | 51 | interfaces->write(); |
52 | 52 | ||
53 | if (interface->getStatus()) { | 53 | if (interface->getStatus()) { |
54 | QString ifup; | 54 | QString ifup; |
55 | ifup += "ifdown "; | 55 | ifup += "ifdown "; |
56 | ifup += iface; | 56 | ifup += iface; |
57 | ifup += "; ifup "; | 57 | ifup += "; ifup "; |
58 | ifup += iface; | 58 | ifup += iface; |
59 | ifup += ";"; | 59 | ifup += ";"; |
60 | 60 | ||
61 | OProcess restart; | 61 | OProcess restart; |
62 | restart << "sh"; | 62 | restart << "sh"; |
63 | restart << "-c"; | 63 | restart << "-c"; |
64 | restart << ifup; | 64 | restart << ifup; |
65 | 65 | ||
66 | OWait *owait = new OWait(); | 66 | OWait *owait = new OWait(); |
67 | Global::statusMessage( tr( "Restarting interface" ) ); | 67 | Global::statusMessage( tr( "Restarting interface" ) ); |
68 | 68 | ||
69 | owait->show(); | 69 | owait->show(); |
70 | qApp->processEvents(); | 70 | qApp->processEvents(); |
71 | 71 | ||
72 | if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { | 72 | if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { |
73 | qWarning("unstable to spawn ifdown/ifup"); | 73 | qWarning("unstable to spawn ifdown/ifup"); |
74 | } | 74 | } |
75 | 75 | ||
76 | owait->hide(); | 76 | owait->hide(); |
77 | delete owait; | 77 | delete owait; |
78 | 78 | ||
79 | interface->refresh(); | 79 | interface->refresh(); |
80 | } | 80 | } |
81 | return true; | 81 | return true; |
82 | } | 82 | } |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * Save the settings for the current Interface. | 85 | * Save the settings for the current Interface. |
86 | * @return bool true if successful, false otherwise | 86 | * @return bool true if successful, false otherwise |
87 | */ | 87 | */ |
88 | bool InterfaceSetupImp::saveSettings(){ | 88 | bool InterfaceSetupImp::saveSettings(){ |
89 | // eh can't really do anything about it other then return. :-D | 89 | // eh can't really do anything about it other then return. :-D |
90 | if(!interfaces->isInterfaceSet()) | 90 | if(!interfaces->isInterfaceSet()) |
91 | return true; | 91 | return true; |
92 | 92 | ||
93 | bool error = false; | 93 | bool error = false; |
94 | // Loopback case | 94 | // Loopback case |
95 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ | 95 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ |
96 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 96 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
97 | return true; | 97 | return true; |
98 | } | 98 | } |
99 | 99 | ||
100 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ | 100 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ |
101 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); | 101 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); |
102 | return false; | 102 | return false; |
103 | } | 103 | } |
104 | // DHCP | 104 | // DHCP |
105 | if(dhcpCheckBox->isChecked()) { | 105 | if(dhcpCheckBox->isChecked()) { |
106 | interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); | 106 | interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); |
107 | interfaces->removeInterfaceOption("address"); | 107 | interfaces->removeInterfaceOption("address"); |
108 | interfaces->removeInterfaceOption("netmask"); | 108 | interfaces->removeInterfaceOption("netmask"); |
109 | interfaces->removeInterfaceOption("gateway"); | 109 | interfaces->removeInterfaceOption("gateway"); |
110 | interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); | 110 | interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); |
111 | interfaces->removeInterfaceOption("down "DNSSCRIPT" -r "); | 111 | interfaces->removeInterfaceOption("down "DNSSCRIPT" -r "); |
112 | } else{ | 112 | } else{ |
113 | interfaces->setInterfaceMethod("static"); | 113 | interfaces->setInterfaceMethod("static"); |
114 | interfaces->setInterfaceOption("address", ipAddressEdit->text()); | 114 | interfaces->setInterfaceOption("address", ipAddressEdit->text()); |
115 | interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); | 115 | interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); |
116 | interfaces->setInterfaceOption("gateway", gatewayEdit->text()); | 116 | interfaces->setInterfaceOption("gateway", gatewayEdit->text()); |
117 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ | 117 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ |
118 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); | 118 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); |
119 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); | 119 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); |
120 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); | 120 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
121 | }else{ | 121 | }else{ |
122 | interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); | 122 | interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); |
123 | interfaces->removeInterfaceOption("down "DNSSCRIPT" -r"); | 123 | interfaces->removeInterfaceOption("down "DNSSCRIPT" -r"); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | // IP Information | 127 | // IP Information |
128 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 128 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
129 | return true; | 129 | return true; |
130 | } | 130 | } |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * The Profile has changed. | 133 | * The Profile has changed. |
134 | * @param QString profile the new profile. | 134 | * @param QString profile the new profile. |
135 | */ | 135 | */ |
136 | void InterfaceSetupImp::setProfile(const QString &profile){ | 136 | void InterfaceSetupImp::setProfile(const QString &profile){ |
137 | /* | 137 | /* |
138 | bool error = false; | 138 | bool error = false; |
139 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ | 139 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ |
140 | staticGroupBox->hide(); | 140 | staticGroupBox->hide(); |
141 | dhcpCheckBox->hide(); | 141 | dhcpCheckBox->hide(); |
142 | leaseTime->hide(); | 142 | leaseTime->hide(); |
143 | leaseHoursLabel->hide(); | 143 | leaseHoursLabel->hide(); |
144 | } | 144 | } |
145 | */ | 145 | */ |
146 | 146 | ||
147 | QString newInterfaceName = interface->getInterfaceName(); | 147 | QString newInterfaceName = interface->getInterfaceName(); |
148 | if(profile.length() > 0) | 148 | if(profile.length() > 0) |
149 | newInterfaceName += "_" + profile; | 149 | newInterfaceName += "_" + profile; |
150 | // See if we have to make a interface. | 150 | // See if we have to make a interface. |
151 | if(!interfaces->setInterface(newInterfaceName)){ | 151 | if(!interfaces->setInterface(newInterfaceName)){ |
152 | // Add making for this new interface if need too | 152 | // Add making for this new interface if need too |
153 | if(profile != ""){ | 153 | if(profile != ""){ |
154 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); | 154 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); |
155 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 155 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
156 | interfaces->addMapping(interface->getInterfaceName()); | 156 | interfaces->addMapping(interface->getInterfaceName()); |
157 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 157 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
158 | qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); | 158 | qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); |
159 | return; | 159 | return; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | interfaces->setMap("map", newInterfaceName); | 162 | interfaces->setMap("map", newInterfaceName); |
163 | interfaces->setScript("getprofile.sh"); | 163 | interfaces->setScript("getprofile.sh"); |
164 | } | 164 | } |
165 | else{ | 165 | else{ |
166 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | 166 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); |
167 | if(!interfaces->setInterface(newInterfaceName)){ | 167 | if(!interfaces->setInterface(newInterfaceName)){ |
168 | qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); | 168 | qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); |
169 | return; | 169 | return; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | // We must have a valid interface to get this far so read some settings. | 174 | // We must have a valid interface to get this far so read some settings. |
175 | 175 | ||
176 | // DHCP | 176 | // DHCP |
177 | bool error = false; | 177 | bool error = false; |
178 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) | 178 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) |
179 | dhcpCheckBox->setChecked(true); | 179 | dhcpCheckBox->setChecked(true); |
180 | else | 180 | else |
181 | dhcpCheckBox->setChecked(false); | 181 | dhcpCheckBox->setChecked(false); |
182 | 182 | ||
183 | // IP Information | 183 | // IP Information |
184 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 184 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
185 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); | 185 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); |
186 | qDebug("dns >%s<",dns.latin1()); | 186 | qDebug("dns >%s<",dns.latin1()); |
187 | if(dns.contains(" ")){ | 187 | if(dns.contains(" ")){ |
188 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 188 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
189 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 189 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
190 | }else firstDNSLineEdit->setText(dns); | 190 | }else firstDNSLineEdit->setText(dns); |
191 | 191 | ||
192 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 192 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
193 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); | 193 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); |
194 | if (subnetMaskEdit->text().isEmpty()) | 194 | if (subnetMaskEdit->text().isEmpty()) |
195 | subnetMaskEdit->setText( "255.255.255.0" ); | 195 | subnetMaskEdit->setText( "255.255.255.0" ); |
196 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 196 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
197 | 197 | ||
198 | 198 | ||
199 | 199 | ||
200 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); | 200 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); |
201 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); | 201 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); |
202 | 202 | ||
203 | } | 203 | } |
204 | 204 | ||