← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2375: Fine tune auto connection detection

 

------------------------------------------------------------
revno: 2375
committer: eMTee <emtee11@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Mon 2011-01-03 19:48:46 +0100
message:
  Fine tune auto connection detection
modified:
  dcpp/ConnectivityManager.cpp
  dcpp/UPnPManager.cpp
  win32/NetworkPage.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/ConnectivityManager.cpp'
--- dcpp/ConnectivityManager.cpp	2011-01-02 17:12:02 +0000
+++ dcpp/ConnectivityManager.cpp	2011-01-03 18:48:46 +0000
@@ -55,6 +55,9 @@
 
 	running = true;
 
+	SettingsManager::getInstance()->set(SettingsManager::EXTERNAL_IP, Util::emptyString);
+	SettingsManager::getInstance()->set(SettingsManager::NO_IP_OVERRIDE, false);
+
 	if (UPnPManager::getInstance()->getOpened()) {
 		UPnPManager::getInstance()->close();
 	}

=== modified file 'dcpp/UPnPManager.cpp'
--- dcpp/UPnPManager.cpp	2011-01-02 17:12:02 +0000
+++ dcpp/UPnPManager.cpp	2011-01-03 18:48:46 +0000
@@ -93,7 +93,6 @@
 		opened = true;
 
 		log(str(F_("Successfully created port mappings (TCP: %1%, UDP: %2%, TLS: %3%), mapped using the %4% interface") % conn_port % search_port % secure_port % impl.getName()));
-		ConnectivityManager::getInstance()->mappingFinished(true);
 
 		if(!BOOLSETTING(NO_IP_OVERRIDE)) {
 			// now lets configure the external IP (connect to me) address
@@ -108,6 +107,8 @@
 			}
 		}
 
+		ConnectivityManager::getInstance()->mappingFinished(true);
+
 		break;
 	}
 

=== modified file 'win32/NetworkPage.cpp'
--- win32/NetworkPage.cpp	2011-01-02 17:12:02 +0000
+++ win32/NetworkPage.cpp	2011-01-03 18:48:46 +0000
@@ -188,15 +188,14 @@
 void NetworkPage::handleDetectClicked() {
 	log->setText(Util::emptyStringT);
 	detectNow->setEnabled(false);
+	externalIP->setText(Util::emptyStringT);
+	overrideIP->setChecked(false);
 	ConnectivityManager::getInstance()->detectConnection();
 }
 
 void NetworkPage::handleAutoClicked() {
 	bool enabled = autoDetect->getChecked();
-	if (enabled) {
-		externalIP->setText(Util::emptyStringT);
-		overrideIP->setChecked(false);
-	}
+
 	incoming->setEnabled(!enabled);
 	detectNow->setEnabled(enabled && !ConnectivityManager::getInstance()->isRunning());
 
@@ -216,6 +215,7 @@
 	passive->setChecked(false);
 
 	setRadioButtons();
+	externalIP->setText(Text::toT(SETTING(EXTERNAL_IP)));
 	detectNow->setEnabled(true);
 }