aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-view.c
diff options
context:
space:
mode:
authorHarry Lu <harry.lu@sun.com>2004-10-08 17:38:31 +0800
committerHarry Lu <haip@src.gnome.org>2004-10-08 17:38:31 +0800
commit6da4058665d0d49eb2c8be7b3a0a62ca9f8f8e7a (patch)
tree6d61c0c34fa47f98fb880494824d2cc256d92b6b /mail/em-folder-view.c
parent35ddf245532168c64559c6b6cfdb0c0970c6a5f2 (diff)
downloadgsoc2013-evolution-6da4058665d0d49eb2c8be7b3a0a62ca9f8f8e7a.tar.gz
gsoc2013-evolution-6da4058665d0d49eb2c8be7b3a0a62ca9f8f8e7a.tar.zst
gsoc2013-evolution-6da4058665d0d49eb2c8be7b3a0a62ca9f8f8e7a.zip
implement popup_menu so that popup menu can be shown with Shift+F10 on
2004-10-08 Harry Lu <harry.lu@sun.com> * em-folder-tree.c: (em_folder_tree_class_init), (real_popup_menu), (emft_popup_menu), (emft_tree_button_press): implement popup_menu so that popup menu can be shown with Shift+F10 on folder tree. * em-folder-view.c: (emfv_popup), (emfv_list_key_press): same as above. svn path=/trunk/; revision=27507
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r--mail/em-folder-view.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index b59fb0ff5c..ab3de6d597 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -121,6 +121,8 @@ static void emfv_setting_setup(EMFolderView *emfv);
static void emfv_on_url_cb(GObject *emitter, const char *url, EMFolderView *emfv);
static void emfv_on_url(EMFolderView *emfv, const char *uri, const char *nice_uri);
+static gboolean emfv_popup_menu (GtkWidget *widget);
+
static const EMFolderViewEnable emfv_enable_map[];
struct _EMFolderViewPrivate {
@@ -266,6 +268,8 @@ emfv_class_init(GObjectClass *klass)
((GtkObjectClass *) klass)->destroy = emfv_destroy;
+ ((GtkWidgetClass *) klass)->popup_menu = emfv_popup_menu;
+
((EMFolderViewClass *) klass)->update_message_style = TRUE;
((EMFolderViewClass *)klass)->set_folder = emfv_set_folder;
@@ -917,7 +921,7 @@ EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_mlist, AUTO_MLIST)
/* TODO: Move some of these to be 'standard' menu's */
-static EPopupItem emfv_popup_menu[] = {
+static EPopupItem emfv_popup_items[] = {
{ E_POPUP_ITEM, "00.emfv.00", N_("_Open"), emfv_popup_open, NULL, NULL, 0 },
{ E_POPUP_ITEM, "00.emfv.01", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_EDIT },
{ E_POPUP_ITEM, "00.emfv.02", N_("_Save As..."), emfv_popup_saveas, NULL, "stock_save-as", 0 },
@@ -1011,8 +1015,8 @@ emfv_popup(EMFolderView *emfv, GdkEvent *event)
emp = em_popup_new("com.ximian.mail.folderview.popup.select");
target = em_folder_view_get_popup_target(emfv, emp);
- for (i=0;i<sizeof(emfv_popup_menu)/sizeof(emfv_popup_menu[0]);i++)
- menus = g_slist_prepend(menus, &emfv_popup_menu[i]);
+ for (i=0;i<sizeof(emfv_popup_items)/sizeof(emfv_popup_items[0]);i++)
+ menus = g_slist_prepend(menus, &emfv_popup_items[i]);
e_popup_add_items((EPopup *)emp, menus, emfv_popup_items_free, emfv);
@@ -1052,7 +1056,7 @@ emfv_popup(EMFolderView *emfv, GdkEvent *event)
if (event == NULL || event->type == GDK_KEY_PRESS) {
/* FIXME: menu pos function */
- gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event ? event->key.time : time (NULL));
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event ? event->key.time : gtk_get_current_event_time());
} else {
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time);
}
@@ -2074,10 +2078,6 @@ emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
case GDK_ISO_Enter:
em_folder_view_open_selected(emfv);
break;
- case GDK_Menu:
- /* FIXME: location of popup */
- emfv_popup(emfv, NULL);
- break;
case '!':
uids = message_list_get_selected(emfv->list);
@@ -2100,6 +2100,16 @@ emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
return TRUE;
}
+static gboolean
+emfv_popup_menu (GtkWidget *widget)
+{
+ EMFolderView *emfv = (EMFolderView *)widget;
+
+ emfv_popup (emfv, NULL);
+
+ return TRUE;
+}
+
static void
emfv_list_selection_change(ETree *tree, EMFolderView *emfv)
{