Пример #1
0
void tao_clicked( WINDOW * win )
{
  OBJECT * form;
  int obj;
  form = FORM(win);
  obj = evnt.buff[4];

  switch( obj )
  {
  case TB_SRC_TEXT:
  case TB_SRC_FILE:
    fileselect( src_file, "*.*", "TXT_SELTAOSRC" );
    reduce_name( src_fred, src_file, MAX_FRED_SRC );
    ObjcDraw( OC_FORM, win, TB_SRC_FILE, MAX_DEPTH );
    tao_gestion_acces( form );
    break;
  case TB_DEST:
  case TB_DSTCYC:
    if( popup_mgr( win, &tao_popup, obj ) == 0 )
    {
      fileselect( dest_file, "*.iso", "TXT_SELDST" );
      form[ TB_DEST ].ob_spec.free_string = dest_fred;
      reduce_name( dest_fred, dest_file, MAX_FRED_DEST );
      ObjcDraw( OC_FORM, win, TB_DEST, MAX_DEPTH );
    }

    if( tao_popup.selected )
    {
      gen_speed_popup( &speed_popup,
        ((struct device_info*)tao_popup.item[tao_popup.selected].info)->sets->max_write_speed );
      if( speed_popup.selected >= speed_popup.item_count )
        speed_popup.selected = speed_popup.item_count - 1;
    }
    form[ TB_SPEED ].ob_spec.free_string = speed_popup.item[speed_popup.selected].text;
    ObjcDraw( OC_FORM, win, TB_SPEED, MAX_DEPTH );

    tao_gestion_acces( form );
    break;
  case TB_SPEED:
  case TB_SPDCYC:
    if( speed_popup.item_count > 1 )
      popup_mgr( win, &speed_popup, obj );
    break;
  case TB_OK:
    tao_valid( form );
  case TB_CANCEL:
    ApplWrite( app.id, WM_DESTROY, win->handle );
    break;
  case TB_START:
    tao_valid( form );
    tao_launch();
    break;
  default:
    tao_gestion_acces( form );
    break;
  }
}
Пример #2
0
void copy_default( OBJECT * tree )
{
  struct device_info * info;
  int i;
  struct _copy_flags f;
  for( i=1; i<srcdev_popup.item_count; i++ )
  {
    info = (struct device_info *)srcdev_popup.item[i].info;
    if( info->id == preferences.source_id
        && info->bus_no == preferences.source_bus )
      srcdev_popup.selected = i;
  }
  for( i=1; i<dstdev_popup.item_count; i++ )
  {
    info = (struct device_info *)dstdev_popup.item[i].info;
    if( info->id == preferences.dest_id
        && info->bus_no == preferences.dest_bus )
      dstdev_popup.selected = i;
  }
  strncpy( copy_info.source_file, preferences.source_file, 255 );
  strncpy( copy_info.dest_file, preferences.dest_file, 255 );
  strncpy( copy_info.int_file, preferences.int_file, 255 );
  reduce_name( copy_info.source_fred, copy_info.source_file, MAX_FRED_COPY );
  reduce_name( copy_info.dest_fred, copy_info.dest_file, MAX_FRED_COPY );
  reduce_name( copy_info.int_fred, copy_info.int_file, MAX_FRED_INT );
  if( preferences.source_id < 0 )
    tree[ CB_SOURCE ].ob_spec.free_string = copy_info.source_fred;
  else
    tree[ CB_SOURCE ].ob_spec.free_string = srcdev_popup.item[srcdev_popup.selected].text;
  if( preferences.dest_id < 0 )
    tree[ CB_DEST ].ob_spec.free_string = copy_info.dest_fred;
  else
    tree[ CB_DEST ].ob_spec.free_string = dstdev_popup.item[dstdev_popup.selected].text;
  if( dstdev_popup.selected )
    gen_speed_popup( &speed_popup,
      ((struct device_info*)dstdev_popup.item[dstdev_popup.selected].info)->sets->max_write_speed );
  speed_popup.selected = 0;
  for( i=0; i<speed_popup.item_count; i++ )
  {
    if( *((unsigned int *)(speed_popup.item[i].info)) == preferences.write_speed )
      speed_popup.selected = i;
  }
  tree[ CB_SPEED ].ob_spec.free_string = speed_popup.item[speed_popup.selected].text;
  tree[ CB_INTFILE ].ob_spec.free_string = copy_info.int_fred;

  tree[ CB_SIMUL ].ob_state &= ~SELECTED;
  tree[ CB_WR ].ob_state &= ~SELECTED;
  tree[ CB_USEHD ].ob_state &= ~SELECTED;
  tree[ CB_INTDEL ].ob_state &= ~SELECTED;
  f = preferences.copy_flags;
  tree[ CB_SIMUL ].ob_state |= f.simul?SELECTED:0;
  tree[ CB_WR ].ob_state |= f.write_cd?SELECTED:0;
  tree[ CB_USEHD ].ob_state |= f.use_hd?SELECTED:0;
  tree[ CB_INTDEL ].ob_state |= f.int_del?SELECTED:0;
}
Пример #3
0
void tao_default( OBJECT * form )
{
  struct device_info * info;
  int i;

  strncpy( src_file, preferences.tao_src_file, 255 );
  reduce_name( src_fred, src_file, MAX_FRED_SRC );
  strncpy( dest_file, preferences.tao_dest_file, 255 );
  reduce_name( dest_fred, dest_file, MAX_FRED_DEST );

  ObjcString( form, TB_SRC_FILE, src_fred );

  for( i=0; i<tao_popup.item_count; i++ )
  {
    info = (struct device_info *)tao_popup.item[i].info;
    if( info && info->id == preferences.tao_id
        && info->bus_no == preferences.tao_bus )
      tao_popup.selected = i;
  }
  if( preferences.tao_id < 0 )
    form[ TB_DEST ].ob_spec.free_string = dest_fred;
  else
    form[ TB_DEST ].ob_spec.free_string = tao_popup.item[tao_popup.selected].text;

  if( tao_popup.selected )
    gen_speed_popup( &speed_popup,
      ((struct device_info*)tao_popup.item[tao_popup.selected].info)->sets->max_write_speed );

  speed_popup.selected = 0;
  for( i=0; i<speed_popup.item_count; i++ )
  {
    if( *((unsigned int *)(speed_popup.item[i].info)) == preferences.tao_write_speed )
      speed_popup.selected = i;
  }
  form[ TB_SPEED ].ob_spec.free_string = speed_popup.item[speed_popup.selected].text;
  objc_select( form, TB_SIMUL, preferences.tao_flags.simul );
  objc_select( form, TB_WR, preferences.tao_flags.write_cd );
}
Пример #4
0
NTSTATUS check_name(connection_struct *conn, const pstring name)
{
	if (IS_VETO_PATH(conn, name))  {
		/* Is it not dot or dot dot. */
		if (!((name[0] == '.') && (!name[1] || (name[1] == '.' && !name[2])))) {
			DEBUG(5,("check_name: file path name %s vetoed\n",name));
			return map_nt_error_from_unix(ENOENT);
		}
	}

	if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) {
		NTSTATUS status = reduce_name(conn,name);
		if (!NT_STATUS_IS_OK(status)) {
			DEBUG(5,("check_name: name %s failed with %s\n",name, nt_errstr(status)));
			return status;
		}
	}

	return NT_STATUS_OK;
}
Пример #5
0
void toc_toolbar( WINDOW * win )
{
  OBJECT * tool;
  int obj;
  tool = TOOL( win );
  obj = evnt.buff[4];
  switch( obj )
  {
  case TTB_SOURCE:
  case TTB_SRCCYC:
    if( popup_mgr( win, &toc_popup, obj ) == 0 )
    {
      fileselect( toc_info.toc_file, "*.cd", "TXT_DAOFILE" );
      tool[ TTB_SOURCE ].ob_spec.free_string = toc_info.toc_fred;
      reduce_name( toc_info.toc_fred, toc_info.toc_file, MAX_FRED_TOC );
      ObjcDraw( OC_TOOLBAR, win, TTB_SOURCE, MAX_DEPTH );
    }
    toc_gestion_acces( win );
    break;
  case TTB_EXTRACT:
    toc_extract( win );
    break;
  case TTB_FORMAT:
  case TTB_FRMTCYC:
    popup_mgr( win, &fmt_popup, obj );
    break;
  case TTB_LOAD:
  case TTB_EJECT:
    dev_insert_open( toc_popup.item[toc_popup.selected].info, obj == TTB_EJECT );
    break;
  case TTB_READTOC:
    toc_readtoc( win );
    toc_gestion_acces( win );
    break;
  case TTB_CANCEL:
    ApplWrite( app.id, WM_DESTROY, win->handle );
    break;
  }
}
Пример #6
0
void toc_default( OBJECT * tool )
{
  struct device_info * info;
  int i;

  strncpy( toc_info.toc_file, preferences.toc_file, 255 );
  for( i=1; i<toc_popup.item_count; i++ )
  {
    info = (struct device_info *)toc_popup.item[i].info;
    if( info->id == preferences.dev_toc_id
        && info->bus_no == preferences.dev_toc_bus )
      toc_popup.selected = i;
  }
  if( toc_popup.selected )
    tool[ TTB_SOURCE ].ob_spec.free_string = toc_popup.item[ toc_popup.selected ].text;
  else
  {
    tool[ TTB_SOURCE ].ob_spec.free_string = toc_info.toc_fred;
    reduce_name( toc_info.toc_fred, toc_info.toc_file, MAX_FRED_TOC );
  }

  fmt_popup.selected = preferences.audio_format;
  tool[ TTB_FORMAT ].ob_spec.free_string = fmt_popup.item[ fmt_popup.selected ].text;
}
Пример #7
0
void copy_seltempfile( void )
{
  fileselect( copy_info.int_file, "*.cd", "TXT_SELINT" );
  reduce_name( copy_info.int_fred, copy_info.int_file, MAX_FRED_INT );
}
Пример #8
0
void copy_clicked( WINDOW * win )
{
  OBJECT * form;
  int obj, ret;
  form = FORM(win);
  obj = evnt.buff[4];

  switch( obj )
  {
  case CB_COPY:
    copy_valid( form );
    ret = dao_launch( srcdev_popup.selected?TST_CD:TST_FILE,
                      dstdev_popup.selected?TST_CD:TST_FILE );
    switch( ret )
    {
      case -5:
        alert_msg( "AL_UNDERRUN", 1 );
        break;
      case -4:
        alert_msg( "AL_DAOWRTERR", 1 );
        break;
      case -3:
        alert_msg( "AL_COPYREADERR", 1 );
        break;
      case -2:
        alert_msg( "AL_COPYINT", 1 );
        break;
      case -1:
        alert_msg( "AL_DAOOPSERR", 1 );
        break;
      case 0:
        alert_msg( "AL_COPYOK", 1 );
        break;
    }
    break;
  case CB_OK:
    copy_valid( form );
  case CB_CANCEL:
    ApplWrite( app.id, WM_DESTROY, win->handle );
    break;
  case CB_SPEED:
  case CB_SPDCYC:
    if( speed_popup.item_count > 1 )
      popup_mgr( win, &speed_popup, obj );
    break;
  case CB_SRCCYC:
  case CB_SOURCE:
    if( popup_mgr( win, &srcdev_popup, obj ) == 0 )
    {
      fileselect( copy_info.source_file, "*.cd", "TXT_SELSRC" );
      form[ CB_SOURCE ].ob_spec.free_string = copy_info.source_fred;
      reduce_name( copy_info.source_fred, copy_info.source_file, MAX_FRED_COPY );
      ObjcDraw( OC_FORM, win, CB_SOURCE, MAX_DEPTH );
    }
    copy_gestion_acces( form );
    break;
  case CB_DSTCYC:
  case CB_DEST:
    if( popup_mgr( win, &dstdev_popup, obj ) == 0 )
    {
      fileselect( copy_info.dest_file, "*.cd", "TXT_SELDST" );
      form[ CB_DEST ].ob_spec.free_string = copy_info.dest_fred;
      reduce_name( copy_info.dest_fred, copy_info.dest_file, MAX_FRED_COPY );
      ObjcDraw( OC_FORM, win, CB_DEST, MAX_DEPTH );
    }
    if( dstdev_popup.selected )
    {
      gen_speed_popup( &speed_popup,
        ((struct device_info*)dstdev_popup.item[dstdev_popup.selected].info)->sets->max_write_speed );
      if( speed_popup.selected >= speed_popup.item_count )
        speed_popup.selected = speed_popup.item_count - 1;
    }
    form[ CB_SPEED ].ob_spec.free_string = speed_popup.item[speed_popup.selected].text;
    ObjcDraw( OC_FORM, win, CB_SPEED, MAX_DEPTH );
    copy_gestion_acces( form );
    break;
  case CB_INTFILE:
    copy_seltempfile();
    ObjcDraw( OC_FORM, win, CB_INTFILE, MAX_DEPTH );
    break;
  default:
    copy_gestion_acces( form );
    break;
  }
}