Changeset b3950f


Ignore:
Timestamp:
02/17/2008 11:46:44 PM (17 years ago)
Author:
Andrew Resch <andrewresch@gmail.com>
Branches:
2.0.x, develop, extjs4-port, master
Children:
b59d148
Parents:
5ca14db
Message:

Expose torrent_paused and torrent_checked alerts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/deluge_core.cpp

    r5ca14db rb3950f  
    9696#define EVENT_PEER_BLOCKED          18
    9797#define EVENT_LISTEN_FAILED         19
     98#define EVENT_FINISHED_CHECKING     20
     99#define EVENT_TORRENT_PAUSED        21
    98100
    99101#define STATE_QUEUED                0
     
    16031605        else
    16041606            { Py_INCREF(Py_None); return Py_None; }
    1605     }
    1606 
     1607    } else if (dynamic_cast<torrent_checked_alert*>(popped_alert))
     1608    {
     1609        torrent_handle handle = (dynamic_cast<torrent_checked_alert*>(popped_alert))->handle;
     1610
     1611        long index = get_torrent_index(handle);
     1612        if (PyErr_Occurred())
     1613            return NULL;
     1614
     1615        if (handle_exists(handle))
     1616            return Py_BuildValue("{s:i,s:i,s:s}",
     1617                "event_type", EVENT_FINISHED_CHECKING,
     1618                "unique_ID", M_torrents->at(index).unique_ID,
     1619                "message", a->msg().c_str());
     1620        else
     1621            { Py_INCREF(Py_None); return Py_None; }
     1622    } else if (dynamic_cast<torrent_paused_alert*>(popped_alert))
     1623    {
     1624        torrent_handle handle = (dynamic_cast<torrent_paused_alert*>(popped_alert))->handle;
     1625
     1626        long index = get_torrent_index(handle);
     1627        if (PyErr_Occurred())
     1628            return NULL;
     1629
     1630        if (handle_exists(handle))
     1631            return Py_BuildValue("{s:i,s:i,s:s}",
     1632                "event_type", EVENT_TORRENT_PAUSED,
     1633                "unique_ID", M_torrents->at(index).unique_ID,
     1634                "message", a->msg().c_str());
     1635        else
     1636            { Py_INCREF(Py_None); return Py_None; }
     1637    }
    16071638    return Py_BuildValue("{s:i,s:s}", "event_type", EVENT_OTHER,
    16081639        "message",   a->msg().c_str()     );
Note: See TracChangeset for help on using the changeset viewer.