add 'event.view.hide/show' commands / events

This commit is contained in:
pyroscope
2018-06-15 18:36:01 +02:00
parent 6c278668e4
commit f37fefcc54
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -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"
+7
View File
@@ -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