linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #03860
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2484: Resizable and scrollable settings dialog; various connectivity touch-ups
------------------------------------------------------------
revno: 2484
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2011-04-11 22:39:22 +0200
message:
Resizable and scrollable settings dialog; various connectivity touch-ups
modified:
changelog.txt
dcpp/ConnectivityManager.cpp
dcpp/MappingManager.cpp
dcpp/SettingsManager.cpp
dcpp/SettingsManager.h
dcpp/Util.cpp
dwt/include/dwt/widgets/ScrolledContainer.h
help/chat_commands.html
help/faq_activemode.html
help/faq_connection.html
help/get_started.html
help/settings_connectivity.html
help/settings_connectivity_manual.html
help/window_system_log.html
win32/ConnectivityManualPage.cpp
win32/ConnectivityManualPage.h
win32/ConnectivityPage.cpp
win32/HubFrame.cpp
win32/PropPage.cpp
win32/PropPage.h
win32/SettingsDialog.cpp
win32/SettingsDialog.h
--
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 'changelog.txt'
--- changelog.txt 2011-04-07 14:57:29 +0000
+++ changelog.txt 2011-04-11 20:39:22 +0000
@@ -14,8 +14,9 @@
* Faster startup with many tabs
* Reduce flickering when resizing
* Reorganize connectivity settings (poy)
-* [L#748623] MiniUPnP respects the bind address (poy)
+* [L#748623] Port mappers respect the bind address (poy)
* Make more parts of the interface DPI-aware (poy)
+* Resizable and scrollable settings dialog
-- 0.782 2011-03-05 --
* Prevent a remote crash triggered via malformed user commands (poy)
=== modified file 'dcpp/ConnectivityManager.cpp'
--- dcpp/ConnectivityManager.cpp 2011-04-07 13:40:55 +0000
+++ dcpp/ConnectivityManager.cpp 2011-04-11 20:39:22 +0000
@@ -63,7 +63,6 @@
SettingsManager::getInstance()->unset(SettingsManager::TLS_PORT);
SettingsManager::getInstance()->unset(SettingsManager::EXTERNAL_IP);
SettingsManager::getInstance()->unset(SettingsManager::NO_IP_OVERRIDE);
- SettingsManager::getInstance()->unset(SettingsManager::MAPPER);
SettingsManager::getInstance()->unset(SettingsManager::BIND_ADDRESS);
if (MappingManager::getInstance()->getOpened()) {
=== modified file 'dcpp/MappingManager.cpp'
--- dcpp/MappingManager.cpp 2011-04-07 13:40:55 +0000
+++ dcpp/MappingManager.cpp 2011-04-11 20:39:22 +0000
@@ -110,11 +110,20 @@
return 0;
}
+ // move the preferred mapper to the top of the stack.
const auto& setting = SETTING(MAPPER);
for(auto i = mappers.begin(); i != mappers.end(); ++i) {
- if(!setting.empty() && i->first != setting)
- continue;
+ if(i->first == setting) {
+ if(i != mappers.begin()) {
+ auto mapper = *i;
+ mappers.erase(i);
+ mappers.insert(mappers.begin(), mapper);
+ }
+ break;
+ }
+ }
+ for(auto i = mappers.begin(); i != mappers.end(); ++i) {
unique_ptr<Mapper> pMapper(i->second());
Mapper& mapper = *pMapper;
=== modified file 'dcpp/SettingsManager.cpp'
--- dcpp/SettingsManager.cpp 2011-04-07 13:40:55 +0000
+++ dcpp/SettingsManager.cpp 2011-04-11 20:39:22 +0000
@@ -61,9 +61,10 @@
"ListDuplicates", "BufferSize", "DownloadSlots", "MaxDownloadSpeed", "LogMainChat", "LogPrivateChat",
"LogDownloads", "LogFinishedDownloads", "LogUploads", "StatusInChat", "ShowJoins",
"UseSystemIcons", "PopupPMs", "MinUploadSpeed", "GetUserInfo", "UrlHandler", "MainWindowState",
- "MainWindowSizeX", "MainWindowSizeY", "MainWindowPosX", "MainWindowPosY", "AutoAway",
+ "MainWindowSizeX", "MainWindowSizeY", "MainWindowPosX", "MainWindowPosY",
+ "SettingsWidth", "SettingsHeight",
"SocksPort", "SocksResolve", "KeepLists", "AutoKick", "QueueFrameShowTree",
- "CompressTransfers", "SFVCheck",
+ "CompressTransfers", "SFVCheck", "AutoAway",
"MaxCompression", "NoAwayMsgToBots", "SkipZeroByte", "AdlsBreakOnFirst",
"HubUserCommands", "AutoSearchAutoMatch", "DownloadBarColor", "UploadBarColor", "LogSystem",
"LogFilelistTransfers", "SendUnknownCommands", "MaxHashSpeed", "OpenUserCmdHelp",
@@ -190,8 +191,9 @@
setDefault(LOG_FILE_SYSTEM, "system.log");
setDefault(GET_USER_INFO, true);
setDefault(URL_HANDLER, false);
- setDefault(AUTO_AWAY, false);
setDefault(BIND_ADDRESS, "0.0.0.0");
+ setDefault(SETTINGS_WIDTH, 700);
+ setDefault(SETTINGS_HEIGHT, 600);
setDefault(SOCKS_PORT, 1080);
setDefault(SOCKS_RESOLVE, 1);
setDefault(CONFIG_VERSION, "0.181"); // 0.181 is the last version missing configversion
@@ -200,6 +202,7 @@
setDefault(QUEUEFRAME_SHOW_TREE, true);
setDefault(COMPRESS_TRANSFERS, true);
setDefault(SFV_CHECK, true);
+ setDefault(AUTO_AWAY, false);
setDefault(DEFAULT_AWAY_MESSAGE, "I'm away. State your business and I might answer later if you're lucky.");
setDefault(TIME_STAMPS_FORMAT, "%H:%M");
setDefault(MAX_COMPRESSION, 6);
=== modified file 'dcpp/SettingsManager.h'
--- dcpp/SettingsManager.h 2011-04-07 13:40:55 +0000
+++ dcpp/SettingsManager.h 2011-04-11 20:39:22 +0000
@@ -80,9 +80,10 @@
LIST_DUPES, BUFFER_SIZE, DOWNLOAD_SLOTS, MAX_DOWNLOAD_SPEED, LOG_MAIN_CHAT, LOG_PRIVATE_CHAT,
LOG_DOWNLOADS, LOG_FINISHED_DOWNLOADS, LOG_UPLOADS, STATUS_IN_CHAT, SHOW_JOINS,
USE_SYSTEM_ICONS, POPUP_PMS, MIN_UPLOAD_SPEED, GET_USER_INFO, URL_HANDLER, MAIN_WINDOW_STATE,
- MAIN_WINDOW_SIZE_X, MAIN_WINDOW_SIZE_Y, MAIN_WINDOW_POS_X, MAIN_WINDOW_POS_Y, AUTO_AWAY,
+ MAIN_WINDOW_SIZE_X, MAIN_WINDOW_SIZE_Y, MAIN_WINDOW_POS_X, MAIN_WINDOW_POS_Y,
+ SETTINGS_WIDTH, SETTINGS_HEIGHT,
SOCKS_PORT, SOCKS_RESOLVE, KEEP_LISTS, AUTO_KICK, QUEUEFRAME_SHOW_TREE,
- COMPRESS_TRANSFERS, SFV_CHECK,
+ COMPRESS_TRANSFERS, SFV_CHECK, AUTO_AWAY,
MAX_COMPRESSION, NO_AWAYMSG_TO_BOTS, SKIP_ZERO_BYTE, ADLS_BREAK_ON_FIRST,
HUB_USER_COMMANDS, AUTO_SEARCH_AUTO_MATCH, UPLOAD_BAR_COLOR, DOWNLOAD_BAR_COLOR, LOG_SYSTEM,
LOG_FILELIST_TRANSFERS, SEND_UNKNOWN_COMMANDS, MAX_HASH_SPEED, OPEN_USER_CMD_HELP,
=== modified file 'dcpp/Util.cpp'
--- dcpp/Util.cpp 2011-03-29 20:40:28 +0000
+++ dcpp/Util.cpp 2011-04-11 20:39:22 +0000
@@ -597,6 +597,10 @@
}
string Util::getLocalIp() {
+ if(!SettingsManager::getInstance()->isDefault(SettingsManager::BIND_ADDRESS)) {
+ return SETTING(BIND_ADDRESS);
+ }
+
string tmp;
char buf[256];
=== modified file 'dwt/include/dwt/widgets/ScrolledContainer.h'
--- dwt/include/dwt/widgets/ScrolledContainer.h 2011-03-16 16:34:26 +0000
+++ dwt/include/dwt/widgets/ScrolledContainer.h 2011-04-11 20:39:22 +0000
@@ -78,7 +78,7 @@
};
inline ScrolledContainer::Seed::Seed(DWORD style, DWORD exStyle) :
-BaseType::Seed(style | WS_CHILD | WS_HSCROLL | WS_VSCROLL, exStyle)
+BaseType::Seed(style | WS_CHILD | WS_HSCROLL | WS_VSCROLL, exStyle | WS_EX_CONTROLPARENT)
{
}
=== modified file 'help/chat_commands.html'
--- help/chat_commands.html 2010-02-08 10:26:49 +0000
+++ help/chat_commands.html 2011-04-11 20:39:22 +0000
@@ -23,10 +23,7 @@
<dd>Toggles visibility of the list of users for the current
hub.</dd>
<dt><untranslated>/connection</untranslated></dt>
- <dd>Displays the IP and port that DC++ will tell users to connect
-to. If either the IP or port is not correct, you will be unable
-to download from some users. This is only useful in <u>active</u> mode - the IP and
-port are unused in passive mode.</dd>
+ <dd>Displays the IP and ports that DC++ is using for connections with users from the current hub.</dd>
<dt><untranslated>/favorite</untranslated></dt>
<dt><untranslated>/fav</untranslated></dt>
<dd>Adds the current hub (along with your nickname and password, if
=== modified file 'help/faq_activemode.html'
--- help/faq_activemode.html 2011-04-07 13:40:55 +0000
+++ help/faq_activemode.html 2011-04-11 20:39:22 +0000
@@ -18,7 +18,7 @@
Click on File menu and then Settings. Click on <a href="settings_connectivity_manual.html">Connection Settings</a>.
</li>
<li>
- Select the <b>My computer is directly connected to Internet (no router)</b> radio button. Leave the IP fields blank. This will make DC++ use the current IP assigned to your network card. You must NOT have an internal IP address for this to work.
+ Select the <b>My computer is directly connected to the Internet (no router)</b> radio button. Leave the IP fields blank. This will make DC++ use the current IP assigned to your network card. You must NOT have an internal IP address for this to work.
</li>
<li>
Leave the TCP/UDP/TLS ports blank also. This will make DC++ randomize the port it uses each time.
=== modified file 'help/faq_connection.html'
--- help/faq_connection.html 2011-04-07 13:40:55 +0000
+++ help/faq_connection.html 2011-04-11 20:39:22 +0000
@@ -58,7 +58,7 @@
system administrator (if on an organization's network).</p>
<p>To manually configure your connectivity settings, uncheck <a href="settings_connectivity.html">
-Enable automatic connection type detection</a> in the Connectivity settings pane of the settings
+Let DC++ determine the best connectivity settings</a> in the Connectivity settings pane of the settings
dialog. This will enable the whole <a href="settings_connectivity_manual.html#connection">Manual configuration</a>
group which you can use to alter connectivity settings manually.</p>
=== modified file 'help/get_started.html'
--- help/get_started.html 2011-04-07 13:40:55 +0000
+++ help/get_started.html 2011-04-11 20:39:22 +0000
@@ -130,16 +130,15 @@
configured active mode connection. For a more in-depth explanation, read
<a href="faq_whyactive.html">Why do I need active mode?</a></p>
-<p>In most cases DC++ should be able to detect the appropriate connection method for you.
-The <a href="settings_connectivity.html">automatic connection type detection feature</a>
-is enabled by default and it tries to decide the best available connection mode at start.
-If you able to search and download from the users of the hubs you're connected to then
+<p>In most cases DC++ should be able to configure connectivity settings on your behalf, provided
+the <a href="settings_connectivity.html">Automatic connectivity setup</a> feature is enabled.
+If you able to search and download from the users of the hubs you are connected to, then
you're done.</p>
-<p>If searches and/or downloads do not work then make sure that <a href="settings_connectivity.html">
-Enable automatic connection type detection</a> setting is enabled. If it doesn't help
+<p>If searches and/or downloads are not working, make sure that the <a href="settings_connectivity.html">
+Let DC++ determine the best connectivity settings</a> option is enabled. If it doesn't help
(or it forces you into passive mode and you want to improve your connectivity) then follow
-<a href="faq_connection.html">the FAQ that tells you how to set up connection manually in DC++.</a></p>
+<a href="faq_connection.html">the FAQ that explains how to manually configure connectivity settings.</a></p>
<h2>Help resources</h2>
<p>
=== modified file 'help/settings_connectivity.html'
--- help/settings_connectivity.html 2011-04-07 13:40:55 +0000
+++ help/settings_connectivity.html 2011-04-11 20:39:22 +0000
@@ -7,32 +7,31 @@
</head>
<body>
<h1>Connectivity</h1>
-<h2 id="autoconn">Automatic connection type detection</h2>
+<h2 id="autoconn">Automatic connectivity setup</h2>
<p>
-Your incoming connection type must be correctly chosen for searches and downloads to work. In most
-cases, DC++ is able to detect the best connection type as long as the automatic detection option is
-enabled (recommended). Otherwise, this page offers manual tweaking of connection settings.
+Connectivity settings must be correctly configured for searches and downloads to work. In most
+cases, DC++ is able to detect the best connectivity settings by itself. When it can't (for example,
+when multiple network cards are available or when the network topology is too complicated), the
+various connectivity settings can still be manually adjusted from the "Manual configuration" page.
</p>
<dl style="margin-left: 40px;">
- <dt>Enable automatic incoming connection type detection</dt>
+ <dt>Let DC++ determine the best connectivity settings</dt>
<dd cshelp="IDH_SETTINGS_CONNECTIVITY_AUTODETECT">
- Select this to let DC++ determine the best connection type on your behalf. This should work with
+ Select this to let DC++ determine the best connectivity settings on your behalf. This should work with
the majority of network structures DC++ is generally used in. The success rate depends on
operating system configuration and on the network topology.<br/>
- Note that when this option is active, <u>manual connection settings will be ignored</u>.
+ Note that when this option is active, <u>manual connectivity settings will be ignored</u>.
<p>It is recommended to disable this option and to manually set up connectivity settings when the network topology is not easy for DC++ to figure out, such as:
<ul>
<li>When there is more than one physical network device (eg. network cards, 3G USB modems) plugged in the computer (the bind address will have to be fiddled with).</li>
- <li>In the presence of network tunneling, a <a href="http://en.wikipedia.org/wiki/Vpn" target="_blank" class="external">VPN</a> service or any other software that leads to virtual network devices.</li>
+ <li>In the presence of network tunneling, a <a href="http://en.wikipedia.org/wiki/Vpn" target="_blank" class="external">VPN</a> service or any other software that creates virtual network devices.</li>
<li>When DC++ is only supposed to connect to local network hubs (eg. in a campus).</li>
</ul>
</p></dd>
<dt>Detect now</dt>
- <dd cshelp="IDH_SETTINGS_CONNECTIVITY_DETECT_NOW">With this button, you can force DC++ to (re)detect the best connection
- mode available to you. Details and result of the operation will be shown in the Detection log box below.</dd>
+ <dd cshelp="IDH_SETTINGS_CONNECTIVITY_DETECT_NOW">With this button, you can force DC++ to (re)detect the best connectivity settings. Details and the result of the operation will be shown in the "Detection log" box below.</dd>
<dt>Detection log</dt>
- <dd cshelp="IDH_SETTINGS_CONNECTIVITY_DETECTION_LOG">This box contains the log and result of the last connection type
- detection started by clicking the Detect now button. It contains the detection steps, possible error messages and shows
+ <dd cshelp="IDH_SETTINGS_CONNECTIVITY_DETECTION_LOG">This box contains the log and result of the last connectivity auto-detection started by clicking the "Detect now" button. It contains the detection steps, possible error messages and shows
why a certain connection mode was chosen. This information is helpful in case of errors or when the result
is other than expected. Detection messages appear in the System log as well; descriptions of the various
messages are available in the <a href="window_system_log.html">list of System log messages</a>.</dd>
=== modified file 'help/settings_connectivity_manual.html'
--- help/settings_connectivity_manual.html 2011-04-07 13:40:55 +0000
+++ help/settings_connectivity_manual.html 2011-04-11 20:39:22 +0000
@@ -12,7 +12,6 @@
<h2 id="connection">Incoming connection settings</h2>
<p>
Use these settings to manually configure DC++ for incoming connections. If unsure, you may want to follow the <a href="get_started.html#connection">connection setup part</a> of the <a href="get_started.html">Get Started guide</a>.
-You should disable Automatic connection type detection to make these settings manually configurable.
</p>
<p style="margin-left: 40px;">Before setting up the following settings, make sure you are familiar
with the meaning of each connection mode and with the <a href="faq_whyactive.html">differences
@@ -22,7 +21,7 @@
<p style="margin-left: 40px;">Active mode is highly preferred in the DC network. For more
information, refer to the <a href="faq_activemode.html">Active mode FAQ</a>.</p>
<dl style="margin-left: 40px;">
- <dt>My computer is directly connected to Internet (no router)</dt>
+ <dt>My computer is directly connected to the Internet (no router)</dt>
<dd cshelp="IDH_SETTINGS_CONNECTIVITY_DIRECT">Select this mode if your computer is connected directly to the
internet or you plan to connect to hubs in your local network only. <b>Do <u>not</u> select this mode if
you have a router or any external firewall.</b>
@@ -67,7 +66,7 @@
<dd><p>Here you can specify what communication ports should DC++ use to accept incoming connections.
Generally you don't need to add specific ports unless you configured your port forwarding settings manually.
If port settings are left blank, DC++ will let the operating system generate a random port number.
-Port values are ignored when <a href="autoconn">Automatic incoming connection type detection</a> is enabled.</p>
+Port values are ignored when <a href="autoconn">Automatic connectivity setup</a> is enabled.</p>
<dl>
<dt>Transfer port (TCP)</dt>
<dd cshelp="IDH_SETTINGS_CONNECTIVITY_PORT_TCP">This is the port that DC++ listens on for incoming
@@ -93,14 +92,29 @@
<a href="get_started.html#connection">connection setup part</a> of the
<a href="get_started.html">Get Started guide</a> or the detailed
<a href="faq_activemode.html">Active mode FAQ</a>. The IP address set here will be erased if the
-<a href="autoconn">Automatic incoming connection type detection</a> setting is in use.</dd>
+<a href="autoconn">Automatic connectivity setup</a> feature is in use.</dd>
<dt id="noipoverride">Don't allow hubs/NAT-PMP/UPnP to override</dt>
<dd cshelp="IDH_SETTINGS_CONNECTIVITY_OVERRIDE">Enable this to always use the IP address in "External
/ WAN IP", and not let either NAT-PMP, UPnP nor connected hubs change it. If unsure, leave
this setting disabled. This option will be cleared out if the
- <a href="autoconn"> Automatic incoming connection type detection</a> setting is in use.</dd>
+ <a href="autoconn">Automatic connectivity setup</a> feature is in use.</dd>
</dl>
+<h2>Preferred port mapping interface</h2>
+<p cshelp="IDH_SETTINGS_CONNECTIVITY_MAPPER">
+DC++ has several interfaces available it can use to try to automatically map the ports it requires
+on the router:
+<li>
+<ul>NAT-PMP: A lightweight protocol that is not widely used by generic routers; but open-source
+ firmwares generally implement it.</ul>
+<ul>MiniUPnP: An open-source UPnP library.</ul>
+<ul>Windows UPnP: Use Windows discovery services. Note that the DC++ implementation of Windows UPnP
+ is partial and prone to random failures. MiniUPnP is recommended instead.</ul>
+</li>
+The interface selected here will be tried first; other available interfaces will then be tried if
+the preferred port mapping interface were to fail.
+</p>
+
<h2>Bind address</h2>
<p cshelp="IDH_SETTINGS_CONNECTIVITY_BIND_ADDRESS">
This setting allows you to bind DC++ to a particular IP address on your machine. Most users do not
@@ -108,7 +122,7 @@
connected to the Internet, you can force DC++ to use a particular connection by entering its IP
here. If binding fails, it will do so silently and INADDR_ANY will be used instead. This value is
ignored when
-<a href="settings_connectivity.html#autoconn">Automatic incoming connection type detection</a> is
+<a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> is
enabled. (default: 0.0.0.0)
</p>
</body>
=== modified file 'help/window_system_log.html'
--- help/window_system_log.html 2011-04-07 13:40:55 +0000
+++ help/window_system_log.html 2011-04-11 20:39:22 +0000
@@ -40,14 +40,14 @@
<dd>As <a href="settings_certs.html">Security certificates</a> enabled but no existing TLS certificate files found (or they are invalid), new certificate files generated in the 'Certificates' subfolder of the directory where DC++ configuraton files are stored.</dd>
<dt>Port mapping: Successfully created port mappings (Transfers: [port1], Searches: [port2], Encrypted transfers: [port3]) on the [router name] device with the [interface identification] interface</dt>
<dd>DC++ has managed to automatically create port forwarding rules on the router with <a href="faq_mapping.html">NAT-PMP or UPnP</a>.</dd>
- <dt>Connectivity: Determining connection type...</dt>
- <dd>This message signs that <a href="settings_connectivity.html#autoconn">Automatic incoming connection type detection</a> is started.</dd>
+ <dt>Connectivity: Determining the best connectivity settings...</dt>
+ <dd>This message signals that <a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> has started.</dd>
<dt>Connectivity: Public IP address detected, selecting active mode with direct connection</dt>
- <dd>It means that <a href="settings_connectivity.html#autoconn">Automatic connection type detection</a> determined that you have a public IP address so it assumed that you are directly connected to the Internet. The appropriate connection type selected.</dd>
+ <dd>It means that <a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> determined that you have a public IP address so it assumed that you are directly connected to the Internet.</dd>
<dt>Connectivity: Local network with possible NAT detected, trying to map the ports using UPnP...</dt>
- <dd><a href="settings_connectivity.html#autoconn">Automatic connection type detection</a> determined that you have a <a href="non-routable.html">private</a> IP address and it started to discover for a possible UPnP capable gateway (router).</dd>
+ <dd><a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> determined that you have a <a href="non-routable.html">private</a> IP address and it started to discover for a possible UPnP capable gateway (router).</dd>
<dt>Connectivity: Automatic setup of active mode has failed. You may want to set up your connection manually for better connectivity</dt>
- <dd><a href="settings_connectivity.html#autoconn">Automatic incoming connection type detection</a> did not find any way to configure any kind of active connection so as a last resort it selected passive connection mode with <a href="http://en.wikipedia.org/wiki/NAT_traversal" target="_blank" class="external">NAT traversal</a> capability.</dd>
+ <dd><a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> did not find any way to configure any kind of active connection so as a last resort it selected passive connection mode with <a href="http://en.wikipedia.org/wiki/NAT_traversal" target="_blank" class="external">NAT traversal</a> capability.</dd>
</dl>
<h2>Error messages</h2>
@@ -59,18 +59,18 @@
<dd>These errors mean that DC++ was unable to register the appropriate link handler(s) in Windows, per the <a href="settings_advanced.html#registrymagnet">Register with Windows to handle magnet: URI links</a> and <a href="settings_advanced.html#registrydchubadc">Register with Windows to handle dchub://, adc:// and adcs:// URL links</a> settings. The most common reason of an unsuccesful registration is that the user account under which DC++ is running does not have appropriate rights for (write) access the required parts of the Windows Registry.</dd>
<dt>Port mapping: Failed to get external IP</dt>
<dd>This error message can appear when DC++ tries to map ports for incoming connections via NAT-PMP / UPnP and means that although port mappings were successful, DC++ couldn't get the external IP address from the UPnP device. If this message persists, it may be because of broken NAT-PMP / UPnP support of the device. This is not very important, since DC++ can still gather the external IP from connected hubs <a href="settings_connectivity_manual.html#noipoverride">if it is allowed to do so</a>.</dd>
- <dt>UPnP: Failed to create port mappings</dt>
- <dd>This error message can appear when DC++ tries to map ports for incoming connections via UPnP. It means that no UPnP device can be found or its not responding. It can happen that you get this message when <a href="settings_connectivity.html#autoconn">Automatic connection type detection</a> is enabled as DC++ trying to discover a possible UPnP device for setting up active mode. This message is a real problem only if you selected the 'Use UPnP to let DC++ configure my router' option manually in <a href="settings_connectivity_manual.html#connection">Incoming connection settings</a>. In this case refer to the <a href="faq_upnp.html">UPnP FAQ</a> for more information.</dd>
- <dt>UPnP: Failed to remove port mappings</dt>
+ <dt>Port mapping: Failed to create port mappings</dt>
+ <dd>This error message can appear when DC++ tries to map ports for incoming connections via NAT-PMP / UPnP. It means that no compatible device could be found or that the device in question is not responding. This message can occur during <a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a>, when DC++ is trying to discover a possible NAT-PMP / UPnP device for setting up active mode. This message is a real problem only if you selected the 'Use UPnP to let DC++ configure my router' option manually in <a href="settings_connectivity_manual.html#connection">Incoming connection settings</a>. In this case, refer to the <a href="faq_mapping.html">port mapping FAQ</a> for more information.</dd>
+ <dt>Port mapping: Failed to remove port mappings</dt>
<dd>This message can appear mostly at shutdown of DC++ and means that UPnP port mappings created before couldn't be successfully removed. If this message persists the most probable reason is broken UPnP support of the (router) device.</dd>
- <dt>UPnP: Another UPnP port mapping attempt is in progress...</dt>
- <dd>This means that an <a href="settings_connectivity.html#autoconn">automatic connection type detection</a> attempt was started too soon (the previous operation has not been finished). Try restarting DC++ if this message persists. If restart DC++ does not help the most probable reason is broken UPnP support of your (router) device.</dd>
- <dt>UPnP: Failed to initalize the [interface name] interface</dt>
+ <dt>Port mapping: Another UPnP port mapping attempt is in progress...</dt>
+ <dd>This means that an <a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> attempt was started too soon (the previous operation has not been finished). Try restarting DC++ if this message persists. If restart DC++ does not help the most probable reason is broken UPnP support of your (router) device.</dd>
+ <dt>Port mapping: Failed to initalize the [interface name] interface</dt>
<dd>DC++ failed to initalize one of its UPnP interface and will try to use the next one in the row.</dd>
- <dt>UPnP: The [interface name] interface has failed to map the [TCP/UDP/TLS] [port number] port</dt>
+ <dt>Port mapping: The [interface name] interface has failed to map the [TCP/UDP/TLS] [port number] port</dt>
<dd>The currently used UPnP interface failed to map the shown port. DC++ will try to use the next UPnP interface in the row.</dd>
<dt>Connectivity: Unable to open TCP/UDP/TLS port(s). You must set up your connection manually</dt>
- <dd>You can get this message only when <a href="settings_connectivity.html#autoconn">Automatic connection type detection</a> is enabled and DC++ failed to open port(s) before trying to determine the available conncetion types. Possible reasons include the choosen port(s) are already occupied by another application or DC++ is blocked by a <a href="get_started.html#firewall">software firewall</a>.</dd>
+ <dd>You can get this message only when <a href="settings_connectivity.html#autoconn">Automatic connectivity setup</a> is enabled and DC++ failed to open port(s) before trying to determine the available conncetion types. Possible reasons include the choosen port(s) are already occupied by another application or DC++ is blocked by a <a href="get_started.html#firewall">software firewall</a>.</dd>
<dt>Not listening for connections - please restart DC++</dt>
<dd>An unrecoverable low level networking error keeps DC++ from listening for connections. Search and download won't work until you restart DC++.</dd>
<dt>Connectivity error: [error message]</dt>
=== modified file 'win32/ConnectivityManualPage.cpp'
--- win32/ConnectivityManualPage.cpp 2011-04-07 13:40:55 +0000
+++ win32/ConnectivityManualPage.cpp 2011-04-11 20:39:22 +0000
@@ -27,8 +27,12 @@
#include <dcpp/SettingsManager.h>
#include "WinUtil.h"
+#include <boost/range/algorithm/for_each.hpp>
+
ConnectivityManualPage::ConnectivityManualPage(dwt::Widget* parent) :
PropPage(parent, 8, 1),
+autoGroup(0),
+autoDetect(0),
directIn(0),
upnp(0),
nat(0),
@@ -45,7 +49,15 @@
grid->column(0).mode = GridInfo::FILL;
- directIn = grid->addChild(RadioButton::Seed(T_("My computer is directly connected to Internet (no router)")));
+ {
+ autoGroup = grid->addChild(GroupBox::Seed(T_("Automatic connectivity setup")));
+ autoGroup->setHelpId(IDH_SETTINGS_CONNECTIVITY_AUTODETECT);
+
+ autoDetect = autoGroup->addChild(CheckBox::Seed(T_("Let DC++ determine the best connectivity settings")));
+ autoDetect->onClicked([this] { handleAutoClicked(); });
+ }
+
+ directIn = grid->addChild(RadioButton::Seed(T_("My computer is directly connected to the Internet (no router)")));
directIn->setHelpId(IDH_SETTINGS_CONNECTIVITY_DIRECT);
upnp = grid->addChild(RadioButton::Seed(T_("Let DC++ configure my router (NAT-PMP / UPnP)")));
@@ -93,21 +105,24 @@
items.push_back(Item(tls, SettingsManager::TLS_PORT, PropPage::T_INT));
}
- mapper = grid->addChild(GroupBox::Seed(T_("Preferred port mapping interface")))->addChild(WinUtil::Seeds::Dialog::comboBox);
-
{
- GroupBoxPtr group = grid->addChild(GroupBox::Seed(T_("Bind address")));
+ auto cur = grid->addChild(Grid::Seed(1, 2));
+ cur->column(1).mode = GridInfo::FILL;
+
+ auto group = cur->addChild(GroupBox::Seed(T_("Preferred port mapping interface")));
+ group->setHelpId(IDH_SETTINGS_CONNECTIVITY_MAPPER);
+
+ mapper = group->addChild(WinUtil::Seeds::Dialog::comboBox);
+
+ group = cur->addChild(GroupBox::Seed(T_("Bind address")));
group->setHelpId(IDH_SETTINGS_CONNECTIVITY_BIND_ADDRESS);
bindAddress = group->addChild(WinUtil::Seeds::Dialog::textBox);
items.push_back(Item(bindAddress, SettingsManager::BIND_ADDRESS, PropPage::T_STR));
}
- PropPage::read(items);
-
- setGroupEnabled();
- setRadioButtons();
- fillMappers();
+ read();
+ updateAuto();
ConnectivityManager::getInstance()->addListener(this);
}
@@ -134,28 +149,28 @@
SettingsManager::getInstance()->set(SettingsManager::INCOMING_CONNECTIONS, c);
}
- auto sel = mapper->getSelected();
- SettingsManager::getInstance()->set(SettingsManager::MAPPER, sel ? Text::fromT(mapper->getValue(sel)) : Util::emptyString);
-}
-
-void ConnectivityManualPage::setGroupEnabled() {
- grid->setEnabled(!BOOLSETTING(AUTO_DETECT_CONNECTION));
-}
-
-void ConnectivityManualPage::setRadioButtons() {
+ SettingsManager::getInstance()->set(SettingsManager::MAPPER, Text::fromT(mapper->getText()));
+}
+
+void ConnectivityManualPage::handleAutoClicked() {
+ // apply immediately so that ConnectivityManager updates.
+ SettingsManager::getInstance()->set(SettingsManager::AUTO_DETECT_CONNECTION, autoDetect->getChecked());
+ ConnectivityManager::getInstance()->fire(ConnectivityManagerListener::SettingChanged());
+}
+
+void ConnectivityManualPage::read() {
switch(SETTING(INCOMING_CONNECTIONS)) {
case SettingsManager::INCOMING_FIREWALL_UPNP: upnp->setChecked(); break;
case SettingsManager::INCOMING_FIREWALL_NAT: nat->setChecked(); break;
case SettingsManager::INCOMING_FIREWALL_PASSIVE: passive->setChecked(); break;
default: directIn->setChecked(); break;
}
-}
-
-void ConnectivityManualPage::fillMappers() {
+
+ PropPage::read(items);
+
const auto& setting = SETTING(MAPPER);
int sel = 0;
- mapper->addValue(_T("All of them"));
auto mappers = MappingManager::getInstance()->getMappers();
for(auto i = mappers.cbegin(), iend = mappers.cend(); i != iend; ++i) {
const auto& name = *i;
@@ -167,21 +182,31 @@
mapper->setSelected(sel);
}
+void ConnectivityManualPage::updateAuto() {
+ bool setting = BOOLSETTING(AUTO_DETECT_CONNECTION);
+ autoDetect->setChecked(setting);
+
+ auto controls = grid->getChildren<Control>();
+ boost::for_each(controls, [this, setting](Control* control) {
+ if(control != autoGroup) {
+ control->setEnabled(!setting);
+ }
+ });
+}
+
void ConnectivityManualPage::on(Finished) noexcept {
callAsync([this] {
directIn->setChecked(false);
upnp->setChecked(false);
nat->setChecked(false);
passive->setChecked(false);
- setRadioButtons();
-
- this->PropPage::read(items);
mapper->clear();
- fillMappers();
+
+ read();
});
}
void ConnectivityManualPage::on(SettingChanged) noexcept {
- callAsync([this] { setGroupEnabled(); });
+ callAsync([this] { updateAuto(); });
}
=== modified file 'win32/ConnectivityManualPage.h'
--- win32/ConnectivityManualPage.h 2011-04-07 13:40:55 +0000
+++ win32/ConnectivityManualPage.h 2011-04-11 20:39:22 +0000
@@ -34,6 +34,9 @@
private:
ItemList items;
+ GroupBoxPtr autoGroup;
+ CheckBoxPtr autoDetect;
+
RadioButtonPtr directIn;
RadioButtonPtr upnp;
RadioButtonPtr nat;
@@ -50,9 +53,10 @@
TextBoxPtr bindAddress;
- void setGroupEnabled();
- void setRadioButtons();
- void fillMappers();
+ void handleAutoClicked();
+
+ void read();
+ void updateAuto();
// ConnectivityManagerListener
virtual void on(Finished) noexcept;
=== modified file 'win32/ConnectivityPage.cpp'
--- win32/ConnectivityPage.cpp 2011-04-07 13:40:55 +0000
+++ win32/ConnectivityPage.cpp 2011-04-11 20:39:22 +0000
@@ -38,18 +38,19 @@
grid->row(0).align = GridInfo::STRETCH;
{
- GroupBoxPtr autoGroup = grid->addChild(GroupBox::Seed(T_("Automatic connection type detection")));
- GridPtr cur = autoGroup->addChild(Grid::Seed(2, 1));
+ auto group = grid->addChild(GroupBox::Seed(T_("Automatic connectivity setup")));
+ group->setHelpId(IDH_SETTINGS_CONNECTIVITY_AUTODETECT);
+
+ auto cur = group->addChild(Grid::Seed(2, 1));
cur->column(0).mode = GridInfo::FILL;
cur->row(1).mode = GridInfo::FILL;
cur->row(1).align = GridInfo::STRETCH;
- GridPtr cur2 = cur->addChild(Grid::Seed(1, 2));
+ auto cur2 = cur->addChild(Grid::Seed(1, 2));
cur2->column(1).mode = GridInfo::FILL;
cur2->column(1).align = GridInfo::BOTTOM_RIGHT;
- autoDetect = cur2->addChild(CheckBox::Seed(T_("Enable automatic incoming connection type detection")));
- autoDetect->setHelpId(IDH_SETTINGS_CONNECTIVITY_AUTODETECT);
+ autoDetect = cur2->addChild(CheckBox::Seed(T_("Let DC++ determine the best connectivity settings")));
items.push_back(Item(autoDetect, SettingsManager::AUTO_DETECT_CONNECTION, PropPage::T_BOOL));
autoDetect->onClicked([this] { handleAutoClicked(); });
@@ -57,12 +58,12 @@
detectNow->setHelpId(IDH_SETTINGS_CONNECTIVITY_DETECT_NOW);
detectNow->onClicked([] { ConnectivityManager::getInstance()->detectConnection(); });
- GroupBoxPtr logGroup = cur->addChild(GroupBox::Seed(T_("Detection log")));
- logGroup->setHelpId(IDH_SETTINGS_CONNECTIVITY_DETECTION_LOG);
+ group = cur->addChild(GroupBox::Seed(T_("Detection log")));
+ group->setHelpId(IDH_SETTINGS_CONNECTIVITY_DETECTION_LOG);
auto seed = WinUtil::Seeds::Dialog::richTextBox;
seed.lines = 0;
- log = logGroup->addChild(seed);
+ log = group->addChild(seed);
}
PropPage::read(items);
@@ -109,6 +110,8 @@
void ConnectivityPage::on(SettingChanged) noexcept {
callAsync([this] {
- detectNow->setEnabled(BOOLSETTING(AUTO_DETECT_CONNECTION) && !ConnectivityManager::getInstance()->isRunning());
+ bool setting = BOOLSETTING(AUTO_DETECT_CONNECTION);
+ autoDetect->setChecked(setting);
+ detectNow->setEnabled(setting && !ConnectivityManager::getInstance()->isRunning());
});
}
=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp 2011-04-07 13:40:55 +0000
+++ win32/HubFrame.cpp 2011-04-11 20:39:22 +0000
@@ -377,7 +377,7 @@
} else if(Util::stricmp(cmd.c_str(), _T("userlist")) == 0) {
showUsers->setChecked(!showUsers->getChecked());
} else if(Util::stricmp(cmd.c_str(), _T("connection")) == 0) {
- addStatus(str(TF_("IP: %1%, Port: %2%/%3%/%4%") % Text::toT(client->getLocalIp())
+ addStatus(str(TF_("IP: %1%, Transfer port: %2%, Search port: %3%, Encrypted transfer port: %4%") % Text::toT(client->getLocalIp())
% ConnectionManager::getInstance()->getPort()
% SearchManager::getInstance()->getPort()
% ConnectionManager::getInstance()->getSecurePort()
=== modified file 'win32/PropPage.cpp'
--- win32/PropPage.cpp 2011-04-05 19:16:53 +0000
+++ win32/PropPage.cpp 2011-04-11 20:39:22 +0000
@@ -134,6 +134,10 @@
box->setText(target);
}
+dwt::Point PropPage::getPreferredSize() {
+ return grid->getPreferredSize();
+}
+
void PropPage::handleListHelp(TablePtr list, unsigned id) {
// we have the help id of the whole list-view; convert to the one of the specific option the user wants help for
int item =
=== modified file 'win32/PropPage.h'
--- win32/PropPage.h 2011-04-05 19:16:53 +0000
+++ win32/PropPage.h 2011-04-11 20:39:22 +0000
@@ -67,11 +67,14 @@
void handleBrowseFile(TextBoxPtr box, int setting);
GridPtr grid;
+
private:
- unordered_map<TablePtr, const ListItem*> lists;
+ virtual dwt::Point getPreferredSize();
void handleListHelp(TablePtr list, unsigned id);
void handleListHelpId(TablePtr list, unsigned& id);
+
+ unordered_map<TablePtr, const ListItem*> lists;
};
#endif // !defined(PROP_PAGE_H)
=== modified file 'win32/SettingsDialog.cpp'
--- win32/SettingsDialog.cpp 2011-04-07 14:57:29 +0000
+++ win32/SettingsDialog.cpp 2011-04-11 20:39:22 +0000
@@ -18,8 +18,14 @@
#include "stdafx.h"
+#include "resource.h"
+
#include "SettingsDialog.h"
-#include "resource.h"
+
+#include <dcpp/SettingsManager.h>
+
+#include <dwt/util/GDI.h>
+#include <dwt/widgets/ScrolledContainer.h>
#include "WinUtil.h"
@@ -59,10 +65,15 @@
{
onInitDialog([this] { return initDialog(); });
onHelp([this](Control* c, unsigned id) { handleHelp(c, id); });
+ onClosing([this] { return handleClosing(); });
}
int SettingsDialog::run() {
- create(Seed(dwt::Point(700, 580), DS_CONTEXTHELP));
+ auto sizeVal = [](SettingsManager::IntSetting setting) {
+ return std::max(SettingsManager::getInstance()->get(setting), 100) * dwt::util::dpiFactor();
+ };
+ create(Seed(dwt::Point(sizeVal(SettingsManager::SETTINGS_WIDTH), sizeVal(SettingsManager::SETTINGS_HEIGHT)),
+ WS_SIZEBOX | DS_CONTEXTHELP));
return show();
}
@@ -109,48 +120,43 @@
tree->onSelectionChanged([this] { handleSelectionChanged(); });
}
- Grid::Seed seed(1, 1);
- seed.style |= WS_BORDER;
- cur = cur->addChild(seed);
- cur->column(0).mode = GridInfo::FILL;
- cur->row(0).mode = GridInfo::FILL;
- cur->row(0).align = GridInfo::STRETCH;
-
- addPage(T_("Personal information"), new GeneralPage(cur));
-
- {
- HTREEITEM item = addPage(T_("Connectivity"), new ConnectivityPage(cur));
- addPage(T_("Manual configuration"), new ConnectivityManualPage(cur), item);
- addPage(T_("Bandwidth limiting"), new BandwidthLimitPage(cur), item);
- addPage(T_("Proxy"), new ProxyPage(cur), item);
- }
-
- {
- HTREEITEM item = addPage(T_("Downloads"), new DownloadPage(cur));
- addPage(T_("Favorites"), new FavoriteDirsPage(cur), item);
- addPage(T_("Queue"), new QueuePage(cur), item);
- }
-
- addPage(T_("Sharing"), new UploadPage(cur));
-
- {
- HTREEITEM item = addPage(T_("Appearance"), new AppearancePage(cur));
- addPage(T_("Colors and sounds"), new Appearance2Page(cur), item);
- addPage(T_("Tabs"), new TabsPage(cur), item);
- addPage(T_("Windows"), new WindowsPage(cur), item);
- }
-
- {
- HTREEITEM item = addPage(T_("History"), new HistoryPage(cur));
- addPage(T_("Logs"), new LogPage(cur), item);
- }
-
- {
- HTREEITEM item = addPage(T_("Advanced"), new AdvancedPage(cur));
- addPage(T_("Experts only"), new ExpertsPage(cur), item);
- addPage(T_("User commands"), new UCPage(cur), item);
- addPage(T_("Security certificates"), new CertificatesPage(cur), item);
- addPage(T_("Search types"), new SearchTypesPage(cur), item);
+ auto container = cur->addChild(dwt::ScrolledContainer::Seed(WS_BORDER));
+
+ addPage(T_("Personal information"), new GeneralPage(container));
+
+ {
+ HTREEITEM item = addPage(T_("Connectivity"), new ConnectivityPage(container));
+ addPage(T_("Manual configuration"), new ConnectivityManualPage(container), item);
+ addPage(T_("Bandwidth limiting"), new BandwidthLimitPage(container), item);
+ addPage(T_("Proxy"), new ProxyPage(container), item);
+ }
+
+ {
+ HTREEITEM item = addPage(T_("Downloads"), new DownloadPage(container));
+ addPage(T_("Favorites"), new FavoriteDirsPage(container), item);
+ addPage(T_("Queue"), new QueuePage(container), item);
+ }
+
+ addPage(T_("Sharing"), new UploadPage(container));
+
+ {
+ HTREEITEM item = addPage(T_("Appearance"), new AppearancePage(container));
+ addPage(T_("Colors and sounds"), new Appearance2Page(container), item);
+ addPage(T_("Tabs"), new TabsPage(container), item);
+ addPage(T_("Windows"), new WindowsPage(container), item);
+ }
+
+ {
+ HTREEITEM item = addPage(T_("History"), new HistoryPage(container));
+ addPage(T_("Logs"), new LogPage(container), item);
+ }
+
+ {
+ HTREEITEM item = addPage(T_("Advanced"), new AdvancedPage(container));
+ addPage(T_("Experts only"), new ExpertsPage(container), item);
+ addPage(T_("User commands"), new UCPage(container), item);
+ addPage(T_("Security certificates"), new CertificatesPage(container), item);
+ addPage(T_("Search types"), new SearchTypesPage(container), item);
}
}
@@ -174,8 +180,8 @@
cur->column(0).align = GridInfo::BOTTOM_RIGHT;
WinUtil::addDlgButtons(cur,
- [this] { handleOKClicked(); },
- [this] { GCC_WTF->endDialog(IDCANCEL); });
+ [this] { handleClosing(); handleOKClicked(); },
+ [this] { handleClosing(); GCC_WTF->endDialog(IDCANCEL); });
Button::Seed seed(T_("Help"));
seed.padding.x = 10;
@@ -199,8 +205,8 @@
updateTitle();
- layout();
centerWindow();
+ onWindowPosChanged([this](const dwt::Rectangle &) { layout(); });
return false;
}
@@ -222,7 +228,6 @@
}
HTREEITEM SettingsDialog::addPage(const tstring& title, PropPage* page, HTREEITEM parent) {
- static_cast<GridPtr>(page->getParent())->setWidget(page, 0, 0);
pages.push_back(page);
return tree->insert(title, parent, reinterpret_cast<LPARAM>(page), true);
}
@@ -233,6 +238,16 @@
WinUtil::help(widget, id);
}
+bool SettingsDialog::handleClosing() {
+ dwt::Point pt = getWindowSize();
+ SettingsManager::getInstance()->set(SettingsManager::SETTINGS_WIDTH,
+ static_cast<int>(static_cast<float>(pt.x) / dwt::util::dpiFactor()));
+ SettingsManager::getInstance()->set(SettingsManager::SETTINGS_HEIGHT,
+ static_cast<int>(static_cast<float>(pt.y) / dwt::util::dpiFactor()));
+
+ return true;
+}
+
void SettingsDialog::handleSelectionChanged() {
PropPage* page = reinterpret_cast<PropPage*>(tree->getData(tree->getSelected()));
if(page) {
@@ -241,7 +256,7 @@
currentPage = 0;
}
- page->setVisible(true);
+ ::SetWindowPos(page->handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER | SWP_SHOWWINDOW);
currentPage = page;
updateTitle();
@@ -288,4 +303,6 @@
void SettingsDialog::layout() {
dwt::Point sz = getClientSize();
grid->resize(dwt::Rectangle(8, 8, sz.x - 16, sz.y - 16));
+
+ currentPage->getParent()->layout();
}
=== modified file 'win32/SettingsDialog.h'
--- win32/SettingsDialog.h 2011-01-02 17:12:02 +0000
+++ win32/SettingsDialog.h 2011-04-11 20:39:22 +0000
@@ -51,6 +51,7 @@
static BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam);
void handleChildHelp(dwt::Control* widget);
void handleHelp(dwt::Control* widget, unsigned id);
+ bool handleClosing();
void handleSelectionChanged();
void handleOKClicked();
void handleCtrlTab(bool shift);