Skip to content

Commit

Permalink
Release/2.2.23 (#26)
Browse files Browse the repository at this point in the history
* Default account name instead of "via intento" in dropdown
* Fix language combobox index setting
* CONTMS-88 TMS: trados prompsit: Provider selecting errors
* CONTMS-67 All custom routing are named "industry-specific routing based on Intento benchmarks"
* CONTMS-105 Transfer: Memoq public version changes: don't show custom parser checkbox
* COMTMS-105 Transfer: contms-58-59-61-settings-form-enhancement
* CONTMS-105 Transfer: contms-40 & 66
* CONTMS-105 Transfer:  contms-72 & 74
* COMTMS-105 Transfer: contms-76-cancel-saves-changes
* CONTMS-105 Transfer: contms-80-link-to-presentation,
* CONTMS-105 Transfer
* Fix: not saving api key until check and uncheck smart routing
* Add: smart default routing when setting up for the first time
* Fix: Missing intento instance in case of saving settings without testing
* CONTMS-81 Only_a_single_character_can_be_typed_into_the_MODEL_field_in_between_other_characters
* Bugfix/setting up routing settings (#22)
* CONTMS-67 fix route settings
* Contms 105 make memo q public and private plugin version consistent (#24)
* COMTMS-105 Transfer: contms-45-improved-ui-settings-form
* CONTMS-101 TMS: Trados: Create build scripts

Co-authored-by: Vladimir Abramov <mr.vovan@gmail.com>
  • Loading branch information
oerodger and vlabramov authored Apr 20, 2021
1 parent 960881a commit 2c3ba42
Show file tree
Hide file tree
Showing 133 changed files with 1,919 additions and 644,980 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net45</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IntentoSDK" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Intento.MT.Plugin.PropertiesForm\Intento.MT.Plugin.PropertiesForm.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

</Project>
35 changes: 14 additions & 21 deletions Tests.cs → ...to.MT.Plugin.PropertiesForm.Test/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Intento.MT.Plugin.PropertiesForm.WinForms;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft;
using Newtonsoft.Json.Linq;
using static Intento.MT.Plugin.PropertiesForm.ApiKeyState;
using static Intento.MT.Plugin.PropertiesForm.IntentoTranslationProviderOptionsForm;
using NUnit.Framework;

namespace Intento.MT.Plugin.PropertiesForm
{
[TestClass]
namespace Intento.MT.Plugin.PropertiesForm.Test
{
public sealed class Tests
{
private IntentoSDK.IntentoAiTextTranslate Fabric(string apiKey, string userAgent, IntentoSDK.ProxySettings proxySettings)
Expand Down Expand Up @@ -409,7 +401,7 @@ Form InitializeForm(Form form)
#endregion all parametries filled, auth - delegated, models & glossary - delegated

#region auth - not delegated (the provider has no predefined), models & glossary - empty
[TestMethod]
[Test]
public void InitionalFillOptionsForm2()
{
IntentoTranslationProviderOptionsForm form;
Expand Down Expand Up @@ -491,9 +483,9 @@ public void InitionalFillOptionsForm2()
Assert.AreEqual(true, form.groupBoxMTConnect2.Visible);
Assert.AreEqual(options.ApiKey, form.apiKey_tb.Text);
Assert.AreEqual(options.ProviderName, form.textBoxProviderName.Text);
Assert.AreEqual(Resource.Empty, form.textBoxAccount.Text);
Assert.AreEqual(Resource.Empty, form.textBoxModel.Text);
Assert.AreEqual(Resource.Empty, form.textBoxGlossary.Text);
Assert.AreEqual(string.Empty, form.textBoxAccount.Text);
Assert.AreEqual(string.Empty, form.textBoxModel.Text);
Assert.AreEqual(string.Empty, form.textBoxGlossary.Text);
Assert.AreEqual(true, form.buttonContinue.Enabled);
form.formMT.Close();
qqq.Refresh();
Expand All @@ -502,7 +494,7 @@ public void InitionalFillOptionsForm2()
#endregion auth - not delegated (the provider has no predefined), models & glossary - empty

#region all parametries filled, auth - delegated, models & glossary - not delegated
[TestMethod]
[Test]
public void InitionalFillOptionsForm3()
{
options = new IntentoMTFormOptions()
Expand Down Expand Up @@ -712,7 +704,7 @@ public void InitionalFillOptionsForm3()
//}
#endregion only API key filled, smartRouting - true

[TestMethod]
[Test]
public void CleanOptionsOnChangeProvider()
{
#region all parametries filled, auth - not delegated, models & glossary - delegated
Expand Down Expand Up @@ -772,7 +764,7 @@ public void CleanOptionsOnChangeProvider()
qqq.Close();
}

[TestMethod]
[Test]
public void CleanOptionsOnChangeCreditionals()
{
// all parametries filled, auth, models & glossary - delegated
Expand Down Expand Up @@ -856,7 +848,8 @@ public void CleanOptionsOnChangeCreditionals()
}

#region ChangeOfLanguageOnChangeModel: all parametries filled, auth - delegated, models & glossary - delegated
[TestMethod]

[Test]
public void ChangeOfLanguageOnChangeModel()
{
options = new IntentoMTFormOptions()
Expand All @@ -878,7 +871,7 @@ public void ChangeOfLanguageOnChangeModel()
};
using (form = new IntentoTranslationProviderOptionsForm(options, langPair, Fabric, true))
{
testProviderData.delegated_credentials = true;
testProviderData.delegated_credentials = true;
form.testListProvidersData = testProvidersData;
form.testOneProviderData = testProviderData;
form.testAuthData = testAuthDataGoogle;
Expand Down Expand Up @@ -950,7 +943,7 @@ public void ChangeOfLanguageOnChangeModel()
Assert.AreEqual(options.ApiKey, form.apiKey_tb.Text);
Assert.AreEqual(options.ProviderName, form.textBoxProviderName.Text);
Assert.AreEqual("test1", form.textBoxAccount.Text);
Assert.AreEqual(Resource.Empty, form.textBoxModel.Text);
Assert.AreEqual(string.Empty, form.textBoxModel.Text);
Assert.AreEqual("gloss_ru_en", form.textBoxGlossary.Text);
Assert.AreEqual(true, form.buttonContinue.Enabled);
form.formMT.Close();
Expand Down
18 changes: 10 additions & 8 deletions Intento.MT.Plugin.PropertiesForm.sln
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2050
# Visual Studio Version 16
VisualStudioVersion = 16.0.31105.61
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intento.MT.Plugin.PropertiesForm", "Intento.MT.Plugin.PropertiesForm.csproj", "{A4374128-DD01-4CE3-B62C-4CC3460620C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestForm", "TestForm\TestForm.csproj", "{A963C442-DFD3-4FE8-A2E1-9917AC274695}"
ProjectSection(ProjectDependencies) = postProject
{A4374128-DD01-4CE3-B62C-4CC3460620C0} = {A4374128-DD01-4CE3-B62C-4CC3460620C0}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Intento.MT.Plugin.PropertiesForm.Test", "Intento.MT.Plugin.PropertiesForm.Test\Intento.MT.Plugin.PropertiesForm.Test.csproj", "{5954BDAE-A274-4615-9E94-2D0A6FA8B786}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intento.MT.Plugin.PropertiesForm", "Intento.MT.Plugin.PropertiesForm\Intento.MT.Plugin.PropertiesForm.csproj", "{A4374128-DD01-4CE3-B62C-4CC3460620C0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5954BDAE-A274-4615-9E94-2D0A6FA8B786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5954BDAE-A274-4615-9E94-2D0A6FA8B786}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Release|Any CPU.Build.0 = Release|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions BaseState.cs → ...nto.MT.Plugin.PropertiesForm/BaseState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ private bool ShowErrorMessage()
form.errors = form.errors.Where(i => i != null).ToList();
if ((form.errors == null || form.errors.Count == 0))
{
form.buttonContinue.Enabled = true;
form.formMT.buttonSave.Enabled = true;
SetErrorMessage();
return true;
}
else
{
SetErrorMessage(string.Join(", ", form.errors.Where(i => i != null)));
form.buttonContinue.Enabled = false;
form.formMT.buttonSave.Enabled = false;
return false;
}
Expand Down
29 changes: 16 additions & 13 deletions GlossaryState.cs → ...MT.Plugin.PropertiesForm/GlossaryState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,27 @@ public string SelectedGlossaryFrom

#endregion Properties

void Clear()
{
internalControlChange = true;
formMT.comboBoxGlossaries.Items.Clear();
formMT.textBoxGlossary.Text = string.Empty;
internalControlChange = false;
}
void Clear(bool clearTextBox = true, bool clearComboBox = true)
{
internalControlChange = true;
if (clearComboBox) formMT.comboBoxGlossaries.Items.Clear();
if (clearTextBox) formMT.textBoxGlossary.Text = string.Empty;
internalControlChange = false;
}


private void FillGlossaryControls()
private void FillGlossaryControls()
{
if (!authState.IsOK)
return;

Clear();

if (!providerState.custom_glossary)
{ // glossaries are not supported by provider
mode = StateModeEnum.prohibited;
formMT.groupBoxGlossary.Enabled = false;
return;
Clear();
return;
}

mode = StateModeEnum.optional;
Expand All @@ -204,8 +205,9 @@ private void FillGlossaryControls()

if (isList)
{
// Fill Glossary and choose SelectedIndex
formMT.comboBoxGlossaries.Items.Insert(0, "");
Clear();
// Fill Glossary and choose SelectedIndex
formMT.comboBoxGlossaries.Items.Insert(0, "");
foreach (string x in glossaries.Select(x => (string)x.Key).OrderBy(x => x))
{
int n = formMT.comboBoxGlossaries.Items.Add(x);
Expand All @@ -216,7 +218,8 @@ private void FillGlossaryControls()
}
else
{
formMT.textBoxGlossary.Text = options.Glossary;
Clear(clearTextBox: false);
formMT.textBoxGlossary.Text = options.Glossary;
formMT.textBoxGlossary.Visible = true;
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<DoSign Condition="'$(DoSign)' == ''">0</DoSign>
<IntentoSDKPath Condition="'$(IntentoSDKPath)' == ''">..\intento-csharp\bin\</IntentoSDKPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -34,19 +36,14 @@
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>intento.pfx</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>intento_sn.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="IntentoSDK">
<HintPath>..\intento-csharp\bin\IntentoSDK.dll</HintPath>
<Reference Include="IntentoSDK, Version=1.5.3.0, Culture=neutral, PublicKeyToken=7fbf26cf2c5f5508, processorArchitecture=MSIL">
<HintPath>..\..\packages\IntentoSDK.1.5.3\lib\net45\IntentoSDK.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\intento-csharp\bin\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -61,7 +58,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Logs.cs" />
<Compile Include="Tests.cs" />
<Compile Include="WinForms\IntentoFormIgnoreError.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -150,11 +146,11 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include=".gitignore" />
<None Include="app.config" />
<None Include="githashForm.bat" />
<None Include="intento.pfx" />
<None Include="intento_sn.snk" />
<None Include="packages.config" />
<None Include="README.md" />
<None Include="Properties\Intento.MT.Plugin.PropertiesForm.nuspec" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\intento.ico" />
Expand All @@ -163,4 +159,7 @@
<PropertyGroup>
<PreBuildEvent>$(ProjectDir)githashForm.bat &gt;$(ProjectDir)GitHash.cs</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent Condition="'$(DoSign)' == '1'">powershell -ExecutionPolicy RemoteSigned $(ProjectDir)postbuild.ps1 '$(TargetDir)$(TargetName).dll'</PostBuildEvent>
</PropertyGroup>
</Project>
Loading

0 comments on commit 2c3ba42

Please sign in to comment.