diff options
Diffstat (limited to 'client-qt/udm-client-qt/udm_main.cpp')
-rw-r--r-- | client-qt/udm-client-qt/udm_main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client-qt/udm-client-qt/udm_main.cpp b/client-qt/udm-client-qt/udm_main.cpp index 3b546c3..9fe80b3 100644 --- a/client-qt/udm-client-qt/udm_main.cpp +++ b/client-qt/udm-client-qt/udm_main.cpp @@ -278,6 +278,19 @@ void udm_main::server_message_received(server_msg msg) msg.set_auth_token(auth_token); session->send_message(msg); } + //subscript to needed events + { + client_msg msg; + msg.set_type(CLIENT_MSG_TYPE::CLIENT_SUBSCRIPTION_REQUEST); + msg.set_auth_token(auth_token); + //subscript to download added event + auto s = msg.add_subscription_request(); + s->set_type(SUBSCRIPTION_TYPE::ST_DOWNLOAD_ADDED); //fire event than new download added + s->set_mode(SUBSCRIPTION_MODE::SM_EVENT); //this type of event support only "event" mode + s->set_module_name(""); //we need this event for all installed modules + + session->send_message(msg); + } } else { @@ -309,6 +322,7 @@ void udm_main::server_message_received(server_msg msg) } for(auto i : msg.downloads()) downloads.push_back(i.download()); + //TODO: something better than whole list rebuild mdl_downloads->insertRows(0, downloads.size()); mdl_downloads->refresh(); } |