changes to shortcuts again
authorCarsten Schurig <Carsten.Schurig@web.de>
Fri, 18 Jan 2002 09:11:01 +0000 (09:11 +0000)
committerCarsten Schurig <Carsten.Schurig@web.de>
Fri, 18 Jan 2002 09:11:01 +0000 (09:11 +0000)
ChangeLog.claws
configure.in
src/compose.c
src/gtkstext.c
src/gtkstext.h
src/mainwindow.c
src/summaryview.c

index 4f5e280..40973b5 100644 (file)
@@ -1,3 +1,17 @@
+2002-01-18 [carsten]   0.7.0claws12
+       * src/html.c
+               small hack to fix a segfault with an empty href
+               (reported by Alexandra Walford <deeni@altern.org>)
+       * src/mainwindow.c
+       * src/summaryview.c
+               the shortcuts for Mark und Mark as unread are hardcoded
+               again
+       * src/compose.c
+       * src/gtkstext.[ch]
+               readded the shortcuts in gtkstext but made them
+               customizeable (simply by adding a menu plus a wrapper
+               to compose.c)
+
 2002-01-17 [melvin]    0.7.0claws11
 
        * src/gtkspell.c
index d5ea5c9..38e51da 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws11
+EXTRA_VERSION=claws12
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 04f19c3..e20eaaa 100644 (file)
@@ -330,6 +330,25 @@ static void compose_copy_cb                (Compose        *compose);
 static void compose_paste_cb           (Compose        *compose);
 static void compose_allsel_cb          (Compose        *compose);
 
+typedef enum {
+       COMPOSE_CALL_GTK_STEXT_MOVE_BEGINNING_OF_LINE,
+       COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_CHARACTER,
+       COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_CHARACTER,
+       COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_WORD,
+       COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_WORD,
+       COMPOSE_CALL_GTK_STEXT_MOVE_END_OF_LINE,
+       COMPOSE_CALL_GTK_STEXT_MOVE_NEXT_LINE,
+       COMPOSE_CALL_GTK_STEXT_MOVE_PREVIOUS_LINE,
+       COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_CHARACTER,
+       COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_CHARACTER,
+       COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_WORD,
+       COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_WORD,
+       COMPOSE_CALL_GTK_STEXT_DELETE_LINE,
+       COMPOSE_CALL_GTK_STEXT_DELETE_TO_LINE_END
+} ComposeCallGtkStextAction;
+
+static void compose_gtk_stext_action_cb        (Compose *compose, ComposeCallGtkStextAction action);
+
 static void compose_grab_focus_cb      (GtkWidget      *widget,
                                         Compose        *compose);
 
