Commit 407d879fcc54799a411c0d43cc325e96b30252ca

  • avatar
  • ssam
  • Sat Aug 15 02:15:27 CEST 2009
[gsettings] Read and write bindings from file.
  
10401040 GladeProjectFormat fmt;
10411041 GValue *gvalue = NULL;
10421042 gchar /* *id, *name, */ *value;
1043 gchar *setting;
10431044 gint translatable = FALSE, has_context = FALSE;
10441045 gchar *comment = NULL, *context = NULL;
10451046
10831083 property->enabled = TRUE;
10841084 }
10851085
1086 setting = glade_xml_get_property_string
1087 (prop, GLADE_TAG_SETTING);
1088
1089 glade_property_set_binding (property, setting);
1090
10861091 translatable = glade_xml_get_property_boolean
10871092 (prop, GLADE_TAG_TRANSLATABLE, FALSE);
10881093 comment = glade_xml_get_property_string
11571157 g_assert (property->klass->def);
11581158
11591159 /* Skip properties that are default by original pspec default
1160 * (excepting those that specified otherwise).
1160 * (excepting those that specified otherwise, and those with setting
1161 * bindings).
11611162 */
11621163 if (!(property->klass->save_always || property->save_always) &&
1164 !(/*FIXME: property->klass->bindable && */property->key != NULL) &&
11631165 glade_property_original_default (property))
11641166 return;
11651167
11921192 /* Name and value */
11931193 glade_xml_node_set_property_string (prop_node, GLADE_XML_TAG_NAME, name);
11941194 glade_xml_set_content (prop_node, value);
1195
1196 /* GSettings binding */
1197 /* FIXME:
1198 if (property->klass->bindable)
1199 {*/
1200 /* FIXME: make sure versioning is applied */
1201 if (property->key != NULL)
1202 glade_xml_node_set_property_string (prop_node,
1203 GLADE_TAG_SETTING,
1204 property->key);
11951205
11961206 /* i18n stuff */
11971207 if (property->klass->translatable)
  
4444 GladeProperty *property,
4545 GtkTreeIter *iter)
4646{
47 GtkTreeIter temp_iter;
47 GtkTreeIter temp_iter;
48 gchar *setting = property->key;
4849 if (iter == NULL)
4950 iter = &temp_iter;
51 if (setting == NULL)
52 setting = KEY_DEFAULT;
5053
5154 GladePropertyClass *property_class = property->klass;;
5255
5858 gtk_list_store_set (GTK_LIST_STORE (self->data), iter,
5959 GLADE_SETTINGS_EDITOR_COLUMN_PROPERTY, property,
6060 GLADE_SETTINGS_EDITOR_COLUMN_PROPERTY_NAME, property_class->name,
61 GLADE_SETTINGS_EDITOR_COLUMN_KEY_NAME, KEY_DEFAULT,
61 GLADE_SETTINGS_EDITOR_COLUMN_KEY_NAME, setting,
6262 -1);
6363};
6464
  
172172#define GLADE_TAG_ID "id"
173173#define GLADE_TAG_KEY "key"
174174#define GLADE_TAG_VALUE "value"
175#define GLADE_TAG_SETTING "setting"
175176#define GLADE_TAG_TRANSLATABLE "translatable"
176177#define GLADE_TAG_HAS_CONTEXT "context"
177178#define GLADE_TAG_CONTEXT "context"