diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-08-09 09:09:55 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-08-09 09:09:55 +0800 |
commit | b9a9cd3a8699c350dc6746c595e4de3e030545c4 (patch) | |
tree | 525676e7afd76aa1babe4fdf6dfe8ab8d16a1feb /mail/message-list.c | |
parent | 4b65801638f2d6b4cfefb9cc13966a7557e2f946 (diff) | |
download | gsoc2013-evolution-b9a9cd3a8699c350dc6746c595e4de3e030545c4.tar.gz gsoc2013-evolution-b9a9cd3a8699c350dc6746c595e4de3e030545c4.tar.zst gsoc2013-evolution-b9a9cd3a8699c350dc6746c595e4de3e030545c4.zip |
New convenience function with params of a normal Gtk callback function. We
2000-08-08 Jeffrey Stedfast <fejj@helixcode.com>
* mail-ops.c (view_msg): New convenience function with params of a
normal Gtk callback function. We also now create a new
FolderBrowser object so that the message-view window isn't tied to
the display in the main window
(view_message): Now calls view_msg (this function is a bonobo
callback and can't be used with gtk widgets)
(edit_msg): Same idea as view_msg()
(edit_message): Again, same as view_message()
* message-list.c (on_right_click): Callback for creating an
e-popup-menu
(message_list_init): Added a right_click event to trigger a pop-up
menu to be displayed
svn path=/trunk/; revision=4619
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 2a390530e4..eb6a163bcc 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -12,12 +12,14 @@ #include <config.h> #include <gnome.h> #include <bonobo/bonobo-main.h> -#include "e-util/e-util.h" -#include "e-util/e-gui-utils.h" -#include "camel/camel-exception.h" +#include <e-util/e-util.h> +#include <e-util/e-gui-utils.h> +#include <e-util/e-popup-menu.h> +#include <camel/camel-exception.h> #include <camel/camel-folder.h> #include "message-list.h" #include "message-thread.h" +#include "mail.h" #include "Mail.h" #include "widgets/e-table/e-table-header-item.h" #include "widgets/e-table/e-table-item.h" @@ -58,6 +60,7 @@ static POA_Evolution_MessageList__vepv evolution_message_list_vepv; static void on_cursor_change_cmd (ETableScrolled *table, int row, gpointer user_data); static void select_row (ETableScrolled *table, gpointer user_data); +static gint on_right_click (ETableScrolled *table, gint row, gint col, GdkEvent *event, MessageList *list); static void select_msg (MessageList *message_list, gint row); static char *filter_date (const void *data); @@ -553,38 +556,41 @@ message_list_init (GtkObject *object) { MessageList *message_list = MESSAGE_LIST (object); char *spec; - + message_list->table_model = (ETableModel *) e_tree_simple_new (ml_tree_icon_at, ml_tree_value_at, ml_tree_set_value_at, ml_tree_is_cell_editable, message_list); e_tree_model_root_node_set_visible ((ETreeModel *)message_list->table_model, FALSE); - + message_list_init_renderers (message_list); message_list_init_header (message_list); - + /* * The etable */ - + spec = message_list_get_layout (message_list); message_list->etable = e_table_scrolled_new ( message_list->header_model, message_list->table_model, spec); g_free (spec); - + gtk_object_set(GTK_OBJECT(message_list->etable), "cursor_mode", E_TABLE_CURSOR_LINE, "drawfocus", FALSE, "drawgrid", FALSE, NULL); - + gtk_signal_connect (GTK_OBJECT (message_list->etable), "realize", GTK_SIGNAL_FUNC (select_row), message_list); gtk_signal_connect (GTK_OBJECT (message_list->etable), "cursor_change", GTK_SIGNAL_FUNC (on_cursor_change_cmd), message_list); - + + gtk_signal_connect (GTK_OBJECT (message_list->etable), "right_click", + GTK_SIGNAL_FUNC (on_right_click), message_list); + gtk_widget_show (message_list->etable); gtk_object_ref (GTK_OBJECT (message_list->table_model)); @@ -967,6 +973,29 @@ select_row (ETableScrolled *table, gpointer user_data) gtk_idle_add (idle_select_row, message_list->etable); } +static gint +on_right_click (ETableScrolled *table, gint row, gint col, GdkEvent *event, MessageList *list) +{ + FolderBrowser *fb = list->parent_folder_browser; + extern CamelFolder *drafts_folder; + EPopupMenu menu[] = { + { "View Message", NULL, GTK_SIGNAL_FUNC (view_msg), 0 }, + { "Edit Message", NULL, GTK_SIGNAL_FUNC (edit_msg), 1 }, + { "Print Message", NULL, GTK_SIGNAL_FUNC (print_msg), 0 }, + { "", NULL, GTK_SIGNAL_FUNC (NULL), 0 }, + { "Reply to Sender", NULL, GTK_SIGNAL_FUNC (reply_to_sender), 0 }, + { "Reply to All", NULL, GTK_SIGNAL_FUNC (reply_to_all), 0 }, + { "Forward Message", NULL, GTK_SIGNAL_FUNC (forward_msg), 0 }, + { "", NULL, GTK_SIGNAL_FUNC (NULL), 0 }, + { "Delete Message", NULL, GTK_SIGNAL_FUNC (delete_msg), 0 }, + { "Move Message", NULL, GTK_SIGNAL_FUNC (move_msg), 0 }, + { NULL, NULL, NULL, 0 } + }; + + e_popup_menu_run (menu, (GdkEventButton *)event, (fb->folder == drafts_folder) ? 0 : 1, fb); + + return TRUE; +} struct message_list_foreach_data { MessageList *message_list; |