author | benmeyer <benmeyer> | 2002-11-04 15:17:58 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-11-04 15:17:58 (UTC) |
commit | 17a29825dcf56cb0e224848e71e24ee6a884890b (patch) (unidiff) | |
tree | 91a7f024de51081800a13312dd1b16822d86c188 | |
parent | a5f1f8a58a5a654503d72042b12f36ab30216a16 (diff) | |
download | opie-17a29825dcf56cb0e224848e71e24ee6a884890b.zip opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.gz opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.bz2 |
Fix bug and gives more user feedback now
10 files changed, 60 insertions, 14 deletions
diff --git a/noncore/net/networksetup/interfaces/interface.cpp b/noncore/net/networksetup/interfaces/interface.cpp index 929b3a1..e4f405e 100644 --- a/noncore/net/networksetup/interfaces/interface.cpp +++ b/noncore/net/networksetup/interfaces/interface.cpp | |||
@@ -65,4 +65,6 @@ void Interface::start(){ | |||
65 | // check to see if we are already running. | 65 | // check to see if we are already running. |
66 | if(true == status) | 66 | if(true == status){ |
67 | emit (updateMessage("Unable to start interface,\n already started")); | ||
67 | return; | 68 | return; |
69 | } | ||
68 | 70 | ||
@@ -70,4 +72,6 @@ void Interface::start(){ | |||
70 | // See if it was successfull... | 72 | // See if it was successfull... |
71 | if(ret != 0) | 73 | if(ret != 0){ |
74 | emit (updateMessage("Starting interface failed.")); | ||
72 | return; | 75 | return; |
76 | } | ||
73 | 77 | ||
@@ -75,2 +79,3 @@ void Interface::start(){ | |||
75 | refresh(); | 79 | refresh(); |
80 | emit (updateMessage("Start successfull")); | ||
76 | } | 81 | } |
@@ -82,11 +87,16 @@ void Interface::stop(){ | |||
82 | // check to see if we are already stopped. | 87 | // check to see if we are already stopped. |
83 | if(false == status) | 88 | if(false == status){ |
89 | emit (updateMessage("Unable to stop interface,\n already stopped")); | ||
84 | return; | 90 | return; |
91 | } | ||
85 | 92 | ||
86 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); | 93 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); |
87 | if(ret != 0) | 94 | if(ret != 0){ |
95 | emit (updateMessage("Stopping interface failed.")); | ||
88 | return; | 96 | return; |
97 | } | ||
89 | 98 | ||
90 | status = true; | 99 | status = false; |
91 | refresh(); | 100 | refresh(); |
101 | emit (updateMessage("Stop successfull")); | ||
92 | } | 102 | } |
diff --git a/noncore/net/networksetup/interfaces/interface.h b/noncore/net/networksetup/interfaces/interface.h index dc9c6d3..fc064fe 100644 --- a/noncore/net/networksetup/interfaces/interface.h +++ b/noncore/net/networksetup/interfaces/interface.h | |||
@@ -13,2 +13,3 @@ signals: | |||
13 | void updateInterface(Interface *i); | 13 | void updateInterface(Interface *i); |
14 | void updateMessage(const QString &message); | ||
14 | 15 | ||
diff --git a/noncore/net/networksetup/interfaces/interfaceinformationimp.cpp b/noncore/net/networksetup/interfaces/interfaceinformationimp.cpp index 43483fb..39575c4 100644 --- a/noncore/net/networksetup/interfaces/interfaceinformationimp.cpp +++ b/noncore/net/networksetup/interfaces/interfaceinformationimp.cpp | |||
@@ -6,2 +6,4 @@ | |||
6 | #include <qgroupbox.h> | 6 | #include <qgroupbox.h> |
7 | #include <qmessagebox.h> | ||
8 | |||
7 | #include <assert.h> | 9 | #include <assert.h> |
@@ -17,2 +19,3 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
17 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 19 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
20 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); | ||
18 | updateInterface(interface); | 21 | updateInterface(interface); |
@@ -23,3 +26,2 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
23 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 26 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
24 | |||
25 | } | 27 | } |
@@ -68,2 +70,11 @@ void InterfaceInformationImp::advanced(){ | |||
68 | 70 | ||
71 | /** | ||
72 | * Messages from the interface if start/stop went as planned. | ||
73 | * Purly for user feedback. | ||
74 | * @param message the message to display. | ||
75 | */ | ||
76 | void InterfaceInformationImp::showMessage(const QString &message){ | ||
77 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | ||
78 | } | ||
79 | |||
69 | // infoimp.cpp | 80 | // infoimp.cpp |
diff --git a/noncore/net/networksetup/interfaces/interfaceinformationimp.h b/noncore/net/networksetup/interfaces/interfaceinformationimp.h index 42213cc..65cdfe0 100644 --- a/noncore/net/networksetup/interfaces/interfaceinformationimp.h +++ b/noncore/net/networksetup/interfaces/interfaceinformationimp.h | |||
@@ -17,2 +17,3 @@ private slots: | |||
17 | void updateInterface(Interface *i); | 17 | void updateInterface(Interface *i); |
18 | void showMessage(const QString &message); | ||
18 | 19 | ||
diff --git a/noncore/net/networksetup/interfaces/interfaces.pro b/noncore/net/networksetup/interfaces/interfaces.pro index 9a024f6..d6b43fb 100644 --- a/noncore/net/networksetup/interfaces/interfaces.pro +++ b/noncore/net/networksetup/interfaces/interfaces.pro | |||
@@ -3,3 +3,3 @@ CONFIG += qt warn_on release | |||
3 | #CONFIG += qt warn_on debug | 3 | #CONFIG += qt warn_on debug |
4 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 4 | #DESTDIR = $(QTDIR)/lib$(PROJMAK) |
5 | HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h | 5 | HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h |
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index 929b3a1..e4f405e 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp | |||
@@ -65,4 +65,6 @@ void Interface::start(){ | |||
65 | // check to see if we are already running. | 65 | // check to see if we are already running. |
66 | if(true == status) | 66 | if(true == status){ |
67 | emit (updateMessage("Unable to start interface,\n already started")); | ||
67 | return; | 68 | return; |
69 | } | ||
68 | 70 | ||
@@ -70,4 +72,6 @@ void Interface::start(){ | |||
70 | // See if it was successfull... | 72 | // See if it was successfull... |
71 | if(ret != 0) | 73 | if(ret != 0){ |
74 | emit (updateMessage("Starting interface failed.")); | ||
72 | return; | 75 | return; |
76 | } | ||
73 | 77 | ||
@@ -75,2 +79,3 @@ void Interface::start(){ | |||
75 | refresh(); | 79 | refresh(); |
80 | emit (updateMessage("Start successfull")); | ||
76 | } | 81 | } |
@@ -82,11 +87,16 @@ void Interface::stop(){ | |||
82 | // check to see if we are already stopped. | 87 | // check to see if we are already stopped. |
83 | if(false == status) | 88 | if(false == status){ |
89 | emit (updateMessage("Unable to stop interface,\n already stopped")); | ||
84 | return; | 90 | return; |
91 | } | ||
85 | 92 | ||
86 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); | 93 | int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); |
87 | if(ret != 0) | 94 | if(ret != 0){ |
95 | emit (updateMessage("Stopping interface failed.")); | ||
88 | return; | 96 | return; |
97 | } | ||
89 | 98 | ||
90 | status = true; | 99 | status = false; |
91 | refresh(); | 100 | refresh(); |
101 | emit (updateMessage("Stop successfull")); | ||
92 | } | 102 | } |
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h index dc9c6d3..fc064fe 100644 --- a/noncore/settings/networksettings/interfaces/interface.h +++ b/noncore/settings/networksettings/interfaces/interface.h | |||
@@ -13,2 +13,3 @@ signals: | |||
13 | void updateInterface(Interface *i); | 13 | void updateInterface(Interface *i); |
14 | void updateMessage(const QString &message); | ||
14 | 15 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp index 43483fb..39575c4 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | |||
@@ -6,2 +6,4 @@ | |||
6 | #include <qgroupbox.h> | 6 | #include <qgroupbox.h> |
7 | #include <qmessagebox.h> | ||
8 | |||
7 | #include <assert.h> | 9 | #include <assert.h> |
@@ -17,2 +19,3 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
17 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 19 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
20 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); | ||
18 | updateInterface(interface); | 21 | updateInterface(interface); |
@@ -23,3 +26,2 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
23 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 26 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
24 | |||
25 | } | 27 | } |
@@ -68,2 +70,11 @@ void InterfaceInformationImp::advanced(){ | |||
68 | 70 | ||
71 | /** | ||
72 | * Messages from the interface if start/stop went as planned. | ||
73 | * Purly for user feedback. | ||
74 | * @param message the message to display. | ||
75 | */ | ||
76 | void InterfaceInformationImp::showMessage(const QString &message){ | ||
77 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | ||
78 | } | ||
79 | |||
69 | // infoimp.cpp | 80 | // infoimp.cpp |
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h index 42213cc..65cdfe0 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.h +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.h | |||
@@ -17,2 +17,3 @@ private slots: | |||
17 | void updateInterface(Interface *i); | 17 | void updateInterface(Interface *i); |
18 | void showMessage(const QString &message); | ||
18 | 19 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfaces.pro b/noncore/settings/networksettings/interfaces/interfaces.pro index 9a024f6..d6b43fb 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.pro +++ b/noncore/settings/networksettings/interfaces/interfaces.pro | |||
@@ -3,3 +3,3 @@ CONFIG += qt warn_on release | |||
3 | #CONFIG += qt warn_on debug | 3 | #CONFIG += qt warn_on debug |
4 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 4 | #DESTDIR = $(QTDIR)/lib$(PROJMAK) |
5 | HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h | 5 | HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h |