Index: gedit-print.c
===================================================================
--- gedit-print.c	(revision 6049)
+++ gedit-print.c	(working copy)
@@ -137,6 +137,43 @@
 
 #define GEDIT_PRINT_CONFIG "gedit-print-config-key"
 
+static gchar *
+get_field_value (GeditFieldSetting fs, GtkSourceBuffer *buffer)
+{
+	gchar *doc_name;
+	gchar *name_to_display;
+    
+	const gchar *res = g_strdup ("");
+	switch (fs)
+	{
+		case GEDIT_FIELD_FILE_NAME_PATH:
+    		doc_name = gedit_document_get_uri_for_display (GEDIT_DOCUMENT (buffer));
+	    	name_to_display = gedit_utils_str_middle_truncate (doc_name, 60);
+    		res = g_strdup_printf (_("File: %s"), name_to_display);
+            g_free (doc_name);
+            g_free (name_to_display);
+			break;
+		case GEDIT_FIELD_FILE_NAME:
+			res = gedit_document_get_short_name_for_display (GEDIT_DOCUMENT (buffer));
+			break;
+		case GEDIT_FIELD_MIME_TYPE:
+			res = gedit_document_get_mime_type (GEDIT_DOCUMENT (buffer));
+			break;
+		case GEDIT_FIELD_PAGE:
+            /* Translators: %N is the current page number, %Q is the total
+             * number of pages (ex. Page 2 of 10) 
+             */
+			res = g_strdup (_("Page %N of %Q"));
+            break;
+		case GEDIT_FIELD_DATE_TIME:
+			res = g_strdup ("%c");
+			break;
+		case GEDIT_FIELD_BLANK:
+			break;
+	}
+	return res;
+}
+
 static void
 buffer_set (GeditPrintJob *job, GParamSpec *pspec, gpointer d)
 {
@@ -178,32 +215,46 @@
 					    gtk_source_buffer_get_highlight_syntax (buffer) &&
 					    gedit_prefs_manager_get_print_syntax_hl ());
 		
-	if (gedit_prefs_manager_get_print_header ())
+    gchar *left;
+    gchar *center;
+    gchar *right;
+    
+    if (gedit_prefs_manager_get_print_header ())
 	{
-		gchar *doc_name;
-		gchar *name_to_display;
-		gchar *left;
-
-		doc_name = gedit_document_get_uri_for_display (GEDIT_DOCUMENT (buffer));
-		name_to_display = gedit_utils_str_middle_truncate (doc_name, 60);
-
-		left = g_strdup_printf (_("File: %s"), name_to_display);
-
-		/* Translators: %N is the current page number, %Q is the total
-		 * number of pages (ex. Page 2 of 10) 
-		 */
+        left = get_field_value (gedit_prefs_manager_get_header_left_field (), buffer);
+        center = get_field_value (gedit_prefs_manager_get_header_center_field (), buffer);
+        right = get_field_value (gedit_prefs_manager_get_header_right_field (), buffer);
+        
 		gtk_source_print_job_set_header_format (pjob,
 							left, 
-							NULL, 
-							_("Page %N of %Q"), 
+							center, 
+							right, 
 							TRUE);
 
 		gtk_source_print_job_set_print_header (pjob, TRUE);
 
-		g_free (doc_name);
-		g_free (name_to_display);
 		g_free (left);
+		g_free (center);
+		g_free (right);
 	}	
+    if (gedit_prefs_manager_get_print_footer ())
+	{
+        left = get_field_value (gedit_prefs_manager_get_footer_left_field (), buffer);
+        center = get_field_value (gedit_prefs_manager_get_footer_center_field (), buffer);
+        right = get_field_value (gedit_prefs_manager_get_footer_right_field (), buffer);
+        
+		gtk_source_print_job_set_footer_format (pjob,
+							left, 
+							center, 
+							right, 
+							TRUE);
+
+		gtk_source_print_job_set_print_footer (pjob, TRUE);
+
+		g_free (left);
+		g_free (center);
+		g_free (right);
+	}	
 }
 
 static void
@@ -347,3 +398,4 @@
 
 	return dialog;
 }
+
Index: dialogs/gedit-page-setup-dialog.c
===================================================================
--- dialogs/gedit-page-setup-dialog.c	(revision 6049)
+++ dialogs/gedit-page-setup-dialog.c	(working copy)
@@ -67,7 +67,15 @@
 	GtkWidget *syntax_checkbutton;
 
 	GtkWidget *page_header_checkbutton;
+	GtkWidget *page_header_left_combobox;
+	GtkWidget *page_header_center_combobox;
+	GtkWidget *page_header_right_combobox;
 
+	GtkWidget *page_footer_checkbutton;
+	GtkWidget *page_footer_left_combobox;
+	GtkWidget *page_footer_center_combobox;
+	GtkWidget *page_footer_right_combobox;
+
 	GtkWidget *line_numbers_checkbutton;
 	GtkWidget *line_numbers_hbox;
 	GtkWidget *line_numbers_spinbutton;
@@ -99,7 +107,6 @@
 static gboolean split_button_state = TRUE;
 static gint old_line_numbers_value = 1;
 
-
 static void 
 gedit_page_setup_dialog_class_init (GeditPageSetupDialogClass *klass)
 {
@@ -141,6 +148,21 @@
 }
 
 static void
+set_header_field_combobox_sensitivities(GeditPageSetupDialog *dlg)
+{
+	gboolean print_header;
+	
+	print_header = gtk_toggle_button_get_active (dlg->priv->page_header_checkbutton);
+
+	gtk_widget_set_sensitive (dlg->priv->page_header_left_combobox,
+				  print_header && gedit_prefs_manager_header_left_field_can_set ());	
+	gtk_widget_set_sensitive (dlg->priv->page_header_center_combobox,
+				  print_header && gedit_prefs_manager_header_center_field_can_set ());	
+	gtk_widget_set_sensitive (dlg->priv->page_header_right_combobox,
+				  print_header && gedit_prefs_manager_header_right_field_can_set ());	
+}
+
+static void
 page_header_checkbutton_toggled (GtkToggleButton      *button,
 				 GeditPageSetupDialog *dlg)
 {
@@ -149,9 +171,105 @@
 	g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->page_header_checkbutton));
 	
 	gedit_prefs_manager_set_print_header (gtk_toggle_button_get_active (button));
+	
+	set_header_field_combobox_sensitivities (dlg);
 }
 
+void
+page_header_left_combobox_changed (GtkComboBox          *combobox,
+				   GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_header_left_combobox));
+	
+	gedit_prefs_manager_set_header_left_field (gtk_combo_box_get_active (combobox));
+}
+
+void
+page_header_center_combobox_changed (GtkComboBox          *combobox,
+				     GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_header_center_combobox));
+	
+	gedit_prefs_manager_set_header_center_field (gtk_combo_box_get_active (combobox));
+}
+void
+page_header_right_combobox_changed (GtkComboBox          *combobox,
+				    GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_header_right_combobox));
+	
+	gedit_prefs_manager_set_header_right_field (gtk_combo_box_get_active (combobox));
+}
+
 static void
