2005-06-27 [colin] 1.9.12cvs1
authorColin Leroy <colin@colino.net>
Mon, 27 Jun 2005 16:57:35 +0000 (16:57 +0000)
committerColin Leroy <colin@colino.net>
Mon, 27 Jun 2005 16:57:35 +0000 (16:57 +0000)
* src/Makefile.am
* src/gtk/Makefile.am
* src/messageview.c
* src/procmsg.c
* src/summaryview.c
* configure.ac
Add optional libgnomeprint-based printing
* src/mainwindow.c
* src/gtk/quicksearch.c
Add an Edit/Quick search menu item to show
and focus the quicksearch

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/Makefile.am
src/gtk/Makefile.am
src/gtk/quicksearch.c
src/mainwindow.c
src/messageview.c
src/procmsg.c
src/summaryview.c

index d2afa4478d1429c2ce89c6312c45b109bd40ff9c..a50f98e3a8dd99149dbfa3e2b844eecd67dfc001 100644 (file)
@@ -1,3 +1,17 @@
+2005-06-27 [colin]     1.9.12cvs1
+
+       * src/Makefile.am
+       * src/gtk/Makefile.am
+       * src/messageview.c
+       * src/procmsg.c
+       * src/summaryview.c
+       * configure.ac
+               Add optional libgnomeprint-based printing
+       * src/mainwindow.c
+       * src/gtk/quicksearch.c
+               Add an Edit/Quick search menu item to show
+               and focus the quicksearch
+
 2005-06-27 [paul]      1.9.12
 
        1.9.12 release
index dfe1bddb41dae68e19f8ba42d9ee40ead5da8d41..2e7fa415952b4cb14cac5e897dbf1e37506fb58e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.59.2.20 -r 1.59.2.21 src/prefs_filtering.c;  ) > 1.9.11cvs104.patchset
 ( cvs diff -u -r 1.213.2.37 -r 1.213.2.38 src/folder.c;  cvs diff -u -r 1.179.2.41 -r 1.179.2.42 src/imap.c;  ) > 1.9.11cvs105.patchset
 ( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/imap_gtk.c;  ) > 1.9.11cvs106.patchset
+( cvs diff -u -r 1.155.2.26 -r 1.155.2.27 src/Makefile.am;  cvs diff -u -r 1.274.2.43 -r 1.274.2.44 src/mainwindow.c;  cvs diff -u -r 1.94.2.55 -r 1.94.2.56 src/messageview.c;  cvs diff -u -r 1.150.2.28 -r 1.150.2.29 src/procmsg.c;  cvs diff -u -r 1.395.2.87 -r 1.395.2.88 src/summaryview.c;  cvs diff -u -r 1.20.2.4 -r 1.20.2.5 src/gtk/Makefile.am;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/gtk/quicksearch.c;  ) > 1.9.12cvs1.patchset
index 2e6f5f079c411433cfa29247b1f34d72af48053c..cfe5b55b0e8cc4d9580f81fa989ef88626172b38 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=0
+EXTRA_VERSION=1
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -53,6 +53,13 @@ dnl GNOME 2.x installed?
 PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
 AM_CONDITIONAL(SYLPHEED_GNOME2, test x"$ac_enable_gnome2" = x"yes")
 
+dnl libgnomeprint installed?
+PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2, ac_enable_gnomeprint=yes, ac_enable_gnomeprint=no)
+AM_CONDITIONAL(SYLPHEED_GNOMEPRINT, test x"$ac_enable_gnomeprint" = x"yes")
+if test x$ac_enable_gnomeprint = xyes; then
+       AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
+fi
+
 dnl Claws version
 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
 
index a7fb7cf2cc61c24d0dd8b34f8ae98835b80aa32b..8475804c571e3877da027455f4619dfc10f71fe6 100644 (file)
@@ -43,6 +43,7 @@ sylpheed_SOURCES = \
        foldersel.c \
        folderutils.c \
        folderview.c \
+       gedit-print.c \
        grouplistdialog.c \
        headerview.c \
        html.c \
@@ -179,6 +180,7 @@ sylpheedinclude_HEADERS = \
        foldersel.h \
        folderutils.h \
        folderview.h \
+       gedit-print.h \
        grouplistdialog.h \
        headerview.h \
        html.h \
@@ -386,6 +388,7 @@ sylpheed_LDADD = \
        $(COMPFACE_LIBS) \
        $(JPILOT_LIBS) \
        $(PTHREAD_LIBS) \
+       $(GNOMEPRINT_LIBS) \
        $(LIBICONV) \
        $(STARTUP_NOTIFICATION_LIBS)
 
