added alert for torrent state changes. Fixes #360

This commit is contained in:
Arvid Norberg
2008-07-03 10:05:51 +00:00
parent d2b37572fa
commit ecb538b4b2
4 changed files with 45 additions and 14 deletions

View File

@@ -68,6 +68,21 @@ namespace libtorrent
std::string name;
};
struct TORRENT_EXPORT state_changed_alert: torrent_alert
{
state_changed_alert(torrent_handle const& h
, torrent_status::state_t const& state_
, std::string const& msg)
: torrent_alert(h, alert::info, msg)
, state(state_)
{}
virtual std::auto_ptr<alert> clone() const
{ return std::auto_ptr<alert>(new state_changed_alert(*this)); }
torrent_status::state_t state;
};
struct TORRENT_EXPORT tracker_alert: torrent_alert
{
tracker_alert(torrent_handle const& h

View File

@@ -167,6 +167,7 @@ namespace libtorrent
bool is_aborted() const { return m_abort; }
torrent_status::state_t state() const { return m_state; }
void set_state(torrent_status::state_t s);
session_settings const& settings() const;