2007-03-23 [colin] 2.8.1cvs42
authorColin Leroy <colin@colino.net>
Fri, 23 Mar 2007 08:59:32 +0000 (08:59 +0000)
committerColin Leroy <colin@colino.net>
Fri, 23 Mar 2007 08:59:32 +0000 (08:59 +0000)
* src/Makefile.am
* src/compose.c
* src/compose.h
* src/stock_pixmap.c
* src/stock_pixmap.h
* src/summaryview.c
* src/summaryview.h
* src/toolbar.c
* src/toolbar.h
* src/pixmaps/open_mail.xpm
Maemo changes: Add the possibility to have
"Open Email" and "Close Window" buttons on
toolbars (and use them in Maemo's default
toolbars)

13 files changed:
ChangeLog
PATCHSETS
configure.ac
src/Makefile.am
src/compose.c
src/compose.h
src/pixmaps/open_mail.xpm [new file with mode: 0644]
src/stock_pixmap.c
src/stock_pixmap.h
src/summaryview.c
src/summaryview.h
src/toolbar.c
src/toolbar.h

index 8ed890aa7ac35f9fb2114daa50eae0678dce5d37..78464457b35673768d4f7edb23d8a96cdd1638c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-03-23 [colin]     2.8.1cvs42
+
+       * src/Makefile.am
+       * src/compose.c
+       * src/compose.h
+       * src/stock_pixmap.c
+       * src/stock_pixmap.h
+       * src/summaryview.c
+       * src/summaryview.h
+       * src/toolbar.c
+       * src/toolbar.h
+       * src/pixmaps/open_mail.xpm
+               Maemo changes: Add the possibility to have
+               "Open Email" and "Close Window" buttons on 
+               toolbars (and use them in Maemo's default
+               toolbars)
+
 2007-03-23 [wwp]       2.8.1cvs41
 
        * src/action.c
index 8ba225633c9d5d827310afff314219af958bc5a9..77e983f37b9cc1a1ebebc1bac42565a78289fbd7 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.59.2.54 -r 1.59.2.55 src/prefs_filtering.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/gtk/combobox.h;  ) > 2.8.1cvs39.patchset
 ( cvs diff -u -r 1.12.2.43 -r 1.12.2.44 src/action.c;  ) > 2.8.1cvs40.patchset
 ( cvs diff -u -r 1.12.2.44 -r 1.12.2.45 src/action.c;  ) > 2.8.1cvs41.patchset
+( cvs diff -u -r 1.155.2.56 -r 1.155.2.57 src/Makefile.am;  cvs diff -u -r 1.382.2.362 -r 1.382.2.363 src/compose.c;  cvs diff -u -r 1.50.2.32 -r 1.50.2.33 src/compose.h;  cvs diff -u -r 1.25.2.33 -r 1.25.2.34 src/stock_pixmap.c;  cvs diff -u -r 1.18.2.24 -r 1.18.2.25 src/stock_pixmap.h;  cvs diff -u -r 1.395.2.290 -r 1.395.2.291 src/summaryview.c;  cvs diff -u -r 1.68.2.34 -r 1.68.2.35 src/summaryview.h;  cvs diff -u -r 1.43.2.61 -r 1.43.2.62 src/toolbar.c;  cvs diff -u -r 1.19.2.15 -r 1.19.2.16 src/toolbar.h;  diff -u /dev/null src/pixmaps/open_mail.xpm;  ) > 2.8.1cvs42.patchset
index 19b0d3bd579ec42dfce949095b2867cecb6d7de2..6af0a884b0b6661bcf51c528b44394b2a526d2ab 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=41
+EXTRA_VERSION=42
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5f3ff4bbf68ce2b967d45ad6a07bda080dea1c08..e06e6d79a0d9cb0d5302aee6773844970752f798 100644 (file)
@@ -370,6 +370,7 @@ EXTRA_DIST = \
        pixmaps/notice_warn.xpm \
        pixmaps/offline.xpm \
        pixmaps/online.xpm \
+       pixmaps/open_mail.xpm \
        pixmaps/outbox_hrm.xpm \
        pixmaps/outbox.xpm \
        pixmaps/paste.xpm \
