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

Added 'default-palette-state' element and attribute declarations.


	* widgets/glade-catalog.dtd: Added 'default-palette-state'
	  element and attribute declarations.

	* widgets/gtk+.xml.in, widgets/gnome.xml.in:
	  o Obsolete widget groups are now marked as unexpanded in the
	    palette by default.
	  o Add support for GtkIconView.

	* src/glade-catalog.[ch], src/glade-palette.c:
	  o Add support for parsing 'default-palette-state' catalog tag.
	  o GladePalette now sets the expanded state for widget groups
	    from glade_widget_group_get_expanded().

	* glade-3.desktop.in: Add "GenericName" field, set
	  to "User Interface Designer".
parent b1c78e0f
2006-06-25 Vincent Geddes <vgeddes@metroweb.co.za>
* widgets/glade-catalog.dtd: Added 'default-palette-state'
element and attribute declarations.
* widgets/gtk+.xml.in, widgets/gnome.xml.in:
o Obsolete widget groups are now marked as unexpanded in the
palette by default.
o Add support for GtkIconView.
* src/glade-catalog.[ch], src/glade-palette.c:
o Add support for parsing 'default-palette-state' catalog tag.
o GladePalette now sets the expanded state for widget groups
from glade_widget_group_get_expanded().
* glade-3.desktop.in: Add "GenericName" field, set
to "User Interface Designer".
2006-06-25 Tristan Van Berkom <tvb@gnome.org>
* src/glade-widget.[ch]:
......
[Desktop Entry]
Encoding=UTF-8
_Name=Glade 3 Interface Designer
_GenericName=User Interface Designer
_Comment=Create or open user interface designs for GTK+ applications
Exec=glade-3 %F
Terminal=false
......
......@@ -71,7 +71,10 @@ struct _GladeCatalog
struct _GladeWidgetGroup
{
gchar *name; /* Group name */
gchar *title; /* Group name on palette */
gchar *title; /* Group name in the palette */
gboolean expanded; /* Whether group is expanded in the palette */
GList *widget_classes; /* List of classes in the palette */
};
......@@ -292,6 +295,7 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
group->name = glade_xml_get_property_string (group_node,
GLADE_TAG_NAME);
if (!group->name)
{
g_warning ("Required property 'name' not found in group node");
......@@ -310,6 +314,9 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
return FALSE;
}
/* by default, group is expanded in palette */
group->expanded = TRUE;
/* Translate it */
group->title = dgettext (catalog->domain ?
catalog->domain : catalog->library,
......@@ -326,28 +333,35 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
node_name = glade_xml_node_get_name (node);
if (strcmp (node_name, GLADE_TAG_GLADE_WIDGET_CLASS_REF) != 0)
continue;
name = glade_xml_get_property_string (node, GLADE_TAG_NAME);
if (!name)
if (strcmp (node_name, GLADE_TAG_GLADE_WIDGET_CLASS_REF) == 0)
{
g_warning ("Couldn't find required property on %s",
GLADE_TAG_GLADE_WIDGET_CLASS);
continue;
}
name = glade_xml_get_property_string (node, GLADE_TAG_NAME);
if (!name)
{
g_warning ("Couldn't find required property on %s",
GLADE_TAG_GLADE_WIDGET_CLASS);
continue;
}
widget_class = glade_widget_class_get_by_name (name);
if (!widget_class)
{
g_warning ("Tried to include undefined widget class '%s' in a widget group", name);
widget_class = glade_widget_class_get_by_name (name);
if (!widget_class)
{
g_warning ("Tried to include undefined widget class '%s' in a widget group", name);
g_free (name);
continue;
}
g_free (name);
continue;
}
g_free (name);
group->widget_classes = g_list_prepend (group->widget_classes,
widget_class);
group->widget_classes = g_list_prepend (group->widget_classes,
widget_class);
}
else if (strcmp (node_name, GLADE_TAG_DEFAULT_PALETTE_STATE) == 0)
{
group->expanded =
glade_xml_get_property_boolean
(node, GLADE_TAG_EXPANDED, group->expanded);
}
}
group->widget_classes = g_list_reverse (group->widget_classes);
......@@ -489,6 +503,14 @@ glade_widget_group_get_title (GladeWidgetGroup *group)
return group->title;
}
gboolean
glade_widget_group_get_expanded (GladeWidgetGroup *group)
{
g_return_val_if_fail (group != NULL, FALSE);
return group->expanded;
}
GList *
glade_widget_group_get_widget_classes (GladeWidgetGroup *group)
{
......
......@@ -51,6 +51,8 @@ const gchar * glade_widget_group_get_name (GladeWidgetGroup *group);
LIBGLADEUI_API
const gchar * glade_widget_group_get_title (GladeWidgetGroup *group);
LIBGLADEUI_API
gboolean glade_widget_group_get_expanded (GladeWidgetGroup *group);
LIBGLADEUI_API
GList * glade_widget_group_get_widget_classes (GladeWidgetGroup *group);
LIBGLADEUI_API
......
......@@ -311,7 +311,6 @@ glade_palette_new_item_group (GladePalette *palette, GladeWidgetGroup *group)
GtkWidget *expander;
GtkWidget *box;
GtkWidget *item;
GtkWidget *vbox;
GList *l;
gchar *title;
......@@ -339,10 +338,11 @@ glade_palette_new_item_group (GladePalette *palette, GladeWidgetGroup *group)
expander = glade_palette_expander_new (title);
glade_palette_expander_set_spacing (GLADE_PALETTE_EXPANDER (expander), 2);
glade_palette_expander_set_use_markup (GLADE_PALETTE_EXPANDER (expander), TRUE);
glade_palette_expander_set_expanded (GLADE_PALETTE_EXPANDER (expander), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (expander), 1);
vbox = gtk_vbox_new (FALSE, 0);
/* set default expanded state */
glade_palette_expander_set_expanded (GLADE_PALETTE_EXPANDER (expander),
glade_widget_group_get_expanded (group));
gtk_container_add (GTK_CONTAINER (expander), box);
......
......@@ -52,7 +52,6 @@ typedef enum _GladeItemAppearance GladeItemAppearance;
#define GLADE_TAG_YES "Yes"
#define GLADE_TAG_NO "No"
#define GLADE_ENUM_DATA_TAG "GladeEnumDataTag"
#define GLADE_TAG_IN_PALETTE "InPalette"
#define GLADE_TAG_EVENT_HANDLER_CONNECTED "EventHandlerConnected"
......@@ -86,6 +85,7 @@ typedef enum _GladeItemAppearance GladeItemAppearance;
#define GLADE_TAG_SIGNAL_NAME "signal-name"
#define GLADE_TAG_DEFAULT "default"
#define GLADE_TAG_DISABLED "disabled"
#define GLADE_TAG_DEFAULT_PALETTE_STATE "default-palette-state"
#define GLADE_TAG_REPLACE_CHILD_FUNCTION "replace-child-function"
#define GLADE_TAG_POST_CREATE_FUNCTION "post-create-function"
#define GLADE_TAG_GET_INTERNAL_CHILD_FUNCTION "get-internal-child-function"
......@@ -110,6 +110,7 @@ typedef enum _GladeItemAppearance GladeItemAppearance;
#define GLADE_TAG_OPTIONAL "optional"
#define GLADE_TAG_OPTIONAL_DEFAULT "optional-default"
#define GLADE_TAG_VISIBLE "visible"
#define GLADE_TAG_EXPANDED "expanded"
#define GLADE_TAG_GENERIC_NAME "generic-name"
#define GLADE_TAG_NAME "name"
#define GLADE_TAG_TITLE "title"
......
......@@ -81,11 +81,15 @@
<!ELEMENT get-internal-child-function (#PCDATA)>
<!ELEMENT child-property-applies-function (#PCDATA)>
<!ELEMENT glade-widget-group (glade-widget-class-ref+)>
<!ELEMENT glade-widget-group (default-palette-state?,
glade-widget-class-ref+)>
<!ATTLIST glade-widget-group name CDATA #REQUIRED
title CDATA #REQUIRED>
<!ELEMENT default-palette-state EMPTY>
<!ATTLIST default-palette-state expanded CDATA #IMPLIED>
<!ELEMENT glade-widget-class-ref EMPTY>
<!ATTLIST glade-widget-class-ref name CDATA #REQUIRED>
......
......@@ -419,6 +419,7 @@
</glade-widget-classes>
<glade-widget-group name="gnomeui-base" _title="GNOME User Interface">
<glade-widget-class-ref name="GnomeApp"/>
<glade-widget-class-ref name="GnomeDruid"/>
<glade-widget-class-ref name="GnomeIconSelection"/>
......@@ -429,6 +430,9 @@
</glade-widget-group>
<glade-widget-group name="gnomeui-obsolete" _title="GNOME UI Obsolete">
<default-palette-state expanded="False" />
<glade-widget-class-ref name="GnomeDialog"/>
<glade-widget-class-ref name="GnomeAbout"/>
<glade-widget-class-ref name="GnomeMessageBox"/>
......
......@@ -654,6 +654,8 @@
</properties>
</glade-widget-class>
<glade-widget-class name="GtkIconView" generic-name="iconview" _title="Icon View" />
<glade-widget-class name="GtkProgressBar" generic-name="progressbar" _title="Progress Bar">
<properties>
<property id="activity-blocks" disabled="True"/>
......@@ -1325,7 +1327,9 @@
<glade-widget-class-ref name="GtkComboBox"/>
<glade-widget-class-ref name="GtkComboBoxEntry"/>
<glade-widget-class-ref name="GtkProgressBar"/>
<glade-widget-class-ref name="GtkTreeView"/>
<glade-widget-class-ref name="GtkIconView"/>
<glade-widget-class-ref name="GtkHandleBox"/>
<glade-widget-class-ref name="GtkStatusbar"/>
......@@ -1339,6 +1343,9 @@
</glade-widget-group>
<glade-widget-group name="gtk-obsolete" _title="Gtk+ Obsolete">
<default-palette-state expanded="False" />
<glade-widget-class-ref name="GtkCombo"/>
<glade-widget-class-ref name="GtkOptionMenu"/>
<glade-widget-class-ref name="GtkHRuler"/>
......
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