From b4c795d8542654896ac92d04641cfc9b4a70bd8d Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Wed, 3 Dec 2003 03:25:43 +0000 Subject: [PATCH] Print dialog now tracks changes to a label's template. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@367 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/print-dialog.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/glabels2/src/print-dialog.c b/glabels2/src/print-dialog.c index 4a99a2f0..b87ba218 100644 --- a/glabels2/src/print-dialog.c +++ b/glabels2/src/print-dialog.c @@ -95,6 +95,9 @@ static GtkWidget *printer_page_new (glPrintDialog *dialog, static void merge_changed_cb (glLabel *label, glPrintDialog *dialog); +static void size_changed_cb (glLabel *label, + glPrintDialog *dialog); + static void delete_event_cb (glPrintDialog *dialog, gpointer user_data); @@ -346,6 +349,9 @@ job_page_new (glPrintDialog *dialog, g_signal_connect (G_OBJECT(label), "merge_changed", G_CALLBACK (merge_changed_cb), dialog); + g_signal_connect (G_OBJECT(label), "size_changed", + G_CALLBACK (size_changed_cb), dialog); + return vbox; } @@ -402,6 +408,35 @@ merge_changed_cb (glLabel *label, gl_debug (DEBUG_PRINT, "END"); } +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "size_changed" (template changed) callback. */ +/*--------------------------------------------------------------------------*/ +static void +size_changed_cb (glLabel *label, + glPrintDialog *dialog) +{ + gl_debug (DEBUG_PRINT, "START"); + + /* Remove and unref original widgets. */ + gtk_container_remove (GTK_CONTAINER(GL_HIG_CATEGORY(dialog->priv->simple_frame)->vbox), + dialog->priv->copies); + gtk_container_remove (GTK_CONTAINER(GL_HIG_CATEGORY(dialog->priv->merge_frame)->vbox), + dialog->priv->prmerge); + + /* Create new widgets based on updated label and install */ + dialog->priv->copies = gl_wdgt_print_copies_new (label); + gl_hig_category_add_widget (GL_HIG_CATEGORY(dialog->priv->simple_frame), + dialog->priv->copies); + dialog->priv->prmerge = gl_wdgt_print_merge_new (label); + gl_hig_category_add_widget (GL_HIG_CATEGORY(dialog->priv->merge_frame), + dialog->priv->prmerge); + + /* Update these widgets. */ + merge_changed_cb (label, dialog); + + gl_debug (DEBUG_PRINT, "END"); +} + /*--------------------------------------------------------------------------*/ /* PRIVATE. delete event callback. */ /*--------------------------------------------------------------------------*/ -- 2.39.5