anjuta r4416 - in trunk: . plugins/devhelp



Author: jhs
Date: Sun Nov 30 22:53:31 2008
New Revision: 4416
URL: http://svn.gnome.org/viewvc/anjuta?rev=4416&view=rev

Log:
2008-11-30  Johannes Schmid  <jhs gnome org>

	* plugins/devhelp/Makefile.am:
	* plugins/devhelp/anjuta-go-help-next.svg:
	* plugins/devhelp/anjuta-go-help-prev.svg:
	Removed icons
	
	* plugins/devhelp/plugin.c (on_online_clicked), (on_load_finished),
	(devhelp_activate):
	* plugins/devhelp/plugin.h:
	Added button to access online API help (library.gnome.org) and improved 
	back/forward handling

Removed:
   trunk/plugins/devhelp/anjuta-go-help-next-16.png
   trunk/plugins/devhelp/anjuta-go-help-next-24.png
   trunk/plugins/devhelp/anjuta-go-help-next.svg
   trunk/plugins/devhelp/anjuta-go-help-prev-16.png
   trunk/plugins/devhelp/anjuta-go-help-prev-24.png
   trunk/plugins/devhelp/anjuta-go-help-prev.svg
Modified:
   trunk/ChangeLog
   trunk/plugins/devhelp/Makefile.am
   trunk/plugins/devhelp/plugin.c
   trunk/plugins/devhelp/plugin.h

Modified: trunk/plugins/devhelp/Makefile.am
==============================================================================
--- trunk/plugins/devhelp/Makefile.am	(original)
+++ trunk/plugins/devhelp/Makefile.am	Sun Nov 30 22:53:31 2008
@@ -8,11 +8,7 @@
 devhelp_pixmapsdir = $(anjuta_image_dir)
 devhelp_pixmaps_DATA = \
 	anjuta-devhelp-plugin.svg \
-	anjuta-devhelp-plugin-48.png \
-	anjuta-go-help-next-24.png \
-	anjuta-go-help-next-16.png \
-	anjuta-go-help-prev-24.png \
-	anjuta-go-help-prev-16.png
+	anjuta-devhelp-plugin-48.png
 
 # Plugin description file
 plugin_in_files = anjuta-devhelp.plugin.in

Modified: trunk/plugins/devhelp/plugin.c
==============================================================================
--- trunk/plugins/devhelp/plugin.c	(original)
+++ trunk/plugins/devhelp/plugin.c	Sun Nov 30 22:53:31 2008
@@ -37,6 +37,9 @@
 #include <devhelp/dh-search.h>
 #include <devhelp/dh-base.h>
 #include <webkit/webkit.h>
+
+#define ONLINE_API_DOCS "http://library.gnome.org/devel";
+
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-devhelp.ui"
 
 #else /* DISABLE_EMBEDDED_DEVHELP */
@@ -125,6 +128,16 @@
 	anjuta_devhelp_check_history (plugin);
 }
 
+static void
+on_online_clicked (GtkWidget* widget, AnjutaDevhelp* plugin)
+{
+	anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
+								 plugin->view_sw, NULL);
+	webkit_web_view_open (WEBKIT_WEB_VIEW(plugin->view),
+						  ONLINE_API_DOCS);
+	anjuta_devhelp_check_history (plugin);
+}
+
 static gboolean
 api_reference_idle (AnjutaDevhelp* plugin)
 {	
@@ -274,6 +287,14 @@
 	g_object_set (action, "sensitive", FALSE, NULL);
 }
 
+#ifndef DISABLE_EMBEDDED_DEVHELP
+static void on_load_finished (GObject* view, GObject* frame, gpointer user_data)
+{
+	AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP(user_data);
+	anjuta_devhelp_check_history(devhelp);
+}
+#endif
+
 static gboolean
 devhelp_activate (AnjutaPlugin *plugin)
 {
@@ -330,6 +351,12 @@
 	gtk_widget_set_sensitive (devhelp->go_forward, FALSE);
 	g_signal_connect (devhelp->go_forward, "clicked",
 			  G_CALLBACK (on_go_forward_clicked), devhelp);
+
+	devhelp->online = gtk_button_new_from_stock (_("Online"));
+	gtk_widget_show (devhelp->online);
+	gtk_box_pack_start (GTK_BOX (button_hbox), devhelp->online, FALSE, FALSE, 0);
+	g_signal_connect (devhelp->online, "clicked",
+			  G_CALLBACK (on_online_clicked), devhelp);
 	
 	gtk_box_pack_start (GTK_BOX (devhelp->main_vbox), button_hbox, FALSE, FALSE, 0);
 	
@@ -376,12 +403,16 @@
 	devhelp->view = webkit_web_view_new ();
 	gtk_widget_show (devhelp->view);
 	
+	// TODO: Show some good start page
 	webkit_web_view_open (WEBKIT_WEB_VIEW (devhelp->view), "about:blank");
+	g_signal_connect(G_OBJECT (devhelp->view), "load-finished", 
+					 G_CALLBACK (on_load_finished), devhelp);
 	
 	devhelp->view_sw = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (devhelp->view_sw),
 									GTK_POLICY_AUTOMATIC,
 									GTK_POLICY_AUTOMATIC);
+	gtk_container_set_border_width (GTK_CONTAINER (devhelp->view_sw), 5);
 	gtk_widget_show (devhelp->view_sw);
 	gtk_container_add (GTK_CONTAINER (devhelp->view_sw), devhelp->view);
 

Modified: trunk/plugins/devhelp/plugin.h
==============================================================================
--- trunk/plugins/devhelp/plugin.h	(original)
+++ trunk/plugins/devhelp/plugin.h	Sun Nov 30 22:53:31 2008
@@ -57,6 +57,7 @@
 	GtkWidget      *search;
 	GtkWidget      *go_back;
 	GtkWidget      *go_forward;
+	GtkWidget      *online;
 	
 	IAnjutaEditor	*editor;
 	guint editor_watch_id;



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