summaryrefslogtreecommitdiff
authorbenmeyer <benmeyer>2002-10-18 18:12:53 (UTC)
committer benmeyer <benmeyer>2002-10-18 18:12:53 (UTC)
commita63b3b36cf4d665b67733e069bfaad8f96388276 (patch) (side-by-side diff)
tree0089ca8d5bacd31982d8bec367d091b4f58cace1
parent5ec0d959ca9d3ade0c7271885028fd4309cf2b4c (diff)
downloadopie-a63b3b36cf4d665b67733e069bfaad8f96388276.zip
opie-a63b3b36cf4d665b67733e069bfaad8f96388276.tar.gz
opie-a63b3b36cf4d665b67733e069bfaad8f96388276.tar.bz2
interfaces now watches for # in most cases
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfaceinformation.ui12
-rw-r--r--noncore/net/networksetup/interfaces.cpp10
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp4
-rw-r--r--noncore/net/networksetup/module.h8
-rw-r--r--noncore/settings/networksettings/interfaceinformation.ui12
-rw-r--r--noncore/settings/networksettings/interfaces.cpp10
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp4
-rw-r--r--noncore/settings/networksettings/module.h8
8 files changed, 34 insertions, 34 deletions
diff --git a/noncore/net/networksetup/interfaceinformation.ui b/noncore/net/networksetup/interfaceinformation.ui
index fc99fce..2838d19 100644
--- a/noncore/net/networksetup/interfaceinformation.ui
+++ b/noncore/net/networksetup/interfaceinformation.ui
@@ -48,46 +48,46 @@
<property stdset="1">
<name>name</name>
<cstring>refreshButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Refresh</string>
+ <string>&amp;Refresh</string>
</property>
</widget>
<widget row="0" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>stopButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Stop</string>
+ <string>S&amp;top</string>
</property>
</widget>
<widget row="1" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>restartButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Restart</string>
+ <string>R&amp;estart</string>
</property>
</widget>
<widget row="0" column="0" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>startButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Start</string>
+ <string>&amp;Start</string>
</property>
</widget>
</grid>
</widget>
<widget row="0" column="0" >
<class>Line</class>
@@ -290,13 +290,13 @@
<property stdset="1">
<name>name</name>
<cstring>advancedButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>View Advanced Information</string>
+ <string>View &amp;Advanced Information</string>
</property>
</widget>
</hbox>
</widget>
<widget row="5" column="0" rowspan="1" colspan="2" >
<class>Line</class>
@@ -330,14 +330,12 @@
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
-<connections>
-</connections>
<tabstops>
<tabstop>startButton</tabstop>
<tabstop>stopButton</tabstop>
<tabstop>refreshButton</tabstop>
<tabstop>restartButton</tabstop>
<tabstop>advancedButton</tabstop>
diff --git a/noncore/net/networksetup/interfaces.cpp b/noncore/net/networksetup/interfaces.cpp
index 9155890..377a6db 100644
--- a/noncore/net/networksetup/interfaces.cpp
+++ b/noncore/net/networksetup/interfaces.cpp
@@ -48,13 +48,13 @@ Interfaces::Interfaces(QString useInterfacesFile){
* @return Return string list of interfaces.
**/
QStringList Interfaces::getInterfaceList(){
QStringList list;
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
- if(line.contains(IFACE)){
+ if(line.contains(IFACE) && line.at(0) != '#'){
line = line.mid(QString(IFACE).length() +1, line.length());
line = line.simplifyWhiteSpace();
int findSpace = line.find(" ");
if( findSpace >= 0){
line = line.mid(0, findSpace);
list.append(line);
@@ -454,13 +454,13 @@ QString Interfaces::getScript(bool &error){
*/
bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator &iterator){
bool found = false;
iterator = interfaces.end();
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
- if(line.contains(stanza) && line.contains(option)){
+ if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){
uint point = line.find(option);
bool valid = true;
if(point > 0){
// There are more chars in the line. check +1
if(line.at(point-1) != ' ')
valid = false;
@@ -500,13 +500,13 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
// Got to the end of the stanza without finding it, so append it.
interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
}
found = true;
break;
}
- if((*it).contains(option) && it != start){
+ if((*it).contains(option) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
(*it) = QString("\t%1 %2").arg(option).arg(value);
}
@@ -531,13 +531,13 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
// got to the end without finding it
break;
}
- if((*it).contains(option) && (*it).contains(value) &&it != start){
+ if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
(*it) = "";
}
@@ -584,13 +584,13 @@ QString Interfaces::getOption(QStringList::Iterator start, QString option, bool
QString value;
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
break;
}
- if((*it).contains(option)){
+ if((*it).contains(option) && (*it).at(0) != '#'){
if(found)
qDebug(QString("Interfaces: Get Options found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1());
found = true;
QString line = (*it).simplifyWhiteSpace();
int space = line.find(" ", option.length());
if(space != -1)
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index 01063c2..8e4e898 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -229,13 +229,13 @@ void MainWindowImp::configureClicked(){
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
i->getModuleOwner()->setProfile(currentProfile);
QTabWidget *tabWidget = NULL;
- QWidget *moduleConfigure = i->getModuleOwner()->configure(&tabWidget);
+ QWidget *moduleConfigure = i->getModuleOwner()->configure(i, &tabWidget);
if(moduleConfigure != NULL){
if(tabWidget != NULL){
InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
configure->setProfile(currentProfile);
tabWidget->insertTab(configure, "TCP/IP");
@@ -275,13 +275,13 @@ void MainWindowImp::informationClicked(){
for(uint i = 0; i < profilesList->count(); i++){
list.append(profilesList->text(i));
}
if(i->getModuleOwner()){
QTabWidget *tabWidget = NULL;
- QWidget *moduleInformation = i->getModuleOwner()->information(&tabWidget);
+ QWidget *moduleInformation = i->getModuleOwner()->information(i, &tabWidget);
if(moduleInformation != NULL){
if(tabWidget != NULL){
InterfaceInformationImp *information = new InterfaceInformationImp(tabWidget, "InterfaceSetupImp", i, true);
tabWidget->insertTab(information, "TCP/IP");
}
moduleInformation->showMaximized();
diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h
index a30f492..96db5b3 100644
--- a/noncore/net/networksetup/module.h
+++ b/noncore/net/networksetup/module.h
@@ -26,34 +26,36 @@ public:
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
- virtual QString getPixmapName(Interface* i) = 0;
+ virtual QString getPixmapName(Interface *) = 0;
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
virtual bool isOwner(Interface *){ return false; };
/**
* Create, set tabWiget and return the WLANConfigure Module
+ * @param Interface *i the interface to configure.
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
- virtual QWidget *configure(QTabWidget **){ return NULL; } ;
+ virtual QWidget *configure(Interface *, QTabWidget **){ return NULL; } ;
/**
* Create, set tabWiget and return the Information Module
+ * @param Interface *i the interface to get info on.
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
- virtual QWidget *information(QTabWidget **){ return NULL; };
+ virtual QWidget *information(Interface *, QTabWidget **){ return NULL; };
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
diff --git a/noncore/settings/networksettings/interfaceinformation.ui b/noncore/settings/networksettings/interfaceinformation.ui
index fc99fce..2838d19 100644
--- a/noncore/settings/networksettings/interfaceinformation.ui
+++ b/noncore/settings/networksettings/interfaceinformation.ui
@@ -48,46 +48,46 @@
<property stdset="1">
<name>name</name>
<cstring>refreshButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Refresh</string>
+ <string>&amp;Refresh</string>
</property>
</widget>
<widget row="0" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>stopButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Stop</string>
+ <string>S&amp;top</string>
</property>
</widget>
<widget row="1" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>restartButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Restart</string>
+ <string>R&amp;estart</string>
</property>
</widget>
<widget row="0" column="0" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>startButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Start</string>
+ <string>&amp;Start</string>
</property>
</widget>
</grid>
</widget>
<widget row="0" column="0" >
<class>Line</class>
@@ -290,13 +290,13 @@
<property stdset="1">
<name>name</name>
<cstring>advancedButton</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>View Advanced Information</string>
+ <string>View &amp;Advanced Information</string>
</property>
</widget>
</hbox>
</widget>
<widget row="5" column="0" rowspan="1" colspan="2" >
<class>Line</class>
@@ -330,14 +330,12 @@
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
-<connections>
-</connections>
<tabstops>
<tabstop>startButton</tabstop>
<tabstop>stopButton</tabstop>
<tabstop>refreshButton</tabstop>
<tabstop>restartButton</tabstop>
<tabstop>advancedButton</tabstop>
diff --git a/noncore/settings/networksettings/interfaces.cpp b/noncore/settings/networksettings/interfaces.cpp
index 9155890..377a6db 100644
--- a/noncore/settings/networksettings/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces.cpp
@@ -48,13 +48,13 @@ Interfaces::Interfaces(QString useInterfacesFile){
* @return Return string list of interfaces.
**/
QStringList Interfaces::getInterfaceList(){
QStringList list;
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
- if(line.contains(IFACE)){
+ if(line.contains(IFACE) && line.at(0) != '#'){
line = line.mid(QString(IFACE).length() +1, line.length());
line = line.simplifyWhiteSpace();
int findSpace = line.find(" ");
if( findSpace >= 0){
line = line.mid(0, findSpace);
list.append(line);
@@ -454,13 +454,13 @@ QString Interfaces::getScript(bool &error){
*/
bool Interfaces::setStanza(QString stanza, QString option, QStringList::Iterator &iterator){
bool found = false;
iterator = interfaces.end();
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
- if(line.contains(stanza) && line.contains(option)){
+ if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){
uint point = line.find(option);
bool valid = true;
if(point > 0){
// There are more chars in the line. check +1
if(line.at(point-1) != ' ')
valid = false;
@@ -500,13 +500,13 @@ bool Interfaces::setOption(QStringList::Iterator start, QString option, QString
// Got to the end of the stanza without finding it, so append it.
interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
}
found = true;
break;
}
- if((*it).contains(option) && it != start){
+ if((*it).contains(option) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
(*it) = QString("\t%1 %2").arg(option).arg(value);
}
@@ -531,13 +531,13 @@ bool Interfaces::removeOption(QStringList::Iterator start, QString option, QStri
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
// got to the end without finding it
break;
}
- if((*it).contains(option) && (*it).contains(value) &&it != start){
+ if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
(*it) = "";
}
@@ -584,13 +584,13 @@ QString Interfaces::getOption(QStringList::Iterator start, QString option, bool
QString value;
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
break;
}
- if((*it).contains(option)){
+ if((*it).contains(option) && (*it).at(0) != '#'){
if(found)
qDebug(QString("Interfaces: Get Options found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1());
found = true;
QString line = (*it).simplifyWhiteSpace();
int space = line.find(" ", option.length());
if(space != -1)
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 01063c2..8e4e898 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -229,13 +229,13 @@ void MainWindowImp::configureClicked(){
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
i->getModuleOwner()->setProfile(currentProfile);
QTabWidget *tabWidget = NULL;
- QWidget *moduleConfigure = i->getModuleOwner()->configure(&tabWidget);
+ QWidget *moduleConfigure = i->getModuleOwner()->configure(i, &tabWidget);
if(moduleConfigure != NULL){
if(tabWidget != NULL){
InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
configure->setProfile(currentProfile);
tabWidget->insertTab(configure, "TCP/IP");
@@ -275,13 +275,13 @@ void MainWindowImp::informationClicked(){
for(uint i = 0; i < profilesList->count(); i++){
list.append(profilesList->text(i));
}
if(i->getModuleOwner()){
QTabWidget *tabWidget = NULL;
- QWidget *moduleInformation = i->getModuleOwner()->information(&tabWidget);
+ QWidget *moduleInformation = i->getModuleOwner()->information(i, &tabWidget);
if(moduleInformation != NULL){
if(tabWidget != NULL){
InterfaceInformationImp *information = new InterfaceInformationImp(tabWidget, "InterfaceSetupImp", i, true);
tabWidget->insertTab(information, "TCP/IP");
}
moduleInformation->showMaximized();
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index a30f492..96db5b3 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -26,34 +26,36 @@ public:
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
- virtual QString getPixmapName(Interface* i) = 0;
+ virtual QString getPixmapName(Interface *) = 0;
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
virtual bool isOwner(Interface *){ return false; };
/**
* Create, set tabWiget and return the WLANConfigure Module
+ * @param Interface *i the interface to configure.
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
- virtual QWidget *configure(QTabWidget **){ return NULL; } ;
+ virtual QWidget *configure(Interface *, QTabWidget **){ return NULL; } ;
/**
* Create, set tabWiget and return the Information Module
+ * @param Interface *i the interface to get info on.
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
- virtual QWidget *information(QTabWidget **){ return NULL; };
+ virtual QWidget *information(Interface *, QTabWidget **){ return NULL; };
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/