mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 12:46:18 +00:00
Add 'event.system.startup_done/shutdown' commands/events (Closes #24)
This commit is contained in:
@@ -168,6 +168,8 @@ Control::is_shutdown_completed() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
Control::handle_shutdown() {
|
Control::handle_shutdown() {
|
||||||
|
rpc::commands.call_catch("event.system.shutdown", rpc::make_target(), "shutdown", "System shutdown event action failed: ");
|
||||||
|
|
||||||
if (!m_shutdownQuick) {
|
if (!m_shutdownQuick) {
|
||||||
// Temporary hack:
|
// Temporary hack:
|
||||||
if (worker_thread->is_active())
|
if (worker_thread->is_active())
|
||||||
|
|||||||
@@ -252,6 +252,9 @@ main(int argc, char** argv) {
|
|||||||
"method.insert = event.view.hide,multi|rlookup|static\n"
|
"method.insert = event.view.hide,multi|rlookup|static\n"
|
||||||
"method.insert = event.view.show,multi|rlookup|static\n"
|
"method.insert = event.view.show,multi|rlookup|static\n"
|
||||||
|
|
||||||
|
"method.insert = event.system.startup_done,multi|rlookup|static\n"
|
||||||
|
"method.insert = event.system.shutdown,multi|rlookup|static\n"
|
||||||
|
|
||||||
"method.insert = event.download.inserted,multi|rlookup|static\n"
|
"method.insert = event.download.inserted,multi|rlookup|static\n"
|
||||||
"method.insert = event.download.inserted_new,multi|rlookup|static\n"
|
"method.insert = event.download.inserted_new,multi|rlookup|static\n"
|
||||||
"method.insert = event.download.inserted_session,multi|rlookup|static\n"
|
"method.insert = event.download.inserted_session,multi|rlookup|static\n"
|
||||||
@@ -480,6 +483,8 @@ main(int argc, char** argv) {
|
|||||||
|
|
||||||
worker_thread->start_thread();
|
worker_thread->start_thread();
|
||||||
|
|
||||||
|
rpc::commands.call_catch("event.system.startup_done", rpc::make_target(), "startup_done", "System startup_done event action failed: ");
|
||||||
|
|
||||||
torrent::thread_base::event_loop(torrent::main_thread());
|
torrent::thread_base::event_loop(torrent::main_thread());
|
||||||
|
|
||||||
control->core()->download_list()->session_save();
|
control->core()->download_list()->session_save();
|
||||||
|
|||||||
Reference in New Issue
Block a user