]> spindle.queued.net Git - midori/commitdiff
Implement stock items for Tab Panel and plugin panel
authorEnrico Tröger <enrico.troeger@uvena.de>
Sat, 4 Apr 2009 22:13:09 +0000 (00:13 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 4 Apr 2009 22:13:09 +0000 (00:13 +0200)
extensions/tab-panel/main.c
midori/midori-stock.h
midori/sokoke.c
panels/midori-plugins.c

index c0aea02494e2ee35bff1b28f6b2fa9b35e771086..bcaf07d73bceefe0814b2d357049f7d012b08429 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <midori/midori.h>
 
+#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 <christian@twotoasts.de>",
index 36bb21293c3ef9e5f4110da483fe5c43c135ded4..3b8436e8e12bfa39bf82ee832da9b3a8d0718d2a 100644 (file)
@@ -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
index 98b59ffeaf4e28040328f37372db0055bfdf1607..d0731931c5af5dd653808d1ad39cfcf80c081536 100644 (file)
@@ -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 },
     };
index 20b5ab033f077cdbc90f1fed6cca7f5f5a2cfb24..f2938164248d603ad96ef6afbf9836de497e8a8e 100644 (file)
@@ -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*