]> git.sur5r.net Git - glabels/commitdiff
Print dialog now tracks changes to a label's template.
authorJim Evins <evins@snaught.com>
Wed, 3 Dec 2003 03:25:43 +0000 (03:25 +0000)
committerJim Evins <evins@snaught.com>
Wed, 3 Dec 2003 03:25:43 +0000 (03:25 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@367 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/print-dialog.c

index 4a99a2f0efd991e1964127068896f5e4b759c1e4..b87ba2189931094991eefa980ec351922adc553c 100644 (file)
@@ -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.                                         */
 /*--------------------------------------------------------------------------*/