Commit 95725e4843da6674d27373aad0cd345f60a47d83
- Diff rendering mode:
- inline
- side by side
gladeui/glade-property.c
(33 / 1)
|   | |||
| 70 | 70 | PROP_CLASS, | |
| 71 | 71 | PROP_ENABLED, | |
| 72 | 72 | PROP_SENSITIVE, | |
| 73 | PROP_SETTINGS_KEY, | ||
| 73 | 74 | PROP_I18N_TRANSLATABLE, | |
| 74 | 75 | PROP_I18N_HAS_CONTEXT, | |
| 75 | 76 | PROP_I18N_CONTEXT, | |
| … | … | ||
| 116 | 116 | glade_property_set_enabled (property, template_prop->enabled); | |
| 117 | 117 | glade_property_set_sensitive (property, template_prop->sensitive, | |
| 118 | 118 | template_prop->insensitive_tooltip); | |
| 119 | |||
| 119 | |||
| 120 | glade_property_set_binding (property, template_prop->key); | ||
| 121 | |||
| 120 | 122 | return property; | |
| 121 | 123 | } | |
| 122 | 124 | ||
| … | … | ||
| 437 | 437 | case PROP_SENSITIVE: | |
| 438 | 438 | property->sensitive = g_value_get_boolean (value); | |
| 439 | 439 | break; | |
| 440 | case PROP_SETTINGS_KEY: | ||
| 441 | property->key = g_value_dup_string (value); | ||
| 442 | break; | ||
| 440 | 443 | case PROP_I18N_TRANSLATABLE: | |
| 441 | 444 | glade_property_i18n_set_translatable (property, g_value_get_boolean (value)); | |
| 442 | 445 | break; | |
| … | … | ||
| 477 | 477 | case PROP_SENSITIVE: | |
| 478 | 478 | g_value_set_boolean (value, glade_property_get_sensitive (property)); | |
| 479 | 479 | break; | |
| 480 | case PROP_SETTINGS_KEY: | ||
| 481 | g_value_set_string (value, glade_property_get_binding (property)); | ||
| 482 | break; | ||
| 480 | 483 | case PROP_I18N_TRANSLATABLE: | |
| 481 | 484 | g_value_set_boolean (value, glade_property_i18n_get_translatable (property)); | |
| 482 | 485 | break; | |
| … | … | ||
| 511 | 511 | g_value_unset (property->value); | |
| 512 | 512 | g_free (property->value); | |
| 513 | 513 | } | |
| 514 | if (property->key) | ||
| 515 | g_free (property->key); | ||
| 514 | 516 | if (property->i18n_comment) | |
| 515 | 517 | g_free (property->i18n_comment); | |
| 516 | 518 | if (property->i18n_context) | |
| … | … | ||
| 530 | 530 | { | |
| 531 | 531 | property->enabled = TRUE; | |
| 532 | 532 | property->sensitive = TRUE; | |
| 533 | property->key = NULL; | ||
| 533 | 534 | property->i18n_translatable = TRUE; | |
| 534 | 535 | property->i18n_has_context = FALSE; | |
| 535 | 536 | property->i18n_comment = NULL; | |
| … | … | ||
| 583 | 583 | _("This gives backends control to set property sensitivity"), | |
| 584 | 584 | TRUE, G_PARAM_READWRITE)); | |
| 585 | 585 | ||
| 586 | g_object_class_install_property | ||
| 587 | (object_class, PROP_SETTINGS_KEY, | ||
| 588 | g_param_spec_string | ||
| 589 | ("settings-key", _("Settings Key"), | ||
| 590 | _("Settings key the property is bound to."), | ||
| 591 | NULL, G_PARAM_READWRITE)); | ||
| 592 | |||
| 586 | 593 | g_object_class_install_property | |
| 587 | 594 | (object_class, PROP_I18N_CONTEXT, | |
| 588 | 595 | g_param_spec_string | |
| … | … | ||
| 1513 | 1513 | { | |
| 1514 | 1514 | return glade_property_su_stack > 0; | |
| 1515 | 1515 | } | |
| 1516 | |||
| 1517 | void | ||
| 1518 | glade_property_set_binding (GladeProperty *property, | ||
| 1519 | const gchar *key) { | ||
| 1520 | g_free (property->key); | ||
| 1521 | |||
| 1522 | property->key = g_strdup (key); | ||
| 1523 | }; | ||
| 1524 | |||
| 1525 | const gchar * | ||
| 1526 | glade_property_get_binding (GladeProperty *property) { | ||
| 1527 | return property->key; | ||
| 1528 | }; |
gladeui/glade-property.h
(8 / 0)
|   | |||
| 43 | 43 | GValue *value; /* The value of the property | |
| 44 | 44 | */ | |
| 45 | 45 | ||
| 46 | gchar *key; /* Binding to setting | ||
| 47 | */ | ||
| 48 | |||
| 46 | 49 | gchar *insensitive_tooltip; /* Tooltip to display when in insensitive state | |
| 47 | 50 | * (used to explain why the property is | |
| 48 | 51 | * insensitive) | |
| … | … | ||
| 221 | 221 | void glade_property_pop_superuser (void); | |
| 222 | 222 | ||
| 223 | 223 | gboolean glade_property_superuser (void); | |
| 224 | |||
| 225 | void glade_property_set_binding (GladeProperty *property, | ||
| 226 | const gchar *key); | ||
| 227 | |||
| 228 | const gchar *glade_property_get_binding (GladeProperty *property); | ||
| 224 | 229 | ||
| 225 | 230 | G_END_DECLS | |
| 226 | 231 |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

