[Xfce4-commits] <midori:master> Remove unused extension panel popup logic
Christian Dywan
noreply at xfce.org
Fri May 7 00:58:01 CEST 2010
Updating branch refs/heads/master
to 2611a24803fd5af770ae779e3adbecc6f4200621 (commit)
from affde90e2c87902437163513a6c32c4bc73d81d1 (commit)
commit 2611a24803fd5af770ae779e3adbecc6f4200621
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu May 6 23:41:07 2010 +0200
Remove unused extension panel popup logic
panels/midori-extensions.c | 145 --------------------------------------------
1 files changed, 0 insertions(+), 145 deletions(-)
diff --git a/panels/midori-extensions.c b/panels/midori-extensions.c
index 6fe8fb7..e03c734 100644
--- a/panels/midori-extensions.c
+++ b/panels/midori-extensions.c
@@ -287,147 +287,6 @@ midori_extensions_treeview_row_activated_cb (GtkTreeView* treeview,
}
static void
-midori_extensions_preferences_activate_cb (GtkWidget* menuitem,
- MidoriExtensions* extensions)
-{
- MidoriExtension* extension;
-
- extension = g_object_get_data (G_OBJECT (menuitem), "MidoriExtension");
- g_return_if_fail (extension != NULL);
-}
-
-static void
-midori_extensions_website_activate_cb (GtkWidget* menuitem,
- MidoriExtensions* extensions)
-{
- gchar* uri;
- gint n;
- MidoriBrowser* browser;
-
- MidoriExtension* extension;
-
- extension = g_object_get_data (G_OBJECT (menuitem), "MidoriExtension");
- g_return_if_fail (extension != NULL);
- uri = katze_object_get_string (extension, "website");
-
- browser = midori_browser_get_for_widget (GTK_WIDGET (extensions));
- n = midori_browser_add_uri (browser, uri);
- midori_browser_set_current_page (browser, n);
-
- g_free (uri);
-}
-
-static void
-midori_extensions_about_activate_cb (GtkWidget* menuitem,
- MidoriExtensions* extensions)
-{
- MidoriExtension* extension;
-
- extension = g_object_get_data (G_OBJECT (menuitem), "MidoriExtension");
- g_return_if_fail (extension != NULL);
-}
-
-static GtkWidget*
-midori_extensions_popup_menu_item (GtkMenu* menu,
- const gchar* stock_id,
- const gchar* label,
- MidoriExtension* extension,
- gpointer callback,
- gboolean enabled,
- MidoriExtensions* extensions)
-{
- GtkWidget* menuitem;
-
- menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL);
- if (label)
- gtk_label_set_text_with_mnemonic (GTK_LABEL (gtk_bin_get_child (
- GTK_BIN (menuitem))), label);
-
- if (!enabled)
- gtk_widget_set_sensitive (menuitem, FALSE);
-
- g_object_set_data (G_OBJECT (menuitem), "MidoriExtension", extension);
-
- if (callback)
- g_signal_connect (menuitem, "activate", G_CALLBACK (callback), extensions);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
- gtk_widget_show (menuitem);
-
- return menuitem;
-}
-
-static void
-midori_extensions_popup (GtkWidget* widget,
- GdkEventButton* event,
- MidoriExtension* extension,
- MidoriExtensions* extensions)
-{
- GtkWidget* menu;
- gchar* website;
-
- website = katze_object_get_string (extension, "website");
-
- menu = gtk_menu_new ();
- midori_extensions_popup_menu_item (GTK_MENU (menu), GTK_STOCK_PREFERENCES, NULL, extension,
- midori_extensions_preferences_activate_cb, FALSE,
- extensions);
- midori_extensions_popup_menu_item (GTK_MENU (menu), GTK_STOCK_HOME, NULL, extension,
- midori_extensions_website_activate_cb, website != NULL,
- extensions);
- midori_extensions_popup_menu_item (GTK_MENU (menu), GTK_STOCK_ABOUT, NULL, extension,
- midori_extensions_about_activate_cb, FALSE,
- extensions);
-
- katze_widget_popup (widget, GTK_MENU (menu), event, KATZE_MENU_POSITION_CURSOR);
-
- g_free (website);
-}
-
-static gboolean
-midori_extensions_popup_menu_cb (GtkWidget* widget,
- MidoriExtensions* extensions)
-{
- GtkTreeModel* model;
- GtkTreeIter iter;
-
- if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
- {
- MidoriExtension *extension;
-
- gtk_tree_model_get (model, &iter, 0, &extension, -1);
-
- midori_extensions_popup (widget, NULL, extension, extensions);
- g_object_unref (extension);
- return TRUE;
- }
- return FALSE;
-}
-
-static gboolean
-midori_extensions_button_release_event_cb (GtkWidget* widget,
- GdkEventButton* event,
- MidoriExtensions* extensions)
-{
- GtkTreeModel* model;
- GtkTreeIter iter;
-
- if (event->button != 3)
- return FALSE;
-
- if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter))
- {
- MidoriExtension* extension;
-
- gtk_tree_model_get (model, &iter, 0, &extension, -1);
-
- midori_extensions_popup (widget, event, extension, extensions);
- g_object_unref (extension);
- return TRUE;
- }
- return FALSE;
-}
-
-static void
midori_extensions_cell_renderer_toggled_cb (GtkCellRendererToggle* renderer,
const gchar* path,
MidoriExtensions* extensions)
@@ -511,10 +370,6 @@ midori_extensions_init (MidoriExtensions* extensions)
g_object_connect (extensions->treeview,
"signal::row-activated",
midori_extensions_treeview_row_activated_cb, extensions,
- "signal::button-release-event",
- midori_extensions_button_release_event_cb, extensions,
- "signal::popup-menu",
- midori_extensions_popup_menu_cb, extensions,
NULL);
gtk_widget_show (extensions->treeview);
gtk_box_pack_start (GTK_BOX (extensions), extensions->treeview, TRUE, TRUE, 0);
More information about the Xfce4-commits
mailing list