index f0e9f69e320d615536f644dc30f98f0fa8bc3998..812a1dc7ce8b55e49e75bb96c12ffbdf5d6b4952 100644 (file)
@@ -8298,6 +8298,11 @@ static gint compose_delete_cb(GtkWidget *widget, GdkEventAny *event,
        return TRUE;
 }
 
+void compose_close_toolbar(Compose *compose)
+{
+       compose_close_cb(compose, 0, NULL);
+}
+
 static void compose_close_cb(gpointer data, guint action, GtkWidget *widget)
 {
        Compose *compose = (Compose *)data;
index 165dce144b696362cac715807a688c163d7ddb36..f5702c4fef156b116a711cc39bffba2deb2218e5 100644 (file)
@@ -298,6 +298,7 @@ gint compose_queue                  (Compose *compose,
                                         gchar **msgpath,
                                         gboolean remove_reedit_target);
 gboolean compose_close                 (Compose *compose);
+void compose_close_toolbar             (Compose *compose);
 void compose_clear_exit_drafts         (void);
 void compose_reopen_exit_drafts                (void);
 #endif /* __COMPOSE_H__ */
diff --git a/src/pixmaps/open_mail.xpm b/src/pixmaps/open_mail.xpm
new file mode 100644 (file)
index 0000000..849a942
--- /dev/null
@@ -0,0 +1,58 @@
+/* XPM */
+static char * open_mail_xpm[] = {
+"24 24 31 1",
+"      c None",
+".     c #4F4F4F",
+"+     c #434343",
+"@     c #F3F3F3",
+"#     c #ECECEC",
+"$     c #E3E3E3",
+"%     c #000000",
+"&     c #484496",
+"*     c #6A6A6A",
+"=     c #BFBFBF",
+"-     c #535353",
+";     c #FFFFFF",
+">     c #999999",
+",     c #929292",
+"'     c #EEEEEE",
+")     c #AEAEAE",
+"!     c #E4E4E4",
+"~     c #ACACAC",
+"{     c #C8C8C8",
+"]     c #F5F5F5",
+"^     c #A0A0A0",
+"/     c #D4D4D4",
+"(     c #FBFBFB",
+"_     c #959595",
+":     c #818181",
+"<     c #C6C6C6",
+"[     c #636363",
+"}     c #737373",
+"|     c #7C7C7C",
+"1     c #BCBCBC",
+"2     c #787878",
+"                        ",
+"          ...           ",
+"         +@#$.          ",
+"     %%%%%%%%%%%%%      ",
+"    %&&&&&&&&&&&&&%     ",
+"    %*************%     ",
+"    %=============%     ",
+"    %=============%     ",
+"   -%;;;;;;;;;;;;;%-    ",
+"  >%%;**;*****;*;;%%,   ",
+"  %*%;;;;;;;;;;;;;%*%   ",
+"  %'*;*;*****;**;;*)%   ",
+"  %;!*;;;;;;;;;;;*~{%   ",
+"  %;]!***;*******^/{%   ",
+"  %;(]!*;;;;;;;*_/!{%   ",
+"  %;]]]!****;**:<!!{%   ",
+"  %;(]]!*******<<]!{%   ",
+"  %;]]![]]]]]]]}<]!{%   ",
+"  %;(![;]]]]]]]!|!!{%   ",
+"  %;!};]]]]!!]]]!|!{%   ",
+"  %;|;!!!!!!!!!!!!|{%   ",
+"  %}111111111111111[%   ",
+"  ,%%%%%%%%%%%%%%%%%2   ",
+"                        "};
index 5d3a0e5ced93dc433c7ba3b57f5993041b9dc3d0..8f5dc74bbbf56e81c74c6596f75009e381cbef5e 100644 (file)
@@ -69,6 +69,7 @@
 #include "pixmaps/mail_reply_to_author.xpm"
 #include "pixmaps/mail_send.xpm"
 #include "pixmaps/mail_send_queue.xpm"
+#include "pixmaps/open_mail.xpm"
 #include "pixmaps/news_compose.xpm"
 #include "pixmaps/paste.xpm"
 #include "pixmaps/preferences.xpm"
@@ -241,6 +242,7 @@ static StockPixmapData pixmaps[] =
        {mail_send_xpm                          , NULL, NULL, "mail_send", NULL},
        {mail_send_queue_xpm                    , NULL, NULL, "mail_send_queue", NULL},
        {mail_xpm                               , NULL, NULL, "mail_sign", NULL},
+       {open_mail_xpm                          , NULL, NULL, "open_mail", NULL},
        {mark_xpm                               , NULL, NULL, "mark", NULL},
        {new_xpm                                , NULL, NULL, "new", NULL},
        {news_compose_xpm                       , NULL, NULL, "news_compose", NULL},
index b87986e7ff4ca03f8e8ab91fbb43beaa0cbe78f7..651a4e081aa4e79b7cb0d494e6640b84a9e7c698 100644 (file)
@@ -86,6 +86,7 @@ typedef enum
        STOCK_PIXMAP_MAIL_SEND,
        STOCK_PIXMAP_MAIL_SEND_QUEUE,
        STOCK_PIXMAP_MAIL_SIGN,
+       STOCK_PIXMAP_OPEN_MAIL,
        STOCK_PIXMAP_MARK,
        STOCK_PIXMAP_NEW,
        STOCK_PIXMAP_NEWS_COMPOSE,
index 42ed4051ebe66feb9332e0f704b73c62e4b2f686..ec37f8b25139ac90f1fa56bc8a52518e2c941f7f 100644 (file)
@@ -269,8 +269,6 @@ static gboolean summary_button_released     (GtkWidget              *ctree,
 static gboolean summary_key_pressed    (GtkWidget              *ctree,
                                         GdkEventKey            *event,
                                         SummaryView            *summaryview);
-static void summary_open_row           (GtkSCTree              *sctree,
-                                        SummaryView            *summaryview);
 static void summary_tree_expanded      (GtkCTree               *ctree,
                                         GtkCTreeNode           *node,
                                         SummaryView            *summaryview);
@@ -5565,7 +5563,7 @@ void summaryview_activate_quicksearch(SummaryView *summaryview, gboolean show)
        }
 }
 
