home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / ArchiveUtils / JumpBack / Source / CDROMIndexControl.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  2.4 KB  |  110 lines

  1.  
  2. //======================================================================
  3. //
  4. //    Portions written by FreemanSoft Inc.
  5. //
  6. //    FreemanSoft disclaims any warranty of any kind, expressed or implied,
  7. //    as to this source code's fitness for any particular use.
  8. //
  9. //    For more information, use the following electronic mail addresses:
  10. //     
  11. //        info@FreemanSoft.com    general questions
  12. //        support@FreemanSoft.com    technical questions
  13. //
  14. //======================================================================
  15.  
  16.  
  17. /* Written by
  18.  *    Joe Freeman    jfreeman@next.com    
  19.  *    RdistControl
  20.  *
  21.  *    This code has no warranty.  
  22.  *    It is provided so that the consumer may maintain and modify it
  23.  *    at their own risk.  Use this code at your own risk.
  24.  */
  25.  
  26. #import "CDROMIndexControl.h"
  27. #import "DragView.h"
  28. #import "Subprocess.h"
  29. #import "pathutil.h"
  30. #import "common.h"
  31. #import "cdromControl.h"        // strings entries
  32.  
  33. #import "JumpBackControl.h"
  34.  
  35.  
  36. /*================================================================
  37.  *    Private methods 
  38.  *================================================================*/
  39.  
  40. @implementation CDROMIndexControl
  41.  
  42.     
  43.  
  44. - (const char *)buttonImageName
  45. {
  46.     return "Index_ROM.tiff";
  47. }
  48.  
  49. - (const char *)buttonAltImageName
  50. {
  51.     return "Index_ROM_abort.tiff";
  52. }
  53.  
  54. - (const char *)stringsTable
  55. {
  56.     return "cdromControl";
  57. }
  58.  
  59. - free
  60. {
  61.     [[NXApp delegate] dropDragJumpBackController:self];
  62.     return [super free];
  63. }
  64.  
  65. #define pass_1_run_string "%s %s %s"
  66.     
  67. - runPassOne:sender
  68. {
  69.     char    buf[MAXPATHLEN+1];
  70.     char    fwPath[MAXPATHLEN+1];    /* writable check executable */
  71.  
  72.     canContinue = YES;
  73.     [[NXBundle mainBundle] getPath: fwPath
  74.             forResource:make_dir_script ofType:""];
  75.     if (fwPath && *fwPath){
  76.             [self setState: PASS_1_RUNNING];
  77.             [self logIt: start_pass_1_string];
  78.             sprintf(buf, pass_1_run_string, 
  79.                     fwPath, sPathList, dPathList);
  80.             subprocessObj = [Subprocess new:buf
  81.                 withDelegate:self
  82.                 andPtySupport:NO
  83.                 andStdErr:YES];    
  84.     } else {
  85.             [self logIt: missing_make_dir_script];
  86.             [self abortProcess:self];
  87.     }
  88.     return self;
  89. }
  90.  
  91.     
  92. - runPassTwo:sender
  93. {    
  94.     char buf[1024];
  95.     
  96.     canContinue = YES;
  97.     [self setState:PASS_2_RUNNING];
  98.     [self logIt:start_pass_2_string];
  99.     sprintf(buf, pass_2_run_string,     dPathList, basename(sPathList));
  100.     subprocessObj = [Subprocess new:buf
  101.                 withDelegate:self
  102.                 andPtySupport:NO
  103.                 andStdErr:YES];
  104.     [subprocessObj terminateInput];
  105.     return self;
  106. }
  107.  
  108.  
  109. @end
  110.