gtranslator r3516 - in trunk: . data plugins/open-tran src src/plugin-system
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3516 - in trunk: . data plugins/open-tran src src/plugin-system
- Date: Mon, 10 Mar 2008 20:07:08 +0000 (GMT)
Author: icq
Date: Mon Mar 10 20:07:08 2008
New Revision: 3516
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3516&view=rev
Log:
2008-03-10 Ignacio Casal Quinteiro <nacho resa gmail com>
* plugins/open-tran/open-tran-plugin.c:
* plugins/open-tran/open-tran.gtranslator-plugin.desktop.in:
* src/plugin-system/plugin-info.c:
* src/application.ch:
* src/main.c:
* src/Makefile.am:
* data/Makefile.am:
Added icon for open tran. This patch fixes partialy the bug
#513684.
Added:
trunk/data/gtranslator-plugin.png (contents, props changed)
Modified:
trunk/ChangeLog
trunk/data/Makefile.am
trunk/plugins/open-tran/open-tran-plugin.c
trunk/plugins/open-tran/open-tran.gtranslator-plugin.desktop.in
trunk/src/application.c
trunk/src/application.h
trunk/src/main.c
trunk/src/plugin-system/plugin-info.c
Modified: trunk/data/Makefile.am
==============================================================================
--- trunk/data/Makefile.am (original)
+++ trunk/data/Makefile.am Mon Mar 10 20:07:08 2008
@@ -18,8 +18,12 @@
po.lang \
layout.xml
+icondir = $(datadir)/pixmaps/gtranslator
+icon_DATA = gtranslator-plugin.png
+
EXTRA_DIST = \
$(ui_DATA) \
+ $(icon_DATA)\
gtranslator.pc.in
CLEANFILES = \
Added: trunk/data/gtranslator-plugin.png
==============================================================================
Binary file. No diff available.
Modified: trunk/plugins/open-tran/open-tran-plugin.c
==============================================================================
--- trunk/plugins/open-tran/open-tran-plugin.c (original)
+++ trunk/plugins/open-tran/open-tran-plugin.c Mon Mar 10 20:07:08 2008
@@ -28,10 +28,12 @@
#include <gconf/gconf-client.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkdialog.h>
+
+#include "application.h"
#include "window.h"
#include "utils.h"
-#define OPEN_TRAN_PLUGIN_ICON PIXMAPSDIR"/open-tran.png"
+#define OPEN_TRAN_PLUGIN_ICON "open-tran.png"
#define WINDOW_DATA_KEY "GtranslatorOpenTranPluginWindowData"
#define GLADE_FILE DATADIR"/open-tran-dialog.glade"
@@ -114,6 +116,9 @@
image = gtk_image_new_from_icon_set(iconset,
GTK_ICON_SIZE_MENU);
}*/
+
+ gtranslator_application_register_icon (GTR_APP, "open-tran.png",
+ "open-tran-plugin-icon");
opentran = gtranslator_open_tran_panel_new(window);
@@ -121,7 +126,7 @@
opentran,
"GtranslatorOpenTranPlugin",
_("Open Tran"),
- NULL,
+ "open-tran-plugin-icon",
GTR_WINDOW_PLACEMENT_LEFT);
g_object_set_data(G_OBJECT(window),
Modified: trunk/plugins/open-tran/open-tran.gtranslator-plugin.desktop.in
==============================================================================
--- trunk/plugins/open-tran/open-tran.gtranslator-plugin.desktop.in (original)
+++ trunk/plugins/open-tran/open-tran.gtranslator-plugin.desktop.in Mon Mar 10 20:07:08 2008
@@ -3,6 +3,7 @@
IAge=2
_Name=Open Tran
_Description=Look for phrases in Open tran memory translation database.
+Icon=open-tran
Authors=Ignacio Casal Quinteiro <nacho resa gmail com>
Copyright=Copyright @ 2008 Ignacio Casal Quinteiro
Website=http://gtranslator.sf.net
Modified: trunk/src/application.c
==============================================================================
--- trunk/src/application.c (original)
+++ trunk/src/application.c Mon Mar 10 20:07:08 2008
@@ -43,6 +43,8 @@
gchar *toolbars_file;
EggToolbarsModel *toolbars_model;
+
+ GtkIconFactory *icon_factory;
};
static gchar *
@@ -135,12 +137,21 @@
EGG_TB_MODEL_NOT_REMOVABLE);
load_accels ();
+
+ /* Create Icon factory */
+ application->priv->icon_factory = gtk_icon_factory_new ();
+ gtk_icon_factory_add_default (application->priv->icon_factory);
}
static void
gtranslator_application_finalize (GObject *object)
{
+ GtranslatorApplication *app = GTR_APPLICATION (object);
+
+ if (app->priv->icon_factory)
+ g_object_unref (app->priv->icon_factory);
+
G_OBJECT_CLASS (gtranslator_application_parent_class)->finalize (object);
}
@@ -296,3 +307,25 @@
return app->priv->windows;
}
+void
+gtranslator_application_register_icon (GtranslatorApplication *app,
+ const gchar *icon,
+ const gchar *stock_id)
+{
+ GtkIconSet *icon_set;
+ GtkIconSource * icon_source = gtk_icon_source_new ();
+ gchar *path;
+
+ path = g_strconcat (PIXMAPSDIR, "/", icon, NULL);
+
+ GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file (path, NULL);
+ if (pixbuf)
+ {
+ icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
+ gtk_icon_factory_add (app->priv->icon_factory, stock_id, icon_set);
+ g_object_unref (pixbuf);
+ }
+
+ g_free (path);
+ gtk_icon_source_free (icon_source);
+}
Modified: trunk/src/application.h
==============================================================================
--- trunk/src/application.h (original)
+++ trunk/src/application.h Mon Mar 10 20:07:08 2008
@@ -89,6 +89,10 @@
const GList *gtranslator_application_get_windows (GtranslatorApplication *app);
+void gtranslator_application_register_icon (GtranslatorApplication *app,
+ const gchar *icon,
+ const gchar *stock_id);
+
G_END_DECLS
#endif /* __APPLICATION_H__ */
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Mon Mar 10 20:07:08 2008
@@ -85,6 +85,12 @@
}
/*
+ * We set the default icon dir
+ */
+ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
+ PIXMAPSDIR);
+
+ /*
* Init preferences manager
*/
gtranslator_prefs_manager_app_init();
Modified: trunk/src/plugin-system/plugin-info.c
==============================================================================
--- trunk/src/plugin-system/plugin-info.c (original)
+++ trunk/src/plugin-system/plugin-info.c Mon Mar 10 20:07:08 2008
@@ -344,7 +344,7 @@
info->icon_name))
return info->icon_name;
else
- return "plugin";
+ return "gtranslator-plugin";
}
const gchar **
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]