Changeset 1641


Ignore:
Timestamp:
1/22/2010 6:26:44 AM (5 years ago)
Author:
lowjoel
Message:

Fixed crash when user clicks on About dialog links but there was an error starting the process. This results in Process.Start throwing a Win32Exception which we now catch and show the error to the user.

Location:
branches/eraser6/6.0/Eraser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0/Eraser/AboutForm.cs

    r1360 r1641  
    190190        { 
    191191            Point cursorPos = PointToClient(Cursor.Position); 
    192             if (WebsiteRect.IntersectsWith(new Rectangle(cursorPos, new Size(1, 1)))) 
    193                 Process.Start("http://eraser.heidi.ie/"); 
    194             else if (DonateRect.IntersectsWith(new Rectangle(cursorPos, new Size(1, 1)))) 
    195                 Process.Start("https://euro.swreg.org/cgi-bin/s.cgi?r=1&s=80181&db_key=1512312&x=0&lang=&lnk="); 
    196             else if ((DateTime.Now - mouseDownTime < mouseSpeedUpSpan)) 
    197                 //Dismiss the dialog. 
    198                 Close(); 
     192            try 
     193            { 
     194                if (WebsiteRect.IntersectsWith(new Rectangle(cursorPos, new Size(1, 1)))) 
     195                    Process.Start("http://eraser.heidi.ie/"); 
     196                else if (DonateRect.IntersectsWith(new Rectangle(cursorPos, new Size(1, 1)))) 
     197                    Process.Start("https://euro.swreg.org/cgi-bin/s.cgi?r=1&s=80181&db_key=1512312&x=0&lang=&lnk="); 
     198                else if ((DateTime.Now - mouseDownTime < mouseSpeedUpSpan)) 
     199                    //Dismiss the dialog. 
     200                    Close(); 
     201            } 
     202            catch (Win32Exception ex) 
     203            { 
     204                //We've got an error executing the the browser to pass the links: show an error 
     205                //to the user. 
     206                MessageBox.Show(S._("Could not open the required web page. The error returned " + 
     207                    "was: {0}", ex.Message), S._("Eraser"), MessageBoxButtons.OK, 
     208                    MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 
     209                    S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     210            } 
    199211        } 
    200212 
  • branches/eraser6/6.0/Eraser/Strings.NL.resx

    r1481 r1641  
    139139    <value>(Untranslated)</value> 
    140140  </data> 
     141  <data name="Could not open the required web page. The error returned was: {0}" xml:space="preserve"> 
     142    <value>(Untranslated)</value> 
     143  </data> 
    141144  <data name="Session: {0:F}" xml:space="preserve"> 
    142145    <value>(Untranslated)</value> 
  • branches/eraser6/6.0/Eraser/Strings.en.resx

    r1481 r1641  
    139139    <value>Please help us to continue developing Eraser - donate some coffee!</value> 
    140140  </data> 
     141  <data name="Could not open the required web page. The error returned was: {0}" xml:space="preserve"> 
     142    <value>Could not open the required web page. The error returned was: {0}</value> 
     143  </data> 
    141144  <data name="Session: {0:F}" xml:space="preserve"> 
    142145    <value>Session: {0:F}</value> 
  • branches/eraser6/6.0/Eraser/Strings.it.resx

    r1481 r1641  
    139139    <value>Aiutateci a continuare lo sviluppo di Eraser - offriteci un caffè!</value> 
    140140  </data> 
     141  <data name="Could not open the required web page. The error returned was: {0}" xml:space="preserve"> 
     142    <value>(Untranslated)</value> 
     143  </data> 
    141144  <data name="Session: {0:F}" xml:space="preserve"> 
    142145    <value>Sessione: {0:F}</value> 
  • branches/eraser6/6.0/Eraser/Strings.resx

    r1481 r1641  
    139139    <value>Please help us to continue developing Eraser - donate some coffee!</value> 
    140140  </data> 
     141  <data name="Could not open the required web page. The error returned was: {0}" xml:space="preserve"> 
     142    <value>Could not open the required web page. The error returned was: {0}</value> 
     143  </data> 
    141144  <data name="Session: {0:F}" xml:space="preserve"> 
    142145    <value>Session: {0:F}</value> 
Note: See TracChangeset for help on using the changeset viewer.