summaryrefslogtreecommitdiff
path: root/client-qt/udm-client-qt/udm_main.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-11-21 18:00:49 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-11-21 18:00:49 +0300
commitf3693316d59943ca30f07dcdb614ffc8ebc30efe (patch)
treeecf8552b288382890be58213bf461ba140da9c78 /client-qt/udm-client-qt/udm_main.cpp
parent23c6b9cb5ec8186584c05fe0db0d0dcdc1c56d28 (diff)
client-qt:
subscription to "ST_DOWNLOAD_ADDED" event
Diffstat (limited to 'client-qt/udm-client-qt/udm_main.cpp')
-rw-r--r--client-qt/udm-client-qt/udm_main.cpp14
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();
}