Skip to content

Commit 0c2c61d

Browse files
committed
LT22418: per Hasso feedback; get PcPatrBrowser toolbar to work
Change-Id: If4b0548070e4dd451b528ef7fc0952330dbc5df3
1 parent df08e01 commit 0c2c61d

9 files changed

Lines changed: 10 additions & 254 deletions

File tree

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/DisambiguateTest.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public override void FixtureSetup()
4040
TestFile = kTestFile;
4141
if (String.IsNullOrEmpty(SavedTestFile))
4242
SavedTestFile = kTestFileB4;
43-
TempTestFile = Path.Combine(Path.GetTempPath(), TestFile);
43+
44+
var temp = new IO.TempFile(Path.Combine(Path.GetTempPath(), TestFile), false);
45+
TempTestFile = temp.Path;
4446
File.Copy(Path.Combine(TestDataDir, SavedTestFile), TempTestFile, true);
4547
ProjId = new ProjectId(TempTestFile);
4648
FwRegistryHelper.Initialize();
@@ -66,10 +68,6 @@ public override void FixtureTeardown()
6668
if (MyCache != null)
6769
{
6870
ProjectLockingService.UnlockCurrentProject(MyCache);
69-
if (File.Exists(TempTestFile))
70-
{
71-
File.Delete(TempTestFile);
72-
}
7371
}
7472
}
7573
}

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/PCPatrInvoker.cs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ private void CreateBatchFile()
5858
sbBatchFile.Append("\\pcpatr64\" -t ");
5959
sbBatchFile.Append(takeFileName);
6060
sbBatchFile.Append("\n");
61-
string removeCRs = sbBatchFile.ToString().Replace("\r", "").Replace("
","");
62-
File.WriteAllText(BatchFile, removeCRs);
63-
Console.WriteLine("\nbatch file =");
64-
Console.WriteLine("=================================================");
65-
Console.Write(removeCRs);
66-
Console.WriteLine("=================================================");
61+
File.WriteAllText(BatchFile, sbBatchFile.ToString());
6762
}
6863

