[epiphany/peas] src: add peas-gtk tools dialog



commit acc232232306c1cc79335c1f7150750ac8096090
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Sun Apr 3 09:13:09 2011 -0500

    src: add peas-gtk tools dialog

 data/ui/epiphany-ui.xml |    4 +++-
 src/ephy-window.c       |    5 +++++
 src/window-commands.c   |   27 +++++++++++++++++++++++++++
 src/window-commands.h   |    3 +++
 4 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml
index 5d1ffbf..f7589c5 100644
--- a/data/ui/epiphany-ui.xml
+++ b/data/ui/epiphany-ui.xml
@@ -84,7 +84,9 @@
 			<separator name="BookmarksSep1"/>
 		</menu>
 
-		<menu name="ToolsMenu" action="Tools"/>
+		<menu name="ToolsMenu" action="Tools">
+			<menuitem name="ToolsExtensionsManager"	action="ToolsExtensionsManager"/>
+		</menu>
 
 		<menu name="TabsMenu" action="Tabs">
 			<menuitem name="TabsPreviousMenu" action="TabsPrevious"/>
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3143458..089dfd4 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -242,6 +242,11 @@ static const GtkActionEntry ephy_menu_entries [] = {
 	  N_("Open the history window"),
 	  G_CALLBACK (window_cmd_go_history) },
 
+	/* Tools menu */
+	{ "ToolsExtensionsManager", NULL, N_("_Tools"), "<control>Y",
+	  N_("Open the extensions manager"),
+	  G_CALLBACK (window_cmd_extensions_manager) },
+
 	/* Tabs menu */
 
 	{ "TabsPrevious", NULL, N_("_Previous Tab"), "<control>Page_Up",
diff --git a/src/window-commands.c b/src/window-commands.c
index 6b70b09..d0dcdbf 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -56,6 +56,7 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include <libpeas-gtk/peas-gtk.h>
 #include <webkit/webkit.h>
 
 static void
@@ -1235,3 +1236,29 @@ window_cmd_browse_with_caret (GtkAction *action,
 	g_settings_set_boolean (EPHY_SETTINGS_MAIN,
 				EPHY_PREFS_ENABLE_CARET_BROWSING, active);
 }
+
+static void
+extensions_manager_delete_cb (GtkWidget *widget,
+			      GdkEvent *event,
+			      gpointer data)
+{
+	gtk_widget_destroy (widget);
+}
+
+void
+window_cmd_extensions_manager (GtkAction *action,
+			       EphyWindow *window)
+{
+	GtkWidget *manager;
+	GtkWidget *dialog;
+
+	manager = peas_gtk_plugin_manager_new (NULL);
+	dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+	gtk_container_add (GTK_CONTAINER (dialog), manager);
+
+	g_signal_connect (dialog, "delete-event",
+			  G_CALLBACK (extensions_manager_delete_cb), NULL);
+
+	gtk_widget_show_all (dialog);
+}
diff --git a/src/window-commands.h b/src/window-commands.h
index 5b37585..07a4779 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -159,3 +159,6 @@ void window_cmd_load_location   (GtkAction *action,
 void window_cmd_browse_with_caret (GtkAction *action,
 				   EphyWindow *window);
 
+void window_cmd_extensions_manager (GtkAction *action,
+				    EphyWindow *window);
+



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