[epiphany] Remove Print Setup item from the super menu and embed it into print dialog



commit 3cc93b5ec64d97739cf5065e19b31759d1495b9e
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Jan 18 16:17:53 2012 +0100

    Remove Print Setup item from the super menu and embed it into print dialog

 data/ui/epiphany-ui.xml |    1 -
 embed/ephy-web-view.c   |    9 ++++++---
 src/ephy-lockdown.c     |    3 ---
 src/ephy-window.c       |    3 ---
 src/window-commands.c   |   25 -------------------------
 src/window-commands.h   |    3 ---
 6 files changed, 6 insertions(+), 38 deletions(-)
---
diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml
index a44059b..1d22837 100644
--- a/data/ui/epiphany-ui.xml
+++ b/data/ui/epiphany-ui.xml
@@ -94,7 +94,6 @@
                 <menuitem name="EditCopyMenu" action="EditCopy"/>
                 <menuitem name="EditPasteMenu" action="EditPaste"/>
                 <separator name="EditSep3"/> 
-                <menuitem name="FilePrintSetupMenu" action="FilePrintSetup"/>
                 <menuitem name="FilePrintMenu" action="FilePrint"/>
                 <separator name="FileSep4"/>
                 <menuitem name="EditFindMenu" action="EditFind"/>
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 638640b..9fe4f1f 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -3277,10 +3277,10 @@ ephy_web_view_run_print_action (EphyWebView *view, GtkPrintOperationAction actio
   main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view));
 
   operation = gtk_print_operation_new ();
-  gtk_print_operation_set_default_page_setup (operation, ephy_embed_shell_get_page_setup  (shell));
+  gtk_print_operation_set_embed_page_setup (operation, TRUE);
+  gtk_print_operation_set_default_page_setup (operation, ephy_embed_shell_get_page_setup (shell));
 
   webkit_web_frame_print_full (main_frame, operation, action, &error);
-  g_object_unref (operation);
 
   if (error) {
     GtkWidget *info_bar;
@@ -3300,7 +3300,10 @@ ephy_web_view_run_print_action (EphyWebView *view, GtkPrintOperationAction actio
 
     ephy_embed_add_top_widget (embed, info_bar, FALSE);
     gtk_widget_show_all (info_bar);
-  }
+  } else
+    ephy_embed_shell_set_page_setup (shell, gtk_print_operation_get_default_page_setup (operation));
+
+  g_object_unref (operation);
 }
 
 /**
diff --git a/src/ephy-lockdown.c b/src/ephy-lockdown.c
index cc75b12..9186cad 100644
--- a/src/ephy-lockdown.c
+++ b/src/ephy-lockdown.c
@@ -103,9 +103,6 @@ typedef struct {
 
 static const BindAction window_actions[] = {
 	{ EPHY_PREFS_LOCKDOWN_PRINTING, "FilePrint", "sensitive" },
-	{ EPHY_PREFS_LOCKDOWN_PRINTING, "FilePrintSetup", "sensitive" },
-	{ EPHY_PREFS_LOCKDOWN_PRINT_SETUP, "FilePrintSetup", "sensitive" },
-	{ EPHY_PREFS_LOCKDOWN_COMMAND_LINE, "FilePrintSetup", "sensitive" },
 
 	{ EPHY_PREFS_LOCKDOWN_BOOKMARK_EDITING, "FileBookmarkPage", "sensitive" },
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 4ff7ce3..dcf312d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -126,9 +126,6 @@ static const GtkActionEntry ephy_menu_entries [] = {
 	{ "FileSaveAsApplication", GTK_STOCK_SAVE_AS, N_("Save As _Web Applicationâ"), "<shift><control>A",
 	  N_("Save the current page as a Web Application"),
 	  G_CALLBACK (window_cmd_file_save_as_application) },
-	{ "FilePrintSetup", STOCK_PRINT_SETUP, N_("Page Set_up"), NULL,
-	  N_("Setup the page settings for printing"),
-	  G_CALLBACK (window_cmd_file_print_setup) },
 	{ "FilePrint", GTK_STOCK_PRINT, N_("_Printâ"), "<control>P",
 	  N_("Print the current page"),
 	  G_CALLBACK (window_cmd_file_print) },
diff --git a/src/window-commands.c b/src/window-commands.c
index 65dedb5..f2539dd 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -59,31 +59,6 @@
 #include <string.h>
 #include <webkit/webkit.h>
 
-static void
-page_setup_done_cb (GtkPageSetup *setup,
-		    EphyEmbedShell *shell)
-{
-	if (setup != NULL)
-	{
-		ephy_embed_shell_set_page_setup (shell, setup);
-	}
-}
-
-void
-window_cmd_file_print_setup (GtkAction *action,
-			     EphyWindow *window)
-{
-	EphyEmbedShell *shell;
-
-	shell = ephy_embed_shell_get_default ();
-	gtk_print_run_page_setup_dialog_async
-		(GTK_WINDOW (window),
-		 ephy_embed_shell_get_page_setup (shell),
-		 ephy_embed_shell_get_print_settings (shell),
-		 (GtkPageSetupDoneFunc) page_setup_done_cb,
-		 shell);
-}
-
 void
 window_cmd_file_print (GtkAction *action,
 		       EphyWindow *window)
diff --git a/src/window-commands.h b/src/window-commands.h
index ddd42a0..70cc9e5 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -54,9 +54,6 @@ void window_cmd_file_save_as    (GtkAction *action,
 void window_cmd_file_save_as_application (GtkAction *action,
                                           EphyWindow *window);
 
-void window_cmd_file_print_setup (GtkAction *action,
-				  EphyWindow *window);
-
 void window_cmd_file_print	(GtkAction *action,
 				 EphyWindow *window);
 



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