Up and down on the download list working.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@250 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-01 15:26:24 +00:00
parent cd9b014eb6
commit 0ff36babee
14 changed files with 95 additions and 25 deletions
+10
View File
@@ -26,6 +26,16 @@ _accumulate<Type, Ftor> accumulate(Type& t, Ftor f) {
return _accumulate<Type, Ftor>(t, f);
}
Manager::iterator
Manager::erase(Window* w) {
iterator itr = std::find(begin(), end(), w);
if (itr == end())
throw std::logic_error("Manager::erase(...) did not find the window");
return Base::erase(itr);
}
void
Manager::adjust_layout() {
int countDynamic = 0;
+6 -3
View File
@@ -1,15 +1,15 @@
#ifndef RTORRENT_DISPLAY_MANAGER_H
#define RTORRENT_DISPLAY_MANAGER_H
#include <vector>
#include <list>
namespace display {
class Window;
class Manager : private std::vector<Window*> {
class Manager : private std::list<Window*> {
public:
typedef std::vector<Window*> Base;
typedef std::list<Window*> Base;
using Base::iterator;
using Base::const_iterator;
@@ -23,8 +23,11 @@ public:
using Base::insert;
using Base::erase;
using Base::push_front;
using Base::push_back;
iterator erase(Window* w);
void adjust_layout();
void do_update();
+3 -1
View File
@@ -12,7 +12,9 @@ public:
WindowDownloadList(List* d);
List::iterator get_focus() { return m_focus; }
List* get_list() { return m_downloads; }
List::iterator get_focus() { return m_focus; }
void set_focus(core::DownloadList::iterator itr) { m_focus = itr; }
virtual void redraw();
+5 -3
View File
@@ -8,7 +8,8 @@
namespace display {
WindowTitle::WindowTitle() :
Window(new Canvas, false, 1) {
Window(new Canvas, false, 1),
m_counter(0) {
m_title += "rtorrent " VERSION " - ";
m_title += torrent::get(torrent::LIBRARY_NAME);
@@ -16,10 +17,11 @@ WindowTitle::WindowTitle() :
void
WindowTitle::redraw() {
m_counter++;
m_canvas->erase();
m_canvas->print(std::max(0, (m_canvas->get_width() - (int)m_title.size()) / 2 - 4), 0,
"*** %s ***", m_title.c_str());
"*** %s *** %i", m_title.c_str(), m_counter);
}
}
+3
View File
@@ -1,6 +1,7 @@
#ifndef RTORRENT_DISPLAY_WINDOW_TITLE_H
#define RTORRENT_DISPLAY_WINDOW_TITLE_H
#include <string>
#include "window.h"
namespace display {
@@ -13,6 +14,8 @@ public:
private:
std::string m_title;
int m_counter;
};
}