linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #02648
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2325: Repurpose passive user icons to mean "no free slot"
------------------------------------------------------------
revno: 2325
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-12-03 18:09:58 +0100
message:
Repurpose passive user icons to mean "no free slot"
modified:
changelog.txt
dcpp/AdcHub.cpp
dcpp/UploadManager.cpp
dcpp/UploadManager.h
help/faq_different_icons.html
help/index.html
win32/HubFrame.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 'changelog.txt'
--- changelog.txt 2010-12-03 16:34:54 +0000
+++ changelog.txt 2010-12-03 17:09:58 +0000
@@ -45,6 +45,7 @@
* [L#250149] Retry on more possible Coral errors (emtee)
* [L#260748] Really readded sfv check (was broken by segmented downloading) (emtee)
* Update bzip2 to version 1.0.6
+* Repurpose passive user icons to mean "no free slot" (poy)
-- 0.770 2010-07-05 --
* [L#550300] Catch more potential file corruptions (thanks bigmuscle)
=== modified file 'dcpp/AdcHub.cpp'
--- dcpp/AdcHub.cpp 2010-12-03 16:16:35 +0000
+++ dcpp/AdcHub.cpp 2010-12-03 17:09:58 +0000
@@ -33,6 +33,7 @@
#include "CryptoManager.h"
#include "LogManager.h"
#include "ThrottleManager.h"
+#include "UploadManager.h"
#include <cmath>
@@ -965,6 +966,7 @@
addParam(lastInfoMap, c, "NI", getCurrentNick());
addParam(lastInfoMap, c, "DE", getCurrentDescription());
addParam(lastInfoMap, c, "SL", Util::toString(SETTING(SLOTS)));
+ addParam(lastInfoMap, c, "FS", Util::toString(UploadManager::getInstance()->getFreeSlots()));
addParam(lastInfoMap, c, "SS", ShareManager::getInstance()->getShareSizeString());
addParam(lastInfoMap, c, "SF", Util::toString(ShareManager::getInstance()->getSharedFiles()));
addParam(lastInfoMap, c, "EM", SETTING(EMAIL));
=== modified file 'dcpp/UploadManager.cpp'
--- dcpp/UploadManager.cpp 2010-08-27 13:47:33 +0000
+++ dcpp/UploadManager.cpp 2010-12-03 17:09:58 +0000
@@ -41,7 +41,7 @@
static const string UPLOAD_AREA = "Uploads";
-UploadManager::UploadManager() throw() : running(0), extra(0), lastGrant(0) {
+UploadManager::UploadManager() throw() : running(0), extra(0), lastGrant(0), lastFreeSlots(-1) {
ClientManager::getInstance()->addListener(this);
TimerManager::getInstance()->addListener(this);
}
@@ -455,6 +455,12 @@
Util::toString(ClientManager::getInstance()->getNicks((*i)->getCID(), Util::emptyString))));
ConnectionManager::getInstance()->disconnect(*i, false);
}
+
+ int freeSlots = getFreeSlots();
+ if(freeSlots != lastFreeSlots) {
+ lastFreeSlots = freeSlots;
+ ClientManager::getInstance()->infoUpdated();
+ }
}
void UploadManager::on(GetListLength, UserConnection* conn) throw() {
=== modified file 'dcpp/UploadManager.h'
--- dcpp/UploadManager.h 2010-08-27 13:47:33 +0000
+++ dcpp/UploadManager.h 2010-12-03 17:09:58 +0000
@@ -69,7 +69,6 @@
GETSET(uint64_t, lastGrant, LastGrant);
private:
-
UploadList uploads;
mutable CriticalSection cs;
@@ -77,6 +76,8 @@
typedef SlotSet::iterator SlotIter;
SlotSet reservedSlots;
+ int lastFreeSlots; /// amount of free slots at the previous minute
+
typedef pair<HintedUser, uint64_t> WaitingUser;
typedef list<WaitingUser> WaitingUserList;
=== modified file 'help/faq_different_icons.html'
--- help/faq_different_icons.html 2010-07-17 18:37:34 +0000
+++ help/faq_different_icons.html 2010-12-03 17:09:58 +0000
@@ -6,16 +6,16 @@
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<body>
-<h1>What do the different icons mean?</h1>
+<h1>What do the different user icons mean?</h1>
<dl style="margin-left: 40px;">
<dt>Green</dt>
- <dd>Normal icon (no DC++ user)</dd>
+ <dd>Standard user icon (no particular attribute).</dd>
<dt>Blue</dt>
<dd>DC++ user (identified on 1st direct connection to this user)</dd>
- <dt>With Bricks</dt>
- <dd>User may not connectable (both peers are in passive mode)</dd>
- <dt>With Key</dt>
- <dd>User is an Operator</dd>
+ <dt>With bricks</dt>
+ <dd>The user has no free slot available.</dd>
+ <dt>With a yellow key</dt>
+ <dd>The user is a hub operator.</dd>
</dl>
<img src="users.bmp" alt="User Icons"/>
</body>
=== modified file 'help/index.html'
--- help/index.html 2010-09-05 16:52:38 +0000
+++ help/index.html 2010-12-03 17:09:58 +0000
@@ -119,7 +119,7 @@
<li><placeholder><a href="faq_university.html">My ISP or University blocks DC++</a></placeholder></li>
<li><placeholder><a href="faq_nosearch.html">Why don't I get any search results?</a></placeholder></li>
<li><placeholder><a href="faq_slowdownload.html">Why am I getting slow download speeds?</a></placeholder></li>
-<li><placeholder><a href="faq_different_icons.html">What do the different icons mean?</a></placeholder></li>
+<li><placeholder><a href="faq_different_icons.html">What do the different user icons mean?</a></placeholder></li>
<li><placeholder><a href="faq_units.html">What do the units mean?</a></placeholder></li>
<li><placeholder><a href="faq_install.html">How do I install/uninstall/upgrade DC++?</a></placeholder></li>
<li><placeholder><a href="faq_secret.html">What secret stuff are there?</a></placeholder></li>
=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp 2010-11-30 18:21:53 +0000
+++ win32/HubFrame.cpp 2010-12-03 17:09:58 +0000
@@ -706,11 +706,13 @@
int image = identity.isOp() ? IMAGE_OP : IMAGE_USER;
if(identity.getUser()->isSet(User::DCPLUSPLUS))
- image+=2;
- if(SETTING(INCOMING_CONNECTIONS) == SettingsManager::INCOMING_FIREWALL_PASSIVE && !identity.isTcpActive()) {
- // Users we can't connect to...
- image+=4;
+ image += 2;
+
+ string freeSlots = identity.get("FS");
+ if(!freeSlots.empty() && Util::toUInt(freeSlots) == 0) {
+ image += 4;
}
+
return image;
}