2007-04-20 [colin] 2.9.1cvs10
authorColin Leroy <colin@colino.net>
Fri, 20 Apr 2007 16:15:58 +0000 (16:15 +0000)
committerColin Leroy <colin@colino.net>
Fri, 20 Apr 2007 16:15:58 +0000 (16:15 +0000)
* src/mimeview.c
* src/summaryview.c
* src/textview.c
Add handling of 'a' to loop in a mail's
mimeparts

ChangeLog
PATCHSETS
configure.ac
src/mimeview.c
src/summaryview.c
src/textview.c

index ca5007fcf3170b09e203fb99c1e915da74355ad8..5968484da288f2f0f42669a42a640ae36e3f4723 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-20 [colin]     2.9.1cvs10
+
+       * src/mimeview.c
+       * src/summaryview.c
+       * src/textview.c
+               Add handling of 'a' to loop in a mail's
+               mimeparts
+
 2007-04-20 [colin]     2.9.1cvs9
 
        * src/toolbar.c
index 841efdba7b457d8c2fbd68629fc9f629a25e10ca..a4b485bb30dafa7c3c699d4338871b3fcf1d6ed2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.50.2.34 -r 1.50.2.35 src/compose.h;  ) > 2.9.1cvs7.patchset
 ( cvs diff -u -r 1.207.2.160 -r 1.207.2.161 src/folderview.c;  cvs diff -u -r 1.274.2.184 -r 1.274.2.185 src/mainwindow.c;  ) > 2.9.1cvs8.patchset
 ( cvs diff -u -r 1.43.2.64 -r 1.43.2.65 src/toolbar.c;  ) > 2.9.1cvs9.patchset
+( cvs diff -u -r 1.83.2.105 -r 1.83.2.106 src/mimeview.c;  cvs diff -u -r 1.395.2.297 -r 1.395.2.298 src/summaryview.c;  cvs diff -u -r 1.96.2.168 -r 1.96.2.169 src/textview.c;  ) > 2.9.1cvs10.patchset
index 710c10e837e19bc3974d27f3de3a501994c7adc8..02e67889a5338771c662599f4463fe95cd4dc063 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=9
+EXTRA_VERSION=10
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index fbacdcef593c60097cb0b2444afb25623aaf8d5a..246872007156631de8ef35f221aa02100e2d5abb 100644 (file)
@@ -125,6 +125,7 @@ static void mimeview_open_with              (MimeView       *mimeview);
 static void mimeview_open_part_with    (MimeView       *mimeview,
                                         MimeInfo       *partinfo,
                                         gboolean        automatic);
+static void mimeview_select_next_part  (MimeView       *mimeview);
 static void mimeview_view_file         (const gchar    *filename,
                                         MimeInfo       *partinfo,
                                         const gchar    *cmd,
@@ -165,11 +166,12 @@ static void mimeview_launch_cb(MimeView *mimeview)
 }
 static GtkItemFactoryEntry mimeview_popup_entries[] =
 {
-       {N_("/_Open"),            NULL, mimeview_launch_cb,       0, NULL},
-       {N_("/Open _with..."),    NULL, mimeview_open_with,       0, NULL},
-       {N_("/_Display as text"), NULL, mimeview_display_as_text, 0, NULL},
-       {N_("/_Save as..."),      NULL, mimeview_save_as,         0, NULL},
-       {N_("/Save _all..."),     NULL, mimeview_save_all,        0, NULL},
+       {N_("/_Open (l)"),                NULL, mimeview_launch_cb,       0, NULL},
+       {N_("/Open _with (o)..."),        NULL, mimeview_open_with,       0, NULL},
+       {N_("/_Display as text (t)"),     NULL, mimeview_display_as_text, 0, NULL},
+       {N_("/_Save as (y)..."),          NULL, mimeview_save_as,         0, NULL},
+       {N_("/Save _all..."),             NULL, mimeview_save_all,        0, NULL},
+       {N_("/Next part (a)"),            NULL, mimeview_select_next_part,0, NULL},
 };
 
 static GtkTargetEntry mimeview_mime_types[] =
@@ -1197,18 +1199,18 @@ static gboolean part_button_pressed(MimeView *mimeview, GdkEventButton *event,
                                 partinfo->type == MIMETYPE_IMAGE ||
                                 partinfo->type == MIMETYPE_MULTIPART))
                        menu_set_sensitive(mimeview->popupfactory,
-                                          "/Display as text", FALSE);
+                                          "/Display as text (t)", FALSE);
                else
                        menu_set_sensitive(mimeview->popupfactory,
-                                          "/Display as text", TRUE);
+                                          "/Display as text (t)", TRUE);
                if (partinfo &&
                    partinfo->type == MIMETYPE_APPLICATION &&
                    !g_ascii_strcasecmp(partinfo->subtype, "octet-stream"))
                        menu_set_sensitive(mimeview->popupfactory,
-                                          "/Open", FALSE);
+                                          "/Open (l)", FALSE);
                else
                        menu_set_sensitive(mimeview->popupfactory,
-                                          "/Open", TRUE);
+                                          "/Open (l)", TRUE);
 
                g_object_set_data(G_OBJECT(mimeview->popupmenu),
                                  "pop_partinfo", partinfo);
