Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
/*
|
|
|
|
* notification.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Sun Microsystems, Inc.
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
* Copyright (C) 2006 Christian Persch
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
COPYING, src/about.c, src/calendar.c, src/eggtrayicon.c, src/entry.c,
2005-04-25 Glynn Foster <glynn.foster@sun.com>
* COPYING, src/about.c, src/calendar.c, src/eggtrayicon.c,
* src/entry.c, src/fileselection.c, src/main.c, src/msg.c,
* src/notification.c, src/option.c, src/progress.c,
* src/text.c, src/tree.c, src/util.c: Update the FSF address
to point to 51 Franklin Street, Fifth Floor as per forwarded
mail from Alvaro Lopez Ortega.
2005-04-25 03:20:45 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
*
|
|
|
|
* Authors: Glynn Foster <glynn.foster@sun.com>
|
|
|
|
*/
|
|
|
|
|
2005-07-06 20:13:11 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
#include <gtk/gtk.h>
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
#include <glade/glade.h>
|
|
|
|
#include <time.h>
|
2005-07-06 20:13:11 +00:00
|
|
|
#include <string.h>
|
2006-03-23 03:43:23 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBNOTIFY
|
|
|
|
#include <libnotify/notify.h>
|
|
|
|
#endif
|
|
|
|
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
#include "zenity.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
static GtkStatusIcon *status_icon;
|
|
|
|
static gchar *icon_file;
|
|
|
|
static const gchar *icon_stock;
|
|
|
|
static gint icon_size;
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
2004-09-30 11:25:37 +00:00
|
|
|
static void
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
zenity_notification_icon_update (void)
|
2004-09-30 11:25:37 +00:00
|
|
|
{
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file_at_scale (icon_file, icon_size, icon_size, TRUE, &error);
|
2007-05-27 20:09:27 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
if (error) {
|
|
|
|
g_warning ("Could not load notification icon '%s': %s",
|
|
|
|
icon_file, error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
if (!pixbuf) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file_at_scale (ZENITY_IMAGE_FULLPATH ("zenity-notification.png"),
|
|
|
|
icon_size, icon_size, TRUE, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_status_icon_set_from_pixbuf (status_icon, pixbuf);
|
|
|
|
|
|
|
|
if (pixbuf) {
|
|
|
|
g_object_unref (pixbuf);
|
2004-09-30 11:25:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
static gboolean
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
zenity_notification_icon_size_changed_cb (GtkStatusIcon *icon,
|
|
|
|
gint size,
|
|
|
|
gpointer user_data)
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
{
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
icon_size = size;
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
/* If we're displaying not a stock icon but a custom pixbuf,
|
|
|
|
* we need to update the icon for the new size.
|
|
|
|
*/
|
|
|
|
if (!icon_stock) {
|
|
|
|
zenity_notification_icon_update ();
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
return FALSE;
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
}
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
static gboolean
|
|
|
|
zenity_notification_icon_activate_cb (GtkWidget *widget,
|
|
|
|
ZenityData *data)
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
{
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
|
|
|
gtk_main_quit ();
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
|
|
|
|
return TRUE;
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
}
|
|
|
|
|
2004-09-16 09:28:09 +00:00
|
|
|
static gboolean
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
zenity_notification_handle_stdin (GIOChannel *channel,
|
2004-09-16 09:28:09 +00:00
|
|
|
GIOCondition condition,
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
gpointer user_data)
|
2004-09-16 09:28:09 +00:00
|
|
|
{
|
|
|
|
ZenityData *zen_data;
|
|
|
|
|
|
|
|
zen_data = (ZenityData *)user_data;
|
|
|
|
|
|
|
|
if ((condition & G_IO_IN) != 0) {
|
|
|
|
GString *string;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
string = g_string_new (NULL);
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
while (channel->is_readable == FALSE)
|
2004-09-16 09:28:09 +00:00
|
|
|
;
|
|
|
|
do {
|
|
|
|
gint status;
|
|
|
|
gchar *command, *value, *colon;
|
|
|
|
|
|
|
|
do {
|
|
|
|
status = g_io_channel_read_line_string (channel, string, NULL, &error);
|
|
|
|
while (gdk_events_pending ())
|
|
|
|
gtk_main_iteration ();
|
|
|
|
|
|
|
|
} while (status == G_IO_STATUS_AGAIN);
|
|
|
|
|
|
|
|
if (status != G_IO_STATUS_NORMAL) {
|
|
|
|
if (error) {
|
|
|
|
g_warning ("zenity_notification_handle_stdin () : %s",
|
|
|
|
error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
error = NULL;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
zenity_util_strip_newline (string->str);
|
|
|
|
colon = strchr(string->str, ':');
|
|
|
|
if (colon == NULL) {
|
|
|
|
g_printerr (_("could not parse command from stdin\n"));
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
/* split off the command and value */
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
command = g_strstrip (g_strndup (string->str, colon - string->str));
|
2004-09-16 09:28:09 +00:00
|
|
|
|
|
|
|
value = colon + 1;
|
|
|
|
while (*value && g_ascii_isspace (*value)) value++;
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
if (!g_ascii_strcasecmp (command, "icon")) {
|
|
|
|
icon_stock = zenity_util_stock_from_filename (value);
|
2006-03-23 03:43:23 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
g_free (icon_file);
|
|
|
|
icon_file = g_strdup (value);
|
2006-03-23 03:43:23 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
if (icon_stock) {
|
|
|
|
gtk_status_icon_set_from_stock (status_icon, icon_stock);
|
|
|
|
} else if (gtk_status_icon_get_visible (status_icon) &&
|
|
|
|
gtk_status_icon_is_embedded (status_icon)) {
|
|
|
|
zenity_notification_icon_update ();
|
|
|
|
}
|
|
|
|
} else if (!g_ascii_strcasecmp (command, "message")) {
|
|
|
|
#ifdef HAVE_LIBNOTIFY
|
|
|
|
/* display a notification bubble */
|
|
|
|
if (!g_utf8_validate (value, -1, NULL)) {
|
|
|
|
g_warning ("Invalid UTF-8 in input!");
|
|
|
|
} else if (notify_is_initted ()) {
|
|
|
|
NotifyNotification *notif;
|
|
|
|
const gchar *icon = NULL;
|
|
|
|
gchar *freeme = NULL;
|
|
|
|
gchar *message;
|
2007-05-14 21:26:08 +00:00
|
|
|
error = NULL;
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
|
|
|
|
message = g_strcompress (value);
|
|
|
|
|
|
|
|
if (icon_stock) {
|
|
|
|
icon = icon_stock;
|
|
|
|
} else if (icon_file) {
|
|
|
|
icon = freeme = g_filename_to_uri (icon_file, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
notif = notify_notification_new_with_status_icon (message, NULL /* summary */,
|
|
|
|
icon, status_icon);
|
|
|
|
g_free (message);
|
|
|
|
g_free (freeme);
|
|
|
|
|
|
|
|
notify_notification_show (notif, &error);
|
2006-08-09 00:55:59 +00:00
|
|
|
|
2006-03-23 03:43:23 +00:00
|
|
|
if (error) {
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
g_warning ("Error showing notification: %s", error->message);
|
2006-03-23 03:43:23 +00:00
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
g_object_unref (notif);
|
2006-03-23 03:43:23 +00:00
|
|
|
} else {
|
|
|
|
#else
|
|
|
|
{ /* this brace is for balance */
|
|
|
|
#endif
|
|
|
|
g_warning ("Notification framework not available");
|
|
|
|
}
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
} else if (!g_ascii_strcasecmp (command, "tooltip")) {
|
|
|
|
if (g_utf8_validate (value, -1, NULL)) {
|
|
|
|
gtk_status_icon_set_tooltip (status_icon, value);
|
|
|
|
} else {
|
|
|
|
g_warning ("Invalid UTF-8 in input!");
|
|
|
|
}
|
|
|
|
} else if (!g_ascii_strcasecmp (command, "visible")) {
|
|
|
|
if (!g_ascii_strcasecmp (value, "false")) {
|
|
|
|
gtk_status_icon_set_visible (status_icon, FALSE);
|
|
|
|
} else {
|
|
|
|
gtk_status_icon_set_visible (status_icon, TRUE);
|
2004-09-16 09:28:09 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
g_warning ("Unknown command '%s'", command);
|
|
|
|
}
|
|
|
|
g_free (command);
|
|
|
|
|
|
|
|
} while (g_io_channel_get_buffer_condition (channel) == G_IO_IN);
|
|
|
|
g_string_free (string, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((condition & G_IO_HUP) != 0) {
|
|
|
|
g_io_channel_shutdown (channel, TRUE, NULL);
|
|
|
|
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
|
|
|
|
gtk_main_quit ();
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
zenity_notification_listen_on_stdin (ZenityData *data)
|
|
|
|
{
|
|
|
|
GIOChannel *channel;
|
|
|
|
|
|
|
|
channel = g_io_channel_unix_new (0);
|
|
|
|
g_io_channel_set_encoding (channel, NULL, NULL);
|
|
|
|
g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);
|
|
|
|
g_io_add_watch (channel, G_IO_IN | G_IO_HUP,
|
|
|
|
zenity_notification_handle_stdin, data);
|
|
|
|
}
|
|
|
|
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
void
|
|
|
|
zenity_notification (ZenityData *data, ZenityNotificationData *notification_data)
|
|
|
|
{
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
status_icon = gtk_status_icon_new ();
|
|
|
|
g_signal_connect (status_icon, "size-changed",
|
|
|
|
G_CALLBACK (zenity_notification_icon_size_changed_cb), data);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
if (notification_data->notification_text) {
|
|
|
|
gtk_status_icon_set_tooltip (status_icon, notification_data->notification_text);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
} else {
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
gtk_status_icon_set_tooltip (status_icon, _("Zenity notification"));
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
}
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
icon_file = g_strdup (data->window_icon);
|
|
|
|
icon_stock = zenity_util_stock_from_filename (data->window_icon);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
/* Only set the stock icon here; if we're going to display a
|
|
|
|
* custom pixbuf we wait for the size-changed signal to load
|
|
|
|
* it at the right size.
|
|
|
|
*/
|
|
|
|
if (icon_stock) {
|
|
|
|
gtk_status_icon_set_from_stock (status_icon, icon_stock);
|
|
|
|
}
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
#ifdef HAVE_LIBNOTIFY
|
|
|
|
/* create the notification widget */
|
|
|
|
if (!notify_is_initted ()) {
|
|
|
|
notify_init (_("Zenity notification"));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-09-16 09:28:09 +00:00
|
|
|
if (notification_data->listen) {
|
|
|
|
zenity_notification_listen_on_stdin (data);
|
|
|
|
} else {
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
/* if we aren't listening for changes, then close on activate (left-click) */
|
|
|
|
g_signal_connect (status_icon, "activate",
|
|
|
|
G_CALLBACK (zenity_notification_icon_activate_cb), data);
|
2004-09-16 09:28:09 +00:00
|
|
|
}
|
|
|
|
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
/* Show icon and wait */
|
|
|
|
gtk_status_icon_set_visible (status_icon, TRUE);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
gtk_main ();
|
src/notification.c (-set_scaled_pixbuf, +zenity_notification_icon_update,
2006-07-27 Lucas Rocha <lucasr@gnome.org>
* src/notification.c (-set_scaled_pixbuf,
+zenity_notification_icon_update,
-zenity_notification_icon_press_callback,
+zenity_notification_icon_size_changed_cb,
-zenity_notification_icon_expose_callback,
-zenity_notification_icon_destroy_callback,
+zenity_notification_icon_activate_cb,
zenity_notification_handle_stdin, zenity_notification),
src/util.[ch] (+zenity_util_stock_from_filename,
zenity_util_pixbuf_new_from_file), Makefile.am, configure.in:
Migration to gtk_status_icon (Fixes bug #341451). Patch from
Christian Persch <chpe@gnome.org>.
* src/eggtrayicon.[ch]: removed.
2006-07-28 21:25:11 +00:00
|
|
|
|
|
|
|
/* Cleanup */
|
|
|
|
g_object_unref (status_icon);
|
|
|
|
g_free (icon_file);
|
Add new notification icon. Update for new files. Restructure code a little
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* data/Makefile.am, data/zenity-notification.png: Add new
notification icon.
* src/Makefile.am: Update for new files.
* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
little bit for new utility functions for setting window icons.
* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
support.
* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
Add support for notification area.
* data/zenity.1, help/*: Update docs for notification and new file
selection changes.
2004-09-13 07:51:51 +00:00
|
|
|
}
|