@@ -451,7 +470,7 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_File/_Insert file"),             "<control>I", compose_insert_file_cb, 0, NULL},
        {N_("/_File/Insert si_gnature"),        "<control>G", compose_insert_sig,     0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
-       {N_("/_File/_Close"),                   "<alt>W", compose_close_cb, 0, NULL},
+       {N_("/_File/_Close"),                   "<control>Q", compose_close_cb, 0, NULL},
 
        {N_("/_Edit"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_Edit/_Undo"),            "<control>Z", compose_undo_cb, 0, NULL},
@@ -461,6 +480,22 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Edit/_Copy"),            "<control>C", compose_copy_cb,   0, NULL},
        {N_("/_Edit/_Paste"),           "<control>V", compose_paste_cb,  0, NULL},
        {N_("/_Edit/Select _all"),      "<control>A", compose_allsel_cb, 0, NULL},
+       {N_("/_Edit/A_dvanced"),        NULL, NULL, 0,
+               "<Branch>"},
+       {N_("/_Edit/A_dvanced/Move a character backward"),      "<control>B", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_CHARACTER, NULL},
+       {N_("/_Edit/A_dvanced/Move a character forward"),       "<control>F", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_CHARACTER, NULL},
+       {N_("/_Edit/A_dvanced/Move a word backward"),   "<alt>B", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_WORD, NULL},
+       {N_("/_Edit/A_dvanced/Move a word forward"),    "<alt>F", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_WORD, NULL},
+       {N_("/_Edit/A_dvanced/Move to beginning of line"),      NULL, compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_BEGINNING_OF_LINE, NULL},
+       {N_("/_Edit/A_dvanced/Move to end of line"),    "<control>E", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_END_OF_LINE, NULL},
+       {N_("/_Edit/A_dvanced/Move to next line"),      "<control>N", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_NEXT_LINE, NULL},
+       {N_("/_Edit/A_dvanced/Move to previous line"),  "<control>P", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_MOVE_PREVIOUS_LINE, NULL},
+       {N_("/_Edit/A_dvanced/Delete a character backward"),    "<control>H", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_CHARACTER, NULL},
+       {N_("/_Edit/A_dvanced/Delete a character forward"),     "<control>D", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_CHARACTER, NULL},
+       {N_("/_Edit/A_dvanced/Delete a word backward"), "<control>w", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_WORD, NULL},
+       {N_("/_Edit/A_dvanced/Delete a word forward"),  "<alt>D", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_WORD, NULL},
+       {N_("/_Edit/A_dvanced/Delete line"),    "<control>U", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_LINE, NULL},
+       {N_("/_Edit/A_dvanced/Delete to end of line"),  "<control>K", compose_gtk_stext_action_cb, COMPOSE_CALL_GTK_STEXT_DELETE_TO_LINE_END, NULL},
        {N_("/_Edit/---"),              NULL, NULL, 0, "<Separator>"},
 #if USE_PSPELL
        {N_("/_Edit/Check backwards misspelled word"),  "<control>;", compose_check_backwards , 0, NULL},
@@ -468,11 +503,11 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Edit/---"),              NULL, NULL, 0, "<Separator>"},
 #endif
        {N_("/_Edit/_Wrap current paragraph"),
-                                       "<alt>L", compose_wrap_line, 0, NULL},
+                                       "<control>L", compose_wrap_line, 0, NULL},
        {N_("/_Edit/Wrap all long _lines"),
-                                       "<shift><alt>L", compose_wrap_line_all, 0, NULL},
+                                       "<control><alt>L", compose_wrap_line_all, 0, NULL},
        {N_("/_Edit/Edit with e_xternal editor"),
-                                       "<alt>X", compose_ext_editor_cb, 0, NULL},
+                                       "<control>X", compose_ext_editor_cb, 0, NULL},
 #if 0 /* NEW COMPOSE GUI */
        {N_("/_View"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_View/_To"),              NULL, compose_toggle_to_cb     , 0, "<ToggleItem>"},
@@ -515,7 +550,7 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Message/_Request Return Receipt"),       NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
        {N_("/_Tool"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_Tool/Show _ruler"),      NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
-       {N_("/_Tool/_Address book"),    "<alt>A", compose_address_cb , 0, NULL},
+       {N_("/_Tool/_Address book"),    "<control><alt>A", compose_address_cb , 0, NULL},
        {N_("/_Tool/_Template"),        NULL, NULL, 0, "<Branch>"},
        {N_("/_Help"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_Help/_About"),           NULL, about_show, 0, NULL}
@@ -2331,11 +2366,6 @@ static void compose_wrap_line_all(Compose *compose)
                                        do_delete = FALSE;
                        }
 
-                       /* skip delete if it is continuous URL */
-                       if (do_delete && (line_pos - p_pos <= i_len) &&
-                           gtkut_stext_is_uri_string(text, line_pos, tlen))
-                               do_delete = FALSE;
-
 #ifdef WRAP_DEBUG
                        printf("qlen=%d l_len=%d wrap_len=%d do_del=%d\n",
                                qlen, line_len, linewrap_len, do_delete);
@@ -6057,6 +6087,65 @@ static void compose_allsel_cb(Compose *compose)
                        (GTK_EDITABLE(compose->focused_editable), 0, -1);
 }
 
+static void compose_move_beginning_of_line_cb(Compose *compose)
+{
+       if (compose->focused_editable &&
+               GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+               gtk_stext_move_beginning_of_line(GTK_STEXT(compose->focused_editable));
+}
+
+static void compose_gtk_stext_action_cb        (Compose *compose, ComposeCallGtkStextAction action)
+{
+       if (!(compose->focused_editable && GTK_WIDGET_HAS_FOCUS(compose->focused_editable))) return;
+               
+       switch (action) {
+               case COMPOSE_CALL_GTK_STEXT_MOVE_BEGINNING_OF_LINE:
+                       gtk_stext_move_beginning_of_line(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_CHARACTER:
+                       gtk_stext_move_forward_character(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_CHARACTER:
+                       gtk_stext_move_backward_character(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_FORWARD_WORD:
+                       gtk_stext_move_forward_word(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_BACKWARD_WORD:
+                       gtk_stext_move_backward_word(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_END_OF_LINE:
+                       gtk_stext_move_end_of_line(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_NEXT_LINE:
+                       gtk_stext_move_next_line(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_MOVE_PREVIOUS_LINE:
+                       gtk_stext_move_previous_line(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_CHARACTER:
+                       gtk_stext_delete_forward_character(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_CHARACTER:
+                       gtk_stext_delete_backward_character(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_WORD:
+                       gtk_stext_delete_forward_word(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_WORD:
+                       gtk_stext_delete_backward_word(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_LINE:
+                       gtk_stext_delete_line(GTK_STEXT(compose->focused_editable));
+                       break;
+               case COMPOSE_CALL_GTK_STEXT_DELETE_TO_LINE_END:
+                       gtk_stext_delete_to_line_end(GTK_STEXT(compose->focused_editable));
+                       break;
+               default:
+                       break;
+       }
+}
+
 static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
 {
        if (GTK_IS_EDITABLE(widget))
index b704bc0..d1ae69e 100644 (file)
@@ -404,7 +404,7 @@ static void gtk_stext_kill_line           (GtkEditable *editable,
                                          gint         direction);
 
 /* To be removed */
-static void gtk_stext_move_forward_character    (GtkSText          *text);
+/*static void gtk_stext_move_forward_character    (GtkSText          *text);
 static void gtk_stext_move_backward_character   (GtkSText          *text);
 static void gtk_stext_move_forward_word         (GtkSText          *text);
 static void gtk_stext_move_backward_word        (GtkSText          *text);
@@ -418,7 +418,7 @@ static void gtk_stext_delete_backward_character (GtkSText          *text);
 static void gtk_stext_delete_forward_word       (GtkSText          *text);
 static void gtk_stext_delete_backward_word      (GtkSText          *text);
 static void gtk_stext_delete_line               (GtkSText          *text);
-static void gtk_stext_delete_to_line_end        (GtkSText          *text);
+static void gtk_stext_delete_to_line_end        (GtkSText          *text);*/
 static void gtk_stext_select_word               (GtkSText          *text,
                                                guint32           time);
 static void gtk_stext_select_line               (GtkSText          *text,
@@ -4453,25 +4453,25 @@ gtk_stext_move_cursor (GtkEditable *editable,
     }
 }
 
-static void
+/*static*/ void
 gtk_stext_move_forward_character (GtkSText *text)
 {
   move_cursor_hor (text, 1);
 }
 
-static void
+/*static*/ void
 gtk_stext_move_backward_character (GtkSText *text)
 {
   move_cursor_hor (text, -1);
 }
 
-static void
+/*static*/ void
 gtk_stext_move_next_line (GtkSText *text)
 {
   move_cursor_ver (text, 1);
 }
 
-static void
+/*static*/ void
 gtk_stext_move_previous_line (GtkSText *text)
 {
   move_cursor_ver (text, -1);
@@ -4493,7 +4493,7 @@ gtk_stext_move_word (GtkEditable *editable,
     }
 }
 
-static void
+/*static*/ void
 gtk_stext_move_forward_word (GtkSText *text)
 {
   text->cursor_virtual_x = 0;
@@ -4525,7 +4525,7 @@ gtk_stext_move_forward_word (GtkSText *text)
   draw_cursor (text, FALSE);
 }
 
-static void
+/*static*/ void
 gtk_stext_move_backward_word (GtkSText *text)
 {
   text->cursor_virtual_x = 0;
@@ -4605,14 +4605,14 @@ gtk_stext_move_to_column (GtkEditable *editable,
   draw_cursor (text, FALSE);
 }
 
-static void
+/*static*/ void
 gtk_stext_move_beginning_of_line (GtkSText *text)
 {
   gtk_stext_move_to_column (GTK_EDITABLE (text), 0);
   
 }
 
-static void
+/*static*/ void
 gtk_stext_move_end_of_line (GtkSText *text)
 {
   gtk_stext_move_to_column (GTK_EDITABLE (text), -1);
@@ -4643,13 +4643,13 @@ gtk_stext_kill_char (GtkEditable *editable,
     }
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_forward_character (GtkSText *text)
 {
   gtk_stext_kill_char (GTK_EDITABLE (text), 1);
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_backward_character (GtkSText *text)
 {
   gtk_stext_kill_char (GTK_EDITABLE (text), -1);
@@ -4677,13 +4677,13 @@ gtk_stext_kill_word (GtkEditable *editable,
     }
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_forward_word (GtkSText *text)
 {
   gtk_stext_kill_word (GTK_EDITABLE (text), 1);
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_backward_word (GtkSText *text)
 {
   gtk_stext_kill_word (GTK_EDITABLE (text), -1);
@@ -4706,14 +4706,14 @@ gtk_stext_kill_line (GtkEditable *editable,
     }
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_line (GtkSText *text)
 {
   gtk_stext_move_to_column (GTK_EDITABLE (text), 0);
   gtk_stext_kill_line (GTK_EDITABLE (text), 1);
 }
 
-static void
+/*static*/ void
 gtk_stext_delete_to_line_end (GtkSText *text)
 {
   gtk_stext_kill_line (GTK_EDITABLE (text), 1);
index 6c4c2ec..c5c8f15 100644 (file)
@@ -245,6 +245,23 @@ void       gtk_stext_set_cursor_type (GtkSText           *text,
                                      GtkSTextCursorType  cursor_type);
 void       gtk_stext_compact_buffer    (GtkSText *text);
 
+/* these are normally not exported! */
+void gtk_stext_move_forward_character    (GtkSText          *text);
+void gtk_stext_move_backward_character   (GtkSText          *text);
+void gtk_stext_move_forward_word         (GtkSText          *text);
+void gtk_stext_move_backward_word        (GtkSText          *text);
+void gtk_stext_move_beginning_of_line    (GtkSText          *text);
+void gtk_stext_move_end_of_line          (GtkSText          *text);
+void gtk_stext_move_next_line            (GtkSText          *text);
+void gtk_stext_move_previous_line        (GtkSText          *text);
+void gtk_stext_delete_forward_character  (GtkSText          *text);
+void gtk_stext_delete_backward_character (GtkSText          *text);
+void gtk_stext_delete_forward_word       (GtkSText          *text);
+void gtk_stext_delete_backward_word      (GtkSText          *text);
+void gtk_stext_delete_line               (GtkSText          *text);
+void gtk_stext_delete_to_line_end        (GtkSText          *text);
+
+
 /* Set the rmargin for the stext. if rmargin is 0, then reset to old 
  * behaviour */
 void      gtk_stext_set_wrap_rmargin (GtkSText *text, gint rmargin);
index 9889e84..04cf2f5 100644 (file)
@@ -609,10 +609,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, delete_duplicated_cb,   0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Mark"),                 NULL, NULL, 0, "<Branch>"},
-       {N_("/_Message/_Mark/_Mark"),           "<shift>asterisk", mark_cb,   0, NULL},
+       {N_("/_Message/_Mark/_Mark"),           NULL, mark_cb,   0, NULL},
        {N_("/_Message/_Mark/_Unmark"),         "u", unmark_cb, 0, NULL},
        {N_("/_Message/_Mark/---"),             NULL, NULL, 0, "<Separator>"},
-       {N_("/_Message/_Mark/Mark as unr_ead"), "<shift>exclam", mark_as_unread_cb, 0, NULL},
+       {N_("/_Message/_Mark/Mark as unr_ead"), NULL, mark_as_unread_cb, 0, NULL},
        {N_("/_Message/_Mark/Mark as rea_d"),
                                                NULL, mark_as_read_cb, 0, NULL},
        {N_("/_Message/_Mark/Mark all _read"),  NULL, mark_all_read_cb, 0, NULL},
index 1130a59..ddefb67 100644 (file)
@@ -4216,6 +4216,21 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        if (!event) return;
 
        switch (event->keyval) {
+       case GDK_Q:             /* Quit */
+               RETURN_IF_LOCKED();
+               BREAK_ON_MODIFIER_KEY();
+
+               if (prefs_common.confirm_on_exit) {
+                       if (alertpanel(_("Exit"), _("Exit this program?"),
+                          _("OK"), _("Cancel"), NULL)
+                          == G_ALERTDEFAULT) {
+                               manage_window_focus_in
+                                       (summaryview->mainwin->window,
+                                        NULL, NULL);
+                                       app_will_exit(NULL, summaryview->mainwin);
+                       }
+               }
+               return;
        case GDK_Escape:
                gtk_widget_grab_focus(summaryview->folderview->ctree);
                return;
@@ -4266,6 +4281,15 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                BREAK_ON_MODIFIER_KEY();
                summary_delete(summaryview);
                break;
+       case GDK_asterisk:      /* Mark */
+               summary_mark(summaryview);
+               break;
+       case GDK_exclam:        /* Mark as unread */
+               summary_mark_as_unread(summaryview);
+               break;
+       case GDK_BackSpace:     /* Page up */
+               textview_scroll_page(summaryview->messageview->textview, TRUE);
+               break;
        default:
                break;
        }