author | benmeyer <benmeyer> | 2002-12-16 16:21:51 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-12-16 16:21:51 (UTC) |
commit | dabe9c5ee8c2d51fe13b4e3a8b160afacf0f539f (patch) (side-by-side diff) | |
tree | 2c9a68097931a6f603be4a62e4ea002dad560dcd | |
parent | c7c8bf3d2fd133fa05ff7a5daed977c05429c4c1 (diff) | |
download | opie-dabe9c5ee8c2d51fe13b4e3a8b160afacf0f539f.zip opie-dabe9c5ee8c2d51fe13b4e3a8b160afacf0f539f.tar.gz opie-dabe9c5ee8c2d51fe13b4e3a8b160afacf0f539f.tar.bz2 |
Fixed icon bug, removed some extra uneeded code, fixed WEP config bug
-rw-r--r-- | noncore/net/networksetup/interfaces/interface.cpp | 4 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 10 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 8 | ||||
-rw-r--r-- | noncore/settings/networksettings/interfaces/interface.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 8 |
6 files changed, 18 insertions, 26 deletions
diff --git a/noncore/net/networksetup/interfaces/interface.cpp b/noncore/net/networksetup/interfaces/interface.cpp index 7ffa76f..d964961 100644 --- a/noncore/net/networksetup/interfaces/interface.cpp +++ b/noncore/net/networksetup/interfaces/interface.cpp @@ -58,54 +58,54 @@ void Interface::setModuleOwner(Module *owner){ }; /** * Try to start the interface. */ void Interface::start(){ // check to see if we are already running. if(true == status){ emit (updateMessage("Unable to start interface,\n already started")); return; } int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); // See if it was successfull... if(ret != 0){ - emit (updateMessage("Starting interface failed.")); + emit (updateMessage("Starting interface failed")); return; } status = true; refresh(); emit (updateMessage("Start successfull")); } /** * Try to stop the interface. */ void Interface::stop(){ // check to see if we are already stopped. if(false == status){ emit (updateMessage("Unable to stop interface,\n already stopped")); return; } int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); if(ret != 0){ - emit (updateMessage("Stopping interface failed.")); + emit (updateMessage("Stopping interface failed")); return; } status = false; refresh(); emit (updateMessage("Stop successfull")); } /** * Try to restart the interface. */ void Interface::restart(){ stop(); start(); } diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 7b93554..9a17743 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -307,75 +307,71 @@ void MainWindowImp::removeClicked(){ * Pull up the configure about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::configureClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
if(moduleConfigure != NULL){
moduleConfigure->showMaximized();
- moduleConfigure->show();
return;
}
}
InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
QString currentProfileText = currentProfileLabel->text();
if(currentProfileText.upper() == "ALL");
currentProfileText = "";
configure->setProfile(currentProfileText);
configure->showMaximized();
- configure->show();
}
/**
* Pull up the information about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::informationClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(!i->isAttached()){
QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
return;
}
if(i->getModuleOwner()){
QWidget *moduleInformation = i->getModuleOwner()->information(i);
if(moduleInformation != NULL){
moduleInformation->showMaximized();
- moduleInformation->show();
return;
}
}
- InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true);
- information->showMaximized();
- information->show();
+ InterfaceInformationImp information(0, "InterfaceSetupImp", i);
+ information.showMaximized();
}
/**
* Update this interface. If no QListViewItem exists create one.
* @param Interface* pointer to the interface that needs to be updated.
*/
void MainWindowImp::updateInterface(Interface *i){
if(!advancedUserMode){
if(i->getInterfaceName() == "lo")
return;
}
QListViewItem *item = NULL;
// Find the interface, making it if needed.
if(items.find(i) == items.end()){
@@ -398,33 +394,33 @@ void MainWindowImp::updateInterface(Interface *i){ QString typeName = "lan";
if(i->getHardwareName().contains("Local Loopback"))
typeName = "lo";
if(i->getInterfaceName().contains("irda"))
typeName = "irda";
if(i->getInterfaceName().contains("wlan"))
typeName = "wlan";
if(i->getInterfaceName().contains("usb"))
typeName = "usb";
if(!i->isAttached())
typeName = "connect_no";
// Actually try to use the Module
if(i->getModuleOwner() != NULL)
typeName = i->getModuleOwner()->getPixmapName(i);
- item->setPixmap(1, (Resource::loadPixmap(typeName)));
+ item->setPixmap(1, (Resource::loadPixmap(QString("networksetup/") + typeName)));
item->setText(2, i->getHardwareName());
item->setText(3, QString("(%1)").arg(i->getInterfaceName()));
item->setText(4, (i->getStatus()) ? i->getIp() : QString(""));
}
void MainWindowImp::newProfileChanged(const QString& newText){
if(newText.length() > 0)
newProfileButton->setEnabled(true);
else
newProfileButton->setEnabled(false);
}
/**
* Adds a new profile to the list of profiles.
* Don't add profiles that already exists.
* Appends to the list and QStringList
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index cc18fba..648932f 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp @@ -86,39 +86,39 @@ void WLANImp::parseSettingFile(){ } } if(line.contains("MODE=")){ QString mode = line.mid(line.find("MODE=")+5, line.length()); if(mode == "Managed"){ networkType->setCurrentItem(0); channelLabel->setEnabled(false); networkChannel->setEnabled(false); } else{ networkType->setCurrentItem(1); networkChannel->setEnabled(true); channelLabel->setEnabled(true); } } if(line.contains("#KEY0=")) - keyLineEdit0->setText(line.mid(5, line.length())); + keyLineEdit0->setText(line.mid(6, line.length())); if(line.contains("#KEY1=")) - keyLineEdit1->setText(line.mid(5, line.length())); + keyLineEdit1->setText(line.mid(6, line.length())); if(line.contains("#KEY2=")) - keyLineEdit2->setText(line.mid(5, line.length())); + keyLineEdit2->setText(line.mid(6, line.length())); if(line.contains("#KEY3=")) - keyLineEdit3->setText(line.mid(5, line.length())); + keyLineEdit3->setText(line.mid(6, line.length())); if(line.contains("KEY=")){ wepEnabled->setChecked(true); QString key; if(line.right(5) == (" open")){ key = line.mid(4, line.length()-5); authOpen->setChecked(true); authShared->setChecked(false); } else{ authOpen->setChecked(false); authShared->setChecked(true); key = line.mid(4, line.length()); } if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index 7ffa76f..d964961 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp @@ -58,54 +58,54 @@ void Interface::setModuleOwner(Module *owner){ }; /** * Try to start the interface. */ void Interface::start(){ // check to see if we are already running. if(true == status){ emit (updateMessage("Unable to start interface,\n already started")); return; } int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); // See if it was successfull... if(ret != 0){ - emit (updateMessage("Starting interface failed.")); + emit (updateMessage("Starting interface failed")); return; } status = true; refresh(); emit (updateMessage("Start successfull")); } /** * Try to stop the interface. */ void Interface::stop(){ // check to see if we are already stopped. if(false == status){ emit (updateMessage("Unable to stop interface,\n already stopped")); return; } int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); if(ret != 0){ - emit (updateMessage("Stopping interface failed.")); + emit (updateMessage("Stopping interface failed")); return; } status = false; refresh(); emit (updateMessage("Stop successfull")); } /** * Try to restart the interface. */ void Interface::restart(){ stop(); start(); } diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 7b93554..9a17743 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -307,75 +307,71 @@ void MainWindowImp::removeClicked(){ * Pull up the configure about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::configureClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
if(moduleConfigure != NULL){
moduleConfigure->showMaximized();
- moduleConfigure->show();
return;
}
}
InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
QString currentProfileText = currentProfileLabel->text();
if(currentProfileText.upper() == "ALL");
currentProfileText = "";
configure->setProfile(currentProfileText);
configure->showMaximized();
- configure->show();
}
/**
* Pull up the information about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::informationClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(!i->isAttached()){
QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
return;
}
if(i->getModuleOwner()){
QWidget *moduleInformation = i->getModuleOwner()->information(i);
if(moduleInformation != NULL){
moduleInformation->showMaximized();
- moduleInformation->show();
return;
}
}
- InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true);
- information->showMaximized();
- information->show();
+ InterfaceInformationImp information(0, "InterfaceSetupImp", i);
+ information.showMaximized();
}
/**
* Update this interface. If no QListViewItem exists create one.
* @param Interface* pointer to the interface that needs to be updated.
*/
void MainWindowImp::updateInterface(Interface *i){
if(!advancedUserMode){
if(i->getInterfaceName() == "lo")
return;
}
QListViewItem *item = NULL;
// Find the interface, making it if needed.
if(items.find(i) == items.end()){
@@ -398,33 +394,33 @@ void MainWindowImp::updateInterface(Interface *i){ QString typeName = "lan";
if(i->getHardwareName().contains("Local Loopback"))
typeName = "lo";
if(i->getInterfaceName().contains("irda"))
typeName = "irda";
if(i->getInterfaceName().contains("wlan"))
typeName = "wlan";
if(i->getInterfaceName().contains("usb"))
typeName = "usb";
if(!i->isAttached())
typeName = "connect_no";
// Actually try to use the Module
if(i->getModuleOwner() != NULL)
typeName = i->getModuleOwner()->getPixmapName(i);
- item->setPixmap(1, (Resource::loadPixmap(typeName)));
+ item->setPixmap(1, (Resource::loadPixmap(QString("networksetup/") + typeName)));
item->setText(2, i->getHardwareName());
item->setText(3, QString("(%1)").arg(i->getInterfaceName()));
item->setText(4, (i->getStatus()) ? i->getIp() : QString(""));
}
void MainWindowImp::newProfileChanged(const QString& newText){
if(newText.length() > 0)
newProfileButton->setEnabled(true);
else
newProfileButton->setEnabled(false);
}
/**
* Adds a new profile to the list of profiles.
* Don't add profiles that already exists.
* Appends to the list and QStringList
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index cc18fba..648932f 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp @@ -86,39 +86,39 @@ void WLANImp::parseSettingFile(){ } } if(line.contains("MODE=")){ QString mode = line.mid(line.find("MODE=")+5, line.length()); if(mode == "Managed"){ networkType->setCurrentItem(0); channelLabel->setEnabled(false); networkChannel->setEnabled(false); } else{ networkType->setCurrentItem(1); networkChannel->setEnabled(true); channelLabel->setEnabled(true); } } if(line.contains("#KEY0=")) - keyLineEdit0->setText(line.mid(5, line.length())); + keyLineEdit0->setText(line.mid(6, line.length())); if(line.contains("#KEY1=")) - keyLineEdit1->setText(line.mid(5, line.length())); + keyLineEdit1->setText(line.mid(6, line.length())); if(line.contains("#KEY2=")) - keyLineEdit2->setText(line.mid(5, line.length())); + keyLineEdit2->setText(line.mid(6, line.length())); if(line.contains("#KEY3=")) - keyLineEdit3->setText(line.mid(5, line.length())); + keyLineEdit3->setText(line.mid(6, line.length())); if(line.contains("KEY=")){ wepEnabled->setChecked(true); QString key; if(line.right(5) == (" open")){ key = line.mid(4, line.length()-5); authOpen->setChecked(true); authShared->setChecked(false); } else{ authOpen->setChecked(false); authShared->setChecked(true); key = line.mid(4, line.length()); } if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); |