f-spot r4341 - in trunk: . src src/Core src/Widgets



Author: sdelcroix
Date: Mon Sep 15 10:44:16 2008
New Revision: 4341
URL: http://svn.gnome.org/viewvc/f-spot?rev=4341&view=rev

Log:
2008-09-15  Stephane Delcroix  <sdelcroix novell com>

	* src/Widgets/CustomPrintWidget.cs:
	* src/Core/Global.cs: keep the PageSetup globally

	* src/MainWindow.cs:
	* src/PrintOperation.cs:
	* src/f-spot.glade: new PageSetup dialog.


Modified:
   trunk/ChangeLog
   trunk/src/Core/Global.cs
   trunk/src/MainWindow.cs
   trunk/src/PrintOperation.cs
   trunk/src/Widgets/CustomPrintWidget.cs
   trunk/src/f-spot.glade

Modified: trunk/src/Core/Global.cs
==============================================================================
--- trunk/src/Core/Global.cs	(original)
+++ trunk/src/Core/Global.cs	Mon Sep 15 10:44:16 2008
@@ -64,5 +64,13 @@
 			set { default_rc_files = value; }
 		}
 #endif
+
+#if GTK_2_10
+		private static Gtk.PageSetup page_setup = null;
+		public static Gtk.PageSetup PageSetup {
+			get { return page_setup; }
+			set { page_setup = value; }
+		}
+#endif
 	}
 }

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Mon Sep 15 10:44:16 2008
@@ -59,6 +59,7 @@
 	
 	[Glade.Widget] MenuItem tools;
 	[Glade.Widget] MenuItem export;
+	[Glade.Widget] MenuItem pagesetup_menu_item;
 	[Glade.Widget] MenuItem print;
 	[Glade.Widget] MenuItem send_mail;
 
@@ -262,6 +263,11 @@
 		LoadPreference (Preferences.SIDEBAR_POSITION);
 		LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);
 		
+#if GTK_2_10
+		pagesetup_menu_item.Activated += HandlePageSetupActivated;
+#else
+		pagesetup_menu_item.Visible = false;
+#endif
 		toolbar = new Gtk.Toolbar ();
 		toolbar_vbox.PackStart (toolbar);
 
@@ -1722,6 +1728,12 @@
 			cam.ReleaseGPhotoResources ();
 		}
 	}
+#if GTK_2_10
+	void HandlePageSetupActivated (object o, EventArgs e)
+	{
+		FSpot.Global.PageSetup = Print.RunPageSetupDialog (this.Window, FSpot.Global.PageSetup, null);
+	}
+#endif
 	
 	void HandlePrintCommand (object sender, EventArgs e)
 	{

Modified: trunk/src/PrintOperation.cs
==============================================================================
--- trunk/src/PrintOperation.cs	(original)
+++ trunk/src/PrintOperation.cs	Mon Sep 15 10:44:16 2008
@@ -31,6 +31,7 @@
 			this.selected_photos = selected_photos;
 			CustomTabLabel = Catalog.GetString ("Image Settings");
 			NPages = selected_photos.Length;
+			DefaultPageSetup = FSpot.Global.PageSetup;
 		}
 
 		protected override void OnBeginPrint (Gtk.PrintContext context)

Modified: trunk/src/Widgets/CustomPrintWidget.cs
==============================================================================
--- trunk/src/Widgets/CustomPrintWidget.cs	(original)
+++ trunk/src/Widgets/CustomPrintWidget.cs	Mon Sep 15 10:44:16 2008
@@ -98,7 +98,12 @@
 
 			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"), "...", "..."));
+			Label current_settings = new Label ();
+			if (FSpot.Global.PageSetup != null)
+				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));
+			else
+				current_settings.Text = 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 {

Modified: trunk/src/f-spot.glade
==============================================================================
--- trunk/src/f-spot.glade	(original)
+++ trunk/src/f-spot.glade	Mon Sep 15 10:44:16 2008
@@ -3133,6 +3133,13 @@
                       </widget>
                     </child>
                     <child>
+                      <widget class="GtkMenuItem" id="pagesetup_menu_item">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Page Set_up...</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
+                    <child>
                       <widget class="GtkImageMenuItem" id="send_mail">
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">Send by _Mail...</property>



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