mirror of
https://gitlab.gnome.org/GNOME/glade.git
synced 2025-10-07 00:14:16 -04:00
Get rid of property_class->update_signals: they were unused, broken and glade-2 doesn't behave like that anyway.
This commit is contained in:
parent
3df13dd998
commit
f790748ae0
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2003-10-31 Paolo Borelli <pborelli@katamail.com>
|
||||||
|
|
||||||
|
* src/glade-gtk.c: remove not needed functions.
|
||||||
|
* src/glade-property-class.[ch]: get rid of updated_signlas, it was
|
||||||
|
unused, broken and glade-2 doesn't work like that anyway.
|
||||||
|
* src/glade-widget-class.c: update for the above.
|
||||||
|
* src/glade-widget.c: update for the above. Also return FALSE on the
|
||||||
|
key_pressed callback so that it is possible to type in a GtkEntry.
|
||||||
|
* src/glade.h: update for the above.
|
||||||
|
* widgets/gtkentry.xml: remove.
|
||||||
|
* widgets/gtktogglebutton.xml: update for the above.
|
||||||
|
* widgets/gtkcheckbutton.xml: ditto.
|
||||||
|
* widgets/gtk-base.xml: readd the files for toggle and check buttons.
|
||||||
|
|
||||||
2003-10-27 Paolo Borelli <pborelli@katamail.com>
|
2003-10-27 Paolo Borelli <pborelli@katamail.com>
|
||||||
|
|
||||||
* src/glade-property.[ch]: janitoring; remove an old prototype and
|
* src/glade-property.[ch]: janitoring; remove an old prototype and
|
||||||
|
@ -34,40 +34,6 @@
|
|||||||
#include "glade-command.h"
|
#include "glade-command.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
glade_gtk_entry_set_text (GObject *object, GValue *value)
|
|
||||||
{
|
|
||||||
GtkEditable *editable = GTK_EDITABLE (object);
|
|
||||||
gint pos;
|
|
||||||
gint insert_pos = 0;
|
|
||||||
const gchar *text = g_value_get_string (value);
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_EDITABLE (object));
|
|
||||||
|
|
||||||
pos = gtk_editable_get_position (editable);
|
|
||||||
gtk_editable_delete_text (editable, 0, -1);
|
|
||||||
/* FIXME: will not work with multibyte languages (strlen) */
|
|
||||||
gtk_editable_insert_text (editable,
|
|
||||||
text,
|
|
||||||
strlen (text),
|
|
||||||
&insert_pos);
|
|
||||||
gtk_editable_set_position (editable, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
glade_gtk_entry_get_text (GObject *object, GValue *value)
|
|
||||||
{
|
|
||||||
GtkEntry *entry = GTK_ENTRY (object);
|
|
||||||
|
|
||||||
const gchar *text;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
|
||||||
|
|
||||||
text = gtk_entry_get_text (entry);
|
|
||||||
|
|
||||||
g_value_set_string (value, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glade_gtk_option_menu_set_items (GObject *object, GValue *value)
|
glade_gtk_option_menu_set_items (GObject *object, GValue *value)
|
||||||
{
|
{
|
||||||
@ -581,21 +547,6 @@ glade_gtk_message_dialog_post_create (GObject *object)
|
|||||||
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 115);
|
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 115);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
glade_gtk_check_button_post_create (GObject *object)
|
|
||||||
{
|
|
||||||
GtkCheckButton *button = GTK_CHECK_BUTTON (object);
|
|
||||||
GtkWidget *label;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
|
|
||||||
|
|
||||||
label = gtk_label_new ("");
|
|
||||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
||||||
gtk_container_add (GTK_CONTAINER (button), label);
|
|
||||||
gtk_widget_show (label);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glade_gtk_table_post_create (GObject *object)
|
glade_gtk_table_post_create (GObject *object)
|
||||||
{
|
{
|
||||||
|
@ -340,16 +340,6 @@ glade_property_class_clone (GladePropertyClass *property_class)
|
|||||||
/* if (clon->child)
|
/* if (clon->child)
|
||||||
clon->child = glade_widget_class_clone (clon->child); */
|
clon->child = glade_widget_class_clone (clon->child); */
|
||||||
|
|
||||||
if (clon->update_signals)
|
|
||||||
{
|
|
||||||
GList *signals;
|
|
||||||
|
|
||||||
clon->update_signals = g_list_copy (clon->update_signals);
|
|
||||||
|
|
||||||
for (signals = clon->update_signals; signals != NULL; signals = signals->next)
|
|
||||||
signals->data = g_strdup ((const char *) signals->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return clon;
|
return clon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,8 +361,6 @@ glade_property_class_free (GladePropertyClass *class)
|
|||||||
g_list_free (class->choices);
|
g_list_free (class->choices);
|
||||||
glade_property_query_free (class->query);
|
glade_property_query_free (class->query);
|
||||||
glade_widget_class_free (class->child);
|
glade_widget_class_free (class->child);
|
||||||
g_list_foreach (class->update_signals, (GFunc) g_free, NULL);
|
|
||||||
g_list_free (class->update_signals);
|
|
||||||
g_free (class);
|
g_free (class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,32 +806,6 @@ glade_property_class_load_from_param_spec (const gchar *name,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static GList *
|
|
||||||
glade_xml_read_list (GladeXmlNode *node, const gchar *list_tag, const gchar *item_tag)
|
|
||||||
{
|
|
||||||
GladeXmlNode *child;
|
|
||||||
GList *list = NULL;
|
|
||||||
gchar *item;
|
|
||||||
|
|
||||||
child = glade_xml_search_child (node, list_tag);
|
|
||||||
if (child == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
child = glade_xml_node_get_children (child);
|
|
||||||
|
|
||||||
for (; child != NULL; child = glade_xml_node_next (child)) {
|
|
||||||
if (!glade_xml_node_verify (child, item_tag))
|
|
||||||
return NULL;
|
|
||||||
item = glade_xml_get_content (child);
|
|
||||||
if (item != NULL)
|
|
||||||
list = g_list_prepend (list, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
list = g_list_reverse (list);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* glade_property_class_update_from_node:
|
* glade_property_class_update_from_node:
|
||||||
* @node: the <property> node
|
* @node: the <property> node
|
||||||
@ -964,11 +926,6 @@ glade_property_class_update_from_node (GladeXmlNode *node,
|
|||||||
if (class->optional)
|
if (class->optional)
|
||||||
class->optional_default = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, FALSE);
|
class->optional_default = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, FALSE);
|
||||||
|
|
||||||
/* The list of signals that we should listen to */
|
|
||||||
class->update_signals = glade_xml_read_list (node,
|
|
||||||
GLADE_TAG_UPDATE_SIGNALS,
|
|
||||||
GLADE_TAG_SIGNAL_NAME);
|
|
||||||
|
|
||||||
/* If this property can't be set with g_object_set, get the workarround
|
/* If this property can't be set with g_object_set, get the workarround
|
||||||
* function
|
* function
|
||||||
*/
|
*/
|
||||||
|
@ -156,15 +156,6 @@ struct _GladePropertyClass
|
|||||||
* the type is object.
|
* the type is object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GList *update_signals; /* A list of gchar * that contains the signal names that
|
|
||||||
* this property should be listening to update itself.
|
|
||||||
* For example the gtkentry wants to listen to the "change"
|
|
||||||
* signal so that the "content" of the entry is updated and
|
|
||||||
* stored when it is changed. A toggle button should listen to
|
|
||||||
* the "toggled" signal to get the state of the property
|
|
||||||
* from the real widget
|
|
||||||
*/
|
|
||||||
|
|
||||||
gboolean common; /* Common properties go in the common tab */
|
gboolean common; /* Common properties go in the common tab */
|
||||||
gboolean packing; /* Packing properties go in the packing tab */
|
gboolean packing; /* Packing properties go in the packing tab */
|
||||||
gboolean get_default; /* If true, when the default property is applied it is queried
|
gboolean get_default; /* If true, when the default property is applied it is queried
|
||||||
|
@ -165,7 +165,6 @@ glade_widget_class_list_properties (GladeWidgetClass *class)
|
|||||||
}
|
}
|
||||||
|
|
||||||
property_class->optional = FALSE;
|
property_class->optional = FALSE;
|
||||||
property_class->update_signals = NULL;
|
|
||||||
|
|
||||||
list = g_list_prepend (list, property_class);
|
list = g_list_prepend (list, property_class);
|
||||||
}
|
}
|
||||||
@ -203,21 +202,11 @@ glade_widget_class_list_child_properties (GladeWidgetClass *class)
|
|||||||
|
|
||||||
specs = gtk_container_class_list_child_properties (object_class, &n_specs);
|
specs = gtk_container_class_list_child_properties (object_class, &n_specs);
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
g_print ("class %s has n child props: %d\n", class->name, n_specs);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < n_specs; i++) {
|
for (i = 0; i < n_specs; i++) {
|
||||||
spec = specs[i];
|
spec = specs[i];
|
||||||
|
|
||||||
property_class = glade_property_class_new_from_spec (spec);
|
property_class = glade_property_class_new_from_spec (spec);
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
g_print ("child prop. name: %s, id: %s, type: %d\n", property_class->name, property_class->id, property_class->type);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
property_class->optional = FALSE;
|
property_class->optional = FALSE;
|
||||||
property_class->update_signals = NULL;
|
|
||||||
property_class->packing = TRUE;
|
property_class->packing = TRUE;
|
||||||
|
|
||||||
list = g_list_prepend (list, property_class);
|
list = g_list_prepend (list, property_class);
|
||||||
|
@ -430,7 +430,7 @@ glade_widget_key_press (GtkWidget *event_widget,
|
|||||||
if (event->keyval == GDK_Delete)
|
if (event->keyval == GDK_Delete)
|
||||||
glade_util_delete_selection (glade_widget->project);
|
glade_util_delete_selection (glade_widget->project);
|
||||||
|
|
||||||
return TRUE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -478,59 +478,6 @@ glade_widget_set_contents (GladeWidget *widget)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
glade_widget_property_changed_cb (GtkWidget *w)
|
|
||||||
{
|
|
||||||
GladeProperty *property;
|
|
||||||
GladeWidget *widget;
|
|
||||||
|
|
||||||
widget = glade_widget_get_from_gtk_widget (w);
|
|
||||||
g_return_if_fail (GLADE_IS_WIDGET (widget));
|
|
||||||
property = g_object_get_data (G_OBJECT (w), GLADE_MODIFY_PROPERTY_DATA);
|
|
||||||
g_return_if_fail (GLADE_IS_PROPERTY (property));
|
|
||||||
|
|
||||||
if (property->loading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
glade_property_get_from_widget (property);
|
|
||||||
|
|
||||||
glade_property_refresh (property);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
glade_widget_connect_edit_signals_with_class (GladeWidget *widget,
|
|
||||||
GladePropertyClass *class)
|
|
||||||
{
|
|
||||||
GladeProperty *property;
|
|
||||||
GList *list;
|
|
||||||
|
|
||||||
property = glade_widget_get_property_from_class (widget, class);
|
|
||||||
|
|
||||||
g_return_if_fail (GLADE_IS_PROPERTY (property));
|
|
||||||
|
|
||||||
for (list = class->update_signals; list; list = list->next) {
|
|
||||||
g_signal_connect_after (G_OBJECT (widget->widget), list->data,
|
|
||||||
G_CALLBACK (glade_widget_property_changed_cb),
|
|
||||||
property);
|
|
||||||
g_object_set_data (G_OBJECT (widget->widget),
|
|
||||||
GLADE_MODIFY_PROPERTY_DATA, property);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
glade_widget_connect_edit_signals (GladeWidget *widget)
|
|
||||||
{
|
|
||||||
GladePropertyClass *class;
|
|
||||||
GList *list;
|
|
||||||
|
|
||||||
for (list = widget->class->properties; list; list = list->next) {
|
|
||||||
class = list->data;
|
|
||||||
if (class->update_signals)
|
|
||||||
glade_widget_connect_edit_signals_with_class (widget,
|
|
||||||
class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
glade_widget_connect_other_signals (GladeWidget *widget)
|
glade_widget_connect_other_signals (GladeWidget *widget)
|
||||||
{
|
{
|
||||||
@ -610,7 +557,6 @@ glade_widget_connect_signals (GladeWidget *widget)
|
|||||||
{
|
{
|
||||||
glade_widget_connect_mouse_signals (widget);
|
glade_widget_connect_mouse_signals (widget);
|
||||||
glade_widget_connect_keyboard_signals (widget);
|
glade_widget_connect_keyboard_signals (widget);
|
||||||
glade_widget_connect_edit_signals (widget);
|
|
||||||
glade_widget_connect_other_signals (widget);
|
glade_widget_connect_other_signals (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@
|
|||||||
#define GLADE_TAG_VISIBLE_LINES "VisibleLines"
|
#define GLADE_TAG_VISIBLE_LINES "VisibleLines"
|
||||||
#define GLADE_ENUM_DATA_TAG "GladeEnumDataTag"
|
#define GLADE_ENUM_DATA_TAG "GladeEnumDataTag"
|
||||||
#define GLADE_FLAGS_DATA_TAG "GladeFlagsDataTag"
|
#define GLADE_FLAGS_DATA_TAG "GladeFlagsDataTag"
|
||||||
#define GLADE_TAG_UPDATE_SIGNALS "UpdateSignals"
|
|
||||||
#define GLADE_TAG_SIGNAL_NAME "SignalName"
|
#define GLADE_TAG_SIGNAL_NAME "SignalName"
|
||||||
#define GLADE_TAG_DEFAULT "Default"
|
#define GLADE_TAG_DEFAULT "Default"
|
||||||
#define GLADE_TAG_DISABLED "Disabled"
|
#define GLADE_TAG_DISABLED "Disabled"
|
||||||
|
@ -10,7 +10,6 @@ widgets_DATA = \
|
|||||||
gtkcheckbutton.xml \
|
gtkcheckbutton.xml \
|
||||||
gtkcontainer.xml \
|
gtkcontainer.xml \
|
||||||
gtkdialog.xml \
|
gtkdialog.xml \
|
||||||
gtkentry.xml \
|
|
||||||
gtkframe.xml \
|
gtkframe.xml \
|
||||||
gtkhandlebox.xml \
|
gtkhandlebox.xml \
|
||||||
gtkmenubar.xml \
|
gtkmenubar.xml \
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
<GladeWidget name="GtkTextView" generic_name="textview"/>
|
<GladeWidget name="GtkTextView" generic_name="textview"/>
|
||||||
|
|
||||||
<GladeWidget name="GtkButton" generic_name="button" filename="gtkbutton.xml"/>
|
<GladeWidget name="GtkButton" generic_name="button" filename="gtkbutton.xml"/>
|
||||||
<GladeWidget name="GtkToggleButton" generic_name="togglebutton"/>
|
<GladeWidget name="GtkToggleButton" generic_name="togglebutton" filename="gtktogglebutton.xml"/>
|
||||||
<GladeWidget name="GtkCheckButton" generic_name="checkbutton"/>
|
<GladeWidget name="GtkCheckButton" generic_name="checkbutton" filename="gtkcheckbutton.xml"/>
|
||||||
<GladeWidget name="GtkSpinButton" generic_name="spinbutton"/>
|
<GladeWidget name="GtkSpinButton" generic_name="spinbutton"/>
|
||||||
<GladeWidget name="GtkRadioButton" generic_name="radiobutton"/>
|
<GladeWidget name="GtkRadioButton" generic_name="radiobutton"/>
|
||||||
|
|
||||||
|
@ -1,21 +1,7 @@
|
|||||||
<GladeWidgetClass>
|
<GladeWidgetClass>
|
||||||
<Name>GtkCheckButton</Name>
|
|
||||||
<GenericName>checkbutton</GenericName>
|
|
||||||
<Toplevel>False</Toplevel>
|
|
||||||
<PostCreateFunction>glade_gtk_check_button_post_create</PostCreateFunction>
|
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
|
|
||||||
<Property Id="border-width"/>
|
|
||||||
<Property Id="label"/>
|
|
||||||
<Property Id="active">
|
|
||||||
<UpdateSignals>
|
|
||||||
<SignalName>toggled</SignalName>
|
|
||||||
</UpdateSignals>
|
|
||||||
</Property>
|
|
||||||
|
|
||||||
<Property Id="draw-indicator" Default="True"/>
|
<Property Id="draw-indicator" Default="True"/>
|
||||||
|
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
</GladeWidgetClass>
|
</GladeWidgetClass>
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<GladeWidgetClass>
|
|
||||||
|
|
||||||
<Properties>
|
|
||||||
|
|
||||||
<Property Id="editable"/>
|
|
||||||
<Property Id="visibility"/>
|
|
||||||
<Property Id="max-length"/>
|
|
||||||
|
|
||||||
<Property Id="text" Name="Text">
|
|
||||||
<Type>String</Type>
|
|
||||||
<Tooltip>Initial Contents of the entry</Tooltip>
|
|
||||||
<SetFunction>glade_gtk_entry_set_text</SetFunction>
|
|
||||||
<GetFunction>glade_gtk_entry_get_text</GetFunction>
|
|
||||||
<UpdateSignals>
|
|
||||||
<SignalName>changed</SignalName>
|
|
||||||
</UpdateSignals>
|
|
||||||
</Property>
|
|
||||||
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
</GladeWidgetClass>
|
|
@ -1,21 +1,7 @@
|
|||||||
<GladeWidgetClass>
|
<GladeWidgetClass>
|
||||||
<Name>GtkToggleButton</Name>
|
|
||||||
<GenericName>togglebutton</GenericName>
|
|
||||||
<Toplevel>False</Toplevel>
|
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property Id="active" Name="Initially On"/>
|
||||||
<Property Id="border-width"/>
|
|
||||||
<Property Id="label"/>
|
|
||||||
<Property Id="active">
|
|
||||||
<UpdateSignals>
|
|
||||||
<SignalName>toggled</SignalName>
|
|
||||||
</UpdateSignals>
|
|
||||||
</Property>
|
|
||||||
|
|
||||||
<Property Id="relief"/>
|
|
||||||
<Property Id="draw-indicator"/>
|
|
||||||
|
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
</GladeWidgetClass>
|
</GladeWidgetClass>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user