+set_footer_field_combobox_sensitivities(GeditPageSetupDialog *dlg)
+{
+	gboolean print_footer;
+	
+	print_footer = gtk_toggle_button_get_active (dlg->priv->page_footer_checkbutton);
+
+	gtk_widget_set_sensitive (dlg->priv->page_footer_left_combobox,
+				  print_footer && gedit_prefs_manager_footer_left_field_can_set ());	
+	gtk_widget_set_sensitive (dlg->priv->page_footer_center_combobox,
+				  print_footer && gedit_prefs_manager_footer_center_field_can_set ());	
+	gtk_widget_set_sensitive (dlg->priv->page_footer_right_combobox,
+				  print_footer && gedit_prefs_manager_footer_right_field_can_set ());	
+}
+
+static void
+page_footer_checkbutton_toggled (GtkToggleButton      *button,
+				 GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->page_footer_checkbutton));
+	
+	gedit_prefs_manager_set_print_footer (gtk_toggle_button_get_active (button));
+	
+	set_footer_field_combobox_sensitivities (dlg);
+}
+
+
+void
+page_footer_left_combobox_changed (GtkComboBox          *combobox,
+				   GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_footer_left_combobox));
+	
+	gedit_prefs_manager_set_footer_left_field (gtk_combo_box_get_active (combobox));
+}
+
+void
+page_footer_center_combobox_changed (GtkComboBox          *combobox,
+				     GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_footer_center_combobox));
+	
+	gedit_prefs_manager_set_footer_center_field (gtk_combo_box_get_active (combobox));
+}
+
+void
+page_footer_right_combobox_changed (GtkComboBox          *combobox,
+				    GeditPageSetupDialog *dlg)
+{
+	gedit_debug (DEBUG_PRINT);
+
+	g_return_if_fail (combobox == GTK_COMBO_BOX (dlg->priv->page_footer_right_combobox));
+	
+	gedit_prefs_manager_set_footer_right_field (gtk_combo_box_get_active (combobox));
+}
+
+static void
 line_numbers_checkbutton_toggled (GtkToggleButton      *button,
 				  GeditPageSetupDialog *dlg)
 {
@@ -240,6 +358,48 @@
 	gtk_widget_set_sensitive (dialog->priv->page_header_checkbutton,
 				  gedit_prefs_manager_print_header_can_set ());
 	
+	/* Header fields */
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_header_left_combobox),
+				  gedit_prefs_manager_get_header_left_field());
+	gtk_widget_set_sensitive (dialog->priv->page_header_left_combobox,
+				  gedit_prefs_manager_header_left_field_can_set ());
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_header_center_combobox),
+				  gedit_prefs_manager_get_header_center_field());
+	gtk_widget_set_sensitive (dialog->priv->page_header_center_combobox,
+				  gedit_prefs_manager_header_center_field_can_set ());
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_header_right_combobox),
+				  gedit_prefs_manager_get_header_right_field());
+	gtk_widget_set_sensitive (dialog->priv->page_header_right_combobox,
+				  gedit_prefs_manager_header_right_field_can_set ());
+
+	set_header_field_combobox_sensitivities (dialog);
+
+	/* Print page footers */
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->page_footer_checkbutton),
+				      gedit_prefs_manager_get_print_footer ());
+	gtk_widget_set_sensitive (dialog->priv->page_footer_checkbutton,
+				  gedit_prefs_manager_print_footer_can_set ());
+	
+	/* Footer fields */
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_footer_left_combobox),
+				  gedit_prefs_manager_get_footer_left_field());
+	gtk_widget_set_sensitive (dialog->priv->page_footer_left_combobox,
+				  gedit_prefs_manager_footer_left_field_can_set ());
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_footer_center_combobox),
+				  gedit_prefs_manager_get_footer_center_field());
+	gtk_widget_set_sensitive (dialog->priv->page_footer_center_combobox,
+				  gedit_prefs_manager_footer_center_field_can_set ());
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_footer_right_combobox),
+				  gedit_prefs_manager_get_footer_right_field());
+	gtk_widget_set_sensitive (dialog->priv->page_footer_right_combobox,
+				  gedit_prefs_manager_footer_right_field_can_set ());
+
+	set_footer_field_combobox_sensitivities (dialog);
+
 	/* Line numbers */
 	line_numbers =  gedit_prefs_manager_get_print_line_numbers ();
 	can_set = gedit_prefs_manager_print_line_numbers_can_set ();
@@ -306,6 +466,34 @@
 			  "toggled",
 			  G_CALLBACK (page_header_checkbutton_toggled),
 			  dialog);
+	g_signal_connect (dialog->priv->page_header_left_combobox,
+			  "changed",
+			  G_CALLBACK (page_header_left_combobox_changed),
+			  dialog);
+	g_signal_connect (dialog->priv->page_header_center_combobox,
+			  "changed",
+			  G_CALLBACK (page_header_center_combobox_changed),
+			  dialog);
+	g_signal_connect (dialog->priv->page_header_right_combobox,
+			  "changed",
+			  G_CALLBACK (page_header_right_combobox_changed),
+			  dialog);
+	g_signal_connect (dialog->priv->page_footer_checkbutton,
+			  "toggled",
+			  G_CALLBACK (page_footer_checkbutton_toggled),
+			  dialog);
+	g_signal_connect (dialog->priv->page_footer_left_combobox,
+			  "changed",
+			  G_CALLBACK (page_footer_left_combobox_changed),
+			  dialog);
+	g_signal_connect (dialog->priv->page_footer_center_combobox,
+			  "changed",
+			  G_CALLBACK (page_footer_center_combobox_changed),
+			  dialog);
+	g_signal_connect (dialog->priv->page_footer_right_combobox,
+			  "changed",
+			  G_CALLBACK (page_footer_right_combobox_changed),
+			  dialog);
 	g_signal_connect (dialog->priv->line_numbers_checkbutton,
 			  "toggled",
 			  G_CALLBACK (line_numbers_checkbutton_toggled),
@@ -549,6 +737,13 @@
 					     "notebook1", &content,
 					     "syntax_checkbutton", &dlg->priv->syntax_checkbutton,
 					     "page_header_checkbutton", &dlg->priv->page_header_checkbutton,
+					     "page_header_left_combobox", &dlg->priv->page_header_left_combobox,
+	          			     "page_header_center_combobox", &dlg->priv->page_header_center_combobox,
+	          			     "page_header_right_combobox", &dlg->priv->page_header_right_combobox,
+	          			     "page_footer_left_combobox", &dlg->priv->page_footer_left_combobox,
+	          			     "page_footer_center_combobox", &dlg->priv->page_footer_center_combobox,
+	          			     "page_footer_right_combobox", &dlg->priv->page_footer_right_combobox,
+					     "page_footer_checkbutton", &dlg->priv->page_footer_checkbutton,
 					     "line_numbers_checkbutton", &dlg->priv->line_numbers_checkbutton,
 					     "line_numbers_hbox", &dlg->priv->line_numbers_hbox,
 					     "line_numbers_spinbutton", &dlg->priv->line_numbers_spinbutton,
Index: dialogs/gedit-page-setup-dialog.glade
===================================================================
--- dialogs/gedit-page-setup-dialog.glade	(revision 6049)
+++ dialogs/gedit-page-setup-dialog.glade	(working copy)
@@ -1,654 +1,508 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
 <glade-interface>
-
-<widget class="GtkDialog" id="dialog">
-  <property name="title" translatable="yes">Page Setup</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="resizable">False</property>
-  <property name="destroy_with_parent">True</property>
-  <property name="has_separator">False</property>
-
-  <child internal-child="vbox">
-    <widget class="GtkVBox" id="dialog-vbox1">
-      <property name="visible">True</property>
-      <property name="homogeneous">False</property>
-      <property name="spacing">0</property>
-
-      <child internal-child="action_area">
-	<widget class="GtkHButtonBox" id="dialog-action_area1">
-	  <property name="visible">True</property>
-	  <property name="layout_style">GTK_BUTTONBOX_END</property>
-
-	  <child>
-	    <widget class="GtkButton" id="helpbutton1">
-	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label">gtk-help</property>
-	      <property name="use_stock">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="response_id">-11</property>
-	    </widget>
-	  </child>
-
-	  <child>
-	    <widget class="GtkButton" id="closebutton1">
-	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label">gtk-close</property>
-	      <property name="use_stock">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="response_id">-7</property>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">False</property>
-	  <property name="fill">True</property>
-	  <property name="pack_type">GTK_PACK_END</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkNotebook" id="notebook1">
-	  <property name="border_width">6</property>
-	  <property name="visible">True</property>
-	  <property name="can_focus">True</property>
-	  <property name="show_tabs">True</property>
-	  <property name="show_border">True</property>
-	  <property name="tab_pos">GTK_POS_TOP</property>
-	  <property name="scrollable">False</property>
-	  <property name="enable_popup">False</property>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox7">
-	      <property name="border_width">12</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">18</property>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox14">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkCheckButton" id="syntax_checkbutton">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">Print synta_x highlighting</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="active">False</property>
-		      <property name="inconsistent">False</property>
-		      <property name="draw_indicator">True</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkCheckButton" id="page_header_checkbutton">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Print page headers</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="active">False</property>
-		      <property name="inconsistent">False</property>
-		      <property name="draw_indicator">True</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox12">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="label18">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">&lt;b&gt;Line Numbers&lt;/b&gt;</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">True</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox12">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkLabel" id="label19">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">    </property>
-			  <property name="use_underline">False</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
-			  <property name="wrap">False</property>
-			  <property name="selectable">False</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkVBox" id="vbox13">
-			  <property name="visible">True</property>
-			  <property name="homogeneous">False</property>
-			  <property name="spacing">6</property>
-
-			  <child>
-			    <widget class="GtkCheckButton" id="line_numbers_checkbutton">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Print _line numbers</property>
-			      <property name="use_underline">True</property>
-			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="active">False</property>
-			      <property name="inconsistent">False</property>
-			      <property name="draw_indicator">True</property>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
-			  </child>
-
-			  <child>
-			    <widget class="GtkHBox" id="line_numbers_hbox">
-			      <property name="visible">True</property>
-			      <property name="homogeneous">False</property>
-			      <property name="spacing">6</property>
-
-			      <child>
-				<widget class="GtkLabel" id="label20">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">_Number every</property>
-				  <property name="use_underline">True</property>
-				  <property name="use_markup">False</property>
-				  <property name="justify">GTK_JUSTIFY_LEFT</property>
-				  <property name="wrap">False</property>
-				  <property name="selectable">False</property>
-				  <property name="xalign">0.48</property>
-				  <property name="yalign">0.5</property>
-				  <property name="xpad">0</property>
-				  <property name="ypad">0</property>
-				  <property name="mnemonic_widget">line_numbers_spinbutton</property>
-				</widget>
-				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">False</property>
-				</packing>
-			      </child>
-
-			      <child>
-				<widget class="GtkSpinButton" id="line_numbers_spinbutton">
-				  <property name="visible">True</property>
-				  <property name="can_focus">True</property>
-				  <property name="climb_rate">1</property>
-				  <property name="digits">0</property>
-				  <property name="numeric">False</property>
-				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-				  <property name="snap_to_ticks">False</property>
-				  <property name="wrap">False</property>
-				  <property name="adjustment">1 1 100 1 10 10</property>
-				</widget>
-				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">False</property>
-				</packing>
-			      </child>
-
-			      <child>
-				<widget class="GtkLabel" id="label21">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">lines</property>
-				  <property name="use_underline">False</property>
-				  <property name="use_markup">False</property>
-				  <property name="justify">GTK_JUSTIFY_LEFT</property>
-				  <property name="wrap">False</property>
-				  <property name="selectable">False</property>
-				  <property name="xalign">0.5</property>
-				  <property name="yalign">0.5</property>
-				  <property name="xpad">0</property>
-				  <property name="ypad">0</property>
-				</widget>
-				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">False</property>
-				</packing>
-			      </child>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox10">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="label16">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">&lt;b&gt;Text Wrapping&lt;/b&gt;</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">True</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox10">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkLabel" id="label17">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">    </property>
-			  <property name="use_underline">False</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
-			  <property name="wrap">False</property>
-			  <property name="selectable">False</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkVBox" id="vbox11">
-			  <property name="visible">True</property>
-			  <property name="homogeneous">False</property>
-			  <property name="spacing">6</property>
-
-			  <child>
-			    <widget class="GtkCheckButton" id="text_wrapping_checkbutton">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Enable text _wrapping</property>
-			      <property name="use_underline">True</property>
-			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="active">False</property>
-			      <property name="inconsistent">False</property>
-			      <property name="draw_indicator">True</property>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
-			  </child>
-
-			  <child>
-			    <widget class="GtkHBox" id="hbox11">
-			      <property name="visible">True</property>
-			      <property name="homogeneous">False</property>
-			      <property name="spacing">0</property>
-
-			      <child>
-				<widget class="GtkCheckButton" id="do_not_split_checkbutton">
-				  <property name="visible">True</property>
-				  <property name="can_focus">True</property>
-				  <property name="label" translatable="yes">Do not _split words over two lines</property>
-				  <property name="use_underline">True</property>
-				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="active">False</property>
-				  <property name="inconsistent">False</property>
-				  <property name="draw_indicator">True</property>
-				</widget>
-				<packing>
-				  <property name="padding">0</property>
-				  <property name="expand">False</property>
-				  <property name="fill">False</property>
-				</packing>
-			      </child>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">True</property>
-			      <property name="fill">True</property>
-			    </packing>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label13">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">General</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox6">
-	      <property name="border_width">12</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">12</property>
-
-	      <child>
-		<widget class="GtkTable" id="fonts_table">
-		  <property name="visible">True</property>
-		  <property name="n_rows">3</property>
-		  <property name="n_columns">2</property>
-		  <property name="homogeneous">False</property>
-		  <property name="row_spacing">12</property>
-		  <property name="column_spacing">12</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="body_font_label">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">_Body:</property>
-		      <property name="use_underline">True</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkLabel" id="numbers_font_label">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">_Line numbers:</property>
-		      <property name="use_underline">True</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkLabel" id="headers_font_label">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">He_aders and footers:</property>
-		      <property name="use_underline">True</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">2</property>
-		      <property name="bottom_attach">3</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkLabel" id="label11">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes"></property>
-		  <property name="use_underline">False</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0.5</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkHBox" id="hbox8">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">0</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="label12">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes"></property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0.5</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkButton" id="restore_button">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Restore Default Fonts</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">True</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label2">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Fonts</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">True</property>
-	  <property name="fill">True</property>
-	</packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
+  <widget class="GtkDialog" id="dialog">
+    <property name="title" translatable="yes">Page Setup</property>
+    <property name="resizable">False</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="border_width">6</property>
+            <child>
+              <widget class="GtkVBox" id="vbox7">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">10</property>
+                <child>
+                  <widget class="GtkCheckButton" id="syntax_checkbutton">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="label" translatable="yes">Print synta_x highlighting</property>
+                    <property name="use_underline">True</property>
+                    <property name="response_id">0</property>
+                    <property name="draw_indicator">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox1">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="text_wrapping_checkbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Enable text _wrapping</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox1">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <child>
+                          <widget class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">10</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkCheckButton" id="do_not_split_checkbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="label" translatable="yes">Do not _split words over two lines</property>
+                            <property name="use_underline">True</property>
+                            <property name="response_id">0</property>
+                            <property name="draw_indicator">True</property>
+                          </widget>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox3">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="line_numbers_checkbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Print _line numbers every</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="line_numbers_hbox">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkSpinButton" id="line_numbers_spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">1 1 100 1 10 10</property>
+                            <property name="climb_rate">1</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label21">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">line(s)</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="spacing">2</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="page_header_checkbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Print page _headers</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox2">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <child>
+                          <widget class="GtkLabel" id="label3">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="padding">10</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_header_left_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_header_center_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="focus_on_click">False</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_header_right_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="spacing">2</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="page_footer_checkbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Print page _footers</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox4">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <child>
+                          <widget class="GtkLabel" id="label4">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="padding">10</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_footer_left_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_footer_center_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkComboBox" id="page_footer_right_combobox">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="items" translatable="yes">-- blank --
+File path/name
+File name
+MIME type
+Page # of #
+Date/Time</property>
+                          </widget>
+                          <packing>
+                            <property name="padding">5</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">4</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label13">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">General</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkVBox" id="vbox6">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">12</property>
+                <child>
+                  <widget class="GtkTable" id="fonts_table">
+                    <property name="visible">True</property>
+                    <property name="n_rows">3</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">12</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="body_font_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">_Body:</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="numbers_font_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">_Line numbers:</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="headers_font_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">He_aders and footers:</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label11">
+                    <property name="visible">True</property>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox8">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkLabel" id="label12">
+                        <property name="visible">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkButton" id="restore_button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">_Restore Default Fonts</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_expand">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Fonts</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="helpbutton1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-help</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">-11</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="closebutton1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-close</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">-7</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </glade-interface>
Index: gedit-prefs-manager.c
===================================================================
--- gedit-prefs-manager.c	(revision 6049)
+++ gedit-prefs-manager.c	(working copy)
@@ -125,7 +125,45 @@
 	return gedit_prefs_manager_key_is_writable (key);		\
 }		
 
