FileBrowser.st
changeset 2101 54dd9ce332bf
parent 2100 b765cf8ab1de
child 2102 da9a9deccee0
equal deleted inserted replaced
2100:b765cf8ab1de 2101:54dd9ce332bf
   823 
   823 
   824                      #(
   824                      #(
   825                        #(#MenuItem
   825                        #(#MenuItem
   826                           #label: 'Remove file && CVS Container'
   826                           #label: 'Remove file && CVS Container'
   827                           #translateLabel: true
   827                           #translateLabel: true
   828                           #value: #fileRemoveAndRemoveFromCVS
   828                           #value: #fileRemoveAndRemoveContainerFromCVS
       
   829                           #enabled: #canRemoveCVSContainer
   829                       )
   830                       )
   830                     ) nil
   831                     ) nil
   831                     nil
   832                     nil
   832                 )
   833                 )
   833             )
   834             )
  1115             ]
  1116             ]
  1116         ]
  1117         ]
  1117       ]
  1118       ]
  1118 
  1119 
  1119     "Modified: / 1.2.1999 / 20:38:42 / cg"
  1120     "Modified: / 1.2.1999 / 20:38:42 / cg"
       
  1121 !
       
  1122 
       
  1123 canRemoveCVSContainer
       
  1124     ^ [ |cvsDir|
       
  1125 
       
  1126         currentDirectory notNil
       
  1127         and:[fileListView selection size > 0
       
  1128         and:[(cvsDir := currentDirectory construct:'CVS') exists
       
  1129         and:[cvsDir isDirectory]]]]
  1120 !
  1130 !
  1121 
  1131 
  1122 canRemoveToClassPath
  1132 canRemoveToClassPath
  1123     ^ [ |f sel|
  1133     ^ [ |f sel|
  1124 
  1134 
  2351         ].
  2361         ].
  2352         (self sensor shiftDown
  2362         (self sensor shiftDown
  2353         or:[self ask:q yesButton:'remove']) ifTrue:[
  2363         or:[self ask:q yesButton:'remove']) ifTrue:[
  2354             self withCursor:(Cursor wait) do:[
  2364             self withCursor:(Cursor wait) do:[
  2355                 self doRemove:sel
  2365                 self doRemove:sel
       
  2366             ]
       
  2367         ]
       
  2368     ]
       
  2369 
       
  2370     "Modified: / 16.12.1998 / 17:30:31 / cg"
       
  2371 !
       
  2372 
       
  2373 fileRemoveAndRemoveContainerFromCVS
       
  2374     "remove the selected file(s) and their CVS containers.
       
  2375      Query if user really wants to really remove them."
       
  2376 
       
  2377     |sel q|
       
  2378 
       
  2379     sel := fileListView selection.
       
  2380     sel size > 0 ifTrue:[
       
  2381         sel := sel collect:[:rawIndex | fileList at:rawIndex].
       
  2382         sel size > 1 ifTrue:[
       
  2383             q := resources string:'remove %1 selected files and CVS containers ?' with:(sel size)
       
  2384         ] ifFalse:[
       
  2385             q := resources string:'remove ''%1'' and CVS container ?' with:(sel first asText allBold)
       
  2386         ].
       
  2387         (self sensor shiftDown
       
  2388         or:[self ask:q yesButton:'remove']) ifTrue:[
       
  2389             self withCursor:(Cursor wait) do:[
       
  2390                 self doRemoveAndRemoveFromCVS:sel
  2356             ]
  2391             ]
  2357         ]
  2392         ]
  2358     ]
  2393     ]
  2359 
  2394 
  2360     "Modified: / 16.12.1998 / 17:30:31 / cg"
  2395     "Modified: / 16.12.1998 / 17:30:31 / cg"
  6481 ! !
  6516 ! !
  6482 
  6517 
  6483 !FileBrowser class methodsFor:'documentation'!
  6518 !FileBrowser class methodsFor:'documentation'!
  6484 
  6519 
  6485 version
  6520 version
  6486     ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.305 1999-04-16 15:51:19 ps Exp $'
  6521     ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.306 1999-04-16 17:46:37 cg Exp $'
  6487 ! !
  6522 ! !