mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 05:02:31 +00:00
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@251 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -7,8 +7,12 @@ libsub_display_a_SOURCES = \
|
||||
manager.h \
|
||||
window.cc \
|
||||
window.h \
|
||||
window_download.cc \
|
||||
window_download.h \
|
||||
window_download_list.cc \
|
||||
window_download_list.h \
|
||||
window_statusbar.cc \
|
||||
window_statusbar.h \
|
||||
window_title.cc \
|
||||
window_title.h
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "canvas.h"
|
||||
#include "window_download.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowDownload::WindowDownload(DPtr d) :
|
||||
Window(new Canvas, true),
|
||||
m_download(d) {
|
||||
}
|
||||
|
||||
void
|
||||
WindowDownload::redraw() {
|
||||
m_canvas->erase();
|
||||
|
||||
m_canvas->print(0, 0, "Download: %s", m_download->get_download().get_name().c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef RTORRENT_DISPLAY_WINDOW_DOWNLOAD_H
|
||||
#define RTORRENT_DISPLAY_WINDOW_DOWNLOAD_H
|
||||
|
||||
#include "window.h"
|
||||
#include "core/download_list.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
class WindowDownload : public Window {
|
||||
public:
|
||||
typedef core::DownloadList::iterator DPtr;
|
||||
|
||||
WindowDownload(DPtr d);
|
||||
|
||||
DPtr get_download() { return m_download; }
|
||||
|
||||
virtual void redraw();
|
||||
|
||||
private:
|
||||
DPtr m_download;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <torrent/torrent.h>
|
||||
|
||||
#include "canvas.h"
|
||||
#include "window_statusbar.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowStatusbar::WindowStatusbar() :
|
||||
Window(new Canvas, false, 1),
|
||||
m_counter(0) {
|
||||
}
|
||||
|
||||
void
|
||||
WindowStatusbar::redraw() {
|
||||
m_canvas->erase();
|
||||
m_canvas->print(0, 0, "Loop: %i", ++m_counter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef RTORRENT_DISPLAY_WINDOW_STATUSBAR_H
|
||||
#define RTORRENT_DISPLAY_WINDOW_STATUSBAR_H
|
||||
|
||||
#include "window.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
class WindowStatusbar : public Window {
|
||||
public:
|
||||
WindowStatusbar();
|
||||
|
||||
virtual void redraw();
|
||||
|
||||
private:
|
||||
int m_counter;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,27 +1,20 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <torrent/torrent.h>
|
||||
|
||||
#include "canvas.h"
|
||||
#include "window_title.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowTitle::WindowTitle() :
|
||||
WindowTitle::WindowTitle(const std::string& s) :
|
||||
Window(new Canvas, false, 1),
|
||||
m_counter(0) {
|
||||
|
||||
m_title += "rtorrent " VERSION " - ";
|
||||
m_title += torrent::get(torrent::LIBRARY_NAME);
|
||||
m_title(s) {
|
||||
}
|
||||
|
||||
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 *** %i", m_title.c_str(), m_counter);
|
||||
"*** %s ***", m_title.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,14 +8,12 @@ namespace display {
|
||||
|
||||
class WindowTitle : public Window {
|
||||
public:
|
||||
WindowTitle();
|
||||
WindowTitle(const std::string& s);
|
||||
|
||||
virtual void redraw();
|
||||
|
||||
private:
|
||||
std::string m_title;
|
||||
|
||||
int m_counter;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user