mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
* Changed ViewSort::less(...) to operator().
* Added a "last changed" paramter to ViewManager::sort(...) which is checked, if the ViewDownloads's last_changed timer was poked withing that timeframe it won't update. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@676 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -48,24 +48,32 @@
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowDownloadList::WindowDownloadList(core::ViewDownloads* l) :
|
||||
Window(new Canvas, true),
|
||||
m_view(l) {
|
||||
|
||||
m_connChanged = m_view->signal_changed().connect(sigc::mem_fun(*this, &Window::mark_dirty));
|
||||
}
|
||||
|
||||
WindowDownloadList::~WindowDownloadList() {
|
||||
m_connChanged.disconnect();
|
||||
}
|
||||
|
||||
void
|
||||
WindowDownloadList::set_view(core::ViewDownloads* l) {
|
||||
m_view = l;
|
||||
|
||||
m_connChanged.disconnect();
|
||||
|
||||
if (m_view != NULL)
|
||||
m_connChanged = m_view->signal_changed().connect(sigc::mem_fun(*this, &Window::mark_dirty));
|
||||
}
|
||||
|
||||
void
|
||||
WindowDownloadList::redraw() {
|
||||
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
|
||||
|
||||
m_canvas->erase();
|
||||
|
||||
if (m_view->empty() || m_canvas->get_width() < 5)
|
||||
if (m_view == NULL)
|
||||
return;
|
||||
|
||||
m_canvas->print(0, 0, "%s", ("[View: " + m_view->name() + "]").c_str());
|
||||
|
||||
if (m_view->empty() || m_canvas->get_width() < 5 || m_canvas->get_height() < 2)
|
||||
return;
|
||||
|
||||
typedef std::pair<core::ViewDownloads::iterator, core::ViewDownloads::iterator> Range;
|
||||
@@ -81,7 +89,7 @@ WindowDownloadList::redraw() {
|
||||
if (range.second != m_view->end())
|
||||
++range.second;
|
||||
|
||||
int pos = 0;
|
||||
int pos = 1;
|
||||
|
||||
while (range.first != range.second) {
|
||||
char buffer[m_canvas->get_width()];
|
||||
|
||||
@@ -51,11 +51,13 @@ namespace display {
|
||||
|
||||
class WindowDownloadList : public Window {
|
||||
public:
|
||||
WindowDownloadList(core::ViewDownloads* l);
|
||||
WindowDownloadList() : Window(new Canvas, true), m_view(NULL) {}
|
||||
~WindowDownloadList();
|
||||
|
||||
virtual void redraw();
|
||||
|
||||
void set_view(core::ViewDownloads* l);
|
||||
|
||||
private:
|
||||
core::ViewDownloads* m_view;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user