home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / ArchiveUtils / tarZanV1.0 / Source / tarZanMain.m < prev    next >
Encoding:
Text File  |  1992-08-06  |  1.2 KB  |  63 lines

  1.  
  2. /* Generated by Interface Builder */
  3. // Created By James T. Romano July 22, 1992 
  4. // Member of the Dynamic Duo of NeXT Computers!
  5. //
  6. // 
  7. // Read it and Weep!
  8.  
  9. #import "tarZanMain.h"
  10. #import "tarZanObject.h"
  11. #import "deCompObject.h"
  12.  
  13. #import <string.h>
  14. #import <appkit/Application.h>
  15. #import <appkit/Cell.h>
  16. #import <appkit/Matrix.h>
  17. #import <appkit/Menu.h>
  18.  
  19.  
  20. @implementation tarZanMain
  21.  
  22. - procedure:sender
  23. {
  24.     Cell *cell = [sender selectedCell];
  25.     
  26.     switch([cell tag]) {
  27.         case 1: [[tarZanObject allocFromZone:[self zone]] init];
  28.             break;
  29.         default:
  30.             printf("UNKNOWN\n");
  31.             break;
  32.     }
  33.     return self;
  34. }
  35.  
  36. // Delegate Methods
  37.  
  38. - (BOOL)appAcceptsAnotherFile:sender
  39. {
  40.     return YES;
  41. }
  42.  
  43. - (int)app:sender openFile:(const char *)filename type:(const char *)aType
  44. {
  45.   if (strcmp(aType,"tar") == 0)
  46.     [[tarZanObject allocFromZone:[self zone]] initUsingFile:filename withType:1];
  47.   else 
  48.     if (strcmp(aType,"Z") == 0) {
  49.       if (strstr(filename,".tar.Z"))
  50.         [[tarZanObject allocFromZone:[self zone]] initUsingFile:filename withType:3];
  51.       else
  52.         [[deComp allocFromZone:[self zone]] deCompressFile:filename];
  53.     }
  54.     else {
  55.       NXRunAlertPanel("ERROR OCCURED!","File type not valid.","OK",NULL,NULL);
  56.       return NO;
  57.     }
  58.   return YES;
  59. }
  60.  
  61.  
  62. @end
  63.