2008-10-09 [colin] 3.6.0cvs20
[claws.git] / src / prefs_image_viewer.c
index 2ac7383b85a19d4d9b2f79d992f93a9d7a05224e..4f1a31d09b600db0cd01e59a082d3418fbcf8c5c 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -44,6 +44,7 @@ typedef struct _ImageViewerPage
        GtkWidget *autoload_img;
        GtkWidget *resize_img;
        GtkWidget *inline_img;
+       GtkWidget *print_imgs;
 }ImageViewerPage;
 
 static void imageviewer_create_widget_func(PrefsPage * _page,
@@ -53,65 +54,56 @@ static void imageviewer_create_widget_func(PrefsPage * _page,
        ImageViewerPage *prefs_imageviewer = (ImageViewerPage *) _page;
 
        GtkWidget *table;
-       GtkWidget *label;
        GtkWidget *autoload_img;
        GtkWidget *resize_img;
        GtkWidget *inline_img;
+       GtkWidget *print_imgs;
+       CLAWS_TIP_DECL();
 
-       table = gtk_table_new(2, 2, FALSE);
+       table = gtk_table_new(4, 1, FALSE);
        gtk_widget_show(table);
-       gtk_container_set_border_width(GTK_CONTAINER(table), 8);
+       gtk_container_set_border_width(GTK_CONTAINER(table), VBOX_BORDER);
        gtk_table_set_row_spacings(GTK_TABLE(table), 4);
        gtk_table_set_col_spacings(GTK_TABLE(table), 8);
 
-       label =
-           gtk_label_new(_("Automatically display attached images"));
-       gtk_widget_show(label);
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
-                        (GtkAttachOptions) (GTK_FILL),
-                        (GtkAttachOptions) (0), 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       label = gtk_label_new(_("Resize attached images by default\n(Clicking image toggles scaling)"));
-       gtk_widget_show(label);
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
-                        (GtkAttachOptions) (GTK_FILL),
-                        (GtkAttachOptions) (0), 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       label = gtk_label_new(_("Display images inline"));
-       gtk_widget_show(label);
-       gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
-                        (GtkAttachOptions) (GTK_FILL),
-                        (GtkAttachOptions) (0), 0, 0);
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-       
-       autoload_img = gtk_check_button_new_with_label("");
+       autoload_img = gtk_check_button_new_with_label(_("Automatically display attached images"));
        gtk_widget_show(autoload_img);
-       gtk_table_attach(GTK_TABLE(table), autoload_img, 1, 2, 0, 1,
+       gtk_table_attach(GTK_TABLE(table), autoload_img, 0, 1, 0, 1,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
-       resize_img = gtk_check_button_new_with_label("");
+       resize_img = gtk_check_button_new_with_label(_("Resize attached images by default"));
        gtk_widget_show(resize_img);
-       gtk_table_attach(GTK_TABLE(table), resize_img, 1, 2, 1, 2,
+       CLAWS_SET_TIP(resize_img,
+                            _("Clicking image toggles scaling"));
+       gtk_table_attach(GTK_TABLE(table), resize_img, 0, 1, 1, 2,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
-       inline_img = gtk_check_button_new_with_label("");
+       inline_img = gtk_check_button_new_with_label(_("Display images inline"));
        gtk_widget_show(inline_img);
-       gtk_table_attach(GTK_TABLE(table), inline_img, 1, 2, 2, 3,
+       gtk_table_attach(GTK_TABLE(table), inline_img, 0, 1, 2, 3,
+                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+       
+       print_imgs = gtk_check_button_new_with_label(_("Print images"));
+#if !defined(USE_GNOMEPRINT) && GTK_CHECK_VERSION(2,10,0)
+       gtk_widget_show(print_imgs);
+#endif
+       gtk_table_attach(GTK_TABLE(table), print_imgs, 0, 1, 3, 4,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resize_img), prefs_common.resize_img);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(autoload_img), prefs_common.display_img);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(inline_img), prefs_common.inline_img);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(print_imgs), prefs_common.print_imgs);
 
        prefs_imageviewer->window       = GTK_WIDGET(window);
        prefs_imageviewer->autoload_img = autoload_img;
        prefs_imageviewer->resize_img   = resize_img;
        prefs_imageviewer->inline_img   = inline_img;
+       prefs_imageviewer->print_imgs   = print_imgs;
 
        prefs_imageviewer->page.widget = table;
 }
@@ -133,6 +125,9 @@ static void imageviewer_save_func(PrefsPage * _page)
        prefs_common.inline_img =
            gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
                                         (imageviewer->inline_img));
+       prefs_common.print_imgs =
+           gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+                                        (imageviewer->print_imgs));
 }
 
 ImageViewerPage *prefs_imageviewer;