linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #05460
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2887: Restore "Get file list" for the time being
------------------------------------------------------------
revno: 2887
committer: eMTee <emtee11@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Wed 2012-03-21 23:50:43 +0100
message:
Restore "Get file list" for the time being
modified:
changelog.txt
help/commands_user_general.inc
win32/QueueFrame.cpp
win32/QueueFrame.h
win32/UserInfoBase.cpp
win32/UserInfoBase.h
win32/WinUtil.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 2012-03-21 06:04:32 +0000
+++ changelog.txt 2012-03-21 22:50:43 +0000
@@ -2,7 +2,7 @@
* Apply ADL searches in partial file lists (poy)
* Heuristics to send additional levels of info in partial file lists (poy)
* Add a "Download full list" button in the file list toolbar (poy)
-* "Get file list" now defaults to partial file lists (poy)
+* "Browse file list" is now available everywhere (works for peers with ADC partial file list support only) (poy)
* Reclaim memory after a file list match
* Improve file reading operations
* [L#678432] Context-sensitive help tooltips in the settings dialog (poy)
=== modified file 'help/commands_user_general.inc'
--- help/commands_user_general.inc 2012-01-07 18:16:19 +0000
+++ help/commands_user_general.inc 2012-03-21 22:50:43 +0000
@@ -1,6 +1,8 @@
<dl style="margin-left: 40px;">
<dt>Get file list</dt>
<dd>Download the file list of the selected users.</dd>
+ <dt>Browse file list</dt>
+ <dd>Download only the required pieces of the file lists of the selected users in form of a partial file list. Note that you may not able to fully exploit certain file list functions in a partial list window until you get the whole list using the "Download full list" button.</dd>
<dt>Match queue</dt>
<dd>Matches the files in your download queue to the file lists of the selected
users. 2 files are considered to be the same if their TTH is the same. If matches are found in one user's file list,
=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp 2012-03-03 19:33:45 +0000
+++ win32/QueueFrame.cpp 2012-03-21 22:50:43 +0000
@@ -656,7 +656,8 @@
}
}
-void QueueFrame::handleGetList(const HintedUser& user) {
+void QueueFrame::handleBrowseList(const HintedUser& user) {
+
if(files->countSelected() == 1) {
try {
QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_PARTIAL_LIST);
@@ -882,7 +883,7 @@
void QueueFrame::addBrowseMenu(Menu* menu, QueueItemInfo* qii) {
auto pos = menu->size();
auto sub = menu->appendPopup(T_("&Get file list"));
- if(!addUsers(sub, &QueueFrame::handleGetList, qii->getSources(), false))
+ if(!addUsers(sub, &QueueFrame::handleBrowseList, qii->getSources(), false))
menu->setItemEnabled(pos, false);
}
=== modified file 'win32/QueueFrame.h'
--- win32/QueueFrame.h 2012-01-22 20:27:14 +0000
+++ win32/QueueFrame.h 2012-03-21 22:50:43 +0000
@@ -269,7 +269,7 @@
void handlePM(const HintedUser& user);
void handleRemoveSource(const HintedUser& user);
void handleRemoveSources(const HintedUser& user);
- void handleGetList(const HintedUser& user);
+ void handleBrowseList(const HintedUser& user);
void handleReadd(const HintedUser& user);
bool handleKeyDownFiles(int c);
bool handleKeyDownDirs(int c);
=== modified file 'win32/UserInfoBase.cpp'
--- win32/UserInfoBase.cpp 2012-01-13 20:55:20 +0000
+++ win32/UserInfoBase.cpp 2012-03-21 22:50:43 +0000
@@ -42,12 +42,20 @@
}
void UserInfoBase::getList() {
try {
+ QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW);
+ } catch(const Exception& e) {
+ LogManager::getInstance()->message(e.getError());
+ }
+}
+void UserInfoBase::browseList() {
+ if(user.user->getCID().isZero())
+ return;
+ try {
QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_PARTIAL_LIST);
} catch(const Exception& e) {
LogManager::getInstance()->message(e.getError());
}
}
-
void UserInfoBase::addFav() {
FavoriteManager::getInstance()->addFavoriteUser(user);
}
=== modified file 'win32/UserInfoBase.h'
--- win32/UserInfoBase.h 2012-01-22 20:27:14 +0000
+++ win32/UserInfoBase.h 2012-03-21 22:50:43 +0000
@@ -38,6 +38,7 @@
UserInfoBase(const HintedUser& u, bool hubSet = false) : user(u), hubSet(hubSet) { }
virtual void getList();
+ virtual void browseList();
virtual void matchQueue();
virtual void pm(TabViewPtr);
virtual void grant();
@@ -109,6 +110,9 @@
void handleGetList() {
handleUserFunction([](UserInfoBase* u) { u->getList(); });
}
+ void handleBrowseList() {
+ handleUserFunction([](UserInfoBase* u) { u->browseList(); });
+ }
void handleAddFavorite() {
handleUserFunction([](UserInfoBase* u) { u->addFav(); });
}
@@ -137,6 +141,7 @@
for_each(users, [&](const UserInfoBase* u) { traits.parse(u); });
menu->appendItem(T_("&Get file list"), [this] { this->t().handleGetList(); }, dwt::IconPtr(), true, defaultIsGetList);
+ menu->appendItem(T_("&Browse file list"), [this] { this->t().handleBrowseList(); });
menu->appendItem(T_("&Match queue"), [this] { this->t().handleMatchQueue(); });
if(includeSendPM)
menu->appendItem(T_("&Send private message"), [this, parent] { this->t().handlePrivateMessage(parent); }, dwt::IconPtr(), true, !defaultIsGetList);
=== modified file 'win32/WinUtil.cpp'
--- win32/WinUtil.cpp 2012-03-18 17:52:34 +0000
+++ win32/WinUtil.cpp 2012-03-21 22:50:43 +0000
@@ -1496,6 +1496,9 @@
QueueManager* qm = QueueManager::getInstance();
addUsers(menu, T_("&Get file list"), users, [=](const HintedUser &u, const string& s) {
+ qm->addList(u, QueueItem::FLAG_CLIENT_VIEW, s); }, dwt::IconPtr(), dirs);
+
+ addUsers(menu, T_("&Browse file list"), users, [=](const HintedUser &u, const string& s) {
qm->addList(u, QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_PARTIAL_LIST, s); }, dwt::IconPtr(), dirs);
addUsers(menu, T_("&Match queue"), users, [=](const HintedUser &u, const string& s) {