From a1a6c627e4856597d5671e9ba4763f68aacb3aaa Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 10 Feb 2010 22:40:28 +0000 Subject: [PATCH] Quick Updates svn path=/trunk/boinc/; revision=20516 --- clientgui/gtk/taskbarex.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/clientgui/gtk/taskbarex.cpp b/clientgui/gtk/taskbarex.cpp index ebf6475f9a..b785476719 100644 --- a/clientgui/gtk/taskbarex.cpp +++ b/clientgui/gtk/taskbarex.cpp @@ -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;