Added setting for session directory.

Added support for quotation in settings.

Added key for changing the priority of all files in a torrent.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@477 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-26 19:51:20 +00:00
parent 28b369dc83
commit 2c5ce1989a
15 changed files with 118 additions and 64 deletions
+5 -5
View File
@@ -74,16 +74,16 @@ Download::~Download() {
if (m_window != m_control->get_display().end())
throw std::logic_error("ui::Download::~Download() called on an active object");
m_connPeerConnected.disconnect();
m_connPeerDisconnected.disconnect();
delete m_bindings;
std::for_each(m_uiArray, m_uiArray + DISPLAY_MAX_SIZE, rak::call_delete<ElementBase>());
delete m_windowTitle;
delete m_windowDownloadStatus;
delete m_windowMainStatus;
delete m_bindings;
m_connPeerConnected.disconnect();
m_connPeerDisconnected.disconnect();
}
void
+36 -17
View File
@@ -37,6 +37,7 @@ ElementFileList::ElementFileList(core::Download* d) :
m_focus(0) {
m_bindings[' '] = sigc::mem_fun(*this, &ElementFileList::receive_priority);
m_bindings['*'] = sigc::mem_fun(*this, &ElementFileList::receive_change_all);
m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &ElementFileList::receive_next);
m_bindings[KEY_UP] = sigc::mem_fun(*this, &ElementFileList::receive_prev);
}
@@ -99,26 +100,44 @@ ElementFileList::receive_priority() {
torrent::Entry e = m_download->get_download().get_entry(m_focus);
switch (e.get_priority()) {
case torrent::Entry::STOPPED:
e.set_priority(torrent::Entry::HIGH);
break;
case torrent::Entry::NORMAL:
e.set_priority(torrent::Entry::STOPPED);
break;
case torrent::Entry::HIGH:
e.set_priority(torrent::Entry::NORMAL);
break;
default:
e.set_priority(torrent::Entry::NORMAL);
break;
};
e.set_priority(next_priority(e.get_priority()));
m_download->get_download().update_priorities();
m_window->mark_dirty();
}
void
ElementFileList::receive_change_all() {
if (m_window == NULL)
throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object");
if (m_focus >= m_download->get_download().get_entry_size())
return;
Priority p = next_priority(m_download->get_download().get_entry(m_focus).get_priority());
for (int i = 0, e = m_download->get_download().get_entry_size(); i != e; ++i)
m_download->get_download().get_entry(i).set_priority(p);
m_download->get_download().update_priorities();
m_window->mark_dirty();
}
ElementFileList::Priority
ElementFileList::next_priority(Priority p) {
switch(p) {
case torrent::Entry::STOPPED:
return torrent::Entry::HIGH;
case torrent::Entry::NORMAL:
return torrent::Entry::STOPPED;
case torrent::Entry::HIGH:
return torrent::Entry::NORMAL;
default:
return torrent::Entry::NORMAL;
};
}
}
+5 -1
View File
@@ -37,7 +37,8 @@ class Control;
class ElementFileList : public ElementBase {
public:
typedef display::WindowFileList WFileList;
typedef torrent::Entry::Priority Priority;
typedef display::WindowFileList WFileList;
ElementFileList(core::Download* d);
@@ -49,6 +50,9 @@ private:
void receive_prev();
void receive_priority();
void receive_change_all();
Priority next_priority(Priority p);
core::Download* m_download;
WFileList* m_window;