@@ -400,6 +403,7 @@ AM_CPPFLAGS = \
        $(GTK_CFLAGS) \
        $(GPGME_CFLAGS) \
        $(OPENSSL_CFLAGS) \
+       $(GNOMEPRINT_CFLAGS) \
        $(STARTUP_NOTIFICATION_CFLAGS)
 
 AM_YFLAGS = -d
index 337a422f2db7f96042d5d306d9c53c8ec8353bf9..ac6197e4627a649719bc2e87e43b57350abe687d 100644 (file)
@@ -16,6 +16,7 @@ libsylpheedgtk_la_SOURCES = \
        gtksctree.c \
        gtkshruler.c \
        gtksctree.c \
+       gtksourceprintjob.c \
        gtkutils.c \
        gtkvscrollbutton.c \
        logwindow.c \
@@ -41,6 +42,7 @@ sylpheedgtkinclude_HEADERS = \
        gtksctree.h \
        gtkshruler.h \
        gtksctree.h \
+       gtksourceprintjob.h \
        gtkutils.h \
        gtkvscrollbutton.h \
        inputdialog.h \
@@ -61,12 +63,14 @@ AM_CPPFLAGS = \
        $(GTK_CFLAGS) \
        $(OPENSSL_CFLAGS) \
        $(ASPELL_CFLAGS) \
-       -DPLUGINDIR=\"$(PLUGINDIR)\"
+       $(GNOMEPRINT_CFLAGS) \
+       -DPLUGINDIR=\"$(PLUGINDIR)\" 
 
 libsylpheedgtk_la_LIBADD = \
        ../common/libsylpheedcommon.la \
        $(GTK_LIBS) \
-       $(ASPELL_LIBS)
+       $(ASPELL_LIBS) \
+       $(GNOMEPRINT_LIBS)
 
 BUILT_SOURCES=sylpheed-marshal.c sylpheed-marshal.h
 
index 8146d20ee01dbad96ab70da9efbf64ed612dfb63..949a33f06ca3d8433874d47b8b9d7e7f8b9ac3e5 100644 (file)
@@ -411,6 +411,8 @@ void quicksearch_show(QuickSearch *quicksearch)
        prepare_matcher(quicksearch);
        gtk_widget_show(quicksearch->hbox_search);
        update_extended_button(quicksearch);
+       gtk_widget_grab_focus(
+               GTK_WIDGET(GTK_COMBO(quicksearch->search_string_entry)->entry));
 }
 
 void quicksearch_hide(QuickSearch *quicksearch)
