Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Code/Blumind/ChartControls/MindMap/MindMapView/MindMapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void Current_OpitonsChanged(object sender, EventArgs e)
UpdateView(ChangeTypes.AllVisual);
}

public void OpenSelectedUrl()
public void OpenSelectedUrl(string documentLocation)
{
if (Selection.Count > 0)
{
Expand All @@ -683,7 +683,7 @@ public void OpenSelectedUrl()

foreach (string url in urls)
{
Helper.OpenUrl(url);
Helper.OpenUrl(url, documentLocation);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Code/Blumind/Controls/ChartPageViews/MindMapChartPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ bool HasAnyUrl(object[] objects, out string urls)

void MenuOpenHyperlink_Click(object sender, EventArgs e)
{
mindMapView1.OpenSelectedUrl();
mindMapView1.OpenSelectedUrl((ParentForm as DocumentForm)?.Document.FileName);
}

void MenuAddTopic_Click(object sender, EventArgs e)
Expand Down
11 changes: 10 additions & 1 deletion Code/Blumind/Core/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static short LOWORD(int value)
return (short)value;
}

public static void OpenUrl(string url)
public static void OpenUrl(string url, string documentLocation = null)
{
if (!string.IsNullOrEmpty(url))
{
Expand All @@ -28,7 +28,16 @@ public static void OpenUrl(string url)
if (File.Exists(url) && StringComparer.OrdinalIgnoreCase.Equals(Path.GetExtension(url), Document.Extension))
Program.MainForm.OpenDocument(url);
else
{
if (!string.IsNullOrEmpty(documentLocation))
{
var relativePath = Path.Combine(Path.GetDirectoryName(documentLocation), url);

if (!File.Exists(url) && File.Exists(relativePath))
url = relativePath;
}
Process.Start(url);
}
}
catch (System.Exception ex)
{
Expand Down