aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-12-18 01:44:46 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-12-18 01:44:46 +0800
commit9a624c83b1ae7055aeafd23607380aa332adfa4a (patch)
tree4c5ae8e5043ada2a14407c17be86203ff30e83d7
parent6d68ea432a9718415056531bf1b5997a8ca428d1 (diff)
downloadgsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar.gz
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar.bz2
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar.lz
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar.xz
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.tar.zst
gsoc2013-evolution-9a624c83b1ae7055aeafd23607380aa332adfa4a.zip
use g_file_test to check if the 'pixmap' argument is a file. If so, get
2003-12-17 Rodrigo Moya <rodrigo@ximian.com> * gui/tasks-component.c (add_popup_menu_item): * gui/calendar-component.c (add_popup_menu_item): use g_file_test to check if the 'pixmap' argument is a file. If so, get the pixmap from it, or gtk_image_new_from_stock will return an empty pixmap. svn path=/trunk/; revision=23969
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/calendar-component.c5
-rw-r--r--calendar/gui/tasks-component.c5
3 files changed, 13 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 07dfc662a1..f1fffca864 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,12 @@
2003-12-17 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/tasks-component.c (add_popup_menu_item):
+ * gui/calendar-component.c (add_popup_menu_item): use g_file_test
+ to check if the 'pixmap' argument is a file. If so, get the pixmap
+ from it, or gtk_image_new_from_stock will return an empty pixmap.
+
+2003-12-17 Rodrigo Moya <rodrigo@ximian.com>
+
* gui/gnome-cal.c (client_cal_opened_cb): set a correct status
message.
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index e113abb296..dc2937eb2e 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -315,9 +315,10 @@ add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
item = gtk_image_menu_item_new_with_label (label);
/* load the image */
- image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
- if (!image)
+ if (g_file_test (pixmap, G_FILE_TEST_EXISTS))
image = gtk_image_new_from_file (pixmap);
+ else
+ image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
if (image) {
gtk_widget_show (image);
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 575b8ca4eb..f12e1a6078 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -288,9 +288,10 @@ add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
item = gtk_image_menu_item_new_with_label (label);
/* load the image */
- image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
- if (!image)
+ if (g_file_test (pixmap, G_FILE_TEST_EXISTS))
image = gtk_image_new_from_file (pixmap);
+ else
+ image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
if (image) {
gtk_widget_show (image);