-static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
+void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
 {
        if (FOLDER_SHOWS_TO_HDR(summaryview->folder_item))
                summary_reedit(summaryview);
index 89fb465bf470104809d8af53704906e40f88e657..3592eb7a95e586466dcb0d27945e5f9c2d183fcd 100644 (file)
@@ -245,6 +245,7 @@ void summary_display_msg_selected (SummaryView              *summaryview,
                                   gboolean              all_headers);
 void summary_redisplay_msg       (SummaryView          *summaryview);
 void summary_open_msg            (SummaryView          *summaryview);
+void summary_open_row            (GtkSCTree *sctree, SummaryView *summaryview);
 void summary_view_source         (SummaryView          *summaryview);
 void summary_reedit              (SummaryView          *summaryview);
 gboolean summary_step            (SummaryView          *summaryview,
index f66282b0e17cf8627f5ae25ebd44239c0cf119c6..5fb7023c575b7640355a1ded0f5d5b39d937ee0a 100644 (file)
@@ -138,6 +138,10 @@ static void toolbar_send_later_cb          (GtkWidget      *widget,
                                                 gpointer        data);
 static void toolbar_draft_cb                   (GtkWidget      *widget,
                                                 gpointer        data);
+static void toolbar_close_cb                   (GtkWidget      *widget,
+                                                gpointer        data);
+static void toolbar_open_mail_cb               (GtkWidget      *widget,
+                                                gpointer        data);
 static void toolbar_insert_cb                  (GtkWidget      *widget,
                                                 gpointer        data);
 static void toolbar_attach_cb                  (GtkWidget      *widget,
@@ -197,6 +201,8 @@ struct {
 #endif
        { "A_SYL_ACTIONS",      N_("Claws Mail Actions Feature")           }, 
        { "A_CANCEL_INC",       N_("Cancel receiving")                     },
+       { "A_OPEN_MAIL",        N_("Open email")                           },
+       { "A_CLOSE",            N_("Close window")                         },
        { "A_SEPARATOR",        "Separator"                             }
 };
 
@@ -402,9 +408,14 @@ static void toolbar_set_default_main(void)
                { A_COMPOSE_EMAIL, STOCK_PIXMAP_MAIL_COMPOSE,
                        (gchar*)Q_("Toolbar|Compose") },
                { A_SEPARATOR,     0,                                 ("")         },
+#ifdef MAEMO
+               { A_OPEN_MAIL,     STOCK_PIXMAP_OPEN_MAIL,            _("Open")    },
+#endif
                { A_REPLY_MESSAGE, STOCK_PIXMAP_MAIL_REPLY,           _("Reply")   }, 
+#ifndef MAEMO
                { A_REPLY_ALL,     STOCK_PIXMAP_MAIL_REPLY_TO_ALL,    _("All")     },
                { A_REPLY_SENDER,  STOCK_PIXMAP_MAIL_REPLY_TO_AUTHOR, _("Sender")  },
+#endif
                { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD,         _("Forward") },
                { A_SEPARATOR,     0,                                 ("")         },
                { A_TRASH,         STOCK_PIXMAP_TRASH,                _("Trash")   },
@@ -453,10 +464,17 @@ static void toolbar_set_default_compose(void)
                { A_SENDL,              STOCK_PIXMAP_MAIL_SEND_QUEUE,   _("Send later")         },
                { A_DRAFT,              STOCK_PIXMAP_MAIL,              _("Draft")              },
                { A_SEPARATOR,          0,                               ("")                   }, 
+#ifndef MAEMO
                { A_INSERT,             STOCK_PIXMAP_INSERT_FILE,       _("Insert")             },
+#endif
                { A_ATTACH,             STOCK_PIXMAP_MAIL_ATTACH,       _("Attach")             },
                { A_SEPARATOR,          0,                               ("")                   },
                { A_ADDRBOOK,           STOCK_PIXMAP_ADDRESS_BOOK,      _("Address")            }
+#ifdef MAEMO
+               ,
+               { A_SEPARATOR,          0,                               ("")                   }, 
+               { A_CLOSE,              STOCK_PIXMAP_CLOSE,             _("Close")              }
+#endif
        };
        
        gint i;
@@ -503,6 +521,11 @@ static void toolbar_set_default_msgview(void)
                { A_LEARN_SPAM,    STOCK_PIXMAP_SPAM_BTN,             _("Spam")    },
 #endif
                { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW,           _("Next")    }
+#ifdef MAEMO
+               ,
+               { A_SEPARATOR,          0,                               ("")      }, 
+               { A_CLOSE,              STOCK_PIXMAP_CLOSE,             _("Close") }
+#endif
        };
        
        gint i;
@@ -1304,6 +1327,52 @@ static void toolbar_draft_cb(GtkWidget *widget, gpointer data)
        compose_toolbar_cb(A_DRAFT, data);
 }
 
