* libnotify/notifynotification.c (notify_notification_show_and_forget):
new method that shows and then unrefs the NotifyNotification object. use this if you just want to fire off a quick notification. * various compiler warning cleanups
This commit is contained in:
parent
38c83b0ef5
commit
4a3be1113e
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
Fri Dec 02 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (notify_notification_show_and_forget):
|
||||||
|
new method that shows and then unrefs the NotifyNotification object.
|
||||||
|
use this if you just want to fire off a quick notification.
|
||||||
|
|
||||||
|
* various compiler warning cleanups
|
||||||
|
|
||||||
|
Fri Dec 02 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
|
* libnotify/notifynotification.c (SIGNAL_TYPE_CLOSED): "closed" glib
|
||||||
|
signal added
|
||||||
|
(notify_notification_clear_hints): New API for clearing out the
|
||||||
|
hints hash
|
||||||
|
(notify_notification_ref, notify_notification_unref): removed - use
|
||||||
|
g_object_ref/unref
|
||||||
|
|
||||||
|
* tests/*: Various changes to the test binaries
|
||||||
|
|
||||||
Thu Nov 10 14:00:00 EST 2005 John (J5) Palmieri <johnp@redhat.com>
|
Thu Nov 10 14:00:00 EST 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||||
|
|
||||||
* Complete rewrite and first import to libnotify-ng module in SVN
|
* Complete rewrite and first import to libnotify-ng module in SVN
|
||||||
|
|
|
@ -186,7 +186,7 @@ notify_notification_finalize (GObject * object)
|
||||||
priv->user_data_free_func (priv->user_data);
|
priv->user_data_free_func (priv->user_data);
|
||||||
|
|
||||||
dbus_g_proxy_disconnect_signal (priv->proxy, "NotificationClosed",
|
dbus_g_proxy_disconnect_signal (priv->proxy, "NotificationClosed",
|
||||||
_close_signal_handler,
|
(GCallback) _close_signal_handler,
|
||||||
object);
|
object);
|
||||||
|
|
||||||
g_free (obj->priv);
|
g_free (obj->priv);
|
||||||
|
@ -375,16 +375,6 @@ notify_notification_set_user_data (NotifyNotification * notification,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DBusHandlerResult
|
|
||||||
filter_func (DBusConnection *connection,
|
|
||||||
DBusMessage *message,
|
|
||||||
void *user_data)
|
|
||||||
{
|
|
||||||
g_message ("member %s", dbus_message_get_member (message));
|
|
||||||
|
|
||||||
return DBUS_HANDLER_RESULT_HANDLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_close_signal_handler (DBusGProxy *proxy,
|
_close_signal_handler (DBusGProxy *proxy,
|
||||||
guint32 id,
|
guint32 id,
|
||||||
|
@ -399,8 +389,10 @@ _close_signal_handler (DBusGProxy *proxy,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
static gboolean
|
||||||
notify_notification_show (NotifyNotification *notification, GError **error)
|
_notify_notification_show_internal (NotifyNotification *notification,
|
||||||
|
GError **error,
|
||||||
|
gboolean ignore_reply)
|
||||||
{
|
{
|
||||||
NotifyNotificationPrivate *priv;
|
NotifyNotificationPrivate *priv;
|
||||||
GError *tmp_error;
|
GError *tmp_error;
|
||||||
|
@ -430,7 +422,7 @@ notify_notification_show (NotifyNotification *notification, GError **error)
|
||||||
dbus_g_proxy_add_signal (priv->proxy, "NotificationClosed",
|
dbus_g_proxy_add_signal (priv->proxy, "NotificationClosed",
|
||||||
G_TYPE_UINT, NULL);
|
G_TYPE_UINT, NULL);
|
||||||
dbus_g_proxy_connect_signal (priv->proxy, "NotificationClosed",
|
dbus_g_proxy_connect_signal (priv->proxy, "NotificationClosed",
|
||||||
_close_signal_handler,
|
(GCallback) _close_signal_handler,
|
||||||
notification, NULL);
|
notification, NULL);
|
||||||
|
|
||||||
dbus_g_connection_unref (bus);
|
dbus_g_connection_unref (bus);
|
||||||
|
@ -440,6 +432,7 @@ notify_notification_show (NotifyNotification *notification, GError **error)
|
||||||
_notify_notification_update_applet_hints (notification);
|
_notify_notification_update_applet_hints (notification);
|
||||||
|
|
||||||
/*TODO: make this nonblocking */
|
/*TODO: make this nonblocking */
|
||||||
|
if (!ignore_reply)
|
||||||
dbus_g_proxy_call (priv->proxy, "Notify", &tmp_error,
|
dbus_g_proxy_call (priv->proxy, "Notify", &tmp_error,
|
||||||
G_TYPE_STRING, _notify_get_app_name (),
|
G_TYPE_STRING, _notify_get_app_name (),
|
||||||
G_TYPE_STRING,
|
G_TYPE_STRING,
|
||||||
|
@ -452,6 +445,19 @@ notify_notification_show (NotifyNotification *notification, GError **error)
|
||||||
G_TYPE_VALUE),
|
G_TYPE_VALUE),
|
||||||
priv->hints, G_TYPE_INT, priv->timeout, G_TYPE_INVALID,
|
priv->hints, G_TYPE_INT, priv->timeout, G_TYPE_INVALID,
|
||||||
G_TYPE_UINT, &priv->id, G_TYPE_INVALID);
|
G_TYPE_UINT, &priv->id, G_TYPE_INVALID);
|
||||||
|
else
|
||||||
|
dbus_g_proxy_call_no_reply (priv->proxy, "Notify",
|
||||||
|
G_TYPE_STRING, _notify_get_app_name (),
|
||||||
|
G_TYPE_STRING,
|
||||||
|
(priv->icon_name != NULL) ? priv->icon_name : "",
|
||||||
|
G_TYPE_UINT, priv->id, G_TYPE_STRING, priv->summary,
|
||||||
|
G_TYPE_STRING, priv->message,
|
||||||
|
dbus_g_type_get_collection ("GSList", G_TYPE_STRING),
|
||||||
|
priv->actions, dbus_g_type_get_map ("GHashTable",
|
||||||
|
G_TYPE_STRING,
|
||||||
|
G_TYPE_VALUE),
|
||||||
|
priv->hints, G_TYPE_INT, priv->timeout, G_TYPE_INVALID);
|
||||||
|
|
||||||
|
|
||||||
if (tmp_error != NULL)
|
if (tmp_error != NULL)
|
||||||
{
|
{
|
||||||
|
@ -462,6 +468,25 @@ notify_notification_show (NotifyNotification *notification, GError **error)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
notify_notification_show (NotifyNotification *notification, GError **error)
|
||||||
|
{
|
||||||
|
return _notify_notification_show_internal (notification, error, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
notify_notification_show_and_forget (NotifyNotification *notification, GError **error)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
|
||||||
|
result = _notify_notification_show_internal (notification, error, TRUE);
|
||||||
|
g_object_unref (G_OBJECT (notification));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
notify_notification_set_timeout (NotifyNotification * notification,
|
notify_notification_set_timeout (NotifyNotification * notification,
|
||||||
gint timeout)
|
gint timeout)
|
||||||
|
|
Loading…
Reference in New Issue