summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings
authortille <tille>2003-06-17 13:05:55 (UTC)
committer tille <tille>2003-06-17 13:05:55 (UTC)
commit154d6deef15b9f7f83ea7a25f2079d9fca034910 (patch) (unidiff)
tree2cb0428922d8d2a4a2adc49b2c62e44cbbdd3b82 /noncore/settings/networksettings
parente3aff4e49db15c44faf874ee96d666ad56c1d37a (diff)
downloadopie-154d6deef15b9f7f83ea7a25f2079d9fca034910.zip
opie-154d6deef15b9f7f83ea7a25f2079d9fca034910.tar.gz
opie-154d6deef15b9f7f83ea7a25f2079d9fca034910.tar.bz2
wellenreiter qcop call works now
dns are saved and read in again
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp47
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp5
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp17
3 files changed, 42 insertions, 27 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 49a47ae..8de30de 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -22,5 +22,5 @@
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 */
25InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ 25InterfaceSetupImp::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) {
@@ -32,5 +32,5 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac
32/** 32/**
33 * Destructor 33 * Destructor
34 */ 34 */
35InterfaceSetupImp::~InterfaceSetupImp(){ 35InterfaceSetupImp::~InterfaceSetupImp(){
36 if(delInterfaces) { 36 if(delInterfaces) {
@@ -40,5 +40,5 @@ InterfaceSetupImp::~InterfaceSetupImp(){
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 */
44bool InterfaceSetupImp::saveChanges(){ 44bool InterfaceSetupImp::saveChanges(){
@@ -57,23 +57,23 @@ bool InterfaceSetupImp::saveChanges(){
57 ifup += iface; 57 ifup += iface;
58 ifup += ";"; 58 ifup += ";";
59 59
60 OProcess restart; 60 OProcess restart;
61 restart << "sh"; 61 restart << "sh";
62 restart << "-c"; 62 restart << "-c";
63 restart << ifup; 63 restart << ifup;
64 64
65 OWait *owait = new OWait(); 65 OWait *owait = new OWait();
66 Global::statusMessage( tr( "Restarting interface" ) ); 66 Global::statusMessage( tr( "Restarting interface" ) );
67 67
68 owait->show(); 68 owait->show();
69 qApp->processEvents(); 69 qApp->processEvents();
70 70
71 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { 71 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {
72 qWarning("unstable to spawn ifdown/ifup"); 72 qWarning("unstable to spawn ifdown/ifup");
73 } 73 }
74 74
75 owait->hide(); 75 owait->hide();
76 delete owait; 76 delete owait;
77 77
78 interface->refresh(); 78 interface->refresh();
79 } 79 }
@@ -84,10 +84,10 @@ bool InterfaceSetupImp::saveChanges(){
84 * Save the settings for the current Interface. 84 * Save the settings for the current Interface.
85 * @return bool true if successfull, false otherwise 85 * @return bool true if successfull, false otherwise
86 */ 86 */
87bool InterfaceSetupImp::saveSettings(){ 87bool InterfaceSetupImp::saveSettings(){
88 // eh can't really do anything about it other then return. :-D 88 // eh can't really do anything about it other then return. :-D
89 if(!interfaces->isInterfaceSet()) 89 if(!interfaces->isInterfaceSet())
90 return true; 90 return true;
91 91
92 bool error = false; 92 bool error = false;
93 // Loopback case 93 // Loopback case
@@ -96,9 +96,9 @@ bool InterfaceSetupImp::saveSettings(){
96 return true; 96 return true;
97 } 97 }
98 98
99 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ 99 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
100 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); 100 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok);
101 return false; 101 return false;
102 } 102 }
103 // DHCP 103 // DHCP
104 if(dhcpCheckBox->isChecked()) { 104 if(dhcpCheckBox->isChecked()) {
@@ -120,5 +120,5 @@ bool InterfaceSetupImp::saveSettings(){
120 } 120 }
121 } 121 }
122 122
123 // IP Information 123 // IP Information
124 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); 124 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked());
@@ -129,5 +129,5 @@ bool InterfaceSetupImp::saveSettings(){
129 * The Profile has changed. 129 * The Profile has changed.
130 * @param QString profile the new profile. 130 * @param QString profile the new profile.
131 */ 131 */
132void InterfaceSetupImp::setProfile(const QString &profile){ 132void InterfaceSetupImp::setProfile(const QString &profile){
133 /* 133 /*
@@ -163,11 +163,11 @@ void InterfaceSetupImp::setProfile(const QString &profile){
163 if(!interfaces->setInterface(newInterfaceName)){ 163 if(!interfaces->setInterface(newInterfaceName)){
164 qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); 164 qDebug("InterfaceSetupImp: Added interface, but still can't setInterface.");
165 return; 165 return;
166 } 166 }
167 } 167 }
168 } 168 }
169 169
170 // We must have a valid interface to get this far so read some settings. 170 // We must have a valid interface to get this far so read some settings.
171 171
172 // DHCP 172 // DHCP
173 bool error = false; 173 bool error = false;
@@ -180,17 +180,20 @@ void InterfaceSetupImp::setProfile(const QString &profile){
180 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); 180 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName()));
181 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); 181 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error);
182 qDebug("dns >%s<",dns.latin1());
182 if(dns.contains(" ")){ 183 if(dns.contains(" ")){
183 firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); 184 firstDNSLineEdit->setText(dns.mid(0, dns.find(" ")));
184 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); 185 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length()));
185 } 186 }
186 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); 187 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error));
187 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); 188 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error));
188 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); 189 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error));
190
191
189 192
190 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); 193 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1());
191 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); 194 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1());
192 195
193} 196}
194 197
195// interfacesetup.cpp 198// interfacesetup.cpp
196 199
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 8ea241d..2d714ca 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -641,4 +641,9 @@ void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
641 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 641 qDebug("MainWindowImp::receive QCop msg >"+msg+"<");
642 642
643 if (msg == "raise") {
644 raise();
645 return;
646 }
647
643 QString dest = msg.left(msg.find("(")); 648 QString dest = msg.left(msg.find("("));
644 QCString param = msg.right(msg.length() - msg.find("(") - 1); 649 QCString param = msg.right(msg.length() - msg.find("(") - 1);
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 371b689..7bded85 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -71,5 +71,5 @@ bool WLANModule::isOwner(Interface *i){
71 */ 71 */
72QWidget *WLANModule::configure(Interface *i){ 72QWidget *WLANModule::configure(Interface *i){
73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); 73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose);
74 wlanconfig->setProfile(profile); 74 wlanconfig->setProfile(profile);
75 return wlanconfig; 75 return wlanconfig;
@@ -133,4 +133,5 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
133 QString interface; 133 QString interface;
134 QString action; 134 QString action;
135 QDialog *toShow;
135 while (! stream.atEnd() ){ 136 while (! stream.atEnd() ){
136 stream >> interface; 137 stream >> interface;
@@ -148,6 +149,6 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
148 if (ifa == 0){ 149 if (ifa == 0){
149 qDebug("WLANModule Did not find %s",interface.latin1()); 150 qDebug("WLANModule Did not find %s",interface.latin1());
150 qDebug("returning"); 151 qDebug("skipping");
151 return; 152 count = 0;
152 } 153 }
153 154
@@ -171,4 +172,5 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
171 //FIXME: what if it got closed meanwhile? 172 //FIXME: what if it got closed meanwhile?
172 wlanconfigWiget = (WLANImp*) configure(ifa); 173 wlanconfigWiget = (WLANImp*) configure(ifa);
174 toShow = (QDialog*) wlanconfigWiget;
173 } 175 }
174 wlanconfigWiget->showMaximized(); 176 wlanconfigWiget->showMaximized();
@@ -192,6 +194,10 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
192 194
193 }else if (action.contains("Channel")){ 195 }else if (action.contains("Channel")){
194 wlanconfigWiget->specifyChan->setChecked( true ); 196 bool ok;
195 wlanconfigWiget->networkChannel->setValue( value.toInt() ); 197 int chan = value.toInt( &ok );
198 if (ok){
199 wlanconfigWiget->specifyChan->setChecked( true );
200 wlanconfigWiget->networkChannel->setValue( chan );
201 }
196 }else if (action.contains("MacAddr")){ 202 }else if (action.contains("MacAddr")){
197 wlanconfigWiget->specifyAp->setChecked( true ); 203 wlanconfigWiget->specifyAp->setChecked( true );
@@ -201,4 +207,5 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
201 } 207 }
202 }// while stream 208 }// while stream
209 if (toShow) toShow->exec();
203} 210}
204 211