index 8d8f91ea6774dd0cd6c7c32df4034038f51ffd7c..0447ea6f1c0a4433d647dc058fd62959679c8467 100644 (file)
@@ -436,6 +436,9 @@ void main_window_reply_cb                   (MainWindow     *mainwin,
 gboolean mainwindow_progressindicator_hook     (gpointer        source,
                                                 gpointer        userdata);
 #define  SEPARATE_ACTION 500 
+static void mainwindow_quicksearch             (MainWindow     *mainwin, 
+                                                guint           action, 
+                                                GtkWidget      *widget);
 
 static GtkItemFactoryEntry mainwin_entries[] =
 {
@@ -468,6 +471,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Edit/_Find in current message..."),
                                                "<control>F", search_cb, 0, NULL},
        {N_("/_Edit/_Search folder..."),        "<shift><control>F", search_cb, 1, NULL},
+       {N_("/_Edit/_Quick search"),            "slash", mainwindow_quicksearch, 0, NULL},
        {N_("/_View"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Show or hi_de"),            NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Show or hi_de/_Folder tree"),
@@ -2480,6 +2484,12 @@ static void search_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                message_search(mainwin->messageview);
 }
 
+static void mainwindow_quicksearch(MainWindow *mainwin, guint action, GtkWidget *widget)
+{
+       prefs_common.show_searchbar = TRUE;
+       quicksearch_show(mainwin->summaryview->quicksearch);
+}
+
 static void toggle_folder_cb(MainWindow *mainwin, guint action,
                             GtkWidget *widget)
 {
index 54beb02212a232a12af69b0ac485443eeca44338..1fe120de2ffeccdf06c9633f4cfcac97ae71b826 100644 (file)
@@ -61,6 +61,7 @@
 #include "hooks.h"
 #include "filtering.h"
 #include "partial_download.h"
+#include "gedit-print.h"
 
 static GList *messageview_list = NULL;
 
@@ -1303,11 +1304,13 @@ static void save_as_cb(gpointer data, guint action, GtkWidget *widget)
 static void print_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MessageView *messageview = (MessageView *)data;
-       gchar *cmdline;
+#ifndef USE_GNOMEPRINT
+       gchar *cmdline = NULL;
        gchar *p;
+#endif
 
        if (!messageview->msginfo) return;
-
+#ifndef USE_GNOMEPRINT
        cmdline = input_dialog(_("Print"),
                               _("Enter the print command line:\n"
                                 "(`%s' will be replaced with file name)"),
@@ -1320,9 +1323,19 @@ static void print_cb(gpointer data, guint action, GtkWidget *widget)
                g_free(cmdline);
                return;
        }
-
        procmsg_print_message(messageview->msginfo, cmdline);
        g_free(cmdline);
+#else
+       if (!messageview->mimeview 
+       ||  !messageview->mimeview->textview
+       ||  !messageview->mimeview->textview->text)
+               alertpanel_warning(_("Cannot print: the message doesn't "
+                                    "contain text."));
+
+       gedit_print(
+               GTK_TEXT_VIEW(messageview->mimeview
+                               ->textview->text));
+#endif
 }
 
 static void close_cb(gpointer data, guint action, GtkWidget *widget)
index 4b5c319a060792f19cc82caad3dd0cd21ea68fec..93b569ff9b2ad201f9f1ac5b9e32a822d51968d8 100644 (file)
@@ -956,7 +956,11 @@ void procmsg_print_message(MsgInfo *msginfo, const gchar *cmdline)
 
        g_return_if_fail(msginfo);
 
-       if ((tmpfp = procmime_get_first_text_content(msginfo)) == NULL) {
+       if (procmime_msginfo_is_encrypted(msginfo))
+               tmpfp = procmime_get_first_encrypted_text_content(msginfo);
+       else
+               tmpfp = procmime_get_first_text_content(msginfo);
+       if (tmpfp == NULL) {
                g_warning("Can't get text part\n");
                return;
        }
index a78d04b5e9abde3565911e9595558edf4f28962a..79e539f3a37ed36e8c57b360bde6d855993c1cfb 100644 (file)
@@ -86,6 +86,7 @@
 #include "quicksearch.h"
 #include "partial_download.h"
 #include "timing.h"
+#include "gedit-print.h"
 
 #define SUMMARY_COL_MARK_WIDTH         10
 #define SUMMARY_COL_STATUS_WIDTH       13
@@ -3461,15 +3462,20 @@ void summary_save_as(SummaryView *summaryview)
 
 void summary_print(SummaryView *summaryview)
 {
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
+#ifndef USE_GNOMEPRINT
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
-       GList *cur;
-       gchar *cmdline;
+       gchar *cmdline = NULL;
        gchar *p;
+#else
+       gboolean first = TRUE;
+       GList *tmplist;
+#endif
+       GList *cur;
 
        if (clist->selection == NULL) return;
-
+#ifndef USE_GNOMEPRINT
        cmdline = input_dialog(_("Print"),
                               _("Enter the print command line:\n"
                                 "(`%s' will be replaced with file name)"),
@@ -3482,7 +3488,6 @@ void summary_print(SummaryView *summaryview)
                g_free(cmdline);
                return;
        }
-
        for (cur = clist->selection; cur != NULL && cur->data != NULL; cur = cur->next) {
                msginfo = gtk_ctree_node_get_row_data
                        (ctree, GTK_CTREE_NODE(cur->data));
@@ -3490,6 +3495,30 @@ void summary_print(SummaryView *summaryview)
        }
 
        g_free(cmdline);
+       
+#else
+       tmplist = g_list_copy(clist->selection);
+       summary_unselect_all(summaryview);
+       for (cur = tmplist; cur != NULL && cur->data != NULL; cur = cur->next) {
+               GtkCTreeNode *node = GTK_CTREE_NODE(cur->data);
+               summary_select_node(summaryview, node, TRUE, TRUE);
+               if (!summaryview->messageview->mimeview 
+               ||  !summaryview->messageview->mimeview->textview
+               ||  !summaryview->messageview->mimeview->textview->text)
+                       alertpanel_warning(_("Cannot print: the message doesn't "
+                                            "contain text."));
+               gedit_print(
+                       GTK_TEXT_VIEW(summaryview->messageview->mimeview
+                                       ->textview->text));
+       }
+       for (cur = tmplist; cur != NULL && cur->data != NULL; cur = cur->next) {
+               GtkCTreeNode *node = GTK_CTREE_NODE(cur->data);
+               gtk_sctree_select_with_state(
+                       GTK_SCTREE(clist), node, first ? 0:GDK_CONTROL_MASK);
+               first = FALSE;
+       }
+       g_list_free(tmplist);
+#endif
 }
 
 gboolean summary_execute(SummaryView *summaryview)