From: Enrico Tröger Date: Sat, 4 Apr 2009 22:13:09 +0000 (+0200) Subject: Implement stock items for Tab Panel and plugin panel X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad8558ab4c7153c7a82b5167795e44b33c22eada;p=midori Implement stock items for Tab Panel and plugin panel --- diff --git a/extensions/tab-panel/main.c b/extensions/tab-panel/main.c index c0aea024..bcaf07d7 100644 --- a/extensions/tab-panel/main.c +++ b/extensions/tab-panel/main.c @@ -13,6 +13,8 @@ #include +#define STOCK_TAB_PANEL "tab-panel" + static void tab_panel_app_add_browser_cb (MidoriApp* app, MidoriBrowser* browser) @@ -26,7 +28,7 @@ tab_panel_app_add_browser_cb (MidoriApp* app, child = midori_view_new (NULL); gtk_widget_show (child); midori_panel_append_widget (MIDORI_PANEL (panel), child, - GTK_STOCK_INDEX, "Tab Panel", NULL); + STOCK_TAB_PANEL, _("Tab Panel"), NULL); } static void @@ -40,8 +42,29 @@ tab_panel_activate_cb (MidoriExtension* extension, MidoriExtension* extension_init (void) { - MidoriExtension* extension = g_object_new (TAB_PANEL_TYPE_EXTENSION, - "name", "Tab Panel", + MidoriExtension* extension; + GtkIconFactory* factory; + GtkIconSource* icon_source; + GtkIconSet* icon_set; + static GtkStockItem items[] = + { + { STOCK_TAB_PANEL, N_("T_ab Panel"), 0, 0, NULL }, + }; + + factory = gtk_icon_factory_new (); + gtk_stock_add (items, G_N_ELEMENTS (items)); + icon_set = gtk_icon_set_new (); + icon_source = gtk_icon_source_new (); + gtk_icon_source_set_icon_name (icon_source, GTK_STOCK_INDEX); + gtk_icon_set_add_source (icon_set, icon_source); + gtk_icon_source_free (icon_source); + gtk_icon_factory_add (factory, STOCK_TAB_PANEL, icon_set); + gtk_icon_set_unref (icon_set); + gtk_icon_factory_add_default (factory); + g_object_unref (factory); + + extension = g_object_new (TAB_PANEL_TYPE_EXTENSION, + "name", _("Tab Panel"), "description", "", "version", "0.1", "authors", "Christian Dywan ", diff --git a/midori/midori-stock.h b/midori/midori-stock.h index 36bb2129..3b8436e8 100644 --- a/midori/midori-stock.h +++ b/midori/midori-stock.h @@ -30,6 +30,7 @@ #define STOCK_STYLES "gnome-settings-theme" #define STOCK_TRANSFER "package" #define STOCK_TRANSFERS "package" +#define STOCK_PLUGINS GTK_STOCK_CONVERT #define STOCK_BOOKMARK_ADD "stock_add-bookmark" #define STOCK_HOMEPAGE GTK_STOCK_HOME diff --git a/midori/sokoke.c b/midori/sokoke.c index 98b59ffe..d0731931 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -776,6 +776,7 @@ sokoke_register_stock_items (void) { STOCK_STYLES, N_("User_styles"), 0, 0, GTK_STOCK_SELECT_COLOR }, { STOCK_TAB_NEW, N_("New _Tab"), 0, 0, GTK_STOCK_ADD }, { STOCK_TRANSFERS, N_("_Transfers"), 0, 0, GTK_STOCK_SAVE }, + { STOCK_PLUGINS, N_("P_lugins"), 0, 0, GTK_STOCK_CONVERT }, { STOCK_USER_TRASH, N_("_Closed Tabs and Windows"), 0, 0, "gtk-undo-ltr" }, { STOCK_WINDOW_NEW, N_("New _Window"), 0, 0, GTK_STOCK_ADD }, }; diff --git a/panels/midori-plugins.c b/panels/midori-plugins.c index 20b5ab03..f2938164 100644 --- a/panels/midori-plugins.c +++ b/panels/midori-plugins.c @@ -90,8 +90,7 @@ midori_plugins_get_label (MidoriViewable* viewable) static const gchar* midori_plugins_get_stock_id (MidoriViewable* viewable) { - /* FIXME: We need a dedicated stock id */ - return GTK_STOCK_CONVERT /* STOCK_PLUGINS */; + return STOCK_PLUGINS; } static GtkWidget*