mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 04:02:30 +00:00
Merge pull request #742 from pyroscope/cmd-event-view-change
add 'event.view.hide/show' commands / events
This commit is contained in:
@@ -249,6 +249,9 @@ main(int argc, char** argv) {
|
||||
|
||||
rpc::parse_command_multiple
|
||||
(rpc::make_target(),
|
||||
"method.insert = event.view.hide,multi|rlookup|static\n"
|
||||
"method.insert = event.view.show,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_session,multi|rlookup|static\n"
|
||||
|
||||
@@ -220,7 +220,14 @@ ElementDownloadList::receive_change_view(const std::string& name) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string old_name = view() ? view()->name() : "";
|
||||
if (!old_name.empty())
|
||||
rpc::commands.call_catch("event.view.hide", rpc::make_target(), name,
|
||||
"View hide event action failed: ");
|
||||
set_view(*itr);
|
||||
if (!old_name.empty())
|
||||
rpc::commands.call_catch("event.view.show", rpc::make_target(), old_name,
|
||||
"View show event action failed: ");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user