Commit 5baf9db1 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Now can optionally make the entry non editable.


	* plugins/gtk+/glade-cell-renderer-button.[ch], plugins/gtk+/glade-text-button.[ch]:
	Now can optionally make the entry non editable.

	* plugins/gtk+/glade-model-data.c: Added pixbuf editing support.

	* doc/widgetclasses.sgml, doc/properties.sgml: Clarified docs.

	* gladeui/glade-editor-property.[ch]: Removed resource editor, edit pixbuf with
	string editor.

	* gladeui/glade-widget-adaptor.c, gladeui/glade-property-class.c,
	gladeui/glade-project.[ch]: Completely removed concept of resources, glade
	no longer copies along pixbufs, pixbuf properties can include full paths
	or relative paths, in the glade runtime; any pixbufs are only ever loaded
	from the glade project directory (only the basename is used).


svn path=/trunk/; revision=1982
parent 98169f37
2008-10-18 Tristan Van Berkom <tvb@gnome.org>
2008-10-20 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/glade-cell-renderer-button.[ch], plugins/gtk+/glade-text-button.[ch]:
Now can optionally make the entry non editable.
* plugins/gtk+/glade-model-data.c: Added pixbuf editing support.
* doc/widgetclasses.sgml, doc/properties.sgml: Clarified docs.
* gladeui/glade-editor-property.[ch]: Removed resource editor, edit pixbuf with
string editor.
* gladeui/glade-widget-adaptor.c, gladeui/glade-property-class.c,
gladeui/glade-project.[ch]: Completely removed concept of resources, glade
no longer copies along pixbufs, pixbuf properties can include full paths
or relative paths, in the glade runtime; any pixbufs are only ever loaded
from the glade project directory (only the basename is used).
2008-10-19 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/glade-cell-renderer-button.[ch], plugins/gtk+/glade-text-button.[ch],
plugins/gtk+/glade-model-data.c: Added i18n support to string values in datastores.
......
......@@ -167,17 +167,6 @@ is the value saved).
</listitem>
</varlistentry>
<varlistentry>
<term>resource</term>
<listitem>
<para>
Depicts string properties that represent filenames that are packaged with
the glade file (like pixbufs); you can set this to "True" and the string
property will be treated like a resource.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>themed-icon</term>
<listitem>
......
......@@ -445,7 +445,8 @@ A #GladeCreateEPropFunc to create widgets to be used in Glade's property editor.
<term>string-from-value-function</term>
<listitem>
<para>
A #GladeStringFromValueFunc to create a string from a #GValue.
A #GladeStringFromValueFunc to create a string from a #GValue, these strings must
be unique and comparable for undo/redo to work properly.
</para>
</listitem>
</varlistentry>
......
......@@ -1558,10 +1558,17 @@ glade_eprop_text_load (GladeEditorProperty *eprop, GladeProperty *property)
if (GTK_IS_ENTRY (eprop_text->text_entry))
{
GtkEntry *entry = GTK_ENTRY (eprop_text->text_entry);
const gchar *text = g_value_get_string (property->value);
const gchar *text = NULL;
if (G_VALUE_TYPE (property->value) == G_TYPE_STRING)
text = g_value_get_string (property->value);
else if (G_VALUE_TYPE (property->value) == GDK_TYPE_PIXBUF)
{
GObject *object = g_value_get_object (property->value);
if (object)
text = g_object_get_data (object, "GladeFileName");
}
gtk_entry_set_text (entry, text ? text : "");
}
else if (GTK_IS_TEXT_VIEW (eprop_text->text_entry))
{
......@@ -1599,10 +1606,12 @@ glade_eprop_text_changed_common (GladeEditorProperty *eprop,
gchar *prop_text;
if (eprop->property->klass->pspec->value_type == G_TYPE_STRV ||
eprop->property->klass->pspec->value_type == G_TYPE_VALUE_ARRAY)
eprop->property->klass->pspec->value_type == G_TYPE_VALUE_ARRAY ||
eprop->property->klass->pspec->value_type == GDK_TYPE_PIXBUF)
{
val = glade_property_class_make_gvalue_from_string
(eprop->property->klass, text, NULL, NULL);
(eprop->property->klass, text,
eprop->property->widget->project, eprop->property->widget);
}
else
{
......@@ -2201,164 +2210,6 @@ glade_eprop_unichar_create_input (GladeEditorProperty *eprop)
return eprop_unichar->entry;
}
/*******************************************************************************
GladeEditorPropertyResourceClass
*******************************************************************************/
typedef struct {
GladeEditorProperty parent_instance;
GtkWidget *entry, *button;
} GladeEPropResource;
GLADE_MAKE_EPROP (GladeEPropResource, glade_eprop_resource)
#define GLADE_EPROP_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_RESOURCE, GladeEPropResource))
#define GLADE_EPROP_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_RESOURCE, GladeEPropResourceClass))
#define GLADE_IS_EPROP_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_RESOURCE))
#define GLADE_IS_EPROP_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_RESOURCE))
#define GLADE_EPROP_RESOURCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_EPROP_RESOURCE, GladeEPropResourceClass))
static void
glade_eprop_resource_finalize (GObject *object)
{
/* Chain up */
G_OBJECT_CLASS (editor_property_class)->finalize (object);
}
static void
glade_eprop_resource_entry_activate (GtkEntry *entry, GladeEditorProperty *eprop)
{
GladeProject *project = glade_widget_get_project (eprop->property->widget);
GValue *value = glade_property_class_make_gvalue_from_string
(eprop->klass, gtk_entry_get_text(entry), project, eprop->property->widget);
/* Set project resource here where we still have the fullpath.
*/
glade_project_set_resource (project, eprop->property,
gtk_entry_get_text(entry));
glade_editor_property_commit (eprop, value);
g_value_unset (value);
g_free (value);
}
static gboolean
glade_eprop_resource_entry_focus_out (GtkWidget *entry,
GdkEventFocus *event,
GladeEditorProperty *eprop)
{
glade_eprop_resource_entry_activate (GTK_ENTRY (entry), eprop);
return FALSE;
}
static void
glade_eprop_resource_select_file (GtkButton *button, GladeEditorProperty *eprop)
{
GladeProject *project = glade_widget_get_project (eprop->property->widget);
GtkWidget *dialog;
GtkFileFilter *filter;
GValue *value;
gchar *file, *basename;
if (eprop->loading) return;
dialog = gtk_file_chooser_dialog_new ("Select a File",
NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), TRUE);
if (eprop->klass->pspec->value_type == GDK_TYPE_PIXBUF)
{
filter = gtk_file_filter_new ();
gtk_file_filter_add_pixbuf_formats (filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
}
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
/* Set project resource here where we still have the fullpath.
*/
glade_project_set_resource (project, eprop->property, file);
basename = g_path_get_basename (file);
value = glade_property_class_make_gvalue_from_string
(eprop->klass, basename, project, eprop->property->widget);
glade_editor_property_commit (eprop, value);
g_value_unset (value);
g_free (value);
g_free (file);
g_free (basename);
}
gtk_widget_destroy (dialog);
}
static void
glade_eprop_resource_load (GladeEditorProperty *eprop, GladeProperty *property)
{
GladeProjectFormat fmt;
GladeEPropResource *eprop_resource = GLADE_EPROP_RESOURCE (eprop);
gchar *file;
/* Chain up first */
editor_property_class->load (eprop, property);
if (property == NULL) return;
fmt = glade_project_get_format (property->widget->project);
file = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
eprop->klass, property->value, fmt);
if (file)
{
gtk_entry_set_text (GTK_ENTRY (eprop_resource->entry), file);
g_free (file);
}
else
{
gtk_entry_set_text (GTK_ENTRY (eprop_resource->entry), "");
}
}
static GtkWidget *
glade_eprop_resource_create_input (GladeEditorProperty *eprop)
{
GladeEPropResource *eprop_resource = GLADE_EPROP_RESOURCE (eprop);
GtkWidget *hbox;
hbox = gtk_hbox_new (FALSE, 0);
eprop_resource->entry = gtk_entry_new ();
gtk_widget_show (eprop_resource->entry);
eprop_resource->button = gtk_button_new_with_label ("...");
gtk_widget_show (eprop_resource->button);
gtk_box_pack_start (GTK_BOX (hbox), eprop_resource->entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), eprop_resource->button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (eprop_resource->entry), "activate",
G_CALLBACK (glade_eprop_resource_entry_activate),
eprop);
g_signal_connect (G_OBJECT (eprop_resource->entry), "focus-out-event",
G_CALLBACK (glade_eprop_resource_entry_focus_out),
eprop);
g_signal_connect (G_OBJECT (eprop_resource->button), "clicked",
G_CALLBACK (glade_eprop_resource_select_file),
eprop);
return hbox;
}
/*******************************************************************************
GladeEditorPropertyObjectClass
*******************************************************************************/
......
......@@ -174,7 +174,6 @@ gboolean glade_editor_property_show_i18n_dialog (GtkWidget
#define GLADE_TYPE_EPROP_TEXT (glade_eprop_text_get_type())
#define GLADE_TYPE_EPROP_BOOL (glade_eprop_bool_get_type())
#define GLADE_TYPE_EPROP_UNICHAR (glade_eprop_unichar_get_type())
#define GLADE_TYPE_EPROP_RESOURCE (glade_eprop_resource_get_type())
#define GLADE_TYPE_EPROP_OBJECT (glade_eprop_object_get_type())
#define GLADE_TYPE_EPROP_OBJECTS (glade_eprop_objects_get_type())
#define GLADE_TYPE_EPROP_ADJUSTMENT (glade_eprop_adjustment_get_type())
......@@ -186,7 +185,6 @@ GType glade_eprop_named_icon_get_type (void) G_GNUC_CONST;
GType glade_eprop_text_get_type (void) G_GNUC_CONST;
GType glade_eprop_bool_get_type (void) G_GNUC_CONST;
GType glade_eprop_unichar_get_type (void) G_GNUC_CONST;
GType glade_eprop_resource_get_type (void) G_GNUC_CONST;
GType glade_eprop_object_get_type (void) G_GNUC_CONST;
GType glade_eprop_objects_get_type (void) G_GNUC_CONST;
GType glade_eprop_adjustment_get_type (void) G_GNUC_CONST;
......
......@@ -59,8 +59,6 @@ enum
WIDGET_NAME_CHANGED,
SELECTION_CHANGED,
CLOSE,
RESOURCE_ADDED,
RESOURCE_REMOVED,
CHANGED,
PARSE_FINISHED,
CONVERT_FINISHED,
......@@ -123,8 +121,6 @@ struct _GladeProjectPrivate
*/
GtkAccelGroup *accel_group;
GHashTable *resources; /* resource filenames & thier associated properties */
gchar *comment; /* XML comment, Glade will preserve whatever comment was
* in file, so users can delete or change it.
......@@ -190,16 +186,7 @@ static void glade_project_verify_adaptor (GladeProject *
gboolean forwidget,
GladeSupportMask *mask);
static void glade_project_move_resources (GladeProject *project,
const gchar *old_dir,
const gchar *new_dir);
static void glade_project_sync_resources_for_widget (GladeProject *project,
GladeProject *prev_project,
GladeWidget *gwidget,
gboolean remove);
GladeWidget *search_ancestry_by_name (GladeWidget *toplevel,
static GladeWidget *search_ancestry_by_name (GladeWidget *toplevel,
const gchar *name);
static GtkWidget *glade_project_build_prefs_dialog (GladeProject *project);
......@@ -311,7 +298,6 @@ glade_project_finalize (GObject *object)
if (project->priv->unsaved_number > 0)
glade_id_allocator_release (get_unsaved_number_allocator (), project->priv->unsaved_number);
g_hash_table_destroy (project->priv->resources);
g_hash_table_destroy (project->priv->target_versions_major);
g_hash_table_destroy (project->priv->target_versions_minor);
g_hash_table_destroy (project->priv->target_radios);
......@@ -605,10 +591,6 @@ glade_project_init (GladeProject *project)
priv->accel_group = NULL;
priv->resources = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL, g_free);
priv->unsaved_number = glade_id_allocator_allocate (get_unsaved_number_allocator ());
priv->format = GLADE_PROJECT_FORMAT_GTKBUILDER;
......@@ -662,8 +644,6 @@ glade_project_class_init (GladeProjectClass *klass)
klass->widget_name_changed = NULL;
klass->selection_changed = NULL;
klass->close = NULL;
klass->resource_added = NULL;
klass->resource_removed = NULL;
klass->changed = glade_project_changed_impl;
/**
......@@ -756,45 +736,6 @@ glade_project_class_init (GladeProjectClass *klass)
G_TYPE_NONE,
0);
/**
* GladeProject::resource-added:
* @gladeproject: the #GladeProject which received the signal.
* @arg1: the file's basename (in the project path).
*
* Emitted when a resource file required by a #GladeProperty is
* added to @gladeproject
*/
glade_project_signals[RESOURCE_ADDED] =
g_signal_new ("resource-added",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladeProjectClass, resource_added),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
/**
* GladeProject::resource-removed:
* @gladeproject: the #GladeProject which received the signal.
* @arg1: the file's basename
*
* Emitted when a resource file is removed from @gladeproject
*/
glade_project_signals[RESOURCE_REMOVED] =
g_signal_new ("resource-removed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladeProjectClass, resource_removed),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
/**
* GladeProject::changed:
* @gladeproject: the #GladeProject which received the signal.
......@@ -1662,19 +1603,8 @@ glade_project_save (GladeProject *project, const gchar *path, GError **error)
if (project->priv->path == NULL ||
strcmp (canonical_path, project->priv->path))
{
gchar *old_dir, *new_dir, *name, *title;
gchar *name, *title;
if (project->priv->path)
{
old_dir = g_path_get_dirname (project->priv->path);
new_dir = g_path_get_dirname (canonical_path);
glade_project_move_resources (project,
old_dir,
new_dir);
g_free (old_dir);
g_free (new_dir);
}
project->priv->path = (g_free (project->priv->path),
g_strdup (canonical_path));
......@@ -2203,7 +2133,7 @@ glade_project_verify_project_for_ui (GladeProject *project)
}
/*******************************************************************
Project object tracking code, name exclusivity, resources etc...
Project object tracking code, name exclusivity etc...
*******************************************************************/
static GladeNameContext *
name_context_by_widget (GladeProject *project,
......@@ -2225,7 +2155,7 @@ name_context_by_widget (GladeProject *project,
return NULL;
}
GladeWidget *
static GladeWidget *
search_ancestry_by_name (GladeWidget *toplevel, const gchar *name)
{
GladeWidget *widget = NULL, *iter;
......@@ -2475,7 +2405,6 @@ glade_project_add_object (GladeProject *project,
GladeNameContext *context;
GladeWidget *gwidget;
GList *list, *children;
static gint reentrancy_count = 0;
gchar *name;
g_return_if_fail (GLADE_IS_PROJECT (project));
......@@ -2519,9 +2448,6 @@ glade_project_add_object (GladeProject *project,
glade_name_context_add_name (context, gwidget->name);
if (!gwidget->parent)
glade_name_context_add_name (project->priv->toplevel_names, gwidget->name);
/* Code body starts here */
reentrancy_count++;
if ((children = glade_widget_adaptor_get_children
(gwidget->adaptor, gwidget->object)) != NULL)
......@@ -2542,13 +2468,6 @@ glade_project_add_object (GladeProject *project,
/* Update user visible compatability info */
glade_project_verify_properties (gwidget);
/* Run this once at the end for every recursive call */
if (--reentrancy_count == 0)
{
glade_project_sync_resources_for_widget
(project, old_project, gwidget, FALSE);
}
}
/**
......@@ -2583,7 +2502,6 @@ glade_project_remove_object (GladeProject *project, GObject *object)
{
GladeWidget *gwidget;
GList *link, *list, *children;
static gint reentrancy_count = 0;
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (G_IS_OBJECT (object));
......@@ -2593,9 +2511,6 @@ glade_project_remove_object (GladeProject *project, GObject *object)
if ((gwidget = glade_widget_get_from_gobject (object)) == NULL)
return;
/* Code body starts here */
reentrancy_count++;
if ((children =
glade_widget_adaptor_get_children (gwidget->adaptor,
......@@ -2620,10 +2535,6 @@ glade_project_remove_object (GladeProject *project, GObject *object)
glade_project_signals [REMOVE_WIDGET],
0,
gwidget);
/* Call this once at the end for every recursive call */
if (--reentrancy_count == 0)
glade_project_sync_resources_for_widget (project, NULL, gwidget, TRUE);
}
static void
......@@ -3294,269 +3205,41 @@ glade_project_set_accel_group (GladeProject *project, GtkAccelGroup *accel_group
project->priv->accel_group = accel_group;
}
static void
gp_sync_resources (GladeProject *project,
GladeProject *prev_project,
GladeWidget *gwidget,
gboolean remove)
{
GList *prop_list, *l;
GladeProperty *property;
gchar *resource, *full_resource;
prop_list = g_list_copy (gwidget->properties);
prop_list = g_list_concat
(prop_list, g_list_copy (gwidget->packing_properties));
for (l = prop_list; l; l = l->next)
{
property = l->data;
if (property->klass->resource)
{
GValue value = { 0, };
if (remove)
{
glade_project_set_resource (project, property, NULL);
continue;
}
glade_property_get_value (property, &value);
if ((resource = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->klass->handle),
property->klass, &value, project->priv->format)) != NULL)
{
full_resource = glade_project_resource_fullpath
(prev_project ? prev_project : project, resource);
/* Use a full path here so that the current
* working directory isnt used.
*/
glade_project_set_resource (project,
property,
full_resource);
g_free (full_resource);
g_free (resource);
}
g_value_unset (&value);
}
}
g_list_free (prop_list);
}
static void
glade_project_sync_resources_for_widget (GladeProject *project,
GladeProject *prev_project,
GladeWidget *gwidget,
gboolean remove)
{
GList *children, *l;
GladeWidget *gchild;
children = glade_widget_adaptor_get_children
(gwidget->adaptor, gwidget->object);
for (l = children; l; l = l->next)
if ((gchild =
glade_widget_get_from_gobject (l->data)) != NULL)
glade_project_sync_resources_for_widget
(project, prev_project, gchild, remove);
if (children)
g_list_free (children);
gp_sync_resources (project, prev_project, gwidget, remove);
}
static void
glade_project_move_resources (GladeProject *project,
const gchar *old_dir,
const gchar *new_dir)
{
GList *list, *resources;
gchar *old_name, *new_name;
if (old_dir == NULL || /* <-- Cant help you :( */
new_dir == NULL) /* <-- Unlikely */
return;
if ((resources = /* Nothing to do here */
glade_project_list_resources (project)) == NULL)
return;
for (list = resources; list; list = list->next)
{
old_name = g_build_filename
(old_dir, (gchar *)list->data, NULL);
new_name = g_build_filename
(new_dir, (gchar *)list->data, NULL);
glade_util_copy_file (old_name, new_name);
g_free (old_name);
g_free (new_name);
}
g_list_free (resources);
}
/**
* glade_project_resource_fullpath:
* @project: The #GladeProject.
* @resource: The resource basename
*
* Project resource strings may be relative or fullpaths, but glade
* always expects a copy in the glade file directory, this function
* is used to make a local path to the file.
*
* Returns: A newly allocated string holding the
* full path the the project resource.
* local path the the project resource.
*/
gchar *
glade_project_resource_fullpath (GladeProject *project,
const gchar *resource)
{
gchar *fullpath, *project_dir;
gchar *fullpath, *project_dir = NULL, *basename;
g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
if (project->priv->path == NULL)
return g_strdup (resource);
project_dir = g_path_get_dirname (project->priv->path);
fullpath = g_build_filename (project_dir, resource, NULL);
g_free (project_dir);
return fullpath;
}
static gboolean
find_resource_by_resource (GladeProperty *key,
const gchar *resource,
const gchar *resource_cmp)
{
g_assert (resource);
g_assert (resource_cmp);
return (!strcmp (resource, resource_cmp));
}
basename = g_path_get_basename (resource);
/**
* glade_project_set_resource:
* @project: A #GladeProject
* @property: The #GladeProperty this resource is required by
* @resource: The resource file basename to be found in the same
* directory as the glade file.
*
* Adds/Modifies/Removes a resource from a project; any project resources
* will be copied when using "Save As...", when moving widgets across projects
* and will be copied into the project's directory when selected.
*/
void
glade_project_set_resource (GladeProject *project,
GladeProperty *property,
const gchar *resource)
{
gchar *last_resource, *last_resource_dup = NULL, *base_resource = NULL;
gchar *fullpath, *dirname;
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (GLADE_IS_PROPERTY (property));
if ((last_resource =
g_hash_table_lookup (project->priv->resources, property)) != NULL)
last_resource_dup = g_strdup (last_resource);
/* Get dependable input */
if (resource && resource[0] != '\0' && strcmp (resource, "."))
base_resource = g_path_get_basename (resource);
/* If the resource has been removed or the base name has changed
* then remove from hash and emit removed.
*/
if (last_resource_dup &&
(base_resource == NULL || strcmp (last_resource_dup, base_resource)))
{
g_hash_table_remove (project->priv->resources, property);
if (g_hash_table_find (project->priv->resources,
(GHRFunc)find_resource_by_resource,
last_resource_dup) == NULL)
g_signal_emit (G_OBJECT (project),
glade_project_signals [RESOURCE_REMOVED],
0, last_resource_dup);
}
/* Copy files when importing widgets with resources.
*/
if (project->priv->path)
{
dirname = g_path_get_dirname (project->priv->path);
fullpath = g_build_filename (dirname, base_resource, NULL);
if (resource && project->priv->path &&
g_file_test (resource, G_FILE_TEST_IS_REGULAR) &&
strcmp (fullpath, resource))
{
/* FIXME: In the case of copy/pasting widgets
* across projects we should ask the user about
* copying any resources.
*/
glade_util_copy_file (resource, fullpath);
}
g_free (fullpath);
g_free (dirname);
}
if (base_resource)
if (project->priv->path == NULL)
{
/* If the resource has been added or the base name has
* changed then emit added.
*/
if ((last_resource_dup == NULL ||
strcmp (last_resource_dup, base_resource)) &&
g_hash_table_find (project->priv->resources,
(GHRFunc)find_resource_by_resource,
base_resource) == NULL)
g_signal_emit (G_OBJECT (project),
glade_project_signals [RESOURCE_ADDED],
0, base_resource);
g_hash_table_insert (project->priv->resources, property, base_resource);
project_dir = g_path_get_dirname (project->priv->path);
fullpath = g_build_filename (project_dir, basename, NULL);
}
g_free (last_resource_dup);
}
static void
list_resources_accum (GladeProperty *key,
gchar *value,
GList **list)
{
*list = g_list_prepend (*list, value);
}
else
fullpath = g_strdup (basename);
if (project_dir)
g_free (project_dir);
g_free (basename);
/**
* glade_project_list_resources: