f-spot r3994 - in trunk: . src src/Widgets



Author: sdelcroix
Date: Mon May 26 12:23:46 2008
New Revision: 3994
URL: http://svn.gnome.org/viewvc/f-spot?rev=3994&view=rev

Log:
2008-05-26  Stephane Delcroix  <sdelcroix novell com>

	* src/PrintOperation.cs:
	* src/Widgets/CustomPrintWidget.cs: adding a "Page Setup" button.


Modified:
   trunk/ChangeLog
   trunk/src/PrintOperation.cs
   trunk/src/Widgets/CustomPrintWidget.cs

Modified: trunk/src/PrintOperation.cs
==============================================================================
--- trunk/src/PrintOperation.cs	(original)
+++ trunk/src/PrintOperation.cs	Mon May 26 12:23:46 2008
@@ -11,6 +11,7 @@
 using Cairo;
 using System;
 using System.Runtime.InteropServices;
+using Mono.Unix;
 
 using FSpot.Widgets;
 
@@ -27,6 +28,7 @@
 		public PrintOperation (IBrowsableItem [] selected_photos) : base ()
 		{
 			this.selected_photos = selected_photos;
+			CustomTabLabel = Catalog.GetString ("Image Settings");
 			NPages = selected_photos.Length;
 		}
 
@@ -37,7 +39,7 @@
 
 		protected override Gtk.Widget OnCreateCustomWidget ()
 		{
-			Gtk.Widget widget = new CustomPrintWidget ();
+			Gtk.Widget widget = new CustomPrintWidget (this);
 			widget.ShowAll ();
 			(widget as CustomPrintWidget).Changed += OnCustomWidgetChanged;
 			OnCustomWidgetChanged (widget);

Modified: trunk/src/Widgets/CustomPrintWidget.cs
==============================================================================
--- trunk/src/Widgets/CustomPrintWidget.cs	(original)
+++ trunk/src/Widgets/CustomPrintWidget.cs	Mon May 26 12:23:46 2008
@@ -10,6 +10,7 @@
 using System;
 using Mono.Unix;
 using Gtk;
+using FSpot.Utils;
 
 namespace FSpot.Widgets
 {
@@ -32,6 +33,8 @@
 		CheckButton repeat, white_border, crop_marks;
 		Entry custom_text;
 	
+		PrintOperation print_operation;
+
 		public event ChangedHandler Changed;
 		private void TriggerChanged (object sender, EventArgs e)
 		{
@@ -84,14 +87,33 @@
 			get { return white_border.Active; }
 		}
 
-		public CustomPrintWidget () : base ()
+		public CustomPrintWidget (PrintOperation print_operation) : base ()
 		{
+			this.print_operation = print_operation;
+
 			HBox upper = new HBox ();
 			preview_image = new Gtk.Image ();
 			upper.PackStart (preview_image, false, false, 0);
 
-			Frame ppp_frame = new Frame (Catalog.GetString ("Photos per page"));
+			Frame page_size = new Frame (Catalog.GetString ("Page Setup"));
 			VBox vb = new VBox ();
+			Label current_settings = new Label (String.Format (Catalog.GetString ("Paper Size: {0} x {1} mm"), "...", "..."));
+			vb.PackStart (current_settings, false, false, 0);
+			Button page_setup_btn = new Button ("Set Page Size and Orientation");
+			page_setup_btn.Clicked += delegate {
+				this.print_operation.DefaultPageSetup = Print.RunPageSetupDialog (null, print_operation.DefaultPageSetup, this.print_operation.PrintSettings); 
+				current_settings.Text = String.Format (Catalog.GetString ("Paper Size: {0} x {1} mm"), print_operation.DefaultPageSetup.GetPaperWidth (Unit.Mm), print_operation.DefaultPageSetup.GetPaperHeight (Unit.Mm));
+			};
+			vb.PackStart (page_setup_btn, false, false, 0);
+
+			page_size.Add (vb);
+
+
+			VBox right_vb = new VBox ();
+			right_vb.PackStart (page_size, true, true, 0);
+
+			Frame ppp_frame = new Frame (Catalog.GetString ("Photos per page"));
+			vb = new VBox ();
 
 			vb.PackStart (ppp1 = new RadioButton ("1"), false, false, 0);
 			vb.PackStart (ppp2 = new RadioButton (ppp1, "2"), false, false, 0);
@@ -107,7 +129,8 @@
 //			crop_marks.Toggled += TriggerChanged;
 
 			ppp_frame.Child = vb;
-			upper.PackStart (ppp_frame, true, true, 0);
+			right_vb.PackStart (ppp_frame, true, true, 0);
+			upper.PackStart (right_vb, true, true, 0);
 
 			this.PackStart (upper, true, true, 0);
 			this.PackStart (fullpage = new CheckButton (Catalog.GetString ("Full Page (no margin)")), false, false, 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]