aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorBolian Yin <bolian.yin@sun.com>2003-06-26 00:08:57 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-06-26 00:08:57 +0800
commitc3ece20f02b7c1452af1380946e6c62a3d48cf11 (patch)
treec0bb58b41fed6f8e2c7a9c1d89e737cfacc4aca5 /calendar
parentbd282c59ea6a83e5893be076965ad926128de702 (diff)
downloadgsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar.gz
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar.bz2
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar.lz
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar.xz
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.tar.zst
gsoc2013-evolution-c3ece20f02b7c1452af1380946e6c62a3d48cf11.zip
Fixes #45275
2003-06-25 Bolian Yin <bolian.yin@sun.com> Fixes #45275 * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): new function. (e_calendar_table_on_right_click_menu): call e_calendar_table_show_popup_menu. (e_calendar_table_on_popup_menu): callback for "popup_menu" signal. (e_calendar_table_init): connect to ETable's "popup_menu" signal. svn path=/trunk/; revision=21537
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog11
-rw-r--r--calendar/gui/e-calendar-table.c45
2 files changed, 47 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 6d4336da32..b668e39e3b 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,4 +1,13 @@
-2003-06-25 Bolian Yin <bolian.yin@sun.com
+2003-06-25 Bolian Yin <bolian.yin@sun.com>
+
+ Fixes #45275
+
+ * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): new function.
+ (e_calendar_table_on_right_click_menu): call e_calendar_table_show_popup_menu.
+ (e_calendar_table_on_popup_menu): callback for "popup_menu" signal.
+ (e_calendar_table_init): connect to ETable's "popup_menu" signal.
+
+2003-06-25 Bolian Yin <bolian.yin@sun.com>
Fixes #45273
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index c55875d943..faaee9d9f4 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -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 @@ static void e_calendar_table_on_double_click (ETable *table,
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 @@ e_calendar_table_init (ECalendarTable *cal_table)
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 EPopupMenu tasks_popup_menu [] = {
};
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 @@ e_calendar_table_on_right_click (ETable *table,
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,