0.9.9claws16
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 16 Feb 2004 22:16:15 +0000 (22:16 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 16 Feb 2004 22:16:15 +0000 (22:16 +0000)
* src/compose.c
* src/stock_pixmap.[ch]
* src/toolbar.[ch]
* src/pixmaps/linewrapcurrent.xpm               ** NEW **
        add "Wrap current paragraph" to compose toolbar

ChangeLog.claws
configure.ac
src/Makefile.am
src/compose.c
src/pixmaps/linewrapcurrent.xpm [new file with mode: 0644]
src/stock_pixmap.c
src/stock_pixmap.h
src/toolbar.c
src/toolbar.h

index 483c037..848c385 100644 (file)
@@ -1,3 +1,11 @@
+2003-02-15 [christoph] 0.9.9claws16
+
+       * src/compose.c
+       * src/stock_pixmap.[ch]
+       * src/toolbar.[ch]
+       * src/pixmaps/linewrapcurrent.xpm               ** NEW **
+               add "Wrap current paragraph" to compose toolbar
+
 2003-02-15 [alfons]    0.9.9claws15
 
        * src/folderview.c
index 6be1b53..21cdf25 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=15
+EXTRA_VERSION=16
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index ce77250..ead94f5 100644 (file)
@@ -289,6 +289,7 @@ EXTRA_DIST = \
        pixmaps/key.xpm \
        pixmaps/ldap.xpm \
        pixmaps/linewrap.xpm \
+       pixmaps/linewrapcurrent.xpm \
        pixmaps/locked.xpm \
        pixmaps/mail_attach.xpm \
        pixmaps/mail_compose.xpm \
index f5b1e1b..5113956 100644 (file)
@@ -1393,7 +1393,8 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo)
        gtk_widget_set_sensitive(compose->toolbar->attach_btn, FALSE);
        gtk_widget_set_sensitive(compose->toolbar->sig_btn, FALSE);
        gtk_widget_set_sensitive(compose->toolbar->exteditor_btn, FALSE);
-       gtk_widget_set_sensitive(compose->toolbar->linewrap_btn, FALSE);
+       gtk_widget_set_sensitive(compose->toolbar->linewrap_current_btn, FALSE);
+       gtk_widget_set_sensitive(compose->toolbar->linewrap_all_btn, FALSE);
 
         return compose;
 }
@@ -1518,7 +1519,10 @@ void compose_toolbar_cb(gint action, gpointer data)
        case A_EXTEDITOR:
                compose_ext_editor_cb(compose, 0, NULL);
                break;
-       case A_LINEWRAP:
+       case A_LINEWRAP_CURRENT:
+               compose_wrap_line(compose);
+               break;
+       case A_LINEWRAP_ALL:
                compose_wrap_line_all(compose);
                break;
        case A_ADDRBOOK:
@@ -6181,7 +6185,8 @@ static void compose_set_ext_editor_sensitive(Compose *compose,
        gtk_widget_set_sensitive(compose->toolbar->insert_btn,    sensitive);
        gtk_widget_set_sensitive(compose->toolbar->sig_btn,       sensitive);
        gtk_widget_set_sensitive(compose->toolbar->exteditor_btn, sensitive);
-       gtk_widget_set_sensitive(compose->toolbar->linewrap_btn,  sensitive);
+       gtk_widget_set_sensitive(compose->toolbar->linewrap_current_btn,  sensitive);
+       gtk_widget_set_sensitive(compose->toolbar->linewrap_all_btn,  sensitive);
 }
 
 /**
diff --git a/src/pixmaps/linewrapcurrent.xpm b/src/pixmaps/linewrapcurrent.xpm
new file mode 100644 (file)
index 0000000..7ca629d
--- /dev/null
@@ -0,0 +1,29 @@
+/* XPM */
+static char * linewrapcurrent_xpm[] = {
+"24 24 2 1",
+"      c None",
+".     c #000000",
+"                        ",
+"                        ",
+"                        ",
+"                        ",
+"                        ",
+"                        ",
+"    .................   ",
+"                        ",
+"    .................   ",
+"                        ",
+"    .............       ",
+"                        ",
+"    .....               ",
+"                        ",
+"    ............    .   ",
+"                  . .   ",
+"    ............ ....   ",
+"                  .     ",
+"    .....               ",
+"                        ",
+"                        ",
+"                        ",
+"                        ",
+"                        "};
index eb222df..d598a6c 100644 (file)
@@ -52,6 +52,7 @@
 #include "pixmaps/key.xpm"
 #include "pixmaps/ldap.xpm"
 #include "pixmaps/linewrap.xpm"
+#include "pixmaps/linewrapcurrent.xpm"
 #include "pixmaps/mark.xpm"
 #include "pixmaps/locked.xpm"
 #include "pixmaps/new.xpm"
@@ -160,6 +161,7 @@ static StockPixmapData pixmaps[] =
        {jpilot_xpm                             , NULL, NULL, "jpilot", NULL},
        {key_xpm                                , NULL, NULL, "key", NULL},
        {ldap_xpm                               , NULL, NULL, "ldap", NULL},
+       {linewrapcurrent_xpm                    , NULL, NULL, "linewrapcurrent", NULL},
        {linewrap_xpm                           , NULL, NULL, "linewrap", NULL},
        {locked_xpm                             , NULL, NULL, "locked", NULL},
        {mail_xpm                               , NULL, NULL, "mail", NULL},
index 15dd17f..7feafdd 100644 (file)
@@ -60,7 +60,8 @@ typedef enum
        STOCK_PIXMAP_JPILOT,
        STOCK_PIXMAP_KEY,
        STOCK_PIXMAP_LDAP,
-       STOCK_PIXMAP_LINEWRAP,
+       STOCK_PIXMAP_LINEWRAP_CURRENT,
+       STOCK_PIXMAP_LINEWRAP_ALL,
        STOCK_PIXMAP_LOCKED,
        STOCK_PIXMAP_MAIL,
        STOCK_PIXMAP_MAIL_ATTACH,
index d3e44af..b111ab9 100644 (file)
@@ -139,7 +139,9 @@ static void toolbar_sig_cb                  (GtkWidget      *widget,
                                                 gpointer        data);
 static void toolbar_ext_editor_cb              (GtkWidget      *widget,
                                                 gpointer        data);
-static void toolbar_linewrap_cb                        (GtkWidget      *widget,
+static void toolbar_linewrap_current_cb                (GtkWidget      *widget,
+                                                gpointer        data);
+static void toolbar_linewrap_all_cb            (GtkWidget      *widget,
                                                 gpointer        data);
 static void toolbar_addrbook_cb                (GtkWidget      *widget, 
                                                 gpointer        data);
@@ -154,36 +156,37 @@ struct {
        gchar *index_str;
        const gchar *descr;
 } toolbar_text [] = {
-       { "A_RECEIVE_ALL",   N_("Receive Mail on all Accounts")         },
-       { "A_RECEIVE_CUR",   N_("Receive Mail on current Account")      },
-       { "A_SEND_QUEUED",   N_("Send Queued Message(s)")               },
-       { "A_COMPOSE_EMAIL", N_("Compose Email")                        },
-       { "A_COMPOSE_NEWS",  N_("Compose News")                         },
-       { "A_REPLY_MESSAGE", N_("Reply to Message")                     },
-       { "A_REPLY_SENDER",  N_("Reply to Sender")                      },
-       { "A_REPLY_ALL",     N_("Reply to All")                         },
-       { "A_REPLY_ML",      N_("Reply to Mailing-list")                },
-       { "A_FORWARD",       N_("Forward Message")                      }, 
-       { "A_DELETE",        N_("Delete Message")                       },
-       { "A_EXECUTE",       N_("Execute")                              },
-       { "A_GOTO_NEXT",     N_("Goto Next Message")                    },
-       { "A_IGNORE_THREAD", N_("Ignore thread")                        },
-       { "A_PRINT",         N_("Print")                                },
-
-       { "A_SEND",          N_("Send Message")                         },
-       { "A_SENDL",         N_("Put into queue folder and send later") },
-       { "A_DRAFT",         N_("Save to draft folder")                 },
-       { "A_INSERT",        N_("Insert file")                          },   
-       { "A_ATTACH",        N_("Attach file")                          },
-       { "A_SIG",           N_("Insert signature")                     },
-       { "A_EXTEDITOR",     N_("Edit with external editor")            },
-       { "A_LINEWRAP",      N_("Wrap all long lines")                  }, 
-       { "A_ADDRBOOK",      N_("Address book")                         },
+       { "A_RECEIVE_ALL",      N_("Receive Mail on all Accounts")         },
+       { "A_RECEIVE_CUR",      N_("Receive Mail on current Account")      },
+       { "A_SEND_QUEUED",      N_("Send Queued Message(s)")               },
+       { "A_COMPOSE_EMAIL",    N_("Compose Email")                        },
+       { "A_COMPOSE_NEWS",     N_("Compose News")                         },
+       { "A_REPLY_MESSAGE",    N_("Reply to Message")                     },
+       { "A_REPLY_SENDER",     N_("Reply to Sender")                      },
+       { "A_REPLY_ALL",        N_("Reply to All")                         },
+       { "A_REPLY_ML",         N_("Reply to Mailing-list")                },
+       { "A_FORWARD",          N_("Forward Message")                      }, 
+       { "A_DELETE",           N_("Delete Message")                       },
+       { "A_EXECUTE",          N_("Execute")                              },
+       { "A_GOTO_NEXT",        N_("Goto Next Message")                    },
+       { "A_IGNORE_THREAD",    N_("Ignore thread")                     },
+       { "A_PRINT",            N_("Print")                             },
+
+       { "A_SEND",             N_("Send Message")                         },
+       { "A_SENDL",            N_("Put into queue folder and send later") },
+       { "A_DRAFT",            N_("Save to draft folder")                 },
+       { "A_INSERT",           N_("Insert file")                          },   
+       { "A_ATTACH",           N_("Attach file")                          },
+       { "A_SIG",              N_("Insert signature")                     },
+       { "A_EXTEDITOR",        N_("Edit with external editor")            },
+       { "A_LINEWRAP_CURRENT", N_("Wrap long lines of current paragraph") }, 
+       { "A_LINEWRAP_ALL",     N_("Wrap all long lines")                  }, 
+       { "A_ADDRBOOK",         N_("Address book")                         },
 #ifdef USE_ASPELL
-       { "A_CHECK_SPELLING",N_("Check spelling")                       },
+       { "A_CHECK_SPELLING",   N_("Check spelling")                       },
 #endif
-       { "A_SYL_ACTIONS",   N_("Sylpheed Actions Feature")             }, 
-       { "A_SEPARATOR",     "Separator"                                }
+       { "A_SYL_ACTIONS",      N_("Sylpheed Actions Feature")             }, 
+       { "A_SEPARATOR",        "Separator"                             }
 };
 
 /* struct holds configuration files and a list of
@@ -311,7 +314,8 @@ GList *toolbar_get_action_items(ToolbarType source)
        else if (source == TOOLBAR_COMPOSE) {
                gint comp_items[] =   { A_SEND,          A_SENDL,        A_DRAFT,
                                        A_INSERT,        A_ATTACH,       A_SIG,
-                                       A_EXTEDITOR,     A_LINEWRAP,     A_ADDRBOOK,
+                                       A_EXTEDITOR,     A_LINEWRAP_CURRENT,     
+                                       A_LINEWRAP_ALL,  A_ADDRBOOK,
 #ifdef USE_ASPELL
                                        A_CHECK_SPELLING, 
 #endif
@@ -419,18 +423,19 @@ static void toolbar_set_default_compose(void)
                gint icon;
                gchar *text;
        } default_toolbar[] = {
-               { A_SEND,      STOCK_PIXMAP_MAIL_SEND,         _("Send")       },
-               { A_SENDL,     STOCK_PIXMAP_MAIL_SEND_QUEUE,   _("Send later") },
-               { A_DRAFT,     STOCK_PIXMAP_MAIL,              _("Draft")      },
-               { A_SEPARATOR, 0,                               ("")           }, 
-               { A_INSERT,    STOCK_PIXMAP_INSERT_FILE,       _("Insert")     },
-               { A_ATTACH,    STOCK_PIXMAP_MAIL_ATTACH,       _("Attach")     },
-               { A_SIG,       STOCK_PIXMAP_MAIL_SIGN,         _("Signature")  },
-               { A_SEPARATOR, 0,                               ("")           },
-               { A_EXTEDITOR, STOCK_PIXMAP_EDIT_EXTERN,       _("Editor")     },
-               { A_LINEWRAP,  STOCK_PIXMAP_LINEWRAP,          _("Linewrap")   },
-               { A_SEPARATOR, 0,                               ("")           },
-               { A_ADDRBOOK,  STOCK_PIXMAP_ADDRESS_BOOK,      _("Address")    }
+               { A_SEND,               STOCK_PIXMAP_MAIL_SEND,         _("Send")               },
+               { A_SENDL,              STOCK_PIXMAP_MAIL_SEND_QUEUE,   _("Send later")         },
+               { A_DRAFT,              STOCK_PIXMAP_MAIL,              _("Draft")              },
+               { A_SEPARATOR,          0,                               ("")                   }, 
+               { A_INSERT,             STOCK_PIXMAP_INSERT_FILE,       _("Insert")             },
+               { A_ATTACH,             STOCK_PIXMAP_MAIL_ATTACH,       _("Attach")             },
+               { A_SIG,                STOCK_PIXMAP_MAIL_SIGN,         _("Signature")          },
+               { A_SEPARATOR,          0,                               ("")                   },
+               { A_EXTEDITOR,          STOCK_PIXMAP_EDIT_EXTERN,       _("Editor")             },
+               { A_LINEWRAP_CURRENT,   STOCK_PIXMAP_LINEWRAP_CURRENT,  _("Wrap paragraph")     },
+               { A_LINEWRAP_ALL,       STOCK_PIXMAP_LINEWRAP_ALL,      _("Wrap all")           },
+               { A_SEPARATOR,          0,                               ("")                   },
+               { A_ADDRBOOK,           STOCK_PIXMAP_ADDRESS_BOOK,      _("Address")            }
        };
        
        gint i;
@@ -1134,9 +1139,14 @@ static void toolbar_ext_editor_cb(GtkWidget *widget, gpointer data)
        compose_toolbar_cb(A_EXTEDITOR, data);
 }
 
-static void toolbar_linewrap_cb(GtkWidget *widget, gpointer data)
+static void toolbar_linewrap_current_cb(GtkWidget *widget, gpointer data)
+{
+       compose_toolbar_cb(A_LINEWRAP_CURRENT, data);
+}
+
+static void toolbar_linewrap_all_cb(GtkWidget *widget, gpointer data)
 {
-       compose_toolbar_cb(A_LINEWRAP, data);
+       compose_toolbar_cb(A_LINEWRAP_ALL, data);
 }
 
 #ifdef USE_ASPELL
@@ -1254,7 +1264,8 @@ static void toolbar_buttons_cb(GtkWidget   *widget,
                { A_ATTACH,             toolbar_attach_cb               },
                { A_SIG,                toolbar_sig_cb                  },
                { A_EXTEDITOR,          toolbar_ext_editor_cb           },
-               { A_LINEWRAP,           toolbar_linewrap_cb             },
+               { A_LINEWRAP_CURRENT,   toolbar_linewrap_current_cb     },
+               { A_LINEWRAP_ALL,       toolbar_linewrap_all_cb         },
                { A_ADDRBOOK,           toolbar_addrbook_cb             },
 #ifdef USE_ASPELL
                { A_CHECK_SPELLING,     toolbar_check_spelling_cb       },
@@ -1530,10 +1541,16 @@ Toolbar *toolbar_create(ToolbarType      type,
                                             toolbar_data->exteditor_btn,
                                             _("Edit with external editor"), NULL);
                        break;
-               case A_LINEWRAP:
-                       toolbar_data->linewrap_btn = item;
+               case A_LINEWRAP_CURRENT:
+                       toolbar_data->linewrap_current_btn = item;
+                       gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), 
+                                            toolbar_data->linewrap_current_btn,
+                                            _("Wrap long lines of current paragraph"), NULL);
+                       break;
+               case A_LINEWRAP_ALL:
+                       toolbar_data->linewrap_all_btn = item;
                        gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), 
-                                            toolbar_data->linewrap_btn,
+                                            toolbar_data->linewrap_all_btn,
                                             _("Wrap all long lines"), NULL);
                        break;
                case A_ADDRBOOK:
@@ -1755,8 +1772,10 @@ void toolbar_comp_set_sensitive(gpointer data, gboolean sensitive)
                gtk_widget_set_sensitive(compose->toolbar->sig_btn, sensitive);
        if (compose->toolbar->exteditor_btn)
                gtk_widget_set_sensitive(compose->toolbar->exteditor_btn, sensitive);
-       if (compose->toolbar->linewrap_btn)
-               gtk_widget_set_sensitive(compose->toolbar->linewrap_btn, sensitive);
+       if (compose->toolbar->linewrap_current_btn)
+               gtk_widget_set_sensitive(compose->toolbar->linewrap_current_btn, sensitive);
+       if (compose->toolbar->linewrap_all_btn)
+               gtk_widget_set_sensitive(compose->toolbar->linewrap_all_btn, sensitive);
        if (compose->toolbar->addrbook_btn)
                gtk_widget_set_sensitive(compose->toolbar->addrbook_btn, sensitive);
 #ifdef USE_ASPELL
@@ -1774,32 +1793,33 @@ void toolbar_comp_set_sensitive(gpointer data, gboolean sensitive)
  **/
 void toolbar_init(Toolbar * toolbar) {
 
-       toolbar->toolbar          = NULL;
-       toolbar->get_btn          = NULL;
-       toolbar->getall_btn       = NULL;
-       toolbar->send_btn         = NULL;
-       toolbar->compose_mail_btn = NULL;
-       toolbar->compose_news_btn = NULL;
-       toolbar->reply_btn        = NULL;
-       toolbar->replysender_btn  = NULL;
-       toolbar->replyall_btn     = NULL;
-       toolbar->replylist_btn    = NULL;
-       toolbar->fwd_btn          = NULL;
-       toolbar->delete_btn       = NULL;
-       toolbar->next_btn         = NULL;
-       toolbar->exec_btn         = NULL;
+       toolbar->toolbar                = NULL;
+       toolbar->get_btn                = NULL;
+       toolbar->getall_btn             = NULL;
+       toolbar->send_btn               = NULL;
+       toolbar->compose_mail_btn       = NULL;
+       toolbar->compose_news_btn       = NULL;
+       toolbar->reply_btn              = NULL;
+       toolbar->replysender_btn        = NULL;
+       toolbar->replyall_btn           = NULL;
+       toolbar->replylist_btn          = NULL;
+       toolbar->fwd_btn                = NULL;
+       toolbar->delete_btn             = NULL;
+       toolbar->next_btn               = NULL;
+       toolbar->exec_btn               = NULL;
 
        /* compose buttons */ 
-       toolbar->sendl_btn        = NULL;
-       toolbar->draft_btn        = NULL;
-       toolbar->insert_btn       = NULL;
-       toolbar->attach_btn       = NULL;
-       toolbar->sig_btn          = NULL;       
-       toolbar->exteditor_btn    = NULL;       
-       toolbar->linewrap_btn     = NULL;       
-       toolbar->addrbook_btn     = NULL;       
+       toolbar->sendl_btn              = NULL;
+       toolbar->draft_btn              = NULL;
+       toolbar->insert_btn             = NULL;
+       toolbar->attach_btn             = NULL;
+       toolbar->sig_btn                = NULL; 
+       toolbar->exteditor_btn          = NULL; 
+       toolbar->linewrap_current_btn   = NULL; 
+       toolbar->linewrap_all_btn       = NULL; 
+       toolbar->addrbook_btn           = NULL; 
 #ifdef USE_ASPELL
-       toolbar->spellcheck_btn   = NULL;
+       toolbar->spellcheck_btn         = NULL;
 #endif
 
        toolbar_destroy(toolbar);
index aa9b28e..6e491d3 100644 (file)
@@ -78,7 +78,8 @@ struct _Toolbar {
        GtkWidget *attach_btn;
        GtkWidget *sig_btn;
        GtkWidget *exteditor_btn;
-       GtkWidget *linewrap_btn;
+       GtkWidget *linewrap_current_btn;
+       GtkWidget *linewrap_all_btn;
        GtkWidget *addrbook_btn;
 #ifdef USE_ASPELL
        GtkWidget *spellcheck_btn;
@@ -158,7 +159,8 @@ enum {
        A_ATTACH,
        A_SIG,
        A_EXTEDITOR,
-       A_LINEWRAP,
+       A_LINEWRAP_CURRENT,
+       A_LINEWRAP_ALL,
        A_ADDRBOOK,
 #ifdef USE_ASPELL
        A_CHECK_SPELLING,