mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
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:
@@ -8,6 +8,9 @@ namespace input {
|
||||
|
||||
bool
|
||||
Bindings::pressed(int key) {
|
||||
if (!m_active)
|
||||
return false;
|
||||
|
||||
const_iterator itr = find(key);
|
||||
|
||||
if (itr != end())
|
||||
|
||||
+10
-1
@@ -2,6 +2,7 @@
|
||||
#define RTORRENT_INPUT_BINDINGS_H
|
||||
|
||||
#include <map>
|
||||
#include <ncurses.h>
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
namespace input {
|
||||
@@ -23,7 +24,15 @@ public:
|
||||
|
||||
using Base::operator[];
|
||||
|
||||
bool pressed(int key);
|
||||
Bindings() : m_active(true) {}
|
||||
|
||||
void activate() { m_active = true; }
|
||||
void disable() { m_active = false; }
|
||||
|
||||
bool pressed(int key);
|
||||
|
||||
private:
|
||||
bool m_active;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,23 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "manager.h"
|
||||
#include "bindings.h"
|
||||
|
||||
namespace input {
|
||||
|
||||
void
|
||||
Manager::erase(Bindings* b) {
|
||||
iterator itr = std::find(begin(), end(), b);
|
||||
|
||||
if (itr == end())
|
||||
throw std::logic_error("Manager::erase(...) could not find binding");
|
||||
|
||||
Base::erase(itr);
|
||||
}
|
||||
|
||||
void
|
||||
Manager::pressed(int key) {
|
||||
std::find_if(begin(), end(), std::bind2nd(std::mem_fun(&Bindings::pressed), key));
|
||||
|
||||
@@ -24,6 +24,8 @@ public:
|
||||
using Base::push_back;
|
||||
using Base::push_front;
|
||||
|
||||
void erase(Bindings* b);
|
||||
|
||||
void pressed(int key);
|
||||
|
||||
// Slot for unreacted keys.
|
||||
|
||||
Reference in New Issue
Block a user