+#define DEFINE_FIELD_PREF(name, key, def) GeditFieldSetting		\
+gedit_prefs_manager_get_ ## name (void)					\
+{									\
+	gchar *str;							\
+	GeditFieldSetting res;						\
+									\
+	gedit_debug (DEBUG_PREFS);					\
+									\
+	const gchar *defstr = get_string_from_field_setting(def);		\
+									\
+	str = gedit_prefs_manager_get_string (key,			\
+					      defstr);			\
+	res = get_field_setting_from_string (str);			\
+									\
+	g_free (str);							\
+									\
+	return res;							\
+}									\
+									\
+void									\
+gedit_prefs_manager_set_ ## name (GeditFieldSetting v)			\
+{									\
+	gedit_debug (DEBUG_PREFS);					\
+									\
+	const gchar *str = get_string_from_field_setting(v);		\
+									\
+	gedit_prefs_manager_set_string (key,				\
+				        str);				\
+}									\
+									\
+gboolean								\
+gedit_prefs_manager_ ## name ## _can_set (void)				\
+{									\
+	gedit_debug (DEBUG_PREFS);					\
+									\
+	return gedit_prefs_manager_key_is_writable (key);		\
+}									\
 
+
 GeditPrefsManager *gedit_prefs_manager = NULL;
 
 
