Commit 95725e4843da6674d27373aad0cd345f60a47d83

  • avatar
  • Sam Thursfield <sam @dja…go.(none)>
  • Tue Jul 21 23:15:39 GMT 2009
[gsettings] Add 'settings key' property to GladeProperty.
gladeui/glade-property.c
(33 / 1)
  
7070 PROP_CLASS,
7171 PROP_ENABLED,
7272 PROP_SENSITIVE,
73 PROP_SETTINGS_KEY,
7374 PROP_I18N_TRANSLATABLE,
7475 PROP_I18N_HAS_CONTEXT,
7576 PROP_I18N_CONTEXT,
116116 glade_property_set_enabled (property, template_prop->enabled);
117117 glade_property_set_sensitive (property, template_prop->sensitive,
118118 template_prop->insensitive_tooltip);
119
119
120 glade_property_set_binding (property, template_prop->key);
121
120122 return property;
121123}
122124
437437 case PROP_SENSITIVE:
438438 property->sensitive = g_value_get_boolean (value);
439439 break;
440 case PROP_SETTINGS_KEY:
441 property->key = g_value_dup_string (value);
442 break;
440443 case PROP_I18N_TRANSLATABLE:
441444 glade_property_i18n_set_translatable (property, g_value_get_boolean (value));
442445 break;
477477 case PROP_SENSITIVE:
478478 g_value_set_boolean (value, glade_property_get_sensitive (property));
479479 break;
480 case PROP_SETTINGS_KEY:
481 g_value_set_string (value, glade_property_get_binding (property));
482 break;
480483 case PROP_I18N_TRANSLATABLE:
481484 g_value_set_boolean (value, glade_property_i18n_get_translatable (property));
482485 break;
511511 g_value_unset (property->value);
512512 g_free (property->value);
513513 }
514 if (property->key)
515 g_free (property->key);
514516 if (property->i18n_comment)
515517 g_free (property->i18n_comment);
516518 if (property->i18n_context)
530530{
531531 property->enabled = TRUE;
532532 property->sensitive = TRUE;
533 property->key = NULL;
533534 property->i18n_translatable = TRUE;
534535 property->i18n_has_context = FALSE;
535536 property->i18n_comment = NULL;
583583 _("This gives backends control to set property sensitivity"),
584584 TRUE, G_PARAM_READWRITE));
585585
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
586593 g_object_class_install_property
587594 (object_class, PROP_I18N_CONTEXT,
588595 g_param_spec_string
15131513{
15141514 return glade_property_su_stack > 0;
15151515}
1516
1517void
1518glade_property_set_binding (GladeProperty *property,
1519 const gchar *key) {
1520 g_free (property->key);
1521
1522 property->key = g_strdup (key);
1523};
1524
1525const gchar *
1526glade_property_get_binding (GladeProperty *property) {
1527 return property->key;
1528};
gladeui/glade-property.h
(8 / 0)
  
4343 GValue *value; /* The value of the property
4444 */
4545
46 gchar *key; /* Binding to setting
47 */
48
4649 gchar *insensitive_tooltip; /* Tooltip to display when in insensitive state
4750 * (used to explain why the property is
4851 * insensitive)
221221void glade_property_pop_superuser (void);
222222
223223gboolean glade_property_superuser (void);
224
225void glade_property_set_binding (GladeProperty *property,
226 const gchar *key);
227
228const gchar *glade_property_get_binding (GladeProperty *property);
224229
225230G_END_DECLS
226231

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment