27 if (!sai_name || !sai_name[0]) error =
"Select SAI to rename";
29 char *new_name =
aw_input(
"Rename SAI",
"Enter new name of SAI", sai_name);
30 if (new_name && new_name[0]) {
37 if (gb_dest_exists) error =
GBS_global_string(
"There is already a SAI named '%s'", new_name);
58 if (!source_name || !source_name[0]) error =
"Select SAI to duplicate";
60 char *dest_name =
aw_input(
"Copy SAI",
"Enter name of new SAI", source_name);
61 if (dest_name && dest_name[0]) {
69 if (gb_dest_exists) error =
GBS_global_string(
"There is already a SAI named '%s'", dest_name);
97 if (!sai_name || !sai_name[0]) error =
"No SAI selected";
99 char *species_name =
aw_input(
"Copy SAI to species",
"Enter target species name:", sai_name);
101 if (species_name && species_name[0]) {
108 if (gb_dest) error =
GBS_global_string(
"Species '%s' already exists", species_name);
140 error = gb_sai ?
GB_delete(gb_sai) :
"Please select a SAI";
160 if (!sai_name || !sai_name[0]) error =
"No SAI selected";
175 gb_ali =
GB_entry(gb_sai, ali_name);
176 if (!gb_ali) error =
GBS_global_string(
"SAI '%s' has no data in alignment '%s'", sai_name, ali_name);
187 error = ta.
close(error);
192 char *new_type =
aw_input(
"Change SAI description", type);
203 error = t2.
close(error);
225 if (!old_group_name || strcmp(old_group_name, group_name) != 0) {
231 if (gb_group) error =
GB_delete(gb_group);
241 const char *group_name =
"";
250 if (group) sai_groups.
put(group);
261 #define AWAR_SAI_GROUP "tmp/extended/group"
262 #define AWAR_SAI_REFRESH_GROUPS "tmp/extended/refresh"
296 AW_window_simple *aws =
new AW_window_simple;
297 aws->init(aw_root,
"SAI_GROUP",
"Define SAI group");
302 aws->create_button(
"CLOSE",
"CLOSE",
"C");
306 aws->create_button(
"HELP",
"HELP",
"H");
319 static AW_window_simple *aws =
NULp;
322 aws =
new AW_window_simple;
323 aws->init(aw_root,
"INFO_OF_SAI",
"SAI INFORMATION");
324 aws->load_xfig(
"ad_ext.fig");
328 aws->create_button(
"CLOSE",
"CLOSE",
"C");
332 aws->create_button(
"HELP",
"HELP",
"H");
334 aws->button_length(13);
338 aws->create_button(
"DELETE",
"DELETE",
"D");
342 aws->create_button(
"RENAME",
"RENAME",
"R");
346 aws->create_button(
"COPY",
"COPY",
"C");
350 aws->create_button(
"EDIT_COMMENT",
"EDIT COMMENT",
"R");
354 aws->create_button(
"ASSIGN_GROUP",
"ASSIGN GROUP",
"R");
358 aws->create_button(
"COPY_TO_SPECIES",
"COPY TO\nSPECIES",
"C");
GB_ERROR GB_begin_transaction(GBDATA *gbd)
GB_ERROR GB_copy_dropProtectMarksAndTempstate(GBDATA *dest, GBDATA *source)
GBDATA * GBT_first_SAI(GBDATA *gb_main)
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const SaiSelectionlistFilterCallback &fcb)
void put(const char *elem)
static void get_SAI_groups(GBDATA *gb_main, ConstStrArray &sai_groups)
void load_xfig(const char *file, bool resize=true)
static void set_SAI_group_cb(AW_root *aw_root, GBDATA *gb_main)
AW_window * NT_create_extendeds_window(AW_root *aw_root)
void NT_create_extendeds_vars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
static void refresh_grouplist(AW_root *aw_root)
char * ARB_strdup(const char *str)
void GB_end_transaction_show_error(GBDATA *gbd, GB_ERROR error, void(*error_handler)(GB_ERROR))
const char * GBS_global_string(const char *templat,...)
void AW_POPDOWN(AW_window *window)
static GB_ERROR set_SAI_group(GBDATA *gb_main, const char *sai_name, const char *group_name)
#define AWAR_SAI_REFRESH_GROUPS
AW_awar * add_callback(const RootCallback &cb)
GB_ERROR GB_delete(GBDATA *&source)
int GB_string_comparator(const void *v0, const void *v1, void *)
GBDATA * GBT_find_SAI(GBDATA *gb_main, const char *name)
const char * read_char_pntr() const
static const char * get_SAI_group(GBDATA *gb_main, const char *sai_name)
GB_ERROR GB_await_error()
GBDATA * GB_create_container(GBDATA *father, const char *key)
WindowCallback makeHelpCallback(const char *helpfile)
static void copy_SAI_cb(AW_window *aww)
char * GBT_read_string(GBDATA *gb_container, const char *fieldpath)
static void map_SAI_to_scanner(AW_root *aw_root, DbScanner *scanner)
static void error(const char *msg)
ItemSelector & SAI_get_selector()
#define AWAR_SPECIES_NAME
static void copy_SAI_to_species_cb(AW_window *aww)
static DbScanner * create(GBDATA *gb_main, const char *scanner_id, AW_window *aws, const char *box_pos_fig, const char *edit_pos_fig, const char *edit_enable_pos_fig, DB_SCANNERMODE scannermode, const char *mark_pos_fig, ItemSelector &selector)
static void refresh_group_cb(AW_root *aw_root, GBDATA *gb_main)
GBDATA * GBT_find_species_rel_species_data(GBDATA *gb_species_data, const char *name)
char * read_string() const
AW_awar * awar(const char *awar)
AW_selection_list * awt_create_selection_list_with_input_field(AW_window *aww, const char *awar_name, const char *at_box, const char *at_field)
static void delete_SAI_cb(AW_window *aww)
GBDATA * GBT_next_SAI(GBDATA *gb_sai)
#define AWAR_TOPAREA_SAIS
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
GB_ERROR close(GB_ERROR error)
GB_ERROR GBT_write_string(GBDATA *gb_container, const char *fieldpath, const char *content)
void Map(GBDATA *gb_new_item, const char *key_path)
void aw_message(const char *msg)
static void edit_SAI_description(AW_window *aww)
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
GBDATA * GBT_find_SAI_rel_SAI_data(GBDATA *gb_sai_data, const char *name)
GB_transaction ta(gb_var)
static AW_window * create_SAI_group_window(AW_root *aw_root)
static void fill_SAI_group_selection_list(AW_selection_list *sel, GBDATA *gb_main)
void init_from_array(const CharPtrArray &entries, const char *default_displayed, const char *default_value)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
GBDATA * GBT_get_SAI_data(GBDATA *gb_main)
char * aw_input(const char *title, const char *prompt, const char *default_input)
static AW_selection_list * sai_group_sel
const char * GBT_read_char_pntr(GBDATA *gb_container, const char *fieldpath)
GBDATA * GB_entry(GBDATA *father, const char *key)
void aw_message_if(GB_ERROR error)
static void refresh_SAI_groups_cb(AW_root *, GBDATA *gb_main)
static void rename_SAI_cb(AW_window *aww)
void sort_and_uniq(CharPtrArray_compare_fun compare, void *client_data)
GBDATA * GBT_get_species_data(GBDATA *gb_main)