diff options
author | JP Rosevear <jpr@ximian.com> | 2002-04-24 13:22:42 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-04-24 13:22:42 +0800 |
commit | 11be06c763d9a9f4d699a7d95a0aff66af6328a2 (patch) | |
tree | e750881e65d3dab275590ecc0483d735d1f491ce /calendar/gui/e-week-view.c | |
parent | 6dc8c1aabd4f9e7a5b785d97a5e6cad3d66d604b (diff) | |
download | gsoc2013-evolution-11be06c763d9a9f4d699a7d95a0aff66af6328a2.tar.gz gsoc2013-evolution-11be06c763d9a9f4d699a7d95a0aff66af6328a2.tar.zst gsoc2013-evolution-11be06c763d9a9f4d699a7d95a0aff66af6328a2.zip |
free the view popup (e_week_view_show_popup_menu): add the view popup to
2002-04-24 JP Rosevear <jpr@ximian.com>
* gui/e-week-view.c (free_view_popup): free the view popup
(e_week_view_show_popup_menu): add the view popup to the
"main_item" menu and listen for destruction
* gui/e-day-view.c (free_view_popup): as above
(e_day_view_on_event_right_click): as above
* gui/e-week-view.h: add class member
* gui/e-day-view.h: add a class member
* gui/gnome-cal.h: new protos
* gui/gnome-cal.c (set_view): set the instance view id properly
when switching views
(gnome_calendar_setup_view_popup): generate a view popup
(gnome_calendar_discard_view_popup): destroy a view popup
svn path=/trunk/; revision=16572
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r-- | calendar/gui/e-week-view.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 3ebc5f9ac0..4fb09c5961 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -44,8 +44,8 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gnome-canvas-pixbuf.h> #include <gal/e-text/e-text.h> -#include <gal/widgets/e-popup-menu.h> #include <gal/widgets/e-canvas-utils.h> +#include <gal/widgets/e-gui-utils.h> #include <gal/widgets/e-unicode.h> #include <e-util/e-dialog-utils.h> #include "dialogs/delete-comp.h" @@ -3444,6 +3444,8 @@ static EPopupMenu main_items [] = { E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, 0), E_POPUP_SEPARATOR, + + E_POPUP_SUBMENU (N_("Current View"), NULL, 0), E_POPUP_ITEM (N_("Go to _Today"), e_week_view_on_goto_today, 0), E_POPUP_ITEM (N_("_Go to Date..."), e_week_view_on_goto_date, 0), @@ -3473,8 +3475,8 @@ static EPopupMenu child_items [] = { E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING), - E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING), + E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_EDITING), + E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITABLE | MASK_EDITING), E_POPUP_SEPARATOR, @@ -3486,6 +3488,14 @@ static EPopupMenu child_items [] = { E_POPUP_TERMINATOR }; +static void +free_view_popup (GtkWidget *widget, gpointer data) +{ + EWeekView *week_view = E_WEEK_VIEW (data); + + gnome_calendar_discard_view_popup (week_view->calendar, week_view->view_menu); +} + void e_week_view_show_popup_menu (EWeekView *week_view, GdkEventButton *bevent, @@ -3496,7 +3506,8 @@ e_week_view_show_popup_menu (EWeekView *week_view, gboolean being_edited; guint32 disable_mask = 0, hide_mask = 0; EPopupMenu *context_menu; - + GtkMenu *popup; + have_selection = GTK_WIDGET_HAS_FOCUS (week_view) && week_view->selection_start_day != -1; @@ -3508,6 +3519,8 @@ e_week_view_show_popup_menu (EWeekView *week_view, being_edited = FALSE; if (event_num == -1) { + week_view->view_menu = gnome_calendar_setup_view_popup (week_view->calendar); + main_items[9].submenu = week_view->view_menu; context_menu = main_items; } else { context_menu = child_items; @@ -3523,7 +3536,10 @@ e_week_view_show_popup_menu (EWeekView *week_view, disable_mask |= MASK_EDITING; week_view->popup_event_num = event_num; - e_popup_menu_run (context_menu, (GdkEvent *) bevent, disable_mask, hide_mask, week_view); + popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, week_view); + gtk_signal_connect (GTK_OBJECT (popup), "selection-done", + GTK_SIGNAL_FUNC (free_view_popup), week_view); + e_popup_menu (popup, (GdkEvent *) bevent); } static void |