- Timestamp:
- 14/12/11 09:36:49 (5 months ago)
- Location:
- branches/e4fix
- Files:
-
- 5 modified
-
ARBDB/ad_prot.h (modified) (1 diff)
-
ARBDB/adquery.cxx (modified) (1 diff)
-
EDIT4/ED4_base.cxx (modified) (1 diff)
-
EDIT4/ED4_main.cxx (modified) (1 diff)
-
EDIT4/ed4_class.hxx (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/e4fix/ARBDB/ad_prot.h
r8287 r8304 232 232 GBDATA *GB_searchOrCreate_int(GBDATA *gb_container, const char *fieldpath, long default_value); 233 233 GBDATA *GB_searchOrCreate_float(GBDATA *gb_container, const char *fieldpath, double default_value); 234 GBDATA *GB_search_last_son(GBDATA *gbd);235 234 long GB_number_of_marked_subentries(GBDATA *gbd); 236 235 GBDATA *GB_first_marked(GBDATA *gbd, const char *keystring); -
branches/e4fix/ARBDB/adquery.cxx
r8274 r8304 653 653 } 654 654 if (!skip_over--) return gb; 655 }656 return NULL;657 }658 659 GBDATA *GB_search_last_son(GBDATA *gbd) {660 GBCONTAINER *gbc = (GBCONTAINER *)gbd;661 int index;662 int end = gbc->d.nheader;663 GBDATA *gb;664 gb_header_list *header = GB_DATA_LIST_HEADER(gbc->d);665 666 for (index = end-1; index>=0; index--) {667 if (header[index].flags.changed >= GB_DELETED) continue;668 if ((gb=GB_HEADER_LIST_GBD(header[index]))==NULL)669 {670 gb_unfold(gbc, 0, index);671 header = GB_DATA_LIST_HEADER(gbc->d);672 gb = GB_HEADER_LIST_GBD(header[index]);673 }674 return gb;675 655 } 676 656 return NULL; -
branches/e4fix/EDIT4/ED4_base.cxx
r8290 r8304 178 178 if (gbtype&GB_CB_SON_CREATED) { 179 179 // @@@ New son for database-member was created ... what may we do now? 180 }181 }182 183 int ED4_elements_in_species_container; // # of elements in species container184 void ED4_species_container_changed_cb(GBDATA *gb_species_data, int * /* cl */, GB_CB_TYPE gbtype)185 {186 if (gbtype==GB_CB_CHANGED) {187 int nsons = GB_number_of_subentries(gb_species_data);188 189 if (nsons>ED4_elements_in_species_container) { // new species was created190 #if defined(DEBUG) && 1191 printf("# of species in species-container changed from %i to %i\n", ED4_elements_in_species_container, nsons);192 aw_popup_ok("Species container changed!");193 #endif194 GBDATA *gb_lastSon = GB_search_last_son(gb_species_data);195 196 if (gb_lastSon) {197 GBDATA *gb_name = GB_search(gb_lastSon, "name", GB_FIND);198 199 if (gb_name) {200 char *name = GB_read_as_string(gb_name);201 202 ED4_get_and_jump_to_species(name);203 #if defined(DEBUG) && 1204 printf("new species = '%s'\n", name);205 #endif206 free(name);207 }208 }209 }210 ED4_elements_in_species_container = nsons;211 180 } 212 181 } -
branches/e4fix/EDIT4/ED4_main.cxx
r8275 r8304 637 637 638 638 // now bind DB depending callbacks 639 640 639 ed4_bind_mainDB_awar_callbacks(ED4_ROOT->aw_root); 641 {642 GB_transaction dummy(GLOBAL_gb_main);643 GBDATA *species_container = GB_search(GLOBAL_gb_main, "species_data", GB_FIND);644 GB_add_callback(species_container, (GB_CB_TYPE)GB_CB_CHANGED, (GB_CB)ED4_species_container_changed_cb, 0); // callback if species_data changes645 646 ED4_elements_in_species_container = GB_number_of_subentries(species_container); // store # of species647 #if defined(DEBUG) && 0648 printf("Species container contains %i species (at startup)\n", ED4_elements_in_species_container);649 #endif650 }651 640 652 641 // Create Additional sequence (aminoacid) terminals to be used in Protein Viewer -
branches/e4fix/EDIT4/ed4_class.hxx
r8296 r8304 2208 2208 void ED4_finish_and_show_notFoundMessage(); 2209 2209 2210 extern int ED4_elements_in_species_container; // # of elements in species container 2211 void ED4_undo_redo (AW_window*, AW_CL undo_type); 2210 void ED4_undo_redo(AW_window*, AW_CL undo_type); 2212 2211 2213 2212 ED4_species_name_terminal *ED4_find_species_name_terminal(const char *species_name); … … 2221 2220 2222 2221 extern "C" { 2223 void ED4_species_container_changed_cb(GBDATA *gbd, int *cl, GB_CB_TYPE gbtype);2224 2222 void ED4_sequence_changed_cb(GBDATA *gb_seq, int *cl, GB_CB_TYPE gbtype); 2225 2223 void ED4_alignment_length_changed(GBDATA *gb_alignment_len, int *dummy, GB_CB_TYPE gbtype);
