aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/tasks-component.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-11-17 23:39:39 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-11-17 23:39:39 +0800
commit6af0f0710011c532c6eff1815a39794db91297aa (patch)
tree57a14c662aa03a3ef3ff3c304bd13d7f93b3748a /calendar/gui/tasks-component.c
parent66d47badff98208b1b1c5db1ce0db0d10f32de4b (diff)
downloadgsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar.gz
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar.bz2
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar.lz
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar.xz
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.tar.zst
gsoc2013-evolution-6af0f0710011c532c6eff1815a39794db91297aa.zip
try first to create the icon from the stock, and then from a file.
2003-11-17 Rodrigo Moya <rodrigo@ximian.com> * gui/calendar-component.c (add_popup_menu_item): try first to create the icon from the stock, and then from a file. (fill_popup_menu_cb): set callback for 'Rename' menu item. (rename_calendar_cb): callback for 'Rename' menu item. (new_calendar_cb): fixed arguments. * gui/tasks-component.c (impl_createControls): connect to "fill_popup_menu" signal on the source selector. (fill_popup_menu_cb): callback to create our menu items. svn path=/trunk/; revision=23388
Diffstat (limited to 'calendar/gui/tasks-component.c')
-rw-r--r--calendar/gui/tasks-component.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 58448dc646..f79ddfd3a8 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -199,6 +199,44 @@ get_default_task (ECal *ecal)
/* Callbacks. */
static void
+add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
+ GCallback callback, gpointer user_data)
+{
+ GtkWidget *item, *image;
+
+ if (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)
+ image = gtk_image_new_from_file (pixmap);
+
+ if (image)
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ } else {
+ item = gtk_menu_item_new_with_label (label);
+ }
+
+ if (callback)
+ g_signal_connect (G_OBJECT (item), "activate", callback, user_data);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (item);
+}
+
+static void
+new_task_list_cb (GtkWidget *widget, TasksComponent *component)
+{
+}
+
+static void
+fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, TasksComponent *component)
+{
+ add_popup_menu (menu, _("New Task List"), GTK_STOCK_NEW, G_CALLBACK (new_task_list_cb), component);
+}
+
+static void
source_selection_changed_cb (ESourceSelector *selector, TasksComponent *component)
{
update_uris_for_selection (component);
@@ -337,6 +375,9 @@ impl_createControls (PortableServer_Servant servant,
g_signal_connect_object (priv->source_selector, "primary_selection_changed",
G_CALLBACK (primary_source_selection_changed_cb),
G_OBJECT (component), 0);
+ g_signal_connect_object (priv->source_selector, "fill_popup_menu",
+ G_CALLBACK (fill_popup_menu_cb),
+ G_OBJECT (component), 0);
/* Load the selection from the last run */
update_selection (component);