Changeset 1769


Ignore:
Timestamp:
2/8/2010 7:29:41 AM (2 years ago)
Author:
lowjoel
Message:

Updated to trunk r1764

Location:
branches/eraser6/CodeReview
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview

  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs

    r1768 r1769  
    8686            if (paths == null) 
    8787            { 
    88                 if (targetSize <= dataSize) 
     88                if (targetSize <= DataSize) 
    8989                    amountToWrite = targetSize; 
    9090                else 
    91                     amountToWrite = dataSize * 2; 
     91                    amountToWrite = DataSize * 2; 
    9292            } 
    9393            else 
    94                 amountToWrite = paths.Count * dataSize * 2; 
     94                amountToWrite = paths.Count * DataSize * 2; 
    9595 
    9696            //The final amount has to be multiplied by the number of passes. 
     
    116116            //If the target stream is shorter than or equal to 32kb, just forward it to 
    117117            //the default function. 
    118             if (strm.Length < dataSize * 2) 
     118            if (strm.Length < DataSize * 2) 
    119119            { 
    120120                method.Erase(strm, erasureLength, prng, callback); 
     
    124124            //We need to intercept the callback function as we run the erasure method 
    125125            //twice on two parts of the file. 
     126            long dataSize = method.CalculateEraseDataSize(null, DataSize * 2); 
    126127            ErasureMethodProgressFunction customCallback = 
    127128                delegate(long lastWritten, long totalData, int currentPass) 
    128129                { 
    129                     callback(lastWritten, dataSize * 2, currentPass); 
     130                    callback(lastWritten, dataSize, currentPass); 
    130131                }; 
    131132 
     
    142143        /// The amount of data to be erased from the header and the end of the file. 
    143144        /// </summary> 
    144         private const long dataSize = 16 * 1024; 
     145        private const long DataSize = 16 * 1024; 
    145146 
    146147        private ErasureMethod method; 
  • branches/eraser6/CodeReview/Eraser.Manager/DirectExecutor.cs

    r1767 r1769  
    5555                thread.Abort(); 
    5656                schedulerInterrupt.Set(); 
     57 
     58                //Wait for the executor thread to exit -- we call some event functions 
     59                //and these events may need invocation on the main thread. So, 
     60                //pump messages from the main thread until the thread exits. 
     61                if (System.Windows.Forms.Application.MessageLoop) 
     62                { 
     63                    if (!thread.Join(new TimeSpan(0, 0, 0, 0, 100))) 
     64                        System.Windows.Forms.Application.DoEvents(); 
     65                } 
     66 
     67                //If we are disposing on a secondary thread, or a thread without 
     68                //a message loop, just wait for the thread to exit indefinitely 
     69                else 
     70                    thread.Join(); 
     71 
    5772                schedulerInterrupt.Close(); 
    5873            } 
     
    615630                            "not be erased because the file was either compressed, encrypted or " + 
    616631                            "a sparse file.", info.FullName), LogLevel.Error)); 
     632                        continue; 
    617633                    } 
    618634 
  • branches/eraser6/CodeReview/Eraser.msbuild

  • branches/eraser6/CodeReview/Eraser/BlackBoxMainForm.cs

    r1681 r1769  
    5858        private void ReportsLv_ItemActivate(object sender, EventArgs e) 
    5959        { 
     60            if (ReportsLv.SelectedItems.Count == 0) 
     61                return; 
     62 
    6063            Process.Start((ReportsLv.SelectedItems[0].Tag as BlackBoxReport).Path); 
    6164        } 
  • branches/eraser6/CodeReview/Eraser/BlackBoxMainForm.it.resx

  • branches/eraser6/CodeReview/Eraser/BlackBoxUploadForm.it.resx

  • branches/eraser6/CodeReview/Eraser/MainForm.cs

    r1768 r1769  
    3434using System.Diagnostics; 
    3535using System.Reflection; 
     36using System.Runtime.Serialization; 
    3637 
    3738namespace Eraser 
     
    261262                        FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 
    262263                    { 
    263                         Program.eraserClient.Tasks.LoadFromStream(stream); 
     264                        try 
     265                        { 
     266                            Program.eraserClient.Tasks.LoadFromStream(stream); 
     267                        } 
     268                        catch (FileLoadException ex) 
     269                        { 
     270                            MessageBox.Show(S._("The task list could not be imported. The error " + 
     271                                "returned was: {0}", ex.Message), S._("Eraser"), 
     272                                MessageBoxButtons.OK, MessageBoxIcon.Error, 
     273                                MessageBoxDefaultButton.Button1, 
     274                                S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     275                        } 
     276                        catch (SerializationException ex) 
     277                        { 
     278                            MessageBox.Show(S._("The task list could not be imported. The error " + 
     279                                "returned was: {0}", ex.Message), S._("Eraser"), 
     280                                MessageBoxButtons.OK, MessageBoxIcon.Error, 
     281                                MessageBoxDefaultButton.Button1, 
     282                                S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     283                        } 
    264284                    } 
    265285                } 
  • branches/eraser6/CodeReview/Eraser/Program.GuiProgram.cs

    r1768 r1769  
    162162                    { 
    163163                        MessageBox.Show(S._("Another instance of Eraser is already running but " + 
    164                             "cannot be connected to.\n\nThe error returned was: {0}", ex.Message, 
     164                            "cannot be connected to.\n\nThe error returned was: {0}", ex.Message), 
    165165                            S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error, 
    166166                            MessageBoxDefaultButton.Button1, 
    167167                            S.IsRightToLeft(null) ? 
    168                                 MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0)); 
     168                                MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); 
    169169                    } 
    170170                    catch (TimeoutException) 
  • branches/eraser6/CodeReview/Eraser/Strings.NL.resx

    r1750 r1769  
    163163    <value>(Untranslated)</value> 
    164164  </data> 
     165  <data name="The task list could not be imported. The error returned was: {0}" xml:space="preserve"> 
     166    <value>(Untranslated)</value> 
     167  </data> 
    165168  <data name="The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}" xml:space="preserve"> 
    166169    <value>(Untranslated)</value> 
     
    175178    <value>(Untranslated)</value> 
    176179  </data> 
    177   <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}Eraser" xml:space="preserve"> 
     180  <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}" xml:space="preserve"> 
    178181    <value>(Untranslated)</value> 
    179182  </data> 
  • branches/eraser6/CodeReview/Eraser/Strings.en.resx

    r1750 r1769  
    163163    <value>Session: {0:F}</value> 
    164164  </data> 
     165  <data name="The task list could not be imported. The error returned was: {0}" xml:space="preserve"> 
     166    <value>The task list could not be imported. The error returned was: {0}</value> 
     167  </data> 
    165168  <data name="The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}" xml:space="preserve"> 
    166169    <value>The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}</value> 
     
    175178    <value>Another instance of Eraser is already running but it is running with higher privileges than this instance of Eraser.\n\nEraser will now exit.</value> 
    176179  </data> 
    177   <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}Eraser" xml:space="preserve"> 
    178     <value>(Untranslated)</value> 
     180  <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}" xml:space="preserve"> 
     181    <value>Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}</value> 
    179182  </data> 
    180183  <data name="Total: {0,2:#0.00%}" xml:space="preserve"> 
  • branches/eraser6/CodeReview/Eraser/Strings.it.resx

    r1750 r1769  
    163163    <value>Sessione: {0:F}</value> 
    164164  </data> 
     165  <data name="The task list could not be imported. The error returned was: {0}" xml:space="preserve"> 
     166    <value>(Untranslated)</value> 
     167  </data> 
    165168  <data name="The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}" xml:space="preserve"> 
    166169    <value>La documentazione di Eraser non può essere aperta. Verificare che Adobe Acrobat Reader sia installato e che la vostra installazione di Eraser non sia corrotta.\n\nL'errore è stato: {0}</value> 
     
    175178    <value>Un'altra occorrenza di Eraser è già in esecuzione, ma con privilegi più elevati di questa.\n\nEraser adesso si chiuderà.</value> 
    176179  </data> 
    177   <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}Eraser" xml:space="preserve"> 
     180  <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}" xml:space="preserve"> 
    178181    <value>(Untranslated)</value> 
    179182  </data> 
  • branches/eraser6/CodeReview/Eraser/Strings.resx

    r1750 r1769  
    163163    <value>Session: {0:F}</value> 
    164164  </data> 
     165  <data name="The task list could not be imported. The error returned was: {0}" xml:space="preserve"> 
     166    <value>The task list could not be imported. The error returned was: {0}</value> 
     167  </data> 
    165168  <data name="The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}" xml:space="preserve"> 
    166169    <value>The Eraser documentation file could not be opened. Check that Adobe Reader installed and that your Eraser install is not corrupt.\n\nThe error returned was: {0}</value> 
     
    175178    <value>Another instance of Eraser is already running but it is running with higher privileges than this instance of Eraser.\n\nEraser will now exit.</value> 
    176179  </data> 
    177   <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}Eraser" xml:space="preserve"> 
    178     <value>Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}Eraser</value> 
     180  <data name="Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}" xml:space="preserve"> 
     181    <value>Another instance of Eraser is already running but cannot be connected to.\n\nThe error returned was: {0}</value> 
    179182  </data> 
    180183  <data name="Total: {0,2:#0.00%}" xml:space="preserve"> 
Note: See TracChangeset for help on using the changeset viewer.