Skip to content

Commit

Permalink
Skyline: Final fix for MS1 and ImageComparerWindow fixes (#3307)
Browse files Browse the repository at this point in the history
- Made several MS1 graph screenshots slightly wider in Japanese
- Fixed detection of modified files in Git for new output format
- Fixed ImageComparerWindow behavior when no modified files are found
  • Loading branch information
brendanx67 authored Dec 30, 2024
1 parent 25248b6 commit b23b6f8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ public static IEnumerable<string> GetChangedFilePaths(string directoryPath)
using var reader = new StringReader(output);
while (reader.ReadLine() is { } line)
{
if (!line.StartsWith(" M "))
continue;
// 'git status --porcelain' format: XY path/to/file
var filePath = line.Substring(3).Replace('/', Path.DirectorySeparatorChar);
// For modified have seen " M " and "M "
line = line.Trim();
if (!line.StartsWith("M"))
continue;
var filePath = line.Substring(1).Trim().Replace('/', Path.DirectorySeparatorChar);
yield return Path.Combine(GetPathInfo(directoryPath).Root, filePath);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,21 @@ private void OpenFolder(string folderPath = null)
toolStripFileList.Enabled = true;
if (toolStripFileList.SelectedIndex != 0)
toolStripFileList.SelectedIndex = 0;
FormStateChanged();
}
else
{
toolStripFileList.Enabled = false;
lock (_lock)
{
_fileToShow = null;
_oldScreenshot = new OldScreenshot();
_newScreenshot = new OldScreenshot();
_diff = null;
}
FormStateChanged();
ShowMessage(string.Format("No changed PNG files found in {0}", folderPath));
}

FormStateChanged();
}

private void Previous()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ protected override void DoTest()

int[] m1Thru5 = { 1, 2, 3, 4, 5, 6 };
PickTransitions(pepIndex, m1Thru5); // turn on M+3 M+4 and M+5
if (Equals("ja", CultureInfo.CurrentCulture.TwoLetterISOLanguageName))
RunUIForScreenShot(() => SkylineWindow.Width += 12); // Japanese needs to be a bit wider for the next 4 screenshots
PauseForChromGraphScreenShot("upper - Chromatogram graph metafile with M+3, M+4 and M+5 added", TIP_NAME, tutorialPage++);
PauseForChromGraphScreenShot("lower - Chromatogram graph metafile with M+3, M+4 and M+5 added", TIB_NAME, tutorialPage);
CheckAnnotations(TIB_L, pepIndex, atest++);
Expand Down
8 changes: 5 additions & 3 deletions pwiz_tools/Skyline/TestUtil/GitFileHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ public static IEnumerable<string> GetChangedFilePaths(string directoryPath)
using var reader = new StringReader(output);
while (reader.ReadLine() is { } line)
{
if (!line.StartsWith(" M "))
continue;
// For modified have seen " M " and "M "
// 'git status --porcelain' format: XY path/to/file
var filePath = line.Substring(3).Replace('/', Path.DirectorySeparatorChar);
line = line.Trim();
if (!line.StartsWith("M"))
continue;
var filePath = line.Substring(1).Trim().Replace('/', Path.DirectorySeparatorChar);
yield return Path.Combine(GetPathInfo(directoryPath).Root, filePath);
}
}
Expand Down

0 comments on commit b23b6f8

Please sign in to comment.