Merge pull request #742 from pyroscope/cmd-event-view-change

add 'event.view.hide/show' commands / events
This commit is contained in:
Jari Sundell
2018-06-16 18:48:10 +09:00
committed by GitHub
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