devhelp r1015 - in trunk: . data/ui src



Author: atoker
Date: Fri May 30 15:34:32 2008
New Revision: 1015
URL: http://svn.gnome.org/viewvc/devhelp?rev=1015&view=rev

Log:
2008-05-30  Alp Toker  <alp nuanti com>

	* src/dh-window.c: (window_activate_print):
	* data/ui/window.ui: Add printing support. Fixes bug #517115.


Modified:
   trunk/ChangeLog
   trunk/data/ui/window.ui
   trunk/src/dh-window.c

Modified: trunk/data/ui/window.ui
==============================================================================
--- trunk/data/ui/window.ui	(original)
+++ trunk/data/ui/window.ui	Fri May 30 15:34:32 2008
@@ -5,6 +5,8 @@
       <menuitem action="NewWindow"/>
       <menuitem action="NewTab"/>
       <separator/>
+      <menuitem action="Print"/>
+      <separator/>
       <menuitem action="Close"/>
       <menuitem action="Quit"/>
     </menu>

Modified: trunk/src/dh-window.c
==============================================================================
--- trunk/src/dh-window.c	(original)
+++ trunk/src/dh-window.c	Fri May 30 15:34:32 2008
@@ -102,6 +102,8 @@
 						   DhWindow        *window);
 static void       window_activate_new_tab         (GtkAction       *action,
 						   DhWindow        *window);
+static void       window_activate_print           (GtkAction       *action,
+						   DhWindow        *window);
 static void       window_activate_close           (GtkAction       *action,
 						   DhWindow        *window);
 static void       window_activate_quit            (GtkAction       *action,
@@ -205,6 +207,8 @@
 	  G_CALLBACK (window_activate_new_window) },
 	{ "NewTab", GTK_STOCK_NEW, N_("New _Tab"), "<control>T", NULL,
 	  G_CALLBACK (window_activate_new_tab) },
+	{ "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P", NULL,
+	  G_CALLBACK (window_activate_print) },
 	{ "Close", GTK_STOCK_CLOSE, NULL, NULL, NULL,
 	  G_CALLBACK (window_activate_close) },
 	{ "Quit", GTK_STOCK_QUIT, NULL, NULL, NULL,
@@ -639,6 +643,15 @@
 }
 
 static void
+window_activate_print (GtkAction *action, DhWindow *window)
+{
+    WebKitWebView *web_view;
+
+    web_view = window_get_active_web_view (window);
+    webkit_web_view_execute_script (web_view, "print();");
+}
+
+static void
 window_activate_close (GtkAction *action, DhWindow *window)
 {
 	DhWindowPriv *priv;



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