model_server/dagraph_disgui/src/disUIHandler.cxx
//
// returns: -1: error, 0: the dialogbox is poped up
//
-1: error, 0: the dialogbox is poped up
- 1 : error 0 : the dialogbox is poped up
int
disUIHandler::restart(symbolArr & source, symbolArr & target)
{
    Initialize(disUIHandler::restart);
    int ret_val = -1;
    if (src_syms!=0 && trg_syms!=0 && shell!=0) {
	RTLNode * src_node = (RTLNode *)0;
	RTLNode * trg_node = (RTLNode *)0;
	if (!disUIHandler::extract(src_syms, src_node) &&
	    !disUIHandler::extract(trg_syms, trg_node)) {
	    src_syms->delete_all_items();
	    trg_syms->delete_all_items();
	    if (source.size() > 0) {
		symbolPtr x_sym;
		ForEachS(x_sym,source) {
		    if (!(src_node->rtl_includes(x_sym)))
			src_node->rtl_insert(x_sym);
		}
	    }
	    if (target.size() > 0) {
		symbolPtr x_sym;
		ForEachS(x_sym,target) {
		    if (!(trg_node->rtl_includes(x_sym)))
			trg_node->rtl_insert(x_sym);
		}
	    }
	    shell->popup(0);
	    disUIHandler::update(src_syms);
	    disUIHandler::update(trg_syms);
	    ret_val = 0;
	}
    }
    return ret_val;
}
int disUIHandler :: restart ( symbolArr & source , symbolArr & target ) { Initialize ( disUIHandler :: restart ) ; int ret_val = -1 ; if ( src_syms != 0 && trg_syms != 0 && shell != 0 ) { RTLNode * src_node = ( RTLNode * ) 0 ; RTLNode * trg_node = ( RTLNode * ) 0 ; if ( ! disUIHandler :: extract ( src_syms , src_node ) && ! disUIHandler :: extract ( trg_syms , trg_node ) ) { src_syms -> delete_all_items ( ) ; trg_syms -> delete_all_items ( ) ; if ( source . size ( ) > 0 ) { symbolPtr x_sym ; ForEachS ( x_sym , source ) { if ( ! ( src_node -> rtl_includes ( x_sym ) ) ) src_node -> rtl_insert ( x_sym ) ; } } if ( target . size ( ) > 0 ) { symbolPtr x_sym ; ForEachS ( x_sym , target ) { if ( ! ( trg_node -> rtl_includes ( x_sym ) ) ) trg_node -> rtl_insert ( x_sym ) ; } } shell -> popup ( 0 ) ; disUIHandler :: update ( src_syms ) ; disUIHandler :: update ( trg_syms ) ; ret_val = 0 ; } } return ret_val ; }
returns: -1: error, 0: the dialogbox is poped up
returns : - 1 : error 0 : the dialogbox is poped up