@@ -1230,6 +1232,44 @@ void mimeview_pass_key_press_event(MimeView *mimeview, GdkEventKey *event)
        mimeview_key_pressed(mimeview->ctree, event, mimeview);
 }
 
+static void mimeview_select_next_part(MimeView *mimeview)
+{
+       gboolean is_next = FALSE;
+
+       GList *child = gtk_container_children(GTK_CONTAINER(mimeview->icon_vbox));
+       for (; child != NULL; child = g_list_next(child)) {
+               if (GTK_IS_TOGGLE_BUTTON(child->data) &&  
+                   gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(child->data))) {
+                       is_next = TRUE;
+               } else if (GTK_IS_TOGGLE_BUTTON(child->data) &&
+                          is_next) {
+                       toggle_icon(GTK_TOGGLE_BUTTON(child->data), mimeview);
+                       gtk_toggle_button_set_active
+                               (GTK_TOGGLE_BUTTON(child->data), TRUE);
+                       icon_selected(mimeview, -1, 
+                               (MimeInfo *)g_object_get_data(G_OBJECT(child->data),
+                                     "partinfo"));
+                       is_next = FALSE;
+                       break;
+               }
+       }
+       if (is_next) {
+               /* we were on the last one, go to first */
+               child = gtk_container_children(GTK_CONTAINER(mimeview->icon_vbox));
+               for (; child != NULL; child = g_list_next(child)) {
+                       if (GTK_IS_TOGGLE_BUTTON(child->data)) {
+                               toggle_icon(GTK_TOGGLE_BUTTON(child->data), mimeview);
+                               gtk_toggle_button_set_active
+                                       (GTK_TOGGLE_BUTTON(child->data), TRUE);
+                               icon_selected(mimeview, -1, 
+                                       (MimeInfo *)g_object_get_data(G_OBJECT(child->data),
+                                               "partinfo"));
+                               break;
+                       }
+               }
+       }
+}
+
 #define BREAK_ON_MODIFIER_KEY() \
        if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
 
@@ -1312,6 +1352,11 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                KEY_PRESS_EVENT_STOP();
                mimeview_check_signature(mimeview);
                return TRUE;
+       case GDK_a:
+               BREAK_ON_MODIFIER_KEY();
+               KEY_PRESS_EVENT_STOP();
+               mimeview_select_next_part(mimeview);
+               return TRUE;
        default:
                break;
        }
@@ -1957,6 +2002,11 @@ static gint icon_key_pressed(GtkWidget *button, GdkEventKey *event,
                KEY_PRESS_EVENT_STOP();
                mimeview_check_signature(mimeview);
                return TRUE;
+       case GDK_a:
+               BREAK_ON_MODIFIER_KEY();
+               KEY_PRESS_EVENT_STOP();
+               mimeview_select_next_part(mimeview);
+               return TRUE;
        default:
                break;
        }
@@ -2183,7 +2233,7 @@ static void icon_list_toggle_by_mime_info(MimeView        *mimeview,
                                      "partinfo") == (gpointer)mimeinfo) {
                        toggle_icon(GTK_TOGGLE_BUTTON(child->data), mimeview);
                        gtk_toggle_button_set_active
-                               (GTK_TOGGLE_BUTTON(child->data), TRUE);
+                               (GTK_TOGGLE_BUTTON(child->data), TRUE); 
                }                                
        }
 }
index ce0a441a83052ff20677a0585b78b01312dabd62..1b6ee5d1d27361f179971f4bd276aa1541c05852 100644 (file)
@@ -5528,6 +5528,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_t:
        case GDK_l:
        case GDK_c:
+       case GDK_a:
                if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) == 0) {
                        g_signal_stop_emission_by_name(G_OBJECT(widget), 
                                        "key_press_event");
index dcc0c9e35740dba4ed8164b7be787518fa923abe..6ed41573345ea63f75f7a34dac7afc944dab2ba0 100644 (file)
@@ -2005,6 +2005,7 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_t:
        case GDK_l:
        case GDK_c:
+       case GDK_a:
                if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) == 0) {
                        KEY_PRESS_EVENT_STOP();
                        mimeview_pass_key_press_event(messageview->mimeview,