Changeset 1493


Ignore:
Timestamp:
1/10/2010 8:36:05 AM (5 years ago)
Author:
lowjoel
Message:

addresses #285: Various Custom Erasure Method editor bugs
-When adding a pass with a pass currently selected, add it after the selected pass.
-When duplicating passes, save the currently selected one before duplication (so both get the new data.)
-When unselecting passes, unset the currentPass member variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0/Eraser.DefaultPlugins/CustomMethodEditorForm.cs

    r1360 r1493  
    170170        private void passesAddBtn_Click(object sender, EventArgs e) 
    171171        { 
     172            //Save the current pass being edited 
     173            if (currentPass != null) 
     174                SavePass(currentPass); 
     175 
     176            //Then create a new, random pass, adding it to the list 
    172177            ErasureMethodPass pass = new ErasureMethodPass(ErasureMethod.WriteRandom, null); 
    173178            ListViewItem item = AddPass(pass); 
    174179 
     180            //If a pass is currently selected, insert the pass after the currently selected one. 
    175181            if (passesLv.SelectedIndices.Count > 0) 
    176182            { 
    177183                item.Remove(); 
    178                 passesLv.Items.Insert(passesLv.SelectedIndices[passesLv.SelectedIndices.Count - 1], 
     184                passesLv.Items.Insert(passesLv.SelectedIndices[passesLv.SelectedIndices.Count - 1] + 1, 
    179185                    item); 
    180186                RenumberPasses(); 
     
    192198        private void passesDuplicateBtn_Click(object sender, EventArgs e) 
    193199        { 
     200            //Save the current pass to prevent data loss 
     201            SavePass(currentPass); 
     202 
    194203            foreach (ListViewItem item in passesLv.SelectedItems) 
    195204            { 
     
    253262            { 
    254263                if (e.Item == currentPass) 
     264                { 
    255265                    SavePass(e.Item); 
     266                    currentPass = null; 
     267                } 
    256268            } 
    257269            else if (passesLv.SelectedIndices.Count == 1) 
Note: See TracChangeset for help on using the changeset viewer.