aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-03 03:01:04 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-03 03:01:04 +0800
commit4654c4625e79a0d36ef25d81a0c6f53fcd714837 (patch)
tree5ce873589d044e1c3ee1fd5aee8f1fbff0c868e4
parente8ae4bc97abed6ad8571908f5fc4ac6fd5565fde (diff)
downloadgsoc2013-evolution-4654c4625e79a0d36ef25d81a0c6f53fcd714837.tar.gz
gsoc2013-evolution-4654c4625e79a0d36ef25d81a0c6f53fcd714837.tar.zst
gsoc2013-evolution-4654c4625e79a0d36ef25d81a0c6f53fcd714837.zip
Make the `Home' and `End' keys do the Right Thing. Remove circular
reference to the shell. Bind "Open in New Window" to `Ctrl-O'. svn path=/trunk/; revision=5181
-rw-r--r--mail/ChangeLog16
-rw-r--r--mail/folder-browser-factory.c3
-rw-r--r--mail/folder-browser.c57
-rw-r--r--mail/message-list.c46
-rw-r--r--mail/message-list.h3
5 files changed, 101 insertions, 24 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f3cd8e7fa7..bc10c02523 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,19 @@
+2000-09-02 Ettore Perazzoli <ettore@helixcode.com>
+
+ * folder-browser.c (etable_key): Make the `Home' key to move to
+ the beginning of the list and `End' to the end of it, using
+ `message_list_home()' and `message_list_end()'.
+
+ * message-list.c (message_list_home): New.
+ (message_list_end): New.
+
+ * folder-browser.c (folder_browser_new): Don't ref the shell here.
+ (folder_browser_destroy): Don't unref the shell. Instead,
+ `CORBA_free()' the object reference.
+
+ * folder-browser-factory.c (control_activate): Bind "Open in New
+ Window" to `Ctrl-O'.
+
2000-09-02 Lauris Kaplinski <lauris@helixcode.com>
* mail-config-gui.c: Use e_utf8 wrappers
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c
index d3eafcb933..134e6a431a 100644
--- a/mail/folder-browser-factory.c
+++ b/mail/folder-browser-factory.c
@@ -175,7 +175,8 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih,
bonobo_ui_handler_menu_new_item (
uih, "/<Component Placeholder>/Message/Open in New Window",
_("_Open in New Window"), NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, 0, 0,
+ BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
+ 'o', GDK_CONTROL_MASK,
view_message, folder_browser);
bonobo_ui_handler_menu_new_item (
uih, "/<Component Placeholder>/Message/Edit Message",
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 44f33a22cf..99365678a3 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -49,13 +49,8 @@ folder_browser_destroy (GtkObject *object)
{
FolderBrowser *folder_browser = FOLDER_BROWSER (object);
- if (folder_browser->shell) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- Bonobo_Unknown_unref (folder_browser->shell, &ev);
- CORBA_exception_free (&ev);
- }
+ if (folder_browser->shell)
+ CORBA_free (folder_browser->shell);
if (folder_browser->uri)
g_free (folder_browser->uri);
@@ -308,7 +303,10 @@ etable_key (ETable *table, int row, int col, GdkEvent *ev, FolderBrowser *fb)
if ((ev->key.state & !(GDK_SHIFT_MASK | GDK_LOCK_MASK)) != 0)
return FALSE;
- if (ev->key.keyval == GDK_space || ev->key.keyval == GDK_BackSpace) {
+ switch (ev->key.keyval) {
+ case GDK_space:
+ case GDK_BackSpace:
+ {
GtkAdjustment *vadj;
gfloat page_size;
@@ -329,20 +327,42 @@ etable_key (ETable *table, int row, int col, GdkEvent *ev, FolderBrowser *fb)
gtk_adjustment_value_changed (vadj);
return TRUE;
- } else if (ev->key.keyval == GDK_Delete ||
- ev->key.keyval == GDK_KP_Delete) {
+ }
+
+ case GDK_Delete:
+ case GDK_KP_Delete:
delete_msg (NULL, fb);
message_list_select (fb->message_list, row,
MESSAGE_LIST_SELECT_NEXT,
0, CAMEL_MESSAGE_DELETED);
return TRUE;
- } else if (ev->key.keyval == 'n' || ev->key.keyval == 'N' ||
- ev->key.keyval == 'p' || ev->key.keyval == 'P') {
+
+ case GDK_Home:
+ case GDK_KP_Home:
+ message_list_home (fb->message_list);
+ return TRUE;
+
+ case GDK_End:
+ case GDK_KP_End:
+ message_list_end (fb->message_list);
+ return TRUE;
+
+ case 'n':
+ case 'N':
message_list_select (fb->message_list, row,
- tolower (ev->key.keyval) == 'p' ?
- MESSAGE_LIST_SELECT_PREVIOUS :
MESSAGE_LIST_SELECT_NEXT,
0, CAMEL_MESSAGE_SEEN);
+ return TRUE;
+
+ case 'p':
+ case 'P':
+ message_list_select (fb->message_list, row,
+ MESSAGE_LIST_SELECT_PREVIOUS,
+ 0, CAMEL_MESSAGE_SEEN);
+ return TRUE;
+
+ default:
+ return FALSE;
}
return FALSE;
@@ -441,21 +461,12 @@ folder_browser_new (Evolution_Shell shell)
{
static int serial;
FolderBrowser *folder_browser = gtk_type_new (folder_browser_get_type ());
- CORBA_Environment ev;
my_folder_browser_init (GTK_OBJECT (folder_browser));
folder_browser->uri = NULL;
folder_browser->serial = serial++;
folder_browser->shell = shell;
-#ifndef NO_WARNINGS
-#warning "is this a circular reference???"
-#endif
-
- CORBA_exception_init (&ev);
- Bonobo_Unknown_ref (shell, &ev);
- CORBA_exception_free (&ev);
-
return GTK_WIDGET (folder_browser);
}
diff --git a/mail/message-list.c b/mail/message-list.c
index e4f21933cf..8ee4541248 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1265,3 +1265,49 @@ void mail_do_regenerate_messagelist (MessageList *list, const gchar *search)
mail_operation_queue (&op_regenerate_messagelist, input, TRUE);
}
+
+static void
+go_to_message (MessageList *message_list,
+ int model_row)
+{
+ ETableScrolled *table_scrolled;
+ const CamelMessageInfo *info;
+ int view_row;
+
+ table_scrolled = E_TABLE_SCROLLED (message_list->etable);
+
+ view_row = e_table_model_to_view_row (table_scrolled->table, model_row);
+ info = get_message_info (message_list, model_row);
+
+ if (info != NULL) {
+ e_table_scrolled_set_cursor_row (table_scrolled, view_row);
+ mail_do_display_message (message_list, info->uid, mark_msg_seen);
+ }
+}
+
+void
+message_list_home (MessageList *message_list)
+{
+ g_return_if_fail (message_list != NULL);
+
+ go_to_message (message_list, 0);
+}
+
+void
+message_list_end (MessageList *message_list)
+{
+ ETableScrolled *table_scrolled;
+ ETable *table;
+ int num_rows;
+
+ g_return_if_fail (message_list != NULL);
+
+ table_scrolled = E_TABLE_SCROLLED (message_list->etable);
+ table = table_scrolled->table;
+
+ num_rows = e_table_model_row_count (table->model);
+ if (num_rows == 0)
+ return;
+
+ go_to_message (message_list, num_rows - 1);
+}
diff --git a/mail/message-list.h b/mail/message-list.h
index 4f9719f30b..d4a0e5e6b2 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -110,6 +110,9 @@ void message_list_select (MessageList *message_list,
MessageListSelectDirection direction,
guint32 flags, guint32 mask);
+void message_list_home (MessageList *message_list);
+void message_list_end (MessageList *message_list);
+
extern gboolean threaded_view;
void message_list_toggle_threads (BonoboUIHandler *uih,
void *user_data,