Commit d1fb1d2b authored by Tristan Van Berkom's avatar Tristan Van Berkom

Updated.


	* TODO: Updated.

	* plugins/gtk+/gtk+.xml.in: 
	  - Added sizegroup support stuff

	* plugins/gtk+/glade-gtk.c: 
	  - Added GtkWidgetClass support for add to size group
	    action with dynamic submenu
	  - added sizegroup virtual "widgets" property
	  - added custom load/save support for "widgets" property

	* gladeui/glade-popup.c: Added support for dynamic action submenus

	* gladeui/glade-widget-adaptor.[ch], gladeui/glade-xml-utils.h: Added
	  GladeActionSubmenuFunc backend support for creation of dynamic
	  action submenus.

	* gladeui/glade-widget.[ch] removed deadcode glade_widget_create_action_menu()

	* gladeui/glade-project.c: Added readonly "format" property


svn path=/trunk/; revision=1940
parent d85b9c28
2008-09-20 Tristan Van Berkom <tvb@gnome.org>
* TODO: Updated.
* gladeui/glade-utils.c: Improved error messages in load_module() routine.
* plugins/gtk+/gtk+.xml.in: Enabled object properties all over.
* plugins/gtk+/gtk+.xml.in:
- Enabled object properties all over.
- Added sizegroup support stuff
* plugins/gtk+/glade-gtk.c:
- Added GtkWidgetClass support for add to size group
action with dynamic submenu
- added sizegroup virtual "widgets" property
- added custom load/save support for "widgets" property
* gladeui/glade-popup.c: Added support for dynamic action submenus
* gladeui/glade-widget-adaptor.[ch], gladeui/glade-xml-utils.h: Added
GladeActionSubmenuFunc backend support for creation of dynamic
action submenus.
* gladeui/glade-widget.[ch] removed deadcode glade_widget_create_action_menu()
* gladeui/glade-project.c: Added readonly "format" property
2008-09-19 Tristan Van Berkom <tvb@gnome.org>
Now we have a conversion routine that is run in the plugin to
......
......@@ -4,18 +4,8 @@
=============================
Glade renames widgets when ids are dupped: http://bugzilla.gnome.org/show_bug.cgi?id=549176
Improve attributes editor
Add sizegroup (with some cute gwa actions)
Add actions, treestore, treemodel, adjustment, pixbuf (Gtk+ objects new group)
Nice editor resizing by Pavel, needs fix for warning icons: http://bugzilla.gnome.org/show_bug.cgi?id=546107
Create Gtk+ Specialized widget group: http://bugzilla.gnome.org/show_bug.cgi?id=544845
No way to add menus to toolbar: http://bugzilla.gnome.org/show_bug.cgi?id=429438
GdkColor null values critical errors: http://bugzilla.gnome.org/show_bug.cgi?id=426345
Need proper conversion routine:
currently adjustments are saved as data in libglade and as objects in builder,
we need a conversion "routine" to be run, to create/remove the nescisary objects
and modify the project as needed when converts take place - this should also help
clean things up wrt the internal icon factory cache for pixbufs.
Its possible that as a result of project conversions, we will dump/lose our
command history.
Add versioning metadata for libglade unsupported properties and widgets.
......@@ -293,6 +293,7 @@ glade_popup_menuitem_ph_packing_activated (GtkMenuItem *item, const gchar *actio
static gint
glade_popup_action_populate_menu_real (GtkWidget *menu,
GladeWidget *gwidget,
GList *actions,
GCallback callback,
gpointer data)
......@@ -310,10 +311,16 @@ glade_popup_action_populate_menu_real (GtkWidget *menu,
{
submenu = gtk_menu_new ();
n += glade_popup_action_populate_menu_real (submenu,
gwidget,
a->actions,
callback,
data);
}
else
submenu = glade_widget_adaptor_action_submenu (gwidget->adaptor,
gwidget->object,
a->klass->path);
item = glade_popup_append_item (menu,
a->klass->stock,
......@@ -361,12 +368,14 @@ glade_popup_action_populate_menu (GtkWidget *menu,
g_return_val_if_fail (GLADE_IS_WIDGET_ACTION (action), 0);
if (glade_widget_get_action (widget, action->klass->path))
return glade_popup_action_populate_menu_real (menu,
widget,
action->actions,
G_CALLBACK (glade_popup_menuitem_activated),
widget);
if (glade_widget_get_pack_action (widget, action->klass->path))
return glade_popup_action_populate_menu_real (menu,
glade_widget_get_parent (widget),
action->actions,
G_CALLBACK (glade_popup_menuitem_packing_activated),
widget);
......@@ -375,6 +384,7 @@ glade_popup_action_populate_menu (GtkWidget *menu,
}
n = glade_popup_action_populate_menu_real (menu,
widget,
widget->actions,
G_CALLBACK (glade_popup_menuitem_activated),
widget);
......@@ -388,6 +398,7 @@ glade_popup_action_populate_menu (GtkWidget *menu,
gtk_widget_show (separator);
}
n += glade_popup_action_populate_menu_real (menu,
glade_widget_get_parent (widget),
widget->packing_actions,
G_CALLBACK (glade_popup_menuitem_packing_activated),
widget);
......@@ -465,6 +476,7 @@ glade_popup_create_menu (GladeWidget *widget,
glade_popup_action_populate_menu_real
(popup_menu,
widget,
widget->actions,
G_CALLBACK (glade_popup_menuitem_activated),
widget);
......@@ -478,6 +490,7 @@ glade_popup_create_menu (GladeWidget *widget,
glade_popup_action_populate_menu_real
(popup_menu,
widget,
placeholder->packing_actions,
G_CALLBACK (glade_popup_menuitem_ph_packing_activated),
placeholder);
......
......@@ -70,7 +70,8 @@ enum
PROP_MODIFIED,
PROP_HAS_SELECTION,
PROP_PATH,
PROP_READ_ONLY
PROP_READ_ONLY,
PROP_FORMAT
};
struct _GladeProjectPrivate
......@@ -256,13 +257,16 @@ glade_project_get_property (GObject *object,
break;
case PROP_HAS_SELECTION:
g_value_set_boolean (value, project->priv->has_selection);
break;
case PROP_READ_ONLY:
g_value_set_boolean (value, project->priv->readonly);
break;
case PROP_PATH:
g_value_set_string (value, project->priv->path);
break;
case PROP_READ_ONLY:
g_value_set_boolean (value, project->priv->readonly);
break;
case PROP_FORMAT:
g_value_set_int (value, project->priv->format);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -1001,6 +1005,14 @@ glade_project_class_init (GladeProjectClass *klass)
FALSE,
G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_PATH,
g_param_spec_string ("path",
_("Path"),
_("The filesystem path of the project"),
NULL,
G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_READ_ONLY,
g_param_spec_boolean ("read-only",
......@@ -1008,15 +1020,17 @@ glade_project_class_init (GladeProjectClass *klass)
_("Whether project is read only or not"),
FALSE,
G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_PATH,
g_param_spec_string ("path",
_("Path"),
_("The filesystem path of the project"),
NULL,
G_PARAM_READABLE));
PROP_FORMAT,
g_param_spec_int ("format",
_("Format"),
_("The project file format"),
GLADE_PROJECT_FORMAT_LIBGLADE,
GLADE_PROJECT_FORMAT_GTKBUILDER,
GLADE_PROJECT_FORMAT_GTKBUILDER,
G_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GladeProjectPrivate));
}
......@@ -3214,13 +3228,25 @@ glade_project_get_modified (GladeProject *project)
return project->priv->modified;
}
/**
* glade_project_set_format:
* @project: a #GladeProject
* @format: the #GladeProjectFormat
*
* Sets @project format to @format, used internally to set the actual format
* state; note that conversions should be done through the glade-command api.
*/
void
glade_project_set_format (GladeProject *project, GladeProjectFormat format)
{
g_return_if_fail (GLADE_IS_PROJECT (project));
if (project->priv->format != format)
{
project->priv->format = format;
g_object_notify (G_OBJECT (project), "format");
}
}
GladeProjectFormat
......
......@@ -1176,6 +1176,7 @@ glade_widget_adaptor_class_init (GladeWidgetAdaptorClass *adaptor_class)
adaptor_class->child_get_property = NULL;
adaptor_class->action_activate = glade_widget_adaptor_object_action_activate;
adaptor_class->child_action_activate= glade_widget_adaptor_object_child_action_activate;
adaptor_class->action_submenu = NULL;
adaptor_class->read_widget = glade_widget_adaptor_object_read_widget;
adaptor_class->write_widget = glade_widget_adaptor_object_write_widget;
adaptor_class->read_child = glade_widget_adaptor_object_read_child;
......@@ -1425,6 +1426,11 @@ gwa_extend_with_node_load_sym (GladeWidgetAdaptorClass *klass,
&symbol))
klass->child_action_activate = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_ACTION_SUBMENU_FUNCTION,
&symbol))
klass->action_submenu = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_READ_WIDGET_FUNCTION,
&symbol))
......@@ -3246,7 +3252,31 @@ glade_widget_adaptor_child_action_activate (GladeWidgetAdaptor *adaptor,
GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->child_action_activate (adaptor, container, object, action_path);
}
/**
* glade_widget_adaptor_action_submenu:
* @adaptor: A #GladeWidgetAdaptor
* @object: The #GObject
* @action_path: The action identifier in the action tree
*
* This delagate function is used to create dynamically customized
* submenus. Called only for actions that dont have children.
*
* Returns: A newly created #GtkMenu or %NULL
*/
GtkWidget *
glade_widget_adaptor_action_submenu (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *action_path)
{
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
g_return_val_if_fail (g_type_is_a (G_OBJECT_TYPE (object), adaptor->type), NULL);
if (GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->action_submenu)
return GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->action_submenu (adaptor, object, action_path);
return NULL;
}
/**
* glade_widget_adaptor_read_widget:
......
......@@ -370,6 +370,24 @@ typedef void (* GladeChildActionActivateFunc) (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *action_path);
/**
* GladeActionSubmenuFunc:
* @adaptor: A #GladeWidgetAdaptor
* @object: The #GObject
* @action_path: The action path
*
* This delagate function is used to create dynamically customized
* submenus. Called only for actions that dont have children.
*
*/
typedef GtkWidget *(* GladeActionSubmenuFunc) (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *action_path);
/**
* GladeReadWidgetFunc:
* @adaptor: A #GladeWidgetAdaptor
......@@ -595,6 +613,8 @@ struct _GladeWidgetAdaptorClass
GladeActionActivateFunc action_activate; /* This method is used to catch actions */
GladeChildActionActivateFunc child_action_activate; /* This method is used to catch packing actions */
GladeActionSubmenuFunc action_submenu; /* Delagate function to create dynamic submenus */
/* in action menus. */
GladeReadWidgetFunc read_widget; /* Reads widget attributes from xml */
......@@ -604,8 +624,6 @@ struct _GladeWidgetAdaptorClass
GladeWriteWidgetFunc write_child; /* Writes widget attributes to the xml */
GladeCreateEPropFunc create_eprop; /* Creates a GladeEditorProperty */
GladeStringFromValueFunc string_from_value; /* Creates a string for a value */
......@@ -760,6 +778,11 @@ void glade_widget_adaptor_child_action_activate (GladeWidgetAdap
GObject *object,
const gchar *action_path);
GtkWidget *glade_widget_adaptor_action_submenu (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *action_path);
void glade_widget_adaptor_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node);
......
......@@ -3974,38 +3974,6 @@ glade_widget_remove_pack_action (GladeWidget *widget, const gchar *action_path)
glade_widget_action_lookup (&widget->packing_actions, action_path, TRUE);
}
/**
* glade_widget_create_action_menu:
* @widget: a #GladeWidget
* @action_path: an action path or NULL to include every @widget action.
*
* Create a new GtkMenu with every action in it.
*
*/
GtkWidget *
glade_widget_create_action_menu (GladeWidget *widget, const gchar *action_path)
{
GladeWidgetAction *action = NULL;
GtkWidget *menu;
g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL);
if (action_path)
{
action = glade_widget_action_lookup (&widget->actions, action_path, FALSE);
if (action == NULL)
action = glade_widget_action_lookup (&widget->packing_actions, action_path, FALSE);
}
menu = gtk_menu_new ();
if (glade_popup_action_populate_menu (menu, widget, action, TRUE))
return menu;
g_object_unref (G_OBJECT (menu));
return NULL;
}
/*******************************************************************************
* Toplevel GladeWidget Embedding *
******************************************************************************
......
......@@ -216,9 +216,6 @@ void glade_widget_remove_action (GladeWidget *widget
void glade_widget_remove_pack_action (GladeWidget *widget,
const gchar *action_path);
GtkWidget * glade_widget_create_action_menu (GladeWidget *widget,
const gchar *action_path);
void glade_widget_write (GladeWidget *widget,
GladeXmlContext *context,
GladeXmlNode *node);
......
......@@ -117,6 +117,7 @@ typedef enum
#define GLADE_TAG_CONSTRUCTOR_FUNCTION "constructor-function"
#define GLADE_TAG_ACTION_ACTIVATE_FUNCTION "action-activate-function"
#define GLADE_TAG_CHILD_ACTION_ACTIVATE_FUNCTION "child-action-activate-function"
#define GLADE_TAG_ACTION_SUBMENU_FUNCTION "action-submenu-function"
#define GLADE_TAG_READ_WIDGET_FUNCTION "read-widget-function"
#define GLADE_TAG_WRITE_WIDGET_FUNCTION "write-widget-function"
#define GLADE_TAG_READ_CHILD_FUNCTION "read-child-function"
......
......@@ -1285,12 +1285,115 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
glade_command_pop_group ();
}
}
else if (strcmp (action_path, "sizegroup_add") == 0)
{
/* Ignore dummy */
}
else
GWA_GET_CLASS (G_TYPE_OBJECT)->action_activate (adaptor,
object,
action_path);
}
static GList *list_sizegroups (GladeWidget *gwidget)
{
GladeProject *project = glade_widget_get_project (gwidget);
GList *groups = NULL;
const GList *list;
for (list = glade_project_get_objects (project); list; list = list->next)
{
GladeWidget *iter = glade_widget_get_from_gobject (list->data);
if (GTK_IS_SIZE_GROUP (iter->object))
groups = g_list_prepend (groups, iter);
}
return g_list_reverse (groups);
}
static void
glade_gtk_widget_add2group_cb (GtkMenuItem *item, GladeWidget *gwidget)
{
GladeWidget *group = g_object_get_data (G_OBJECT (item), "glade-group-widget");
gchar *desc = group ? g_strdup_printf (_("Adding %s to Size Group %s"), gwidget->name, group->name) :
g_strdup_printf (_("Adding %s to a new Size Group"), gwidget->name);
GladeWidgetAdaptor *adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_SIZE_GROUP);
GList *widget_list = NULL, *new_list;
GladeProperty *property;
glade_command_push_group (desc);
g_free (desc);
if (!group)
/* Cant cancel a size group */
group = glade_command_create (adaptor, NULL, NULL, glade_widget_get_project (gwidget));
property = glade_widget_get_property (group, "widgets");
glade_property_get (property, &widget_list);
new_list = g_list_copy (widget_list);
if (!g_list_find (widget_list, gwidget->object))
new_list = g_list_append (new_list, gwidget->object);
glade_command_set_property (property, new_list);
g_list_free (new_list);
glade_command_pop_group ();
}
GtkWidget *
glade_gtk_widget_action_submenu (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *action_path)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (object);
GList *groups, *list;
if (strcmp (action_path, "sizegroup_add") == 0)
{
GtkWidget *menu = gtk_menu_new ();
GtkWidget *separator, *item;
GladeWidget *group;
if ((groups = list_sizegroups (gwidget)) != NULL)
{
for (list = groups; list; list = list->next)
{
group = list->data;
item = gtk_menu_item_new_with_label (group->name);
g_object_set_data (G_OBJECT (item), "glade-group-widget", group);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (glade_gtk_widget_add2group_cb), gwidget);
gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
g_list_free (groups);
separator = gtk_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), separator);
gtk_widget_show (separator);
}
/* Add trailing new... item */
item = gtk_menu_item_new_with_label (_("New Size Group"));
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (glade_gtk_widget_add2group_cb), gwidget);
gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
return menu;
}
else if (GWA_GET_CLASS (G_TYPE_OBJECT)->action_submenu)
return GWA_GET_CLASS (G_TYPE_OBJECT)->action_submenu (adaptor,
object,
action_path);
return NULL;
}
/* ----------------------------- GtkContainer ------------------------------ */
void
......@@ -8302,3 +8405,155 @@ glade_gtk_message_dialog_get_property (GladeWidgetAdaptor *adaptor,
GWA_GET_CLASS (GTK_TYPE_DIALOG)->get_property (adaptor, object,
property_name, value);
}
/*--------------------------- GtkSizeGroup ---------------------------------*/
#define GLADE_TAG_SIZEGROUP_WIDGETS "widgets"
#define GLADE_TAG_SIZEGROUP_WIDGET "widget"
static void
glade_gtk_size_group_read_widgets (GladeWidget *widget,
GladeXmlNode *node)
{
GladeXmlNode *widgets_node;
GladeProperty *property;
gchar *string = NULL;
if ((widgets_node =
glade_xml_search_child (node, GLADE_TAG_SIZEGROUP_WIDGETS)) != NULL)
{
GladeXmlNode *node;
for (node = glade_xml_node_get_children (widgets_node);
node; node = glade_xml_node_next (node))
{
gchar *widget_name, *tmp;
if (!glade_xml_node_verify_silent (node, GLADE_TAG_SIZEGROUP_WIDGET))
continue;
widget_name = glade_xml_get_property_string_required
(node, GLADE_TAG_NAME, NULL);
if (string == NULL)
string = widget_name;
else if (widget_name != NULL)
{
tmp = g_strdup_printf ("%s%s%s", string, GPC_OBJECT_DELIMITER, widget_name);
string = (g_free (string), tmp);
g_free (widget_name);
}
}
}
if (string)
{
property = glade_widget_get_property (widget, "widgets");
g_assert (property);
/* we must synchronize this directly after loading this project
* (i.e. lookup the actual objects after they've been parsed and
* are present).
*/
g_object_set_data_full (G_OBJECT (property),
"glade-loaded-object",
string, g_free);
}
}
void
glade_gtk_size_group_read_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlNode *node)
{
if (!glade_xml_node_verify
(node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
return;
/* First chain up and read in all the normal properties.. */
GWA_GET_CLASS (G_TYPE_OBJECT)->read_widget (adaptor, widget, node);
glade_gtk_size_group_read_widgets (widget, node);
}
static void
glade_gtk_size_group_write_widgets (GladeWidget *widget,
GladeXmlContext *context,
GladeXmlNode *node)
{
GladeXmlNode *widgets_node, *widget_node;
GList *widgets = NULL, *list;
GladeWidget *awidget;
widgets_node = glade_xml_node_new (context, GLADE_TAG_SIZEGROUP_WIDGETS);
glade_xml_node_append_child (node, widgets_node);
if (glade_widget_property_get (widget, "widgets", &widgets))
{
for (list = widgets; list; list = list->next)
{
awidget = glade_widget_get_from_gobject (list->data);
widget_node = glade_xml_node_new (context, GLADE_TAG_SIZEGROUP_WIDGET);
glade_xml_node_append_child (widgets_node, widget_node);
glade_xml_node_set_property_string (widget_node, GLADE_TAG_NAME, awidget->name);
}
}
if (!glade_xml_node_get_children (widgets_node))
{
glade_xml_node_remove (widgets_node);
glade_xml_node_delete (widgets_node);
}
}
void
glade_gtk_size_group_write_widget (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeXmlContext *context,
GladeXmlNode *node)
{
if (!glade_xml_node_verify
(node, GLADE_XML_TAG_WIDGET (glade_project_get_format (widget->project))))
return;
/* First chain up and read in all the normal properties.. */
GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
glade_gtk_size_group_write_widgets (widget, context, node);
}
void
glade_gtk_size_group_set_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *property_name,
const GValue *value)
{
if (!strcmp (property_name, "widgets"))
{
GSList *sg_widgets, *slist;
GList *widgets, *list;
/* remove old widgets */
if ((sg_widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (object))) != NULL)
{
/* copy since we are modifying an internal list */
sg_widgets = g_slist_copy (sg_widgets);
for (slist = sg_widgets; slist; slist = slist->next)
gtk_size_group_remove_widget (GTK_SIZE_GROUP (object), GTK_WIDGET (slist->data));
g_slist_free (sg_widgets);
}
/* add new widgets */
if ((widgets = g_value_get_boxed (value)) != NULL)
{
for (list = widgets; list; list = list->next)
gtk_size_group_add_widget (GTK_SIZE_GROUP (object), GTK_WIDGET (list->data));
}
}
else
GWA_GET_CLASS (G_TYPE_OBJECT)->set_property (adaptor, object,
property_name, value);
}
......@@ -14,6 +14,7 @@
<set-property-function>glade_gtk_widget_set_property</set-property-function>
<get-property-function>glade_gtk_widget_get_property</get-property-function>
<action-activate-function>glade_gtk_widget_action_activate</action-activate-function>
<action-submenu-function>glade_gtk_widget_action_submenu</action-submenu-function>
<read-widget-function>glade_gtk_widget_read_widget</read-widget-function>
<write-widget-function>glade_gtk_widget_write_widget</write-widget-function>
<create-editor-property-function>glade_gtk_widget_create_eprop</create-editor-property-function>
......@@ -41,6 +42,7 @@
<action id="hpaned" _name="Horizontal Panes"/>
<action id="vpaned" _name="Vertical Panes"/>
</action>
<action id="sizegroup_add" _name="Add to Size Group"/>
</actions>
......@@ -1736,8 +1738,18 @@ x <property id="buffer"/>
</properties>
</glade-widget-class>
<glade-widget-class name="GtkSizeGroup" generic-name="sizegroup" _title="Size Group">
<read-widget-function>glade_gtk_size_group_read_widget</read-widget-function>
<write-widget-function>glade_gtk_size_group_write_widget</write-widget-function>
<set-property-function>glade_gtk_size_group_set_property</set-property-function>
<properties>
<property id="widgets" _name="Widgets" save="False">
<_tooltip>List of widgets in this group</_tooltip>
<spec>glade_standard_objects_spec</spec>
</property>
</properties>
</glade-widget-class>
<glade-widget-class name="GtkSizeGroup" generic-name="sizegroup" _title="Size Group"/>
<glade-widget-class name="GtkTextBuffer" generic-name="textbuffer" _title="Text Buffer"/>
<glade-widget-class name="GtkTextTag" generic-name="texttag" _title="Text Tag"/>
<glade-widget-class name="GtkTextTagTable" generic-name="texttagtable" _title="Text Tag Table"/>
......
......@@ -647,7 +647,7 @@ project_selection_changed_cb (GladeProject *project, GladeWindow *window)
/* Only update the toolbar & workspace if the selection has changed on
* the currently active project.
*/
if (project == glade_app_get_project ())
if (project && (project == glade_app_get_project ()))
{
list = glade_project_selection_get (project);
num = g_list_length (list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment