TxID control via xmlrpc

* Added xmlrpc commands
    - Main.get_txid
    - Main.set_txid
    - Main.toggle_txid
pull/1/head
David Freese 2014-10-18 13:17:59 -05:00
rodzic 880df3d57c
commit 287e692f7a
1 zmienionych plików z 51 dodań i 0 usunięć

Wyświetl plik

@ -1359,6 +1359,53 @@ public:
};
// =============================================================================
class Main_get_txid : public xmlrpc_c::method
{
public:
Main_get_txid()
{
_signature = "b:n";
_help = "Returns the TXID state.";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
*retval = xmlrpc_c::value_boolean(btnTxRSID->value());
}
};
class Main_set_txid : public xmlrpc_c::method
{
public:
Main_set_txid()
{
_signature = "b:b";
_help = "Sets the TXID state. Returns the old state.";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
XMLRPC_LOCK;
bool v = btnTxRSID->value();
REQ(set_button, btnTxRSID, params.getBoolean(0));
*retval = xmlrpc_c::value_boolean(v);
}
};
class Main_toggle_txid : public xmlrpc_c::method
{
public:
Main_toggle_txid()
{
_signature = "b:n";
_help = "Toggles the TXID state. Returns the new state.";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
XMLRPC_LOCK;
bool v = !btnTxRSID->value();
REQ(set_button, btnTxRSID, v);
*retval = xmlrpc_c::value_boolean(v);
}
};
class Main_get_rsid : public xmlrpc_c::method
{
@ -3318,6 +3365,10 @@ ELEM_(Main_get_lock, "main.get_lock") \
ELEM_(Main_set_lock, "main.set_lock") \
ELEM_(Main_toggle_lock, "main.toggle_lock") \
\
ELEM_(Main_get_txid, "main.get_txid") \
ELEM_(Main_set_txid, "main.set_txid") \
ELEM_(Main_toggle_txid, "main.toggle_txid") \
\
ELEM_(Main_get_rsid, "main.get_rsid") \
ELEM_(Main_set_rsid, "main.set_rsid") \
ELEM_(Main_toggle_rsid, "main.toggle_rsid") \