@@ -534,12 +572,86 @@
 		  GPM_PRINT_SYNTAX,
 		  GPM_DEFAULT_PRINT_SYNTAX)
 
+/* Header/Footer field setting helpers */
+static GeditFieldSetting
+get_field_setting_from_string (const gchar *str)
+{
+	GeditFieldSetting res;
+
+	g_return_val_if_fail (str != NULL, GEDIT_FIELD_BLANK);
+	
+	if (strcmp (str, "GEDIT_FIELD_FILE_NAME_PATH") == 0)
+		res = GEDIT_FIELD_FILE_NAME_PATH;
+	else if (strcmp (str, "GEDIT_FIELD_FILE_NAME") == 0)
+		res = GEDIT_FIELD_FILE_NAME;
+	else if (strcmp (str, "GEDIT_FIELD_MIME_TYPE") == 0)
+		res = GEDIT_FIELD_MIME_TYPE;
+	else if (strcmp (str, "GEDIT_FIELD_PAGE") == 0)
+		res = GEDIT_FIELD_PAGE;
+	else if (strcmp (str, "GEDIT_FIELD_DATE_TIME") == 0)
+		res = GEDIT_FIELD_DATE_TIME;
+	else 
+		res = GEDIT_FIELD_BLANK;
+
+	return res;
+}
+
+static const gchar *
+get_string_from_field_setting (GeditFieldSetting fs)
+{
+	const gchar *res = "GEDIT_FIELD_BLANK";
+	switch (fs)
+	{
+		case GEDIT_FIELD_FILE_NAME_PATH:
+			res = "GEDIT_FIELD_FILE_NAME_PATH";
+			break;
+		case GEDIT_FIELD_FILE_NAME:
+			res = "GEDIT_FIELD_FILE_NAME";
+			break;
+		case GEDIT_FIELD_MIME_TYPE:
+			res = "GEDIT_FIELD_MIME_TYPE";
+			break;
+		case GEDIT_FIELD_PAGE:
+			res = "GEDIT_FIELD_PAGE";
+			break;
+		case GEDIT_FIELD_DATE_TIME:
+			res = "GEDIT_FIELD_DATE_TIME";
+			break;
+		case GEDIT_FIELD_BLANK:
+			break;
+	}
+	return res;
+}
+
 /* Print header */
 DEFINE_BOOL_PREF (print_header,
 		  GPM_PRINT_HEADER,
 		  GPM_DEFAULT_PRINT_HEADER)