6964
private string GetPcPatr64ExePath()
@@ -91,22 +86,14 @@ public void Invoke()
9186
using (var process = Process.Start(processInfo))
9287
{
9388
process.PriorityClass = ProcessPriorityClass.High;
94-
Console.WriteLine("\nBefore WaitForExit");
9589
process.WaitForExit();
96-
Console.WriteLine("\tAfter WaitForExit");
9790
string error = process.StandardError.ReadToEnd();
98-
Console.WriteLine("\nStdErr=");
99-
Console.WriteLine("=================================================");
100-
Console.Write(error);
101-
Console.WriteLine("=================================================");
10291
if (error.Contains("ERROR "))
10392
{
104-
Console.WriteLine("\tFailure");
10593
InvocationSucceeded = false;
10694
}
10795
else
10896
{
109-
Console.WriteLine("\tSuccess");
11097
InvocationSucceeded = true;
11198
}
11299
process.StandardOutput.Close();
@@ -118,8 +105,6 @@ public void Invoke()
118105
private void CreateTakeFile()
119106
{
120107
string takeFile = Path.Combine(Path.GetTempPath(), takeFileName);
121-
//StringBuilder sbTakeFileShortPath = new StringBuilder(255);
122-
//int i = GetShortPathName(takeFile, sbTakeFileShortPath, sbTakeFileShortPath.Capacity);
123108
var sbTake = new StringBuilder();
124109
sbTake.Append("set comment |\n");
125110
sbTake.Append("log ");
@@ -128,15 +113,6 @@ private void CreateTakeFile()
128113
sbTake.Append("load grammar ");
129114
sbTake.Append(GrammarFile);
130115
sbTake.Append("\n");
131-
// See if the failure we're getting in GitHub is due to not finding the grammr file:
132-
// We'll put it in the temp directory now.
133-
//StringBuilder sbGrammarFileShortPath = new StringBuilder(255);
134-
//i = GetShortPathName(
135-
// GrammarFile,
136-
// sbGrammarFileShortPath,
137-
// sbGrammarFileShortPath.Capacity
138-
//);
139-
//sbTake.Append(sbGrammarFileShortPath.ToString() + "\n");
140116
sbTake.Append("set timing on\n");
141117
sbTake.Append("set gloss on\n");
142118
sbTake.Append("set features all\n");
@@ -155,13 +131,8 @@ private void CreateTakeFile()
155131
// since the batch fle defaults to the temp directory, we just use the invoker files as they are
156132
sbTake.Append("file disambiguate Invoker.ana Invoker.and\n");
157133
sbTake.Append("exit\n");
158-
string removeCRs = sbTake.ToString().Replace("\r", "").Replace("
", "");
159-
File.WriteAllText(takeFile, removeCRs);
134+
File.WriteAllText(takeFile, sbTake.ToString());
160135
AndFile = Path.Combine(Path.GetTempPath(), "Invoker.and");
161-
Console.WriteLine("\ntake file =");
162-
Console.WriteLine("=================================================");
163-
Console.Write(removeCRs);
164-
Console.WriteLine("=================================================");
165136
}
166137

167138
private void HandleRootGloss(StringBuilder sbTake)

Src/Utilities/pcpatrflex/ExtractAnaFilesFromTexts/Properties/Resources.Designer.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

Src/Utilities/pcpatrflex/ExtractAnaFilesFromTexts/Properties/Resources.resx

Lines changed: 0 additions & 117 deletions
This file was deleted.

Src/Utilities/pcpatrflex/ExtractAnaFilesFromTexts/Properties/Settings.Designer.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

Src/Utilities/pcpatrflex/ExtractAnaFilesFromTexts/Properties/Settings.settings

Lines changed: 0 additions & 7 deletions
This file was deleted.

Src/Utilities/pcpatrflex/PcPatrBrowserDll/GoToDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace SIL.PcPatrBrowser
99
/// <summary>
1010
/// Summary description for GoToDialog.
1111
/// </summary>
12-
public class dlgGoTo : System.Windows.Forms.Form
12+
public class GoToDialog : System.Windows.Forms.Form
1313
{
1414
private System.Windows.Forms.Label lblGoToPrompt;
1515
private System.Windows.Forms.TextBox tbNumber;
@@ -21,7 +21,7 @@ public class dlgGoTo : System.Windows.Forms.Form
2121
/// </summary>
2222
private System.ComponentModel.Container components = null;
2323

24-
public dlgGoTo()
24+
public GoToDialog()
2525
{
2626
//
2727
// Required for Windows Form Designer support
@@ -83,7 +83,7 @@ public int Number
8383
private void InitializeComponent()
8484
{
8585
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(
86-
typeof(dlgGoTo)
86+
typeof(GoToDialog)
8787
);
8888
this.lblGoToPrompt = new System.Windows.Forms.Label();
8989
this.tbNumber = new System.Windows.Forms.TextBox();

Src/Utilities/pcpatrflex/PcPatrBrowserDll/PcPatrBrowser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ private void miViewToolBar_Click(object sender, System.EventArgs e)
17731773

17741774
private void miSentenceGoTo_Click(object sender, System.EventArgs e)
17751775
{
1776-
dlgGoTo dlg = new dlgGoTo();
1776+
GoToDialog dlg = new GoToDialog();
17771777
dlg.Text = "Go To Sentence";
17781778
dlg.GoToPrompt = "&Go to sentence:";
17791779
dlg.ShowDialog();
@@ -1788,7 +1788,7 @@ private void miSentenceGoTo_Click(object sender, System.EventArgs e)
17881788

17891789
private void miParserGoTo_Click(object sender, System.EventArgs e)
17901790
{
1791-
dlgGoTo dlg = new dlgGoTo();
1791+
GoToDialog dlg = new GoToDialog();
17921792
dlg.Text = "Go To Parse";
17931793
dlg.GoToPrompt = "&Go to parse:";
17941794
dlg.ShowDialog();

Src/Utilities/pcpatrflex/PcPatrBrowserDll/PcPatrBrowser.resx renamed to Src/Utilities/pcpatrflex/PcPatrBrowserDll/PcPatrBrowserApp.resx

File renamed without changes.

0 commit comments

Comments
 (0)