Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 313081 Details for
Bug 457151
gnome-ppp status icon transparent background patch
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
updated patch to use GtkStatusIcon in place of EggTrayIcon
gnome-ppp-gtkstatusicon.patch (text/plain), 13.81 KB, created by
Michal Ruzicka
on 2008-07-31 09:15:53 UTC
(
hide
)
Description:
updated patch to use GtkStatusIcon in place of EggTrayIcon
Filename:
MIME Type:
Creator:
Michal Ruzicka
Created:
2008-07-31 09:15:53 UTC
Size:
13.81 KB
patch
obsolete
>diff -Naur gnome-ppp-0.3.23.orig/po/POTFILES.in gnome-ppp-0.3.23/po/POTFILES.in >--- gnome-ppp-0.3.23.orig/po/POTFILES.in 2004-11-08 11:10:34.000000000 +0100 >+++ gnome-ppp-0.3.23/po/POTFILES.in 2008-07-31 11:00:15.000000000 +0200 >@@ -1,7 +1,5 @@ > gnome-ppp.desktop.in > gnome-ppp.glade >-src/eggtrayicon.c >-src/eggtrayicon.h > src/gnome-ppp.c > src/gnome-ppp-connected.c > src/gnome-ppp-connecting.c >diff -Naur gnome-ppp-0.3.23.orig/src/gnome-ppp.h gnome-ppp-0.3.23/src/gnome-ppp.h >--- gnome-ppp-0.3.23.orig/src/gnome-ppp.h 2005-05-04 01:29:31.000000000 +0200 >+++ gnome-ppp-0.3.23/src/gnome-ppp.h 2008-07-31 11:02:53.000000000 +0200 >@@ -34,7 +34,6 @@ > # include <config.h> > #endif > >-#include "eggtrayicon.h" > /*#include <gnome.h>*/ > #include <gtk/gtk.h> > #include <glade/glade.h> >@@ -190,9 +189,7 @@ > /* notification */ > struct _Notification { > >- EggTrayIcon *tray; >- GtkWidget *box; >- GtkWidget *pixmap; >+ GtkStatusIcon *tray; > GtkWidget *menu; > }; > >@@ -208,7 +205,6 @@ > ConnectedWin connected; > DetailsWin details; > GtkWidget *detect; >- GtkWidget *about; > PhoneListWin phone; > InitStringsWin init_strs; > /* notification */ >@@ -313,7 +309,8 @@ > void update_notification (guint status); > void show_notification (gboolean show); > void destroy_notification (void); >-void on_notification_bpress_event (GtkWidget *widget, GdkEventButton *event, gpointer *data); >+void on_notification_activate (GtkStatusIcon *status_icon, gpointer data); >+void on_notification_popup_menu (GtkStatusIcon *status_icon, guint button, guint time, gpointer data); > void on_notification_menu (GtkWidget *widget, gpointer data); > > #ifdef __cplusplus >diff -Naur gnome-ppp-0.3.23.orig/src/gnome-ppp-main.c gnome-ppp-0.3.23/src/gnome-ppp-main.c >--- gnome-ppp-0.3.23.orig/src/gnome-ppp-main.c 2005-05-04 01:52:47.000000000 +0200 >+++ gnome-ppp-0.3.23/src/gnome-ppp-main.c 2008-07-31 11:00:15.000000000 +0200 >@@ -133,11 +133,7 @@ > gnome_ppp.detect = NULL; > /* notification */ > gnome_ppp.notification.tray = NULL; >- gnome_ppp.notification.box = NULL; >- gnome_ppp.notification.pixmap = NULL; > gnome_ppp.notification.menu = NULL; >- /* about window */ >- gnome_ppp.about = NULL; > /* phone list window */ > gnome_ppp.phone.window = NULL; > gnome_ppp.phone.phone_nums = NULL; >diff -Naur gnome-ppp-0.3.23.orig/src/gnome-ppp-notification.c gnome-ppp-0.3.23/src/gnome-ppp-notification.c >--- gnome-ppp-0.3.23.orig/src/gnome-ppp-notification.c 2005-05-04 00:29:20.000000000 +0200 >+++ gnome-ppp-0.3.23/src/gnome-ppp-notification.c 2008-07-31 11:02:23.000000000 +0200 >@@ -24,64 +24,61 @@ > > #include "gnome-ppp.h" > >+enum menu_choice { >+ MENU_DETAILS = 1, >+ MENU_DISCONNECT, >+ MENU_LOG >+}; >+ >+static gchar *icon_names[] = { >+ "sending_receiving", >+ "receiving", >+ "sending", >+ "idle" >+}; > > void init_notification (void) > { >- gchar *sr; >- gchar *s; >- gchar *r; >- gchar *i; >+ gchar *icon_file_name; >+ gchar *icon_path; >+ guint i; > > if (gnome_ppp.notification.tray == NULL) >- gnome_ppp.notification.tray = egg_tray_icon_new ("GNOME PPP"); >+ gnome_ppp.notification.tray = gtk_status_icon_new (); > >- gnome_ppp.notification.box = gtk_event_box_new (); >- gnome_ppp.notification.pixmap = gtk_image_new (); >+ gtk_status_icon_set_tooltip (gnome_ppp.notification.tray, "GNOME PPP"); > >- g_signal_connect (G_OBJECT (gnome_ppp.notification.box), "button_press_event", >- G_CALLBACK (on_notification_bpress_event), NULL); >+ g_signal_connect (G_OBJECT (gnome_ppp.notification.tray), "activate", >+ G_CALLBACK (on_notification_activate), NULL); >+ g_signal_connect (G_OBJECT (gnome_ppp.notification.tray), "popup-menu", >+ G_CALLBACK (on_notification_popup_menu), NULL); > >- gtk_container_add (GTK_CONTAINER (gnome_ppp.notification.tray), gnome_ppp.notification.box); >- gtk_container_add (GTK_CONTAINER (gnome_ppp.notification.box), gnome_ppp.notification.pixmap); > g_object_ref (G_OBJECT (gnome_ppp.notification.tray)); > >- /* notification icon paths */ >- sr = g_build_filename (PACKAGE_DATA_DIR, "gnome_ppp_sending_receiving.png", NULL); >- r = g_build_filename (PACKAGE_DATA_DIR, "gnome_ppp_receiving.png", NULL); >- s = g_build_filename (PACKAGE_DATA_DIR, "gnome_ppp_sending.png", NULL); >- i = g_build_filename (PACKAGE_DATA_DIR, "gnome_ppp_idle.png", NULL); >- > /* register icon factory */ > gnome_ppp.icon_factory = gtk_icon_factory_new (); >- gtk_icon_factory_add (gnome_ppp.icon_factory, "sending_receiving", >- gtk_icon_set_new_from_pixbuf (gdk_pixbuf_new_from_file (sr, NULL))); >- >- gtk_icon_factory_add (gnome_ppp.icon_factory, "receiving", >- gtk_icon_set_new_from_pixbuf (gdk_pixbuf_new_from_file (r, NULL))); >- >- gtk_icon_factory_add (gnome_ppp.icon_factory, "sending", >- gtk_icon_set_new_from_pixbuf (gdk_pixbuf_new_from_file (s, NULL))); >- >- gtk_icon_factory_add (gnome_ppp.icon_factory, "idle", >- gtk_icon_set_new_from_pixbuf (gdk_pixbuf_new_from_file (i, NULL))); >- >- gtk_icon_factory_add_default (gnome_ppp.icon_factory); > >- /* free icon paths */ >- g_free (sr); >- g_free (r); >- g_free (s); >- g_free (i); >+ /* load notification icons */ >+ for (i = 0; i < G_N_ELEMENTS (icon_names); i++) { >+ icon_file_name = g_build_path ("", "gnome_ppp_", icon_names[i], ".png", NULL); >+ icon_path = g_build_filename (PACKAGE_DATA_DIR, icon_file_name, NULL); >+ g_free (icon_file_name); >+ gtk_icon_factory_add (gnome_ppp.icon_factory, icon_names[i], >+ gtk_icon_set_new_from_pixbuf (gdk_pixbuf_new_from_file (icon_path, NULL))); >+ g_free (icon_path); >+ } >+ >+ gtk_icon_factory_add_default (gnome_ppp.icon_factory); > > /* popup menu */ > GtkWidget *item; > >- if (gnome_ppp.notification.menu == NULL) >+ if (gnome_ppp.notification.menu == NULL) > gnome_ppp.notification.menu = gtk_menu_new (); > > item = gtk_image_menu_item_new_with_label (_("Connection log")); > g_signal_connect (G_OBJECT (item), "activate", >- G_CALLBACK (on_notification_menu), "log"); >+ G_CALLBACK (on_notification_menu), (gpointer)MENU_LOG); > gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), > gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_MENU)); > gtk_menu_shell_append (GTK_MENU_SHELL (gnome_ppp.notification.menu), item); >@@ -89,7 +86,7 @@ > > item = gtk_image_menu_item_new_with_label (_("Details")); > g_signal_connect (G_OBJECT (item), "activate", >- G_CALLBACK (on_notification_menu), "details"); >+ G_CALLBACK (on_notification_menu), (gpointer)MENU_DETAILS); > gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), > gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_MENU)); > gtk_menu_shell_append (GTK_MENU_SHELL (gnome_ppp.notification.menu), item); >@@ -97,121 +94,64 @@ > > item = gtk_image_menu_item_new_with_label (_("Disconnect")); > g_signal_connect (G_OBJECT (item), "activate", >- G_CALLBACK (on_notification_menu), "disconnect"); >+ G_CALLBACK (on_notification_menu), (gpointer)MENU_DISCONNECT); > gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), > gtk_image_new_from_stock (GTK_STOCK_STOP, GTK_ICON_SIZE_MENU)); > gtk_menu_shell_append (GTK_MENU_SHELL (gnome_ppp.notification.menu), item); > gtk_widget_show (item); >- >- item = gtk_separator_menu_item_new (); >- gtk_menu_shell_append (GTK_MENU_SHELL (gnome_ppp.notification.menu), item); >- gtk_widget_show (item); >- >- /*item = gtk_image_menu_item_new_with_label (_("About")); >- g_signal_connect (G_OBJECT (item ), "activate", >- G_CALLBACK (on_notification_menu), "about"); >- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), >- gtk_image_new_from_stock (GNOME_STOCK_ABOUT, GTK_ICON_SIZE_MENU)); >- gtk_menu_shell_append (GTK_MENU_SHELL (gnome_ppp.notification.menu), item); >- gtk_widget_show (item);*/ > } > > void update_notification (guint status) > { >- if (status == 0) /* sending_receiving */ >- gtk_image_set_from_stock (GTK_IMAGE (gnome_ppp.notification.pixmap), >- "sending_receiving", >- GTK_ICON_SIZE_LARGE_TOOLBAR); >- else if (status == 1) /* receiving */ >- gtk_image_set_from_stock (GTK_IMAGE (gnome_ppp.notification.pixmap), >- "receiving", >- GTK_ICON_SIZE_LARGE_TOOLBAR); >- else if (status == 2) /* sending */ >- gtk_image_set_from_stock (GTK_IMAGE (gnome_ppp.notification.pixmap), >- "sending", >- GTK_ICON_SIZE_LARGE_TOOLBAR); >- else if (status == 3) /* idle */ >- gtk_image_set_from_stock (GTK_IMAGE (gnome_ppp.notification.pixmap), >- "idle", >- GTK_ICON_SIZE_LARGE_TOOLBAR); >+ if (status < G_N_ELEMENTS (icon_names)) { >+ gtk_status_icon_set_from_stock (gnome_ppp.notification.tray, >+ icon_names[status]); >+ } > } > > void show_notification (gboolean show) > { > if (gnome_ppp.notification.tray) { >- >- if (show) >- gtk_widget_show_all (GTK_WIDGET (gnome_ppp.notification.tray)); >- else >- gtk_widget_hide_all (GTK_WIDGET (gnome_ppp.notification.tray)); >+ gtk_status_icon_set_visible (gnome_ppp.notification.tray, show); > } > } > >-void on_notification_bpress_event (GtkWidget *widget, GdkEventButton *event, gpointer *data) >+void on_notification_activate (GtkStatusIcon *status_icon, gpointer data) > { >- if (event->type != GDK_BUTTON_PRESS) >- return; >- >- if (event->button == 1) { /* left button */ >- >- if (gnome_ppp.connected.show == TRUE) { >- gtk_widget_hide (gnome_ppp.connected.window); >- gnome_ppp.connected.show = FALSE; >- } else { >- gtk_widget_show (gnome_ppp.connected.window); >- gnome_ppp.connected.show = TRUE; >- } >+ if (gnome_ppp.connected.show == TRUE) { >+ gtk_widget_hide (gnome_ppp.connected.window); >+ gnome_ppp.connected.show = FALSE; >+ } else { >+ gtk_widget_show (gnome_ppp.connected.window); >+ gnome_ppp.connected.show = TRUE; > } >- >- if (event->button == 3 ) /* right button */ >- gtk_menu_popup (GTK_MENU (gnome_ppp.notification.menu), NULL, NULL, NULL, NULL, event->button, event->time); >+} >+ >+void on_notification_popup_menu (GtkStatusIcon *status_icon, guint button, guint time, gpointer data) >+{ >+ gtk_menu_popup (GTK_MENU (gnome_ppp.notification.menu), NULL, NULL, >+ NULL, NULL, button, time); > } > > void on_notification_menu (GtkWidget *widget, gpointer data) > { >- gchar *tmp = NULL; >- >- tmp = (gchar *)data; >- >- if (g_strrstr (data, "details") != NULL) >- gtk_widget_show (gnome_ppp.details.window); >- >- if (g_strrstr (data, "disconnect") != NULL) >- on_conn_disconnect (NULL, NULL); >- >- if (g_strrstr (data, "about") != NULL) { >- /*gchar *icon; >- >- icon = g_build_filename (PACKAGE_APPICON_DIR, "gnome-ppp.png", NULL); >- >- static const gchar *authors [] = { >- "Vladimir ÄokiÄ <vladeck@gnome-ppp.org>", >- "", >- "Contributor: Dan Korostelev <dan@ats.energo.ru>", >- NULL >- }; >- const gchar *documenters [] = { NULL }; >- const gchar *translator_credits = _("translator_credits"); >- gnome_ppp.about = gnome_about_new (_("GNOME PPP"), VERSION, >- "Copyright \xc2\xa9 2004 Vladimir ÄokiÄ\n", >- _("GNOME Dialup Tool."), authors, documenters, >- strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL, >- gdk_pixbuf_new_from_file (icon, NULL)); >- g_free (icon); >+ switch ((enum menu_choice)data) { >+ case MENU_DETAILS: >+ gtk_widget_show (gnome_ppp.details.window); >+ break; > >- g_signal_connect (G_OBJECT (gnome_ppp.about), "destroy", >- G_CALLBACK (gtk_widget_destroyed), &gnome_ppp.about); >+ case MENU_DISCONNECT: >+ on_conn_disconnect (NULL, NULL); >+ break; > >- gtk_widget_show (gnome_ppp.about);*/ >+ case MENU_LOG: >+ gtk_widget_show (gnome_ppp.log.window); >+ break; > } >- >- if (g_strrstr (data, "log") != NULL) >- gtk_widget_show (gnome_ppp.log.window); > } > > void destroy_notification (void) > { >- gtk_widget_destroy (GTK_WIDGET (gnome_ppp.notification.tray)); > gtk_widget_destroy (gnome_ppp.notification.menu); > g_object_unref (G_OBJECT (gnome_ppp.notification.tray)); > gnome_ppp.notification.tray = NULL; >diff -Naur gnome-ppp-0.3.23.orig/src/Makefile.am gnome-ppp-0.3.23/src/Makefile.am >--- gnome-ppp-0.3.23.orig/src/Makefile.am 2005-06-30 19:41:40.000000000 +0200 >+++ gnome-ppp-0.3.23/src/Makefile.am 2008-07-31 11:00:15.000000000 +0200 >@@ -1,6 +1,5 @@ > bin_PROGRAMS = gnome-ppp >-gnome_ppp_SOURCES = eggtrayicon.c \ >- gnome-ppp-connected.c \ >+gnome_ppp_SOURCES = gnome-ppp-connected.c \ > gnome-ppp-connecting.c \ > gnome-ppp-details.c \ > gnome-ppp-detect.c \ >@@ -13,7 +12,6 @@ > gnome-ppp-wvdial.c \ > gnome-ppp-wvdialconf.c \ > gnome-ppp.c \ >- eggtrayicon.h \ > gnome-ppp.h > > AM_CFLAGS = -Wall -export-dynamic >diff -Naur gnome-ppp-0.3.23.orig/src/Makefile.in gnome-ppp-0.3.23/src/Makefile.in >--- gnome-ppp-0.3.23.orig/src/Makefile.in 2005-07-13 01:47:50.000000000 +0200 >+++ gnome-ppp-0.3.23/src/Makefile.in 2008-07-31 11:00:15.000000000 +0200 >@@ -51,7 +51,7 @@ > am__installdirs = "$(DESTDIR)$(bindir)" > binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) > PROGRAMS = $(bin_PROGRAMS) >-am_gnome_ppp_OBJECTS = eggtrayicon.$(OBJEXT) \ >+am_gnome_ppp_OBJECTS = \ > gnome-ppp-connected.$(OBJEXT) gnome-ppp-connecting.$(OBJEXT) \ > gnome-ppp-details.$(OBJEXT) gnome-ppp-detect.$(OBJEXT) \ > gnome-ppp-init-strings.$(OBJEXT) gnome-ppp-log.$(OBJEXT) \ >@@ -220,8 +220,7 @@ > sharedstatedir = @sharedstatedir@ > sysconfdir = @sysconfdir@ > target_alias = @target_alias@ >-gnome_ppp_SOURCES = eggtrayicon.c \ >- gnome-ppp-connected.c \ >+gnome_ppp_SOURCES = gnome-ppp-connected.c \ > gnome-ppp-connecting.c \ > gnome-ppp-details.c \ > gnome-ppp-detect.c \ >@@ -234,7 +233,6 @@ > gnome-ppp-wvdial.c \ > gnome-ppp-wvdialconf.c \ > gnome-ppp.c \ >- eggtrayicon.h \ > gnome-ppp.h > > AM_CFLAGS = -Wall -export-dynamic >@@ -311,7 +309,6 @@ > distclean-compile: > -rm -f *.tab.c > >-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eggtrayicon.Po@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnome-ppp-connected.Po@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnome-ppp-connecting.Po@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnome-ppp-details.Po@am__quote@
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457151
:
312937
|
312938
|
313052
|
313053
|
313054
| 313081 |
313082