+DEFINE_FIELD_PREF (header_left_field,
+		   GPM_HEADER_LEFT_FIELD,
+		   GPM_DEFAULT_HEADER_LEFT_FIELD);
+DEFINE_FIELD_PREF (header_center_field,
+		   GPM_HEADER_CENTER_FIELD,
+		   GPM_DEFAULT_HEADER_CENTER_FIELD);
+DEFINE_FIELD_PREF (header_right_field,
+		   GPM_HEADER_RIGHT_FIELD,
+		   GPM_DEFAULT_HEADER_RIGHT_FIELD);
 
+/* Print footer */
+DEFINE_BOOL_PREF (print_footer,
+		  GPM_PRINT_FOOTER,
+		  GPM_DEFAULT_PRINT_FOOTER)
+DEFINE_FIELD_PREF (footer_left_field,
+		   GPM_FOOTER_LEFT_FIELD,
+		   GPM_DEFAULT_FOOTER_LEFT_FIELD);
+DEFINE_FIELD_PREF (footer_center_field,
+		   GPM_FOOTER_CENTER_FIELD,
+		   GPM_DEFAULT_FOOTER_CENTER_FIELD);
+DEFINE_FIELD_PREF (footer_right_field,
+		   GPM_FOOTER_RIGHT_FIELD,
+		   GPM_DEFAULT_FOOTER_RIGHT_FIELD);
 
+
 /* Print Wrap mode */
 GtkWrapMode
 gedit_prefs_manager_get_print_wrap_mode (void)
Index: gedit-prefs-manager.h
===================================================================
--- gedit-prefs-manager.h	(revision 6049)
+++ gedit-prefs-manager.h	(working copy)
@@ -35,6 +35,15 @@
 #include <gtksourceview/gtksourceview.h>
 #include "gedit-app.h"
 
+typedef enum {
+	GEDIT_FIELD_BLANK = 0,
+	GEDIT_FIELD_FILE_NAME_PATH,
+	GEDIT_FIELD_FILE_NAME,
+	GEDIT_FIELD_MIME_TYPE,
+	GEDIT_FIELD_PAGE,
+	GEDIT_FIELD_DATE_TIME
+} GeditFieldSetting;
+
 #define GEDIT_BASE_KEY	"/apps/gedit-2"
 
 #define GPM_PREFS_DIR			GEDIT_BASE_KEY "/preferences"
@@ -111,6 +120,13 @@
 #define GPM_PRINT_PAGE_DIR		GPM_PREFS_DIR "/print/page"
 #define GPM_PRINT_SYNTAX		GPM_PRINT_PAGE_DIR "/print_syntax_highlighting"
 #define GPM_PRINT_HEADER		GPM_PRINT_PAGE_DIR "/print_header"
