Ignore:
Timestamp:
1/11/2010 3:52:47 AM (5 years ago)
Author:
lowjoel
Message:

fixes #295: Tasks name excessive when alot of files selected to be removed in one go

The new behaviour is to list only the file name bit (ignoring the full path), and listing all only if there are less than 5 entries. After the task contains 5 or more targets, we will only use the file names of the first, the median and the last element, followed by the number of other targets not included in the summary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/Task.cs

    r1374 r1497  
    118118 
    119119                string result = string.Empty; 
    120                 if (Targets.Count < 3) 
     120                if (Targets.Count < 5) 
     121                { 
    121122                    //Simpler case, small set of data. 
    122123                    foreach (ErasureTarget tgt in Targets) 
    123124                        result += tgt.UIText + ", "; 
     125 
     126                    return result.Remove(result.Length - 2); 
     127                } 
    124128                else 
     129                { 
    125130                    //Ok, we've quite a few entries, get the first, the mid and the end. 
    126                     for (int i = 0; i < Targets.Count; i += Targets.Count / 3) 
    127                         result += Targets[i].UIText + ", "; 
    128                 return result.Substring(0, result.Length - 2); 
     131                    result = Targets[0].UIText + ", "; 
     132                    result += Targets[Targets.Count / 2].UIText + ", "; 
     133                    result += Targets[Targets.Count - 1].UIText; 
     134 
     135                    return S._("{0} and {1} other files", result, Targets.Count - 3); 
     136                } 
    129137            } 
    130138        } 
     
    456464        public override string UIText 
    457465        { 
    458             get { return Path; } 
     466            get { return System.IO.Path.GetFileName(Path); } 
    459467        } 
    460468 
Note: See TracChangeset for help on using the changeset viewer.