Skip to content

Commit

Permalink
Fix Linux (#251)
Browse files Browse the repository at this point in the history
* README: recommend instaling python-is-python2
  * Required for Mercurial to run an Ubuntu 20.04
  * Related to https://jira.sil.org/browse/LT-20521
* Update TestBuild.sh to match the script in TeamCity
* LT-20610: Enable QA Server on Linux
  Fix case of LANGUAGEFORGESERVER environment variable
* LT-20323: Cosmetic Improvements
  * More space for labels (so Custom URL fits on Linux)
  * Fix the width of the Custom URL checkbox
  * Increase the default width
  * Make text boxes for username and password the same width
* Clean up: remove redundant IsUnix utility and unused delegates; clean up usings.
  • Loading branch information
papeh committed Apr 14, 2021
1 parent 0bcd92c commit 97a15e8
Show file tree
Hide file tree
Showing 27 changed files with 106 additions and 276 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ build using `UpdateDependencies.sh`:
cd chorus
./UpdateDependencies.sh

##### Python

Beginning with Ubuntu 20.04 (Focal), you will need to `sudo apt install python-is-python2` so that Mercurial can run.

8 changes: 5 additions & 3 deletions build/TestBuild.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
cd "$(dirname "$0")/.."
build/buildupdate.mono.sh
export MONO_PREFIX=/usr
. environ
root=$PWD
cd build
xbuild "/target:${2:-Clean;Compile}" /property:Configuration="${1:-Debug}Mono" /property:RootDir=$root /property:BUILD_NUMBER="1.5.1.abcd" Chorus.proj
# root=$PWD
# cd build
# xbuild "/target:${2:-Clean;Compile}" /property:Configuration="${1:-Debug}Mono" /property:RootDir=$root /property:BUILD_NUMBER="1.5.1.abcd" Chorus.proj
xbuild /t:Compile /property:Configuration=DebugMono /property:BUILD_NUMBER="1.5.1.abcd" build/Chorus.proj
7 changes: 6 additions & 1 deletion src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ public GetCloneFromInternetDialog(GetCloneFromInternetModel model)
_targetFolderControl.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
_targetFolderControl._downloadButton.Click+=OnDownloadClick;
_targetFolderControl.Location = new Point(0, _serverSettingsControl.Height +10);
MinimumSize = new Size(_targetFolderControl.MinimumSize.Width+20, _targetFolderControl.Bottom +20);
var minimumWidth = Math.Max(_serverSettingsControl.MinimumSize.Width, _targetFolderControl.MinimumSize.Width) + 20;
MinimumSize = new Size(minimumWidth, _targetFolderControl.Bottom + 20);
// On Linux, we have to set the dialog width, then set the control width back to what it had been. TODO: different order
var sscWidth = _serverSettingsControl.Width;
Width = sscWidth + 30;
_serverSettingsControl.Width = sscWidth;
if (_targetFolderControl.Bottom +30> Bottom)
{
this.Size = new Size(this.Width,_targetFolderControl.Bottom + 30);
Expand Down
138 changes: 80 additions & 58 deletions src/Chorus/UI/Misc/ServerSettingsControl.Designer.cs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/Chorus/UI/Settings/SendReceiveSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System;
using System.IO;
using System.Windows.Forms;
using Chorus.UI.Misc;
using Chorus.Utilities.Help;
using Chorus.VcsDrivers.Mercurial;
using L10NSharp;
Expand Down
4 changes: 2 additions & 2 deletions src/LibChorus/ChorusHub/ChorusHubOptions.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.IO;
using Chorus.Utilities.code;
using SIL.PlatformUtilities;

namespace Chorus.ChorusHub
{
public static class ChorusHubOptions
{
private static string _rootDirectory = LinuxUtils.IsUnix ? Path.Combine(Environment.GetEnvironmentVariable("HOME"), "ChorusHub") : @"C:\ChorusHub";
private static string _rootDirectory = Platform.IsUnix ? Path.Combine(Environment.GetEnvironmentVariable("HOME"), "ChorusHub") : @"C:\ChorusHub";

//these numbers were selected by looking at the IANA registry and intentionally *not* picking,
//"undefined" ones (which could become defined in the future), but rather ones already assigned to stuff
Expand Down
6 changes: 0 additions & 6 deletions src/LibChorus/FileTypeHandlers/IChorusFileTypeHandler.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Chorus.FileTypeHandlers.test;
using Chorus.Utilities.code;
using Chorus.merge;
using Chorus.VcsDrivers.Mercurial;
using SIL.IO;
Expand Down
3 changes: 0 additions & 3 deletions src/LibChorus/FileTypeHandlers/xml/XmlTextChange.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using Chorus.Properties;
using Chorus.VcsDrivers.Mercurial;
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/LibChorus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@
<Compile Include="sync\DefaultSychronizerAdjunct.cs" />
<Compile Include="sync\ISychronizerAdjunct.cs" />
<Compile Include="sync\LargeFileFilter.cs" />
<Compile Include="Utilities\code\LinuxUtils.cs" />
<Compile Include="Utilities\Help\HelpUtils.cs" />
<Compile Include="Utilities\MakeRecordDictionary.cs" />
<Compile Include="FileTypeHandlers\NotePresenter.cs" />
Expand Down Expand Up @@ -336,7 +335,6 @@
<DependentUpon>AnnotationImages.resx</DependentUpon>
</Compile>
<Compile Include="notes\AnnotationClass.cs" />
<Compile Include="Utilities\code\DelegateDefinitions.cs" />
<Compile Include="Utilities\MultiMap.cs" />
<Compile Include="Utilities\UrlHelper.cs" />
<Compile Include="Utilities\WebResponseHelper.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/LibChorus/Model/ServerSettingsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ServerSettingsModel
{
#region static and constant
private const string LanguageForge = "languageforge.org";
private const string ServerEnvVar = "LanguageForgeServer";
private const string ServerEnvVar = "LANGUAGEFORGESERVER";

public static string LanguageForgeServer
{
Expand Down
4 changes: 0 additions & 4 deletions src/LibChorus/Utilities/FailureSimulator.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;

namespace Chorus.Utilities
{
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/Utilities/ProcessStream.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;

namespace Chorus.Utilities
Expand Down
3 changes: 0 additions & 3 deletions src/LibChorus/Utilities/UrlHelper.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using SIL.Reporting;

Expand Down
138 changes: 0 additions & 138 deletions src/LibChorus/Utilities/code/DelegateDefinitions.cs

This file was deleted.

20 changes: 0 additions & 20 deletions src/LibChorus/Utilities/code/LinuxUtils.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/LibChorus/Utilities/ini/IniException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
#endregion

using System;
using System.Security;
using System.Globalization;
using System.Security.Permissions;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;


namespace Nini.Ini
Expand Down
3 changes: 0 additions & 3 deletions src/LibChorus/VcsDrivers/Mercurial/HgExceptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chorus.VcsDrivers.Mercurial
{
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/VcsDrivers/Mercurial/HgRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Net.Mime;
using System.Threading;
using Chorus.Utilities;
using SIL.Progress;
using SIL.Reporting;
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/merge/text/PartialTextMerger.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using Chorus.Utilities;

namespace Chorus.merge.text
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/merge/xml/generic/DropTheirsMergeStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Chorus.merge.xml.generic;

namespace Chorus.merge.xml.generic
{
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/merge/xml/generic/FindNodeToMerge.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#define USEOPTIMIZEDVERSION
using System;
using System.Collections.Generic;
using SIL.Extensions;
#if USEOPTIMIZEDVERSION
using System.Linq;
#endif
using System.Text;
using System.Web;
using System.Xml;
using Chorus.merge.xml.generic.xmldiff;
using SIL.Code;
Expand Down
3 changes: 0 additions & 3 deletions src/LibChorus/notes/AnnotationClass.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;


namespace Chorus.notes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 SIL International
// Copyright (c) 2015 SIL International
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)
using System;
using System.Collections.Generic;
Expand All @@ -7,7 +7,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Chorus.Utilities.code;
using SIL.PlatformUtilities;

namespace Chorus.notes
{
Expand Down Expand Up @@ -38,7 +38,7 @@ public EmbeddedMessageContentHandlerRepository()
var libChorusAssembly = Assembly.GetExecutingAssembly();

//Set the codebase variable appropriately depending on the OS
var codeBase = libChorusAssembly.CodeBase.Substring(LinuxUtils.IsUnix ? 7 : 8);
var codeBase = libChorusAssembly.CodeBase.Substring(Platform.IsUnix ? 7 : 8);
var baseDir = Path.GetDirectoryName(codeBase);

// REVIEW: for some reason using *.* or *.dll didn't work - creating the catalogs in
Expand Down
5 changes: 1 addition & 4 deletions src/LibChorus/notes/IAnnotationRepository.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using SIL.Progress;

namespace Chorus.notes
Expand Down
2 changes: 0 additions & 2 deletions src/LibChorus/notes/IndexOfAllAnnotationsByKey.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Diagnostics;
using System.Web;
using Chorus.Utilities;

namespace Chorus.notes
Expand Down
Loading

0 comments on commit 97a15e8

Please sign in to comment.