+#define GPM_HEADER_LEFT_FIELD		GPM_PRINT_PAGE_DIR "/header_left_field"
+#define GPM_HEADER_CENTER_FIELD		GPM_PRINT_PAGE_DIR "/header_center_field"
+#define GPM_HEADER_RIGHT_FIELD		GPM_PRINT_PAGE_DIR "/header_right_field"
+#define GPM_PRINT_FOOTER		GPM_PRINT_PAGE_DIR "/print_footer"
+#define GPM_FOOTER_LEFT_FIELD		GPM_PRINT_PAGE_DIR "/footer_left_field"
+#define GPM_FOOTER_CENTER_FIELD		GPM_PRINT_PAGE_DIR "/footer_center_field"
+#define GPM_FOOTER_RIGHT_FIELD		GPM_PRINT_PAGE_DIR "/footer_right_field"
 #define GPM_PRINT_WRAP_MODE		GPM_PRINT_PAGE_DIR "/print_wrap_mode"
 #define GPM_PRINT_LINE_NUMBERS		GPM_PRINT_PAGE_DIR "/print_line_numbers"
 
@@ -176,6 +192,13 @@
 
 #define GPM_DEFAULT_PRINT_SYNTAX	1 /* TRUE */
 #define GPM_DEFAULT_PRINT_HEADER	1 /* TRUE */
+#define GPM_DEFAULT_HEADER_LEFT_FIELD	GEDIT_FIELD_FILE_NAME_PATH
+#define GPM_DEFAULT_HEADER_CENTER_FIELD	GEDIT_FIELD_BLANK
+#define GPM_DEFAULT_HEADER_RIGHT_FIELD	GEDIT_FIELD_PAGE
+#define GPM_DEFAULT_PRINT_FOOTER	0 /* FALSE */
+#define GPM_DEFAULT_FOOTER_LEFT_FIELD	GEDIT_FIELD_BLANK
+#define GPM_DEFAULT_FOOTER_CENTER_FIELD	GEDIT_FIELD_BLANK
+#define GPM_DEFAULT_FOOTER_RIGHT_FIELD	GEDIT_FIELD_BLANK
 #define GPM_DEFAULT_PRINT_WRAP_MODE	"GTK_WRAP_WORD"
 #define GPM_DEFAULT_PRINT_LINE_NUMBERS	0 /* No numbers */
 
@@ -316,7 +339,36 @@
 gboolean		 gedit_prefs_manager_get_print_header		(void);
 void			 gedit_prefs_manager_set_print_header		(gboolean ph);
 gboolean		 gedit_prefs_manager_print_header_can_set	(void);
+
+GeditFieldSetting	 gedit_prefs_manager_get_header_left_field	(void);
+void			 gedit_prefs_manager_set_header_left_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_header_left_field_can_set	(void);
+
+GeditFieldSetting	 gedit_prefs_manager_get_header_center_field	(void);
+void			 gedit_prefs_manager_set_header_center_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_header_center_field_can_set(void);
+
+GeditFieldSetting	 gedit_prefs_manager_get_header_right_field	(void);
+void			 gedit_prefs_manager_set_header_right_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_header_right_field_can_set	(void);
+
+/* Print footer */
+gboolean		 gedit_prefs_manager_get_print_footer		(void);
+void			 gedit_prefs_manager_set_print_footer		(gboolean ph);
+gboolean		 gedit_prefs_manager_print_footer_can_set	(void);
 	
+GeditFieldSetting	 gedit_prefs_manager_get_footer_left_field	(void);
+void			 gedit_prefs_manager_set_footer_left_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_footer_left_field_can_set		(void);
+
+GeditFieldSetting	 gedit_prefs_manager_get_footer_center_field	(void);
+void			 gedit_prefs_manager_set_footer_center_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_footer_center_field_can_set(void);
+
+GeditFieldSetting	 gedit_prefs_manager_get_footer_right_field	(void);
+void			 gedit_prefs_manager_set_footer_right_field	(GeditFieldSetting field);
+gboolean		 gedit_prefs_manager_footer_right_field_can_set	(void);
+
 /* Wrap mode while printing */
 GtkWrapMode		 gedit_prefs_manager_get_print_wrap_mode	(void);
 void			 gedit_prefs_manager_set_print_wrap_mode	(GtkWrapMode pwm);
@@ -333,7 +385,7 @@
 gboolean		 gedit_prefs_manager_print_font_body_can_set	(void);
 const gchar		*gedit_prefs_manager_get_default_print_font_body (void);
 
-/* Font used to print headers */
+/* Font used to print headers and/or footers */
 gchar			*gedit_prefs_manager_get_print_font_header	(void);
 void			 gedit_prefs_manager_set_print_font_header	(const gchar *font);
 gboolean		 gedit_prefs_manager_print_font_header_can_set	(void);
