mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-06 14:19:21 +00:00
* Added file_path_iterator that allows the client to iterate through
FileList in a structured manner. Messed up the file list view to test it. * Added operator[] and at(...) to torrent::FileList and torrent::Path. * Fixed Handshake::fill_read_buffer(...) that was throwing due to a bad error check. Patch by Josef Drexler. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@830 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -54,8 +54,8 @@ ElementChunksSeen::ElementChunksSeen(core::Download* d) :
|
||||
|
||||
m_bindings[KEY_LEFT] = m_bindings['B' - '@'] = sigc::mem_fun(&m_slotExit, &slot_type::operator());
|
||||
|
||||
m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &ElementChunksSeen::receive_next);
|
||||
m_bindings[KEY_UP] = sigc::mem_fun(*this, &ElementChunksSeen::receive_prev);
|
||||
m_bindings[KEY_DOWN] = m_bindings['N' - '@'] = sigc::mem_fun(*this, &ElementChunksSeen::receive_next);
|
||||
m_bindings[KEY_UP] = m_bindings['P' - '@'] = sigc::mem_fun(*this, &ElementChunksSeen::receive_prev);
|
||||
m_bindings[KEY_NPAGE] = sigc::mem_fun(*this, &ElementChunksSeen::receive_pagenext);
|
||||
m_bindings[KEY_PPAGE] = sigc::mem_fun(*this, &ElementChunksSeen::receive_pageprev);
|
||||
}
|
||||
@@ -137,14 +137,14 @@ ElementChunksSeen::receive_pagenext() {
|
||||
throw torrent::internal_error("ui::ElementChunksSeen::receive_pagenext(...) called on a disabled object");
|
||||
|
||||
unsigned int visible = m_window->height() - 1;
|
||||
unsigned int scrollable = std::max<int>(m_window->rows() - visible, 0);
|
||||
unsigned int maxFocus = m_window->max_focus();
|
||||
|
||||
if (scrollable == 0 || m_focus == scrollable)
|
||||
if (maxFocus == 0 || m_focus == maxFocus)
|
||||
m_focus = 0;
|
||||
else if (m_focus + visible / 2 < scrollable)
|
||||
else if (m_focus + visible / 2 < maxFocus)
|
||||
m_focus += visible / 2;
|
||||
else
|
||||
m_focus = scrollable;
|
||||
m_focus = maxFocus;
|
||||
|
||||
m_window->mark_dirty();
|
||||
}
|
||||
@@ -155,12 +155,12 @@ ElementChunksSeen::receive_pageprev() {
|
||||
throw torrent::internal_error("ui::ElementChunksSeen::receive_pageprev(...) called on a disabled object");
|
||||
|
||||
unsigned int visible = m_window->height() - 1;
|
||||
unsigned int scrollable = std::max<int>(m_window->rows() - visible, 0);
|
||||
unsigned int maxFocus = m_window->max_focus();
|
||||
|
||||
if (m_focus > visible / 2)
|
||||
m_focus -= visible / 2;
|
||||
else if (scrollable > 0 && m_focus == 0)
|
||||
m_focus = scrollable;
|
||||
else if (maxFocus > 0 && m_focus == 0)
|
||||
m_focus = maxFocus;
|
||||
else
|
||||
m_focus = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user