mirror of https://github.com/BOINC/boinc.git
parent
8bcf9a6ab4
commit
a1a6c627e4
|
@ -50,14 +50,22 @@ extern "C" {
|
|||
static void
|
||||
statis_icon_notification_closed(NotifyNotification* notification, wxTaskBarIconEx* taskBarIcon)
|
||||
{
|
||||
gint id, closed_reason;
|
||||
int id, closed_reason;
|
||||
GValue val = { 0, };
|
||||
|
||||
g_object_get_property(notification, "id", &id, NULL);
|
||||
g_object_get_property(notification, "closed-reason", &closed_reason, NULL);
|
||||
g_value_init(&val, G_TYPE_PARAM_UINT);
|
||||
|
||||
g_object_get_property(G_OBJECT(notification), "id", val);
|
||||
id = g_value_get_int(&val);
|
||||
|
||||
g_object_get_property(G_OBJECT(notification), "closed-reason", val);
|
||||
closed_reason = g_value_get_int(&val);
|
||||
|
||||
if (id == taskBarIcon->GetNotificationID()) {
|
||||
fprintf(stdout, "Notification Closed: id: %d closed-reason: %d", id, closed_reason);
|
||||
}
|
||||
|
||||
g_value_unset(&val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +175,7 @@ bool wxTaskBarIconEx::SetBalloon(const wxIcon& icon, const wxString title, const
|
|||
|
||||
bool retval = false;
|
||||
GError* error = NULL;
|
||||
GValue val = { 0, };
|
||||
|
||||
if (!IsOK())
|
||||
return false;
|
||||
|
@ -200,7 +209,12 @@ bool wxTaskBarIconEx::SetBalloon(const wxIcon& icon, const wxString title, const
|
|||
desired_icon,
|
||||
g_pStatusIcon
|
||||
);
|
||||
g_object_set_property(g_pNotification, "id", m_iNotificationID, NULL);
|
||||
|
||||
g_value_init(&val, G_TYPE_PARAM_UINT);
|
||||
g_value_set_int(&val, m_iNotificationID);
|
||||
|
||||
g_object_set_property(G_OBJECT(notification), "id", val);
|
||||
|
||||
g_signal_connect(g_pNotification, "closed", G_CALLBACK(statis_icon_notification_closed), this);
|
||||
}
|
||||
else
|
||||
|
@ -215,6 +229,7 @@ bool wxTaskBarIconEx::SetBalloon(const wxIcon& icon, const wxString title, const
|
|||
|
||||
retval = notify_notification_show(g_pNotification, &error);
|
||||
g_clear_error(&error);
|
||||
g_value_unset(&val);
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("wxTaskBarIconEx::SetBalloon - Function End"));
|
||||
return retval;
|
||||
|
|
Loading…
Reference in New Issue