+2009-09-18 Jim Evins <evins@snaught.com>
+
+ * po/POTFILES.in:
+ Added missing file.
+ * src/mini-preview.h:
+ * src/mini-preview.c: (gl_mini_preview_class_init),
+ (gl_mini_preview_finalize), (gl_mini_preview_set_by_name),
+ (gl_mini_preview_highlight_range), (gl_mini_preview_set_label),
+ (gl_mini_preview_set_page), (gl_mini_preview_set_n_sheets),
+ (gl_mini_preview_set_n_copies), (gl_mini_preview_set_first),
+ (gl_mini_preview_set_last), (gl_mini_preview_set_collate_flag),
+ (gl_mini_preview_set_outline_flag),
+ (gl_mini_preview_set_reverse_flag),
+ (gl_mini_preview_set_crop_marks_flag), (button_release_event_cb),
+ (expose_event_cb), (redraw), (draw), (draw_labels),
+ (draw_rich_preview):
+ Added rich preview capability to mini preview.
+ * src/print-op-dialog.c: (create_custom_widget_cb),
+ (simple_sheets_radio_cb), (simple_first_spin_cb),
+ (simple_last_spin_cb), (preview_pressed_cb), (preview_released_cb),
+ (merge_spin_cb), (merge_collate_check_cb), (preview_clicked_cb),
+ (option_toggled_cb):
+ Use new rich preview capability of mini preview in print dialog.
+
2009-09-17 Jim Evins <evins@snaught.com>
* src/stock.c: (add_icons), (add_button_icon):
[type: gettext/glade]data/builder/prefs-dialog.builder
[type: gettext/glade]data/builder/property-bar.builder
[type: gettext/glade]data/builder/template-designer.builder
+[type: gettext/glade]data/builder/print-op-dialog-custom-widget.builder
[type: gettext/xml]data/templates/paper-sizes.xml
[type: gettext/xml]data/templates/categories.xml
#include "cairo-label-path.h"
#include "marshal.h"
#include "color.h"
+#include "print.h"
#include "debug.h"
enum {
CLICKED,
PRESSED,
+ RELEASED,
LAST_SIGNAL
};
gint first_i;
gint last_i;
gint prev_i;
+
+ gboolean update_scheduled_flag;
+
+ glLabel *label;
+ gint page;
+ gint n_sheets;
+ gint n_copies;
+ gint first;
+ gint last;
+ gboolean collate_flag;
+ gboolean outline_flag;
+ gboolean reverse_flag;
+ gboolean crop_marks_flag;
};
cairo_t *cr,
lglTemplate *template,
gdouble line_width);
+static void draw_rich_preview (glMiniPreview *this,
+ cairo_t *cr);
+
static gint find_closest_label (glMiniPreview *this,
gdouble x,
gl_marshal_VOID__INT_INT,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+ mini_preview_signals[RELEASED] =
+ g_signal_new ("released",
+ G_OBJECT_CLASS_TYPE(object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (glMiniPreviewClass, released),
+ NULL, NULL,
+ gl_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
+
gl_debug (DEBUG_MINI_PREVIEW, "END");
}
g_return_if_fail (object != NULL);
g_return_if_fail (GL_IS_MINI_PREVIEW (object));
+ if (this->priv->label)
+ {
+ g_object_unref (this->priv->label);
+ }
lgl_template_free (this->priv->template);
g_free (this->priv->centers);
g_free (this->priv);
/****************************************************************************/
-/* Set label for mini-preview to determine geometry. */
+/* Set template for mini-preview to determine geometry. */
/****************************************************************************/
void
-gl_mini_preview_set_label_by_name (glMiniPreview *this,
- const gchar *name)
+gl_mini_preview_set_by_name (glMiniPreview *this,
+ const gchar *name)
{
lglTemplate *template;
/****************************************************************************/
-/* Set label for mini-preview to determine geometry. */
+/* Set template for mini-preview to determine geometry. */
/****************************************************************************/
void
gl_mini_preview_set_template (glMiniPreview *this,
{
gl_debug (DEBUG_MINI_PREVIEW, "START");
- this->priv->highlight_first = first_label;
- this->priv->highlight_last = last_label;
+ if ( (first_label != this->priv->highlight_first) ||
+ (last_label != this->priv->highlight_last) )
+ {
- redraw (this);
+ this->priv->highlight_first = first_label;
+ this->priv->highlight_last = last_label;
+
+ redraw (this);
+
+ }
gl_debug (DEBUG_MINI_PREVIEW, "END");
}
+/****************************************************************************/
+/* Set label. */
+/****************************************************************************/
+void
+gl_mini_preview_set_label (glMiniPreview *this,
+ glLabel *label)
+{
+ if ( this->priv->label )
+ {
+ g_object_unref (this->priv->label);
+ }
+ this->priv->label = g_object_ref (label);
+ redraw (this);
+}
+
+
+/****************************************************************************/
+/* Set page number. */
+/****************************************************************************/
+void
+gl_mini_preview_set_page (glMiniPreview *this,
+ gint page)
+{
+ if ( page != this->priv->page )
+ {
+ this->priv->page = page;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set number of sheets. */
+/****************************************************************************/
+void
+gl_mini_preview_set_n_sheets (glMiniPreview *this,
+ gint n_sheets)
+{
+ if ( n_sheets != this->priv->n_sheets )
+ {
+ this->priv->n_sheets = n_sheets;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set number of copies (merge only). */
+/****************************************************************************/
+void
+gl_mini_preview_set_n_copies (glMiniPreview *this,
+ gint n_copies)
+{
+ if ( n_copies != this->priv->n_copies )
+ {
+ this->priv->n_copies = n_copies;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set first label number on first sheet. */
+/****************************************************************************/
+void
+gl_mini_preview_set_first (glMiniPreview *this,
+ gint first)
+{
+ if ( first != this->priv->first )
+ {
+ this->priv->first = first;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set last label number on first sheet (non-merge only). */
+/****************************************************************************/
+void
+gl_mini_preview_set_last (glMiniPreview *this,
+ gint last)
+{
+ if ( last != this->priv->last )
+ {
+ this->priv->last = last;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set collate flag (merge only). */
+/****************************************************************************/
+void
+gl_mini_preview_set_collate_flag (glMiniPreview *this,
+ gboolean collate_flag)
+{
+ if ( collate_flag != this->priv->collate_flag )
+ {
+ this->priv->collate_flag = collate_flag;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set outline flag. */
+/****************************************************************************/
+void
+gl_mini_preview_set_outline_flag (glMiniPreview *this,
+ gboolean outline_flag)
+{
+ if ( outline_flag != this->priv->outline_flag )
+ {
+ this->priv->outline_flag = outline_flag;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set reverse flag. */
+/****************************************************************************/
+void
+gl_mini_preview_set_reverse_flag (glMiniPreview *this,
+ gboolean reverse_flag)
+{
+ if ( reverse_flag != this->priv->reverse_flag )
+ {
+ this->priv->reverse_flag = reverse_flag;
+ redraw (this);
+ }
+}
+
+
+/****************************************************************************/
+/* Set crop marks flag. */
+/****************************************************************************/
+void
+gl_mini_preview_set_crop_marks_flag (glMiniPreview *this,
+ gboolean crop_marks_flag)
+{
+ if ( crop_marks_flag != this->priv->crop_marks_flag )
+ {
+ this->priv->crop_marks_flag = crop_marks_flag;
+ redraw (this);
+ }
+}
+
+
/*--------------------------------------------------------------------------*/
/* Set transformation and return scale. */
/*--------------------------------------------------------------------------*/
}
+ g_signal_emit (G_OBJECT(this),
+ mini_preview_signals[RELEASED],
+ 0, this->priv->first_i, this->priv->last_i);
+
gl_debug (DEBUG_MINI_PREVIEW, "END");
return FALSE;
}
gl_debug (DEBUG_MINI_PREVIEW, "START");
+ this->priv->update_scheduled_flag = FALSE;
+
cr = gdk_cairo_create (widget->window);
cairo_rectangle (cr,
if (GTK_WIDGET (this->priv->canvas)->window)
{
- region = gdk_drawable_get_clip_region (GTK_WIDGET (this->priv->canvas)->window);
-
- gdk_window_invalidate_region (GTK_WIDGET (this->priv->canvas)->window, region, TRUE);
- gdk_window_process_updates (GTK_WIDGET (this->priv->canvas)->window, TRUE);
+ if ( !this->priv->update_scheduled_flag )
+ {
+ this->priv->update_scheduled_flag = TRUE;
- gdk_region_destroy (region);
+ region = gdk_drawable_get_clip_region (GTK_WIDGET (this->priv->canvas)->window);
+ gdk_window_invalidate_region (GTK_WIDGET (this->priv->canvas)->window, region, TRUE);
+ gdk_region_destroy (region);
+ }
}
gl_debug (DEBUG_MINI_PREVIEW, "END");
1.0/scale);
draw_labels (this, cr, template, 1.0/scale);
+
+ if (this->priv->label)
+ {
+ draw_rich_preview (this, cr);
+ }
}
gint i, n_labels;
lglTemplateOrigin *origins;
GtkStyle *style;
- guint highlight_color, paper_color, outline_color;
+ guint base_color;
+ guint highlight_color, paper_color, outline_color;
gl_debug (DEBUG_MINI_PREVIEW, "START");
origins = lgl_template_frame_get_origins (frame);
style = gtk_widget_get_style (GTK_WIDGET(this));
- highlight_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]);
+ base_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]);
+
paper_color = gl_color_from_gdk_color (&style->light[GTK_STATE_NORMAL]);
- outline_color = gl_color_from_gdk_color (&style->fg[GTK_STATE_NORMAL]);
+ highlight_color = gl_color_set_opacity (base_color, 0.10);
+ if (this->priv->label)
+ {
+ /* Outlines are more subtle when doing a rich preview. */
+ outline_color = gl_color_set_opacity (base_color, 0.05);
+ }
+ else
+ {
+ outline_color = gl_color_set_opacity (base_color, 1.00);
+ }
for ( i=0; i < n_labels; i++ ) {
if ( ((i+1) >= this->priv->highlight_first) &&
((i+1) <= this->priv->highlight_last) )
{
- cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (highlight_color));
+ cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (highlight_color));
+ cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+ cairo_fill_preserve (cr);
}
- else
- {
- cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (paper_color));
- }
- cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
- cairo_fill_preserve (cr);
cairo_set_line_width (cr, line_width);
- cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (outline_color));
+ cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (outline_color));
cairo_stroke (cr);
cairo_restore (cr);
}
+/*--------------------------------------------------------------------------*/
+/* Draw rich preview using print renderers. */
+/*--------------------------------------------------------------------------*/
+static void
+draw_rich_preview (glMiniPreview *this,
+ cairo_t *cr)
+{
+ glMerge *merge;
+ glPrintState state;
+
+ merge = gl_label_get_merge (this->priv->label);
+
+ if (!merge)
+ {
+ gl_print_simple_sheet (this->priv->label,
+ cr,
+ this->priv->page,
+ this->priv->n_sheets,
+ this->priv->first,
+ this->priv->last,
+ this->priv->outline_flag,
+ this->priv->reverse_flag,
+ this->priv->crop_marks_flag);
+ }
+ else
+ {
+ /* FIXME: maybe the renderers should be more self contained.
+ * This will only work for the first page, since
+ * previous pages must be rendered to establish
+ * state.
+ */
+ state.i_copy = 0;
+ state.p_record = (GList *)gl_merge_get_record_list (merge);
+
+ if (this->priv->collate_flag)
+ {
+ gl_print_collated_merge_sheet (this->priv->label,
+ cr,
+ this->priv->page,
+ this->priv->n_copies,
+ this->priv->first,
+ this->priv->outline_flag,
+ this->priv->reverse_flag,
+ this->priv->crop_marks_flag,
+ &state);
+ }
+ else
+ {
+ gl_print_uncollated_merge_sheet (this->priv->label,
+ cr,
+ this->priv->page,
+ this->priv->n_copies,
+ this->priv->first,
+ this->priv->outline_flag,
+ this->priv->reverse_flag,
+ this->priv->crop_marks_flag,
+ &state);
+ }
+ }
+}
+
+
/*
* Local Variables: -- emacs
struct _glMiniPreviewClass {
GtkEventBoxClass parent_class;
- void (*clicked) (glMiniPreview *this,
- gint index,
- gpointer user_data);
-
- void (*pressed) (glMiniPreview *this,
- gint index1,
- gint index2,
- gpointer user_data);
+ void (*clicked) (glMiniPreview *this,
+ gint index,
+ gpointer user_data);
+
+ void (*pressed) (glMiniPreview *this,
+ gint index1,
+ gint index2,
+ gpointer user_data);
+
+ void (*released) (glMiniPreview *this,
+ gint index1,
+ gint index2,
+ gpointer user_data);
+
};
-GType gl_mini_preview_get_type (void) G_GNUC_CONST;
+GType gl_mini_preview_get_type (void) G_GNUC_CONST;
+
+GtkWidget *gl_mini_preview_new (gint height,
+ gint width);
-GtkWidget *gl_mini_preview_new (gint height,
- gint width);
+void gl_mini_preview_set_by_name (glMiniPreview *this,
+ const gchar *name);
-void gl_mini_preview_set_label_by_name (glMiniPreview *this,
- const gchar *name);
+void gl_mini_preview_set_template (glMiniPreview *this,
+ const lglTemplate *template);
-void gl_mini_preview_set_template (glMiniPreview *this,
- const lglTemplate *template);
+void gl_mini_preview_highlight_range (glMiniPreview *this,
+ gint first_label,
+ gint last_label);
+
+
+/*
+ * If label is set, the preview will be rich.
+ */
+void gl_mini_preview_set_label (glMiniPreview *this,
+ glLabel *label);
+
+void gl_mini_preview_set_page (glMiniPreview *this,
+ gint n_sheets);
+void gl_mini_preview_set_n_sheets (glMiniPreview *this,
+ gint n_sheets);
+void gl_mini_preview_set_n_copies (glMiniPreview *this,
+ gint n_copies);
+void gl_mini_preview_set_first (glMiniPreview *this,
+ gint first);
+void gl_mini_preview_set_last (glMiniPreview *this,
+ gint last);
+void gl_mini_preview_set_collate_flag (glMiniPreview *this,
+ gboolean collate_flag);
+void gl_mini_preview_set_outline_flag (glMiniPreview *this,
+ gboolean outline_flag);
+void gl_mini_preview_set_reverse_flag (glMiniPreview *this,
+ gboolean reverse_flag);
+void gl_mini_preview_set_crop_marks_flag (glMiniPreview *this,
+ gboolean crop_marks_flag);
-void gl_mini_preview_highlight_range (glMiniPreview *this,
- gint first_label,
- gint last_label);
G_END_DECLS
gint last,
glPrintOpDialog *op);
+static void preview_released_cb (glMiniPreview *preview,
+ gint first,
+ gint last,
+ glPrintOpDialog *op);
+
static void merge_spin_cb (GtkSpinButton *spinbutton,
glPrintOpDialog *op);
gint first,
glPrintOpDialog *op);
+static void option_toggled_cb (GtkToggleButton *togglebutton,
+ glPrintOpDialog *op);
+
/*****************************************************************************/
/* Boilerplate object stuff. */
/* ---- Install preview. ---- */
op->priv->preview = gl_mini_preview_new (MINI_PREVIEW_MIN_HEIGHT, MINI_PREVIEW_MIN_WIDTH);
gl_mini_preview_set_template (GL_MINI_PREVIEW(op->priv->preview), label->template);
+ gl_mini_preview_set_label (GL_MINI_PREVIEW(op->priv->preview), label);
gtk_box_pack_start (GTK_BOX(hbox), op->priv->preview, TRUE, TRUE, 0);
gtk_widget_show_all (op->priv->preview);
op->priv->labels_per_sheet);
/* Update preview. */
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview),
- 1, op->priv->labels_per_sheet);
+ gl_mini_preview_set_page (GL_MINI_PREVIEW (op->priv->preview), 0);
+ gl_mini_preview_set_n_sheets (GL_MINI_PREVIEW (op->priv->preview),
+ gl_print_op_get_n_sheets (GL_PRINT_OP(op)));
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview), 1);
+ gl_mini_preview_set_last (GL_MINI_PREVIEW (op->priv->preview),
+ op->priv->labels_per_sheet);
gtk_widget_show_all (op->priv->simple_frame);
gtk_widget_hide_all (op->priv->merge_frame);
G_CALLBACK (simple_last_spin_cb), op);
g_signal_connect (G_OBJECT (op->priv->preview), "pressed",
G_CALLBACK (preview_pressed_cb), op);
+ g_signal_connect (G_OBJECT (op->priv->preview), "released",
+ G_CALLBACK (preview_released_cb), op);
} else {
if ( gl_print_op_get_collate_flag (GL_PRINT_OP(op)) )
{
- pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
}
else
{
- pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm);
}
gtk_image_set_from_pixbuf (GTK_IMAGE (op->priv->merge_collate_image), pixbuf);
/* Update preview. */
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview),
- gl_print_op_get_first (GL_PRINT_OP(op)),
- gl_print_op_get_first (GL_PRINT_OP(op)) + op->priv->n_records - 1);
+ gl_mini_preview_set_page (GL_MINI_PREVIEW (op->priv->preview), 0);
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview),
+ gl_print_op_get_first (GL_PRINT_OP(op)));
+ gl_mini_preview_set_n_copies (GL_MINI_PREVIEW (op->priv->preview),
+ gl_print_op_get_n_copies (GL_PRINT_OP(op)));
+ gl_mini_preview_set_collate_flag (GL_MINI_PREVIEW (op->priv->preview),
+ gl_print_op_get_collate_flag (GL_PRINT_OP(op)));
+
gtk_widget_hide_all (op->priv->simple_frame);
gtk_widget_show_all (op->priv->merge_frame);
G_CALLBACK (merge_collate_check_cb), op);
g_signal_connect (G_OBJECT (op->priv->preview), "clicked",
G_CALLBACK (preview_clicked_cb), op);
+ g_signal_connect (G_OBJECT (op->priv->preview), "pressed",
+ G_CALLBACK (preview_pressed_cb), op);
+ g_signal_connect (G_OBJECT (op->priv->preview), "released",
+ G_CALLBACK (preview_released_cb), op);
g_object_unref (G_OBJECT(merge));
gtk_widget_set_sensitive (op->priv->crop_marks_check, FALSE);
}
+ g_signal_connect (G_OBJECT (op->priv->outline_check), "toggled",
+ G_CALLBACK (option_toggled_cb), op);
+ g_signal_connect (G_OBJECT (op->priv->reverse_check), "toggled",
+ G_CALLBACK (option_toggled_cb), op);
+ g_signal_connect (G_OBJECT (op->priv->crop_marks_check), "toggled",
+ G_CALLBACK (option_toggled_cb), op);
+
return G_OBJECT (hbox);
}
gtk_spin_button_set_value (GTK_SPIN_BUTTON (op->priv->simple_last_spin),
op->priv->labels_per_sheet);
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview),
- 1, op->priv->labels_per_sheet);
+ gl_mini_preview_set_n_sheets (GL_MINI_PREVIEW (op->priv->preview),
+ gl_print_op_get_n_sheets (GL_PRINT_OP(op)));
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview), 1);
+ gl_mini_preview_set_last (GL_MINI_PREVIEW (op->priv->preview),
+ op->priv->labels_per_sheet);
} else {
first = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (op->priv->simple_first_spin));
last = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (op->priv->simple_last_spin));
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
+ gl_mini_preview_set_n_sheets (GL_MINI_PREVIEW (op->priv->preview), 1);
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview), first);
+ gl_mini_preview_set_last (GL_MINI_PREVIEW (op->priv->preview), last);
+
}
}
first, op->priv->labels_per_sheet);
/* Update preview. */
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview), first);
+ gl_mini_preview_set_last (GL_MINI_PREVIEW (op->priv->preview), last);
}
1, last);
/* Update preview. */
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
+ gl_mini_preview_set_first (GL_MINI_PREVIEW (op->priv->preview), first);
+ gl_mini_preview_set_last (GL_MINI_PREVIEW (op->priv->preview), last);
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->simple_labels_radio), TRUE);
}
- /* Update preview. */
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
-
}
+
+ gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
+
+}
+
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Preview "pressed" callback */
+/*--------------------------------------------------------------------------*/
+static void
+preview_released_cb (glMiniPreview *preview,
+ gint first,
+ gint last,
+ glPrintOpDialog *op)
+{
+
+ gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), 0, 0);
+
}
/*--------------------------------------------------------------------------*/
static void
merge_spin_cb (GtkSpinButton *spinbutton,
- glPrintOpDialog *op)
+ glPrintOpDialog *op)
{
- gint first, last, n_copies;
+ gint first, n_copies;
first = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (op->priv->merge_first_spin));
n_copies = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (op->priv->merge_copies_spin));
- last = first + (n_copies * op->priv->n_records) - 1;
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW(op->priv->preview), first, last );
+ gl_mini_preview_set_first (GL_MINI_PREVIEW(op->priv->preview), first);
+ gl_mini_preview_set_n_copies (GL_MINI_PREVIEW(op->priv->preview), n_copies);
gtk_widget_set_sensitive (op->priv->merge_collate_check, (n_copies > 1));
gtk_widget_set_sensitive (op->priv->merge_collate_image, (n_copies > 1));
if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (op->priv->merge_collate_check)) )
{
- pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
+ gl_mini_preview_set_collate_flag (GL_MINI_PREVIEW (op->priv->preview), TRUE);
}
else
{
- pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm);
+ pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm);
+ gl_mini_preview_set_collate_flag (GL_MINI_PREVIEW (op->priv->preview), FALSE);
}
gtk_image_set_from_pixbuf (GTK_IMAGE (op->priv->merge_collate_image), pixbuf);
glPrintOpDialog *op)
{
gint n_copies;
- gint last;
if ( op->priv->merge_flag )
{
gtk_widget_set_sensitive (op->priv->merge_collate_check, (n_copies > 1));
gtk_widget_set_sensitive (op->priv->merge_collate_image, (n_copies > 1));
+ }
+}
- /* Update preview. */
- last = first + (n_copies * op->priv->n_records) - 1;
- gl_mini_preview_highlight_range (GL_MINI_PREVIEW (op->priv->preview), first, last);
- }
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Option checkbox "toggled" callback */
+/*--------------------------------------------------------------------------*/
+static void
+option_toggled_cb (GtkToggleButton *togglebutton,
+ glPrintOpDialog *op)
+{
+ gboolean flag;
+
+ flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (op->priv->outline_check));
+ gl_mini_preview_set_outline_flag (GL_MINI_PREVIEW (op->priv->preview), flag);
+
+ flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (op->priv->reverse_check));
+ gl_mini_preview_set_reverse_flag (GL_MINI_PREVIEW (op->priv->preview), flag);
+
+ flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (op->priv->crop_marks_check));
+ gl_mini_preview_set_crop_marks_flag (GL_MINI_PREVIEW (op->priv->preview), flag);
}