Fixes #103. Tests pending.

This commit is contained in:
Ashhar Hasan 2015-12-14 22:38:22 +05:30
parent 069fa99b9a
commit 796b75a170
4 changed files with 8 additions and 7 deletions

View File

@ -649,7 +649,7 @@
Type="Exclamation"
Buttons="YesNo"
Title="Open Live Writer"
Text="{0}
Not a valid URL.
Do you want to continue?"
Text="{0}
Not a valid URL.
Do you want to go back and edit the URL?"
comment:Text="{0} - the url that was entered"/>
<Message
Identifier="InvalidInsertionPoint"

View File

@ -2835,7 +2835,7 @@ Check the file name and try again.</value>
<data name="DisplayMessage.InputIsNotUrl.Text" xml:space="preserve">
<value>{0}
Not a valid URL.
Do you want to continue?</value>
Do you want to go back and edit the URL?</value>
<comment>{0} - the url that was entered</comment></data>
<data name="DisplayMessage.InputIsNotUrl.Title" xml:space="preserve">
<value>Open Live Writer</value>

View File

@ -48,10 +48,11 @@ namespace OpenLiveWriter.PostEditor.ImageInsertion.WebImages
{
if (!UrlHelper.IsUrl(_source.SourceImageLink))
{
if (DisplayMessage.Show(MessageId.InputIsNotUrl, this, _source.SourceImageLink) == System.Windows.Forms.DialogResult.No)
//Ask if they want to go back and correct the link or just abort it altogether
if (DisplayMessage.Show(MessageId.InputIsNotUrl, this, _source.SourceImageLink) == System.Windows.Forms.DialogResult.Yes)
return;
}
DialogResult = System.Windows.Forms.DialogResult.OK;
DialogResult = System.Windows.Forms.DialogResult.Abort;
}
}

View File

@ -95,15 +95,15 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing
imgHtmlElement.setAttribute("height", oldHeight, 0);
if (!String.IsNullOrEmpty(oldWidth))
imgHtmlElement.setAttribute("width", oldWidth, 0);
try
{
info = new ImagePropertiesInfo(new Uri(imgSrc), new Size(width, height), remoteImageDecoratorsList);
}
catch (UriFormatException)
{
DisplayMessage.Show(MessageId.InvalidWebImage);
return null;
DisplayMessage.Show(MessageId.NoSuchImageFile);
imgHtmlElement.setAttribute("src", "https://browshot.com/static/images/not-found.png");
info = new ImagePropertiesInfo(new Uri("https://browshot.com/static/images/not-found.png"), new Size(width, height), remoteImageDecoratorsList);
}
info.ImgElement = imgHtmlElement;