mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
remove trailing whitespace, simplify installer script
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@903 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
55e8a58c93
commit
d32aaafab5
10
build.bat
10
build.bat
@ -126,22 +126,22 @@ EXIT
|
||||
|
||||
|
||||
:SHOWHELP
|
||||
TITLE "%~nx0 %1"
|
||||
TITLE %~nx0 %1
|
||||
ECHO. & ECHO.
|
||||
ECHO Usage: %~nx0 [Clean^|Build^|Rebuild]
|
||||
ECHO.
|
||||
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
|
||||
ECHO The arguments are not case sensitive.
|
||||
ECHO. & ECHO.
|
||||
ECHO Executing "%~nx0" will use the defaults: "%~nx0 build"
|
||||
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 build"
|
||||
ECHO.
|
||||
ENDLOCAL
|
||||
EXIT /B
|
||||
|
||||
|
||||
:SubDetectInnoSetup
|
||||
REM Detect if we are running on 64bit WIN and use Wow6432Node, and set the path
|
||||
REM of Inno Setup accordingly
|
||||
rem Detect if we are running on 64bit Windows and use Wow6432Node since Inno Setup is
|
||||
rem a 32-bit application, and set the registry key of Inno Setup accordingly
|
||||
IF DEFINED PROGRAMFILES(x86) (
|
||||
SET "U_=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
|
||||
) ELSE (
|
||||
@ -155,5 +155,5 @@ EXIT /B
|
||||
|
||||
|
||||
:SubInnoSetup
|
||||
SET InnoSetupPath=%*
|
||||
SET "InnoSetupPath=%*"
|
||||
EXIT /B
|
||||
|
@ -381,9 +381,7 @@ function ShouldSkipPage(PageID: Integer): Boolean;
|
||||
begin
|
||||
// Hide the license page
|
||||
if IsUpgrade() and (PageID = wpLicense) then
|
||||
Result := True
|
||||
else
|
||||
Result := False;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
|
||||
@ -401,9 +399,8 @@ end;
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
begin
|
||||
if CurStep = ssInstall then begin
|
||||
if IsTaskSelected('reset_dictionaries') then begin
|
||||
if IsTaskSelected('reset_dictionaries') then
|
||||
CleanUpDictionaries();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -450,9 +447,8 @@ begin
|
||||
Result := True;
|
||||
CreateMutex(installer_mutex_name);
|
||||
|
||||
while IsModuleLoaded('SubtitleEdit.exe') and (iMsgBoxResult <> IDCANCEL) do begin
|
||||
while IsModuleLoaded('SubtitleEdit.exe') and (iMsgBoxResult <> IDCANCEL) do
|
||||
iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunning'), mbError, MB_OKCANCEL, IDCANCEL);
|
||||
end;
|
||||
|
||||
if iMsgBoxResult = IDCANCEL then
|
||||
Result := False;
|
||||
@ -467,9 +463,8 @@ begin
|
||||
ShellExec('open','http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe','','',SW_SHOWNORMAL,ewNoWait,iErrorCode);
|
||||
Result := False;
|
||||
end
|
||||
else begin
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -489,9 +484,8 @@ begin
|
||||
CreateMutex(installer_mutex_name);
|
||||
|
||||
// Check if app is running during uninstallation
|
||||
while IsModuleLoadedU('SubtitleEdit.exe') and (iMsgBoxResult <> IDCANCEL) do begin
|
||||
while IsModuleLoadedU('SubtitleEdit.exe') and (iMsgBoxResult <> IDCANCEL) do
|
||||
iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunningUninstall'), mbError, MB_OKCANCEL, IDCANCEL);
|
||||
end;
|
||||
|
||||
if iMsgBoxResult = IDCANCEL then
|
||||
Result := False;
|
||||
|
@ -268,7 +268,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
{
|
||||
Items[i].UseItemStyleForSubItems = false;
|
||||
if (_settings.Tools.ListViewSyntaxColorDuration)
|
||||
{
|
||||
{
|
||||
double charactersPerSecond = Utilities.GetCharactersPerSecond(paragraph);
|
||||
if (charactersPerSecond > Configuration.Settings.General.SubtitleMaximumCharactersPerSeconds + 7)
|
||||
Items[i].SubItems[ColumnIndexDuration].BackColor = System.Drawing.Color.Red;
|
||||
|
@ -1148,7 +1148,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
//fix missing spaces before/after quotes - Get a"get out of jail free"card. -> Get a "get out of jail free" card.
|
||||
if (Utilities.CountTagInText(p.Text, "\"") == 2)
|
||||
{
|
||||
{
|
||||
int start = p.Text.IndexOf('"');
|
||||
int end = p.Text.LastIndexOf('"');
|
||||
string quote = p.Text.Substring(start, end - start + 1);
|
||||
@ -1160,7 +1160,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
newText = newText.Insert(start, " ");
|
||||
end++;
|
||||
}
|
||||
if (end < newText.Length - 2 && !(Environment.NewLine + " <,.!?:;])♪♫").Contains(p.Text[end + 1].ToString()))
|
||||
if (end < newText.Length - 2 && !(Environment.NewLine + " <,.!?:;])♪♫").Contains(p.Text[end + 1].ToString()))
|
||||
{
|
||||
newText = newText.Insert(end + 1, " ");
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
newSub.Paragraphs.Add(p);
|
||||
}
|
||||
if (newSub.Paragraphs.Count > 0 && newSub.Paragraphs.Count < sub.Paragraphs.Count)
|
||||
{
|
||||
{
|
||||
outputFileName = Path.GetFileNameWithoutExtension(fileName) + "_" + className + sf.Extension;
|
||||
if (File.Exists(outputFileName))
|
||||
outputFileName = Path.GetFileNameWithoutExtension(fileName) + "_" + className + "_" + Guid.NewGuid().ToString() + sf;
|
||||
@ -1525,7 +1525,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
mkv.GetMatroskaInfo(fileName, ref isValid, ref hasConstantFrameRate, ref frameRate, ref width, ref height, ref milliseconds, ref videoCodec);
|
||||
if (isValid)
|
||||
{
|
||||
ImportSubtitleFromMatroskaFile(fileName);
|
||||
ImportSubtitleFromMatroskaFile(fileName);
|
||||
if (Path.GetExtension(fileName).ToLower() == ".mkv")
|
||||
OpenVideo(fileName);
|
||||
return;
|
||||
@ -1796,7 +1796,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
MessageBox.Show(string.Format(_language.FileNotFound, fileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsTransportStream(string fileName)
|
||||
{
|
||||
@ -5419,7 +5419,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_changeAlternate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UpdateListSyntaxColoring();
|
||||
|
||||
if (GetCurrentSubtitleFormat().IsFrameBased)
|
||||
@ -8405,7 +8405,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_videoFileName = fileName;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FileInfo fi = new FileInfo(fileName);
|
||||
if (fi.Length < 1000)
|
||||
return;
|
||||
|
@ -407,7 +407,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_mainWindow.CorrectWord(_prefix + ChangeWord + _postfix, _currentParagraph, _prefix + _currentWord + _postfix, ref _firstChange);
|
||||
break;
|
||||
case SpellCheckAction.Skip:
|
||||
_noOfSkippedWords++;
|
||||
_noOfSkippedWords++;
|
||||
break;
|
||||
case SpellCheckAction.SkipAll:
|
||||
_noOfSkippedWords++;
|
||||
|
@ -50,7 +50,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
panelContainer.Controls.Clear();
|
||||
_mainForm.ReDockVideoPlayer(control);
|
||||
_mainForm.SetVideoPlayerToggleOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
_positionsAndSizes.SavePositionAndSize(this);
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
||||
}
|
||||
|
||||
return pre + word + post;
|
||||
}
|
||||
}
|
||||
|
||||
private string FixCommonWordErrorsQuick(string word, string lastWord)
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
|
||||
{
|
||||
_errorCount = 0;
|
||||
_errorCount = 0;
|
||||
var sb = new StringBuilder();
|
||||
foreach (string l in lines)
|
||||
sb.AppendLine(l);
|
||||
|
@ -283,17 +283,17 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
if (temp.Length < mergeLinesShorterThan)
|
||||
{
|
||||
string[] lines = text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
if (lines.Length > 1) {
|
||||
bool isDialog = true;
|
||||
foreach (string line in lines) {
|
||||
string cleanLine = Utilities.RemoveHtmlTags(line).Trim();
|
||||
isDialog = isDialog && (cleanLine.StartsWith("-") ||
|
||||
cleanLine.StartsWith("—"));
|
||||
}
|
||||
if (isDialog) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
if (lines.Length > 1) {
|
||||
bool isDialog = true;
|
||||
foreach (string line in lines) {
|
||||
string cleanLine = Utilities.RemoveHtmlTags(line).Trim();
|
||||
isDialog = isDialog && (cleanLine.StartsWith("-") ||
|
||||
cleanLine.StartsWith("—"));
|
||||
}
|
||||
if (isDialog) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace Test
|
||||
[TestMethod()]
|
||||
[DeploymentItem("SubtitleEdit.exe")]
|
||||
public void RemoveColonTest()
|
||||
{
|
||||
{
|
||||
FormRemoveTextForHearImpaired_Accessor target = new FormRemoveTextForHearImpaired_Accessor();
|
||||
string text = "Man over P.A.:\r\nGive back our homes.";
|
||||
string expected = "Give back our homes.";
|
||||
|
Loading…
Reference in New Issue
Block a user