gconf-editor r1368 - in trunk: . data data/icons src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gconf-editor r1368 - in trunk: . data data/icons src
- Date: Mon, 18 Aug 2008 19:47:13 +0000 (UTC)
Author: chpe
Date: Mon Aug 18 19:47:13 2008
New Revision: 1368
URL: http://svn.gnome.org/viewvc/gconf-editor?rev=1368&view=rev
Log:
Bug 348822 â gconf-editor should use icons provided by themes
Based on patches by Christopher Bratusek.
Added:
trunk/data/icons/hicolor_apps_48x48_gconf-editor.png
- copied, changed from r1367, /trunk/data/icons/gconf-editor.png
trunk/data/icons/hicolor_status_16x16_type-boolean.png
- copied, changed from r1367, /trunk/data/icons/entry-bool.png
trunk/data/icons/hicolor_status_16x16_type-float.png
- copied, changed from r1367, /trunk/data/icons/entry-number.png
trunk/data/icons/hicolor_status_16x16_type-integer.png
- copied, changed from r1367, /trunk/data/icons/entry-number.png
trunk/data/icons/hicolor_status_16x16_type-list.png
- copied, changed from r1367, /trunk/data/icons/entry-list.png
trunk/data/icons/hicolor_status_16x16_type-pair.png
- copied, changed from r1367, /trunk/data/icons/entry-blank.png
trunk/data/icons/hicolor_status_16x16_type-schema.png
- copied, changed from r1367, /trunk/data/icons/entry-schema.png
trunk/data/icons/hicolor_status_16x16_type-string.png
- copied, changed from r1367, /trunk/data/icons/entry-string.png
trunk/data/icons/hicolor_status_16x16_type-undefined.png
- copied, changed from r1367, /trunk/data/icons/entry-blank.png
Removed:
trunk/data/icons/entry-blank.png
trunk/data/icons/entry-bool.png
trunk/data/icons/entry-list.png
trunk/data/icons/entry-number.png
trunk/data/icons/entry-schema.png
trunk/data/icons/entry-string.png
trunk/data/icons/folder-closed.png
trunk/data/icons/folder-open.png
trunk/data/icons/gconf-editor.png
Modified:
trunk/ChangeLog
trunk/data/gconf-editor.desktop.in.in
trunk/data/icons/Makefile.am
trunk/src/Makefile.am
trunk/src/gconf-editor-window.c
trunk/src/gconf-list-model.c
trunk/src/gconf-list-model.h
trunk/src/gconf-stock-icons.c
trunk/src/gconf-stock-icons.h
trunk/src/gconf-tree-model.c
trunk/src/gconf-tree-model.h
trunk/src/gedit-output-window.c
trunk/src/main.c
Modified: trunk/data/gconf-editor.desktop.in.in
==============================================================================
--- trunk/data/gconf-editor.desktop.in.in (original)
+++ trunk/data/gconf-editor.desktop.in.in Mon Aug 18 19:47:13 2008
@@ -5,7 +5,7 @@
Exec=gconf-editor
Terminal=false
Type=Application
-Icon=gconf-editor.png
+Icon=gconf-editor
StartupNotify=true
Categories=GNOME;GTK;System;
X-GNOME-Bugzilla-Bugzilla=GNOME
Modified: trunk/data/icons/Makefile.am
==============================================================================
--- trunk/data/icons/Makefile.am (original)
+++ trunk/data/icons/Makefile.am Mon Aug 18 19:47:13 2008
@@ -1,30 +1,84 @@
-icondir = $(datadir)/icons/hicolor/48x48/apps
-icon_DATA = gconf-editor.png
+NULL =
+
+public_icons_themes = \
+ hicolor \
+ $(NULL)
+
+public_icons = \
+ hicolor_apps_48x48_gconf-editor.png \
+ $(NULL)
+
+private_icons = \
+ hicolor_status_16x16_type-boolean.png \
+ hicolor_status_16x16_type-float.png \
+ hicolor_status_16x16_type-integer.png \
+ hicolor_status_16x16_type-list.png \
+ hicolor_status_16x16_type-pair.png \
+ hicolor_status_16x16_type-schema.png \
+ hicolor_status_16x16_type-string.png \
+ hicolor_status_16x16_type-undefined.png \
+ $(NULL)
+
+noinst_DATA = \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(public_icons) \
+ $(private_icons) \
+ $(noinst_DATA) \
+ $(NULL)
+
+###############################################################################
+
+gtk_update_icon_cache = gtk-update-icon-cache -f -t
-gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
-install-data-hook: update-icon-cache
-uninstall-hook: update-icon-cache
update-icon-cache:
@-if test -z "$(DESTDIR)"; then \
echo "Updating Gtk icon cache."; \
- $(gtk_update_icon_cache); \
+ for theme in $(public_icons_themes); do \
+ $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \
+ done; \
else \
echo "*** Icon cache not updated. After (un)install, run this:"; \
- echo "*** $(gtk_update_icon_cache)"; \
+ for theme in $(public_icons_themes); do \
+ echo "*** $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \
+ done; \
fi
-imagesdir = $(datadir)/pixmaps/gconf-editor
-images_DATA = \
- entry-blank.png \
- entry-bool.png \
- entry-list.png \
- entry-number.png \
- entry-schema.png \
- entry-string.png \
- folder-closed.png \
- folder-open.png
+install-icons:
+ for icon in $(public_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
+ $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done; \
+ for icon in $(private_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ mkdir -p $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
+ $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done
+uninstall-icons:
+ -for icon in $(public_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ rm -f $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done; \
+ for icon in $(private_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ rm -f $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done
-EXTRA_DIST = \
- $(images_DATA) \
- $(icon_DATA)
+install-data-local: install-icons update-icon-cache
+
+uninstall-local: uninstall-icons update-icon-cache
Copied: trunk/data/icons/hicolor_apps_48x48_gconf-editor.png (from r1367, /trunk/data/icons/gconf-editor.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-boolean.png (from r1367, /trunk/data/icons/entry-bool.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-float.png (from r1367, /trunk/data/icons/entry-number.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-integer.png (from r1367, /trunk/data/icons/entry-number.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-list.png (from r1367, /trunk/data/icons/entry-list.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-pair.png (from r1367, /trunk/data/icons/entry-blank.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-schema.png (from r1367, /trunk/data/icons/entry-schema.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-string.png (from r1367, /trunk/data/icons/entry-string.png)
==============================================================================
Binary files. No diff available.
Copied: trunk/data/icons/hicolor_status_16x16_type-undefined.png (from r1367, /trunk/data/icons/entry-blank.png)
==============================================================================
Binary files. No diff available.
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Mon Aug 18 19:47:13 2008
@@ -1,9 +1,8 @@
INCLUDES = \
-DLOCALEDIR=\""$(datadir)/locale"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DGCONF_EDITOR_IMAGEDIR=\""$(datadir)/pixmaps/gconf-editor"\" \
- -DIMAGEDIR=\""$(datadir)/pixmaps"\" \
- $(GCONF_EDITOR_CFLAGS)
+ -DDATADIR=\""$(pkgdatadir)"\" \
+ -DICONDIR="\"$(pkgdatadir)/icons\"" \
+ $(GCONF_EDITOR_CFLAGS)
bin_PROGRAMS = gconf-editor
Modified: trunk/src/gconf-editor-window.c
==============================================================================
--- trunk/src/gconf-editor-window.c (original)
+++ trunk/src/gconf-editor-window.c Mon Aug 18 19:47:13 2008
@@ -399,16 +399,20 @@
"Shaun McCance <shaunm gnome org>",
NULL
};
- const gchar *translator_credits = _("translator-credits");
gtk_show_about_dialog (GTK_WINDOW (callback_data),
+#if GTK_CHECK_VERSION (2, 11, 0)
+ "program-name", _("Configuration Editor"),
+#else
+ "name", _("Configuration Editor"),
+#endif
"version", VERSION,
"copyright", "Copyright \xc2\xa9 2001-2004 Anders Carlsson",
"comments", _("An editor for the GConf configuration system."),
"authors", authors,
"documenters", documenters,
- "translator_credits", strcmp(translator_credits, "translator-credits") != 0 ? translator_credits : NULL,
- "logo_icon_name", "gconf-editor",
+ "translator-credits", _("translator-credits"),
+ "logo-icon-name", "gconf-editor",
NULL);
}
@@ -1406,8 +1410,8 @@
g_object_class_install_property (object_class, PROP_TYPE,
g_param_spec_int ("type",
- _("Type"),
- _("The Configuration Editor window type."),
+ "Type",
+ "The Configuration Editor window type.",
GCONF_EDITOR_WINDOW_TYPE_NORMAL, GCONF_EDITOR_WINDOW_TYPE_MANDATORY,
GCONF_EDITOR_WINDOW_TYPE_NORMAL,
(G_PARAM_WRITABLE |
@@ -1417,7 +1421,37 @@
parent_class = g_type_class_peek_parent (klass);
}
-
+static void
+tree_view_style_set_cb (GtkWidget *widget,
+ GtkStyle *previous_style,
+ GObject *cell)
+{
+ GdkPixbuf *folder_open = NULL, *folder_closed = NULL;
+ int w, h;
+
+ if (gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (widget),
+ GTK_ICON_SIZE_MENU,
+ &w, &h)) {
+ GtkIconTheme *theme;
+
+ theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
+
+ folder_open = gtk_icon_theme_load_icon (theme, "folder-open", w, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+ folder_closed = gtk_icon_theme_load_icon (theme, "folder", w, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+ }
+
+ g_object_set (cell,
+ "pixbuf-expander-open", folder_open,
+ "pixbuf-expander-closed", folder_closed,
+ "pixbuf", folder_closed,
+ NULL);
+ if (folder_open) {
+ g_object_unref (folder_open);
+ }
+ if (folder_closed) {
+ g_object_unref (folder_closed);
+ }
+}
static void
gconf_editor_window_init (GConfEditorWindow *window)
@@ -1516,12 +1550,8 @@
column = gtk_tree_view_column_new ();
cell = gtk_cell_renderer_pixbuf_new ();
+ g_signal_connect (window->tree_view, "style-set", G_CALLBACK (tree_view_style_set_cb), cell);
gtk_tree_view_column_pack_start (column, cell, FALSE);
- gtk_tree_view_column_set_attributes (column, cell,
- "pixbuf", GCONF_TREE_MODEL_CLOSED_ICON_COLUMN,
- "pixbuf_expander_closed", GCONF_TREE_MODEL_CLOSED_ICON_COLUMN,
- "pixbuf_expander_open", GCONF_TREE_MODEL_OPEN_ICON_COLUMN,
- NULL);
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell,
@@ -1563,9 +1593,10 @@
gtk_tree_view_column_set_title (column, _("Name"));
cell = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (cell, "stock-size", GTK_ICON_SIZE_MENU, NULL);
gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell,
- "pixbuf", GCONF_LIST_MODEL_ICON_COLUMN,
+ "icon-name", GCONF_LIST_MODEL_ICON_NAME_COLUMN,
NULL);
gtk_tree_view_column_set_resizable (column, TRUE);
Modified: trunk/src/gconf-list-model.c
==============================================================================
--- trunk/src/gconf-list-model.c (original)
+++ trunk/src/gconf-list-model.c Mon Aug 18 19:47:13 2008
@@ -16,22 +16,32 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <config.h>
+
#include "gconf-list-model.h"
#include <string.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gconf-util.h"
#define G_SLIST(x) ((GSList *) x)
-static GdkPixbuf *blank_pixbuf;
-static GdkPixbuf *bool_pixbuf;
-static GdkPixbuf *number_pixbuf;
-static GdkPixbuf *schema_pixbuf;
-static GdkPixbuf *string_pixbuf;
-static GdkPixbuf *list_pixbuf;
+static const char *gconf_value_icon_names[] = {
+ "type-undefined",
+ "type-string",
+ "type-integer",
+ "type-float",
+ "type-boolean",
+ "type-schema",
+ "type-list",
+ "type-pair"
+};
+
+static void gconf_list_model_class_init (GConfListModelClass *klass);
+static void gconf_list_model_init (GConfListModel *model);
+static void gconf_list_model_tree_model_init (GtkTreeModelIface *iface);
-static GObjectClass *parent_class;
+G_DEFINE_TYPE_WITH_CODE (GConfListModel, gconf_list_model, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, gconf_list_model_tree_model_init));
static void
gconf_list_model_notify_func (GConfClient* client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
@@ -191,8 +201,7 @@
gconf_list_model_get_column_type (GtkTreeModel *tree_model, gint index)
{
switch (index) {
- case GCONF_LIST_MODEL_ICON_COLUMN:
- return GDK_TYPE_PIXBUF;
+ case GCONF_LIST_MODEL_ICON_NAME_COLUMN:
case GCONF_LIST_MODEL_KEY_PATH_COLUMN:
case GCONF_LIST_MODEL_KEY_NAME_COLUMN:
return G_TYPE_STRING;
@@ -252,8 +261,6 @@
gconf_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value)
{
GConfEntry *entry;
- gchar *name;
- GdkPixbuf *icon;
g_return_if_fail (iter->stamp == GCONF_LIST_MODEL (tree_model)->stamp);
@@ -262,57 +269,30 @@
switch (column) {
case GCONF_LIST_MODEL_KEY_PATH_COLUMN:
g_value_init (value, G_TYPE_STRING);
-
g_value_set_string (value, gconf_entry_get_key (entry));
break;
case GCONF_LIST_MODEL_KEY_NAME_COLUMN:
g_value_init (value, G_TYPE_STRING);
-
- name = gconf_get_key_name_from_path (gconf_entry_get_key (entry));
- g_value_set_string (value, name);
- g_free (name);
+ g_value_take_string (value, gconf_get_key_name_from_path (gconf_entry_get_key (entry)));
break;
- case GCONF_LIST_MODEL_ICON_COLUMN:
- if (gconf_entry_get_value (entry) == NULL) {
- g_value_init (value, GDK_TYPE_PIXBUF);
- g_value_set_object (value, blank_pixbuf);
-
- break;
- }
-
- switch (gconf_entry_get_value (entry)->type) {
- case GCONF_VALUE_BOOL:
- icon = bool_pixbuf;
- break;
- case GCONF_VALUE_INT:
- case GCONF_VALUE_FLOAT:
- icon = number_pixbuf;
- break;
- case GCONF_VALUE_STRING:
- icon = string_pixbuf;
- break;
- case GCONF_VALUE_LIST:
- icon = list_pixbuf;
- break;
- case GCONF_VALUE_SCHEMA:
- icon = schema_pixbuf;
- break;
- case GCONF_VALUE_PAIR:
- /* FIXME: We need an icon for pairs */
- icon = blank_pixbuf;
- break;
- default:
- icon = blank_pixbuf;
- g_warning ("unknown value type %d", gconf_entry_get_value (entry)->type);
- break;
- }
+ case GCONF_LIST_MODEL_ICON_NAME_COLUMN: {
+ GConfValue *gconf_value;
+ GConfValueType value_type;
+
+ gconf_value = gconf_entry_get_value (entry);
+ if (gconf_value) {
+ value_type = gconf_value->type;
+ } else {
+ value_type = GCONF_VALUE_INVALID;
+ }
- g_value_init (value, GDK_TYPE_PIXBUF);
- g_value_set_object (value, icon);
+ g_value_init (value, G_TYPE_STRING);
+ g_value_set_static_string (value, gconf_value_icon_names[value_type]);
break;
+ }
case GCONF_LIST_MODEL_VALUE_COLUMN:
g_value_init (value, GCONF_TYPE_VALUE);
@@ -402,28 +382,21 @@
list_model->root_path, NULL);
}
+ if (list_model->client) {
+ g_object_unref (list_model->client);
+ }
+
g_free (list_model->root_path);
- parent_class->finalize (object);
+ G_OBJECT_CLASS (gconf_list_model_parent_class)->finalize (object);
}
static void
gconf_list_model_class_init (GConfListModelClass *klass)
{
- GObjectClass *object_class;
-
- object_class = (GObjectClass *)klass;
- parent_class = g_type_class_peek_parent (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gconf_list_model_finalize;
-
- /* Load the pixbufs */
- blank_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-blank.png", NULL);
- bool_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-bool.png", NULL);
- list_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-list.png", NULL);
- number_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-number.png", NULL);
- schema_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-schema.png", NULL);
- string_pixbuf = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/entry-string.png", NULL);
}
static void
@@ -442,48 +415,8 @@
model->client = client;
}
-
-
-GType
-gconf_list_model_get_type (void)
-{
- static GType object_type = 0;
-
- if (!object_type) {
- static const GTypeInfo object_info = {
- sizeof (GConfListModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gconf_list_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GConfListModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gconf_list_model_init
- };
-
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) gconf_list_model_tree_model_init,
- NULL,
- NULL
- };
-
- object_type = g_type_register_static (G_TYPE_OBJECT, "GConfListModel", &object_info, 0);
-
- g_type_add_interface_static (object_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return object_type;
-}
-
GtkTreeModel *
gconf_list_model_new (void)
{
- GConfListModel *model;
-
- model = g_object_new (GCONF_TYPE_LIST_MODEL, NULL);
-
- return GTK_TREE_MODEL (model);
+ return GTK_TREE_MODEL (g_object_new (GCONF_TYPE_LIST_MODEL, NULL));
}
Modified: trunk/src/gconf-list-model.h
==============================================================================
--- trunk/src/gconf-list-model.h (original)
+++ trunk/src/gconf-list-model.h Mon Aug 18 19:47:13 2008
@@ -34,7 +34,7 @@
typedef struct _GConfListModelClass GConfListModelClass;
enum {
- GCONF_LIST_MODEL_ICON_COLUMN,
+ GCONF_LIST_MODEL_ICON_NAME_COLUMN,
GCONF_LIST_MODEL_KEY_NAME_COLUMN,
GCONF_LIST_MODEL_KEY_PATH_COLUMN,
GCONF_LIST_MODEL_VALUE_COLUMN,
Modified: trunk/src/gconf-stock-icons.c
==============================================================================
--- trunk/src/gconf-stock-icons.c (original)
+++ trunk/src/gconf-stock-icons.c Mon Aug 18 19:47:13 2008
@@ -16,6 +16,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <config.h>
+
#include "gconf-stock-icons.h"
#include <gtk/gtkiconfactory.h>
@@ -24,40 +26,9 @@
static const char *icon_theme_items[] =
{
STOCK_BOOKMARK,
- STOCK_ADD_BOOKMARK,
- STOCK_EDIT_BOOKMARK
+ STOCK_EDIT_BOOKMARK
};
-
-static GtkIconSet *
-create_icon_set_from_filename (const gchar *filename)
-{
- GtkIconSet *set;
- GtkIconSource *source;
- GdkPixbuf *pixbuf;
- gchar *path;
-
- path = g_strdup_printf (GCONF_EDITOR_IMAGEDIR"/%s", filename);
-
- pixbuf = gdk_pixbuf_new_from_file (path, NULL);
- g_free (path);
-
- if (pixbuf == NULL) {
- return NULL;
- }
-
- set = gtk_icon_set_new ();
- source = gtk_icon_source_new ();
- gtk_icon_source_set_pixbuf (source, pixbuf);
- g_object_unref (pixbuf);
- gtk_icon_source_set_size (source, GTK_ICON_SIZE_MENU);
- gtk_icon_source_set_size_wildcarded (source, TRUE);
- gtk_icon_set_add_source (set, source);
- gtk_icon_source_free (source);
-
- return set;
-}
-
void
gconf_stock_icons_register (void)
{
@@ -74,13 +45,6 @@
icon_factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (icon_factory);
- set = create_icon_set_from_filename ("stock-about-16.png");
-
- if (set != NULL) {
- gtk_icon_factory_add (icon_factory, GCONF_STOCK_ABOUT, set);
- gtk_icon_set_unref (set);
- }
-
for (i = 0; i < (int) G_N_ELEMENTS (icon_theme_items); i++)
{
set = gtk_icon_set_new ();
Modified: trunk/src/gconf-stock-icons.h
==============================================================================
--- trunk/src/gconf-stock-icons.h (original)
+++ trunk/src/gconf-stock-icons.h Mon Aug 18 19:47:13 2008
@@ -22,7 +22,6 @@
#include <gtk/gtkstock.h>
-#define GCONF_STOCK_ABOUT "gconf-about"
#define STOCK_BOOKMARK "stock_bookmark"
#define STOCK_ADD_BOOKMARK "bookmark-new"
#define STOCK_EDIT_BOOKMARK "stock_edit-bookmark"
Modified: trunk/src/gconf-tree-model.c
==============================================================================
--- trunk/src/gconf-tree-model.c (original)
+++ trunk/src/gconf-tree-model.c Mon Aug 18 19:47:13 2008
@@ -1,16 +1,19 @@
+#include <config.h>
+
#include <string.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gconf-tree-model.h"
typedef struct _Node Node;
#define NODE(x) ((Node *)(x))
+static void gconf_tree_model_class_init (GConfTreeModelClass *klass);
+static void gconf_tree_model_init (GConfTreeModel *model);
+static void gconf_tree_model_tree_model_init (GtkTreeModelIface *iface);
static void gconf_tree_model_clear_node (GtkTreeModel *tree_model, Node *node);
-static GdkPixbuf *closed_icon;
-static GdkPixbuf *open_icon;
-
+G_DEFINE_TYPE_WITH_CODE (GConfTreeModel, gconf_tree_model, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, gconf_tree_model_tree_model_init));
struct _Node {
gint ref_count;
@@ -171,9 +174,6 @@
switch (index) {
case GCONF_TREE_MODEL_NAME_COLUMN:
return G_TYPE_STRING;
- case GCONF_TREE_MODEL_CLOSED_ICON_COLUMN:
- case GCONF_TREE_MODEL_OPEN_ICON_COLUMN:
- return GDK_TYPE_PIXBUF;
default:
return G_TYPE_INVALID;
}
@@ -267,15 +267,6 @@
g_value_set_string (value, ptr);
}
break;
- case GCONF_TREE_MODEL_CLOSED_ICON_COLUMN:
- g_value_init (value, GDK_TYPE_PIXBUF);
- g_value_set_object (value, closed_icon);
- break;
-
- case GCONF_TREE_MODEL_OPEN_ICON_COLUMN:
- g_value_init (value, GDK_TYPE_PIXBUF);
- g_value_set_object (value, open_icon);
- break;
default:
break;
}
@@ -477,8 +468,6 @@
static void
gconf_tree_model_class_init (GConfTreeModelClass *klass)
{
- closed_icon = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/folder-closed.png", NULL);
- open_icon = gdk_pixbuf_new_from_file (GCONF_EDITOR_IMAGEDIR"/folder-open.png", NULL);
}
static void
@@ -501,46 +490,8 @@
model->client = client;
}
-GType
-gconf_tree_model_get_type (void)
-{
- static GType object_type = 0;
-
- if (!object_type) {
- static const GTypeInfo object_info = {
- sizeof (GConfTreeModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gconf_tree_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GConfTreeModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gconf_tree_model_init
- };
-
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) gconf_tree_model_tree_model_init,
- NULL,
- NULL
- };
-
- object_type = g_type_register_static (G_TYPE_OBJECT, "GConfTreeModel", &object_info, 0);
-
- g_type_add_interface_static (object_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return object_type;
-}
-
GtkTreeModel *
gconf_tree_model_new (void)
{
- GConfTreeModel *model;
-
- model = g_object_new (GCONF_TYPE_TREE_MODEL, NULL);
-
- return GTK_TREE_MODEL (model);
+ return GTK_TREE_MODEL (g_object_new (GCONF_TYPE_TREE_MODEL, NULL));
}
Modified: trunk/src/gconf-tree-model.h
==============================================================================
--- trunk/src/gconf-tree-model.h (original)
+++ trunk/src/gconf-tree-model.h Mon Aug 18 19:47:13 2008
@@ -35,8 +35,6 @@
enum {
GCONF_TREE_MODEL_NAME_COLUMN,
- GCONF_TREE_MODEL_CLOSED_ICON_COLUMN,
- GCONF_TREE_MODEL_OPEN_ICON_COLUMN,
GCONF_TREE_MODEL_NUM_COLUMNS
};
Modified: trunk/src/gedit-output-window.c
==============================================================================
--- trunk/src/gedit-output-window.c (original)
+++ trunk/src/gedit-output-window.c Mon Aug 18 19:47:13 2008
@@ -340,6 +340,7 @@
GtkRcStyle* rc = gtk_widget_get_modifier_style (GTK_WIDGET (button));
rc->xthickness = 0;
rc->ythickness = 0;
+ gtk_widget_modify_style (GTK_WIDGET (button), rc);
gtk_button_set_relief (button, GTK_RELIEF_NONE);
gtk_button_set_focus_on_click (button, FALSE);
}
@@ -389,7 +390,7 @@
gedit_output_window_format_button (GTK_BUTTON (output_window->priv->close_button), w, h);
- image = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (output_window->priv->close_button), image);
g_signal_connect (output_window->priv->close_button,
@@ -426,7 +427,7 @@
gedit_output_window_format_button (GTK_BUTTON (output_window->priv->copy_button), w, h);
- image = gtk_image_new_from_stock ("gtk-copy", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_stock (GTK_STOCK_COPY, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (output_window->priv->copy_button), image);
g_signal_connect (output_window->priv->copy_button,
@@ -445,7 +446,7 @@
gedit_output_window_format_button (GTK_BUTTON (output_window->priv->clear_button), w, h);
- image = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (output_window->priv->clear_button), image);
g_signal_connect (output_window->priv->clear_button,
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Mon Aug 18 19:47:13 2008
@@ -60,8 +60,11 @@
GNOME_PARAM_NONE);
/* Register our stock icons */
+ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), ICONDIR);
gconf_stock_icons_register ();
+ gtk_window_set_default_icon_name ("gconf-editor");
+
window = gconf_editor_application_create_editor_window (GCONF_EDITOR_WINDOW_TYPE_NORMAL);
gtk_widget_show_now (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]