Skip to content

Commit

Permalink
fix #47, #45
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 23, 2019
1 parent 2ea14ab commit 6ff29a7
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 61 deletions.
2 changes: 2 additions & 0 deletions Analogy/DataProviders/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public static class CommonChangeLog
{
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
yield return new AnalogyChangeLog("Add default file-data provider associations (issue #47)", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2019, 11, 23));
yield return new AnalogyChangeLog("Add default file-data provider associations (issue #45)", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2019, 11, 23));
yield return new AnalogyChangeLog("Allows disabling of data providers (issue #60)", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2019, 11, 22));
yield return new AnalogyChangeLog("User Settings: Add Export/Import of messages' color settings (Issue #56)", AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2019, 11, 19));
yield return new AnalogyChangeLog("Bookmarks window is not customizable (font size). (issue #59)", AnalogChangeLogType.Defect, "Lior Banai", new DateTime(2019, 11, 19));
Expand Down
2 changes: 0 additions & 2 deletions Analogy/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 30 additions & 5 deletions Analogy/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,37 @@ private async Task OpenOfflineFileWithSpecificDataProvider(string[] files)
OpenOfflineLogs(page, files, parser.DataProvider);
}
else
XtraMessageBox.Show(
"Zero or more than one data provider detected for this file." + Environment.NewLine +
"Please open it directly from the data provider menu", "Unable to open file", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
{
//try from file association:
var supportedAssociation = settings.GetFactoriesThatHasFileAssociation(files).ToList();
if (supportedAssociation.Count == 1)
{
var factory = supportedAssociation.First();
var parser = AnalogyFactoriesManager.Instance
.GetSupportedOfflineDataSourcesFromFactory(factory.FactoryGuid, files).ToList();
RibbonPage page = (Mapping.ContainsKey(factory.FactoryGuid)) ? Mapping[factory.FactoryGuid] : null;
if (parser.Count == 1)
OpenOfflineLogs(page, files, parser.First());
else
{
XtraMessageBox.Show(
$@"More than one data provider detected for this file for {factory.FactoryName}." + Environment.NewLine +
"Please open it directly from the data provider menu", "Unable to open file",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

}
else

XtraMessageBox.Show(
"Zero or more than one data provider detected for this file." + Environment.NewLine +
"Please open it directly from the data provider menu", "Unable to open file",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

}
}

private void AnalogyMainForm_DragDrop(object sender, DragEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion Analogy/Forms/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABc
HAAAAk1TRnQBSQFMAgEBBAEAAVABBAFQAQQBKAEAASgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
HAAAAk1TRnQBSQFMAgEBBAEAAVgBBAFYAQQBKAEAASgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABoAMAAVADAAEBAQABCAYAATIYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
Expand Down
Loading

0 comments on commit 6ff29a7

Please sign in to comment.