Commit 2ce2cec3b0bdb58794ec0604dd19c9a54e47452c
- Diff rendering mode:
- inline
- side by side
gladeui/glade-popup.c
(11 / 6)
|   | |||
| 739 | 739 | { | |
| 740 | 740 | ||
| 741 | 741 | GladeWidgetAdaptor *adaptor, *prop_adaptor; | |
| 742 | GtkWidget *popup_menu; | ||
| 742 | GtkWidget *popup_menu, *item; | ||
| 743 | 743 | gchar *book = NULL; | |
| 744 | 744 | gint button; | |
| 745 | 745 | gint event_time; | |
| … | … | ||
| 751 | 751 | ||
| 752 | 752 | popup_menu = gtk_menu_new (); | |
| 753 | 753 | ||
| 754 | /* Don't allow binding properties that it would be crazy to bind to, like packing ones */ | ||
| 755 | if (!property->klass->packing) | ||
| 756 | glade_popup_append_item (popup_menu, NULL, _("Connect to setting..."), NULL, | ||
| 757 | TRUE, glade_popup_connect_property_to_setting_cb, | ||
| 758 | property); | ||
| 754 | item = glade_popup_append_item (popup_menu, NULL, _("Connect to setting..."), NULL, | ||
| 755 | TRUE, glade_popup_connect_property_to_setting_cb, | ||
| 756 | property); | ||
| 757 | if (!property->klass->bindable) | ||
| 758 | { | ||
| 759 | gtk_widget_set_sensitive (item, FALSE); | ||
| 760 | if (property->klass->unbindable_reason != NULL) | ||
| 761 | gtk_widget_set_tooltip_text (item, property->klass->unbindable_reason); | ||
| 762 | } | ||
| 763 | |||
| 759 | 764 | ||
| 760 | 765 | glade_popup_append_item (popup_menu, GTK_STOCK_CLEAR, _("Set default value"), NULL, | |
| 761 | 766 | TRUE, glade_popup_clear_property_cb, property); |
gladeui/glade-property-class.c
(28 / 0)
|   | |||
| 101 | 101 | property_class->libglade_only = FALSE; | |
| 102 | 102 | property_class->libglade_unsupported = FALSE; | |
| 103 | 103 | property_class->parentless_widget = FALSE; | |
| 104 | property_class->bindable = TRUE; | ||
| 105 | property_class->unbindable_reason = NULL; | ||
| 104 | 106 | ||
| 105 | 107 | /* Initialize them to the base version */ | |
| 106 | 108 | property_class->version_since_major = GWA_VERSION_SINCE_MAJOR (handle); | |
| … | … | ||
| 1645 | 1645 | klass->optional_default = | |
| 1646 | 1646 | glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, | |
| 1647 | 1647 | klass->optional_default); | |
| 1648 | |||
| 1649 | /* work out if this property is bindable, from the above info */ | ||
| 1650 | if (klass->construct_only) | ||
| 1651 | { | ||
| 1652 | klass->bindable = FALSE; | ||
| 1653 | klass->unbindable_reason = _("Cannot connect this property to a setting, because " | ||
| 1654 | "it can only be set during the object's construction"); | ||
| 1655 | } | ||
| 1656 | else if (klass->packing) | ||
| 1657 | { | ||
| 1658 | klass->bindable = FALSE; | ||
| 1659 | klass->unbindable_reason = ("Cannot connect this property to a setting, because it " | ||
| 1660 | "is a packing property."); | ||
| 1661 | } | ||
| 1662 | else if (klass->libglade_only) | ||
| 1663 | { | ||
| 1664 | klass->bindable = FALSE; | ||
| 1665 | klass->unbindable_reason = ("Cannot connect this property to a setting, because it " | ||
| 1666 | "is only available in libglade and libglade does not " | ||
| 1667 | "setting connections."); | ||
| 1668 | } | ||
| 1669 | else | ||
| 1670 | { | ||
| 1671 | klass->bindable = TRUE; | ||
| 1672 | klass->unbindable_reason = NULL; | ||
| 1673 | } | ||
| 1648 | 1674 | ||
| 1649 | 1675 | /* notify that we changed the property class */ | |
| 1650 | 1676 | klass->is_modified = TRUE; |
|   | |||
| 177 | 177 | * in the project | |
| 178 | 178 | */ | |
| 179 | 179 | ||
| 180 | guint bindable : 1; /* True if the property can be bound to a GSettings key. | ||
| 181 | */ | ||
| 182 | gchar *unbindable_reason; /* If not bindable, this contains the reason. Used as a | ||
| 183 | * tooltip for the 'Connect to setting' menu item when it | ||
| 184 | * is insensitive. | ||
| 185 | */ | ||
| 186 | |||
| 180 | 187 | gdouble weight; /* This will determine the position of this property in | |
| 181 | 188 | * the editor. | |
| 182 | 189 | */ |
gladeui/glade-property.c
(3 / 2)
|   | |||
| 1086 | 1086 | setting = glade_xml_get_property_string | |
| 1087 | 1087 | (prop, GLADE_TAG_SETTING); | |
| 1088 | 1088 | ||
| 1089 | glade_property_set_binding (property, setting); | ||
| 1089 | if (property->klass->bindable) | ||
| 1090 | glade_property_set_binding (property, setting); | ||
| 1090 | 1091 | ||
| 1091 | 1092 | translatable = glade_xml_get_property_boolean | |
| 1092 | 1093 | (prop, GLADE_TAG_TRANSLATABLE, FALSE); | |
| … | … | ||
| 1162 | 1162 | * bindings). | |
| 1163 | 1163 | */ | |
| 1164 | 1164 | if (!(property->klass->save_always || property->save_always) && | |
| 1165 | !(/*FIXME: property->klass->bindable && */property->key != NULL) && | ||
| 1165 | !(property->klass->bindable && property->key != NULL) && | ||
| 1166 | 1166 | glade_property_original_default (property)) | |
| 1167 | 1167 | return; | |
| 1168 | 1168 |