+static void toolbar_close_cb(GtkWidget *widget, gpointer data)
+{
+       ToolbarItem *toolbar_item = (ToolbarItem*)data;
+       MainWindow *mainwin;
+       MessageView *messageview;
+       Compose *compose;
+
+       g_return_if_fail(toolbar_item != NULL);
+
+       switch (toolbar_item->type) {
+       case TOOLBAR_MAIN:
+               mainwin = (MainWindow *) toolbar_item->parent;
+               app_will_exit(NULL, mainwin);
+               break;
+       case TOOLBAR_MSGVIEW:
+               messageview = (MessageView *)toolbar_item->parent;
+               messageview_destroy(messageview);
+               break;
+       case TOOLBAR_COMPOSE:
+               compose = (Compose *)toolbar_item->parent;
+               compose_close_toolbar(compose);
+               break;
+       }
+}
+
+static void toolbar_open_mail_cb(GtkWidget *widget, gpointer data)
+{
+       ToolbarItem *toolbar_item = (ToolbarItem*)data;
+       MainWindow *mainwin;
+
+       g_return_if_fail(toolbar_item != NULL);
+
+       switch (toolbar_item->type) {
+       case TOOLBAR_MAIN:
+               mainwin = (MainWindow *) toolbar_item->parent;
+               summary_open_row(NULL, mainwin->summaryview);
+               break;
+       case TOOLBAR_MSGVIEW:
+               debug_print("toolbar event not supported\n");
+               break;
+       case TOOLBAR_COMPOSE:
+               debug_print("toolbar event not supported\n");
+               break;
+       }
+}
+
 static void toolbar_insert_cb(GtkWidget *widget, gpointer data)
 {
        compose_toolbar_cb(A_INSERT, data);
@@ -1428,6 +1497,8 @@ static void toolbar_buttons_cb(GtkWidget   *widget,
                { A_SEND,               toolbar_send_cb                 },
                { A_SENDL,              toolbar_send_later_cb           },
                { A_DRAFT,              toolbar_draft_cb                },
+               { A_OPEN_MAIL,          toolbar_open_mail_cb            },
+               { A_CLOSE,              toolbar_close_cb                },
                { A_INSERT,             toolbar_insert_cb               },
                { A_ATTACH,             toolbar_attach_cb               },
                { A_SIG,                toolbar_sig_cb                  },
@@ -1554,6 +1625,18 @@ Toolbar *toolbar_create(ToolbarType       type,
                                             toolbar_data->send_btn,
                                           _("Send Queued Messages"), NULL);
                        break;
+               case A_CLOSE:
+                       toolbar_data->close_window_btn = item; 
+                       gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), 
+                                            toolbar_data->close_window_btn,
+                                          _("Close window"), NULL);
+                       break;
+               case A_OPEN_MAIL:
+                       toolbar_data->open_mail_btn = item; 
+                       gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), 
+                                            toolbar_data->open_mail_btn,
+                                          _("Open email"), NULL);
+                       break;
                case A_COMPOSE_EMAIL:
                        icon_news = stock_pixmap_widget(container, STOCK_PIXMAP_NEWS_COMPOSE);
                        item_news = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
@@ -1954,6 +2037,14 @@ void toolbar_main_set_sensitive(gpointer data)
                SET_WIDGET_COND(toolbar->compose_news_btn, 
                        M_HAVE_ACCOUNT);
        }
+       if (toolbar->close_window_btn) {
+               SET_WIDGET_COND(toolbar->compose_news_btn, 
+                       M_UNLOCKED);
+       }
+       if (toolbar->open_mail_btn) {
+               SET_WIDGET_COND(toolbar->open_mail_btn, 
+                       M_TARGET_EXIST);
+       }
        if (toolbar->reply_btn) {
                SET_WIDGET_COND(toolbar->reply_btn,
                        M_HAVE_ACCOUNT|M_TARGET_EXIST);
@@ -2116,7 +2207,8 @@ void toolbar_init(Toolbar * toolbar) {
        toolbar->prev_btn               = NULL;
        toolbar->next_btn               = NULL;
        toolbar->exec_btn               = NULL;
-
+       toolbar->open_mail_btn          = NULL;
+       toolbar->close_window_btn       = NULL;
        /* compose buttons */ 
        toolbar->sendl_btn              = NULL;
        toolbar->draft_btn              = NULL;
index 18097d395163f59fc21b79122cc65bf0b7590cbe..8eda03cc2134d30816fe38274e65d8c5026e060b 100644 (file)
@@ -100,6 +100,9 @@ struct _Toolbar {
        GtkWidget *spellcheck_btn;
 #endif
 
+       GtkWidget *open_mail_btn;
+       GtkWidget *close_window_btn;
+
        GSList    *action_list;
        GSList    *item_list;
 
@@ -159,6 +162,7 @@ enum {
        A_REPLY_SENDER,
        A_REPLY_ALL,
        A_REPLY_ML,
+       A_OPEN_MAIL,
        A_FORWARD,
        A_TRASH,
        A_DELETE_REAL,
@@ -187,6 +191,7 @@ enum {
        /* common items */
        A_SYL_ACTIONS,
        A_CANCEL_INC,
+       A_CLOSE,
 
        A_SEPARATOR,