Diff of /trunk/src/relation_edit.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 153 by harbaum, Mon Mar 30 11:14:20 2009 UTC revision 154 by harbaum, Tue Mar 31 06:31:53 2009 UTC
# Line 40  static const guint LIST_OF_MEMBERS_DIALO Line 40  static const guint LIST_OF_MEMBERS_DIALO
40  /* --------------- relation dialog for an item (node or way) ----------- */  /* --------------- relation dialog for an item (node or way) ----------- */
41    
42  typedef struct {  typedef struct {
43    relation_item_t *item;    object_t *item;
44    appdata_t *appdata;    appdata_t *appdata;
45    GtkWidget *dialog, *list;    GtkWidget *dialog, *list;
46    GtkListStore *store;    GtkListStore *store;
# Line 61  typedef struct role_chain_s { Line 61  typedef struct role_chain_s {
61  } role_chain_t;  } role_chain_t;
62    
63  static gboolean relation_add_item(GtkWidget *parent,  static gboolean relation_add_item(GtkWidget *parent,
64                                relation_t *relation, relation_item_t *item) {                                relation_t *relation, object_t *item) {
65    role_chain_t *chain = NULL, **chainP = &chain;    role_chain_t *chain = NULL, **chainP = &chain;
66    
67    printf("add item of type %d to relation #%ld\n",    printf("add item of type %d to relation #%ld\n",
# Line 184  static gboolean relation_add_item(GtkWid Line 184  static gboolean relation_add_item(GtkWid
184    return TRUE;    return TRUE;
185  }  }
186    
187  static void relation_remove_item(relation_t *relation, relation_item_t *item) {  static void relation_remove_item(relation_t *relation, object_t *item) {
188    
189    printf("remove item of type %d from relation #%ld\n",    printf("remove item of type %d from relation #%ld\n",
190           item->type, relation->id);           item->type, relation->id);
# Line 342  static void on_relation_item_remove(GtkW Line 342  static void on_relation_item_remove(GtkW
342    relation_item_list_selected(context, FALSE);    relation_item_list_selected(context, FALSE);
343  }  }
344    
345  static char *relitem_get_role_in_relation(relation_item_t *item, relation_t *relation) {  static char *relitem_get_role_in_relation(object_t *item, relation_t *relation) {
346    member_t *member = relation->member;    member_t *member = relation->member;
347    while(member) {    while(member) {
348      switch(member->type) {      switch(member->type) {
# Line 404  relitem_toggled(GtkCellRendererToggle *c Line 404  relitem_toggled(GtkCellRendererToggle *c
404    
405  }  }
406    
407  static gboolean relitem_is_in_relation(relation_item_t *item, relation_t *relation) {  static gboolean relitem_is_in_relation(object_t *item, relation_t *relation) {
408    member_t *member = relation->member;    member_t *member = relation->member;
409    while(member) {    while(member) {
410      switch(member->type) {      switch(member->type) {
# Line 480  static GtkWidget *relation_item_list_wid Line 480  static GtkWidget *relation_item_list_wid
480    return context->list;    return context->list;
481  }  }
482    
483  void relation_add_dialog(appdata_t *appdata, relation_item_t *relitem) {  void relation_add_dialog(appdata_t *appdata, object_t *object) {
484    relitem_context_t *context = g_new0(relitem_context_t, 1);    relitem_context_t *context = g_new0(relitem_context_t, 1);
485    map_t *map = appdata->map;    map_t *map = appdata->map;
486    g_assert(map);    g_assert(map);
487    
488    context->appdata = appdata;    context->appdata = appdata;
489    context->item = relitem;    context->item = object;
490    
491    char *str = NULL;    char *str = NULL;
492    switch(relitem->type) {    switch(object->type) {
493    case NODE:    case NODE:
494      str = g_strdup_printf(_("Relations for node #%ld"), relitem->node->id);      str = g_strdup_printf(_("Relations for node #%ld"), object->node->id);
495      break;      break;
496    case WAY:    case WAY:
497      str = g_strdup_printf(_("Relations for way #%ld"), relitem->way->id);      str = g_strdup_printf(_("Relations for way #%ld"), object->way->id);
498      break;      break;
499    default:    default:
500      g_assert((relitem->type == NODE) || (relitem->type == WAY));      g_assert((object->type == NODE) || (object->type == WAY));
501      break;      break;
502    }    }
503    

Legend:
Removed from v.153  
changed lines
  Added in v.154