20 #define AWAR_TREE_NAME_SRC AWAR_MERGE_TMP_SRC "tree_name"
21 #define AWAR_TREE_NAME_DST AWAR_MERGE_TMP_DST "tree_name"
23 #define AWAR_TREE_XFER_WHAT AWAR_MERGE_TMP "xfer_what"
24 #define AWAR_TREE_OVERWRITE AWAR_MERGE_TMP "overwrite"
56 error =
"No tree selected in source DB";
69 error =
GBS_global_string(
"Can't position tree behind '%s' (no such tree)", behind_name);
77 error =
GBS_global_string(
"Tree '%s' already exists in destination DB", tree_name);
82 if (gb_tree_infrontof) {
84 gb_at_tree = gb_tree_infrontof;
89 gb_at_tree = gb_tree_behind;
131 char *source_name = awar_tree_source->
read_string();
134 char *select_dst =
NULp;
139 int xferd_missing = 0;
140 int xferd_existing = 0;
146 if (!error) select_dst =
ARB_strdup(source_name);
170 if (!select_dst) select_dst =
ARB_strdup(tree_name);
171 freedup(behind_name, tree_name);
182 if (select_dst) awar_tree_dest->
write_string(select_dst);
190 if (xferd_existing) {
214 AW_window_simple *aws =
new AW_window_simple;
216 aws->init(awr,
"MERGE_TREES",
"MERGE TREES");
217 aws->load_xfig(
"merge/trees.fig");
219 aws->button_length(7);
223 aws->create_button(
"CLOSE",
"CLOSE",
"C");
227 aws->create_button(
"HELP",
"HELP",
"H");
238 aws->button_length(15);
242 aws->create_button(
"DELETE TREE_DB1",
"Delete Tree");
246 aws->create_button(
"DELETE_TREE_DB2",
"Delete Tree");
250 aws->create_button(
"RENAME_TREE_DB1",
"Rename Tree");
254 aws->create_button(
"RENAME_TREE_DB2",
"Rename Tree");
258 aws->create_autosize_button(
"TRANSFER_TREE",
"Transfer");
260 aws->at(
"xfer_what");
262 aws->insert_default_option(
"selected tree",
"s",
XFER_SELECTED);
263 aws->insert_option (
"all trees",
"a",
XFER_ALL);
264 aws->insert_option (
"missing trees",
"m",
XFER_MISSING);
266 aws->update_option_menu();
268 aws->at(
"overwrite");
269 aws->label(
"Overwrite trees?");
272 aws->button_length(0);
273 aws->shadow_width(1);
276 aws->create_button(
"HELP_MERGE",
"#merge/icon.xpm");
GB_ERROR GB_begin_transaction(GBDATA *gbd)
GBDATA * GBT_find_bottom_tree(GBDATA *gb_main)
void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def)
GB_ERROR GB_copy_dropProtectMarksAndTempstate(GBDATA *dest, GBDATA *source)
static GB_ERROR transfer_tree(const char *tree_name, bool overwrite, const char *behind_name)
NOT4PERL GB_ERROR GBT_move_tree(GBDATA *gb_moved_tree, GBT_ORDER_MODE mode, GBDATA *gb_target_tree)
AW_window * create_rename_window(AW_root *root, const Spec *spec)
GBDATA * GBT_tree_behind(GBDATA *gb_tree)
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
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,...)
GB_ERROR MG_expect_renamed()
AW_DB_selection * awt_create_TREE_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname)
void AW_POPDOWN(AW_window *window)
GBDATA * GBT_get_tree_data(GBDATA *gb_main)
GB_ERROR GB_delete(GBDATA *&source)
const char * GBT_get_tree_name(GBDATA *gb_tree)
GB_ERROR GB_await_error()
GBDATA * GB_create_container(GBDATA *father, const char *key)
WindowCallback makeHelpCallback(const char *helpfile)
#define AWAR_TREE_NAME_SRC
GBDATA * GBT_find_next_tree(GBDATA *gb_tree)
void create_awars(AW_root *root, AW_default aw_def, bool registerTreeAwar)
GBDATA * GBT_find_top_tree(GBDATA *gb_main)
void delete_tree_cb(AW_window *aww, const Spec *spec)
#define AWAR_TREE_OVERWRITE
#define AWAR_TREE_NAME_DST
static void error(const char *msg)
char * read_string() const
AW_awar * awar(const char *awar)
#define AWAR_TREE_XFER_WHAT
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
static void MG_transfer_tree(AW_window *aww)
void aw_message(const char *msg)
GB_ERROR write_string(const char *aw_string)
AW_window * MG_create_merge_trees_window(AW_root *awr)
GBDATA * GBT_find_tree(GBDATA *gb_main, const char *tree_name)
GB_transaction ta(gb_var)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
GBDATA * GBT_tree_infrontof(GBDATA *gb_tree)