[evolution-patches] [Fwd: [calendar, keynav] seek review for bug 45275, Shift+F10 to activate Popup menu in ToDo List]
- From: Bolian Yin <bolian yin sun com>
- To: JP Rosevear <jpr ximian com>
- Cc: evolution-patches ximian com
- Subject: [evolution-patches] [Fwd: [calendar, keynav] seek review for bug 45275, Shift+F10 to activate Popup menu in ToDo List]
- Date: Wed, 25 Jun 2003 09:39:11 +0800
Hi JP,
Did you got time to review it?
-Bolian
-------- Original Message --------
Hi,
A Calendar keynav fix. bug 45275, Shift+F10 to activate Popup menu in
ToDo List (http://bugzilla.ximian.com/show_bug.cgi?id=45275)
This is like the bug 44682, Shift+F10 to active popup menu on day/week
view (http://bugzilla.ximian.com/show_bug.cgi?id=44682)
Please review. Thanks.
-Bolian
Index: e-calendar-table.c
===================================================================
RCS file: /home/localcvs/src/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- e-calendar-table.c 20 Jun 2003 02:15:51 -0000 1.2
+++ e-calendar-table.c 20 Jun 2003 02:21:02 -0000 1.3
@@ -33,6 +33,7 @@
#include <unistd.h>
#include <gnome.h>
#include <gtk/gtkinvisible.h>
+#include <gal/widgets/e-gui-utils.h>
#include <gal/e-table/e-cell-checkbox.h>
#include <gal/e-table/e-cell-toggle.h>
#include <gal/e-table/e-cell-text.h>
@@ -70,11 +71,18 @@
gint col,
GdkEvent *event,
ECalendarTable *cal_table);
+static gint e_calendar_table_show_popup_menu (ETable *table,
+ GdkEvent *gdk_event,
+ ECalendarTable *cal_table);
+
static gint e_calendar_table_on_right_click (ETable *table,
gint row,
gint col,
- GdkEventButton *event,
+ GdkEvent *event,
ECalendarTable *cal_table);
+static gboolean e_calendar_table_on_popup_menu (GtkWidget *widget,
+ gpointer data);
+
static void e_calendar_table_on_open_task (GtkWidget *menuitem,
gpointer data);
static void e_calendar_table_on_save_as (GtkWidget *menuitem,
@@ -519,6 +527,7 @@
g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
+ g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_calendar_table_on_popup_menu), cal_table);
/* Set up the invisible widget for the clipboard selections */
cal_table->invisible = gtk_invisible_new ();
@@ -972,15 +981,14 @@
};
static gint
-e_calendar_table_on_right_click (ETable *table,
- gint row,
- gint col,
- GdkEventButton *event,
- ECalendarTable *cal_table)
+e_calendar_table_show_popup_menu (ETable *table,
+ GdkEvent *gdk_event,
+ ECalendarTable *cal_table)
{
int n_selected;
int hide_mask = 0;
int disable_mask = 0;
+ GtkMenu *gtk_menu;
n_selected = e_table_selected_count (table);
if (n_selected <= 0)
@@ -998,12 +1006,33 @@
CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT))
disable_mask |= MASK_ASSIGNABLE;
- e_popup_menu_run (tasks_popup_menu, (GdkEvent *) event,
- disable_mask, hide_mask, cal_table);
+ gtk_menu = e_popup_menu_create (tasks_popup_menu, disable_mask,
+ hide_mask, cal_table);
+
+ e_popup_menu (gtk_menu, gdk_event);
return TRUE;
}
+static gint
+e_calendar_table_on_right_click (ETable *table,
+ gint row,
+ gint col,
+ GdkEvent *event,
+ ECalendarTable *cal_table)
+{
+ return e_calendar_table_show_popup_menu (table, event, cal_table);
+}
+
+static gboolean
+e_calendar_table_on_popup_menu (GtkWidget *widget, gpointer data)
+{
+ ETable *table = E_TABLE(widget);
+ g_return_if_fail(table);
+
+ return e_calendar_table_show_popup_menu (table, NULL,
+ E_CALENDAR_TABLE(data));
+}
static void
e_calendar_table_on_open_task (GtkWidget *menuitem,
Index: e-calendar-table.h
===================================================================
RCS file: /home/localcvs/src/evolution/calendar/gui/e-calendar-table.h,v
retrieving revision 1.1
retrieving revision 1.1.1.1
diff -u -r1.1 -r1.1.1.1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]