Skip to content

Commit

Permalink
Bugfix/setting up routing settings (#22)
Browse files Browse the repository at this point in the history
CONTMS-67 fix route settings
  • Loading branch information
vlabramov authored Apr 11, 2021
1 parent b8922f1 commit 9df62bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions IntentoMTFormOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public void Fill(IntentoMTFormOptions res)
res.TraceEndTime = this.TraceEndTime;
res.MemoqAdditional = this.MemoqAdditional;
res.SaveLocally = this.SaveLocally;
res.Routing = this.Routing;
res._authDict = _authDict == null ? null : new Dictionary<string, string>(_authDict);
}

Expand Down
3 changes: 2 additions & 1 deletion SmartRoutingState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public static string Draw(IntentoTranslationProviderOptionsForm form, SmartRouti
public string Draw()
{
form.formMT.RoutingTable = routingTable;
form.formMT.comboBoxRouting.SelectedValue = routing == null ? "best" : routing;
if (routing != null)
form.formMT.comboBoxRouting.SelectedValue = routing;

return ProviderState.Draw(form, providerState);
}
Expand Down
9 changes: 8 additions & 1 deletion WinForms/IntentoFormOptonsMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,15 @@ Func<string, string, ProxySettings, IntentoAiTextTranslate> fabric
currentOptions = originalOptions.Duplicate();

//smart routing by default
if (currentOptions.ApiKey == null && currentOptions.ProviderId == null)
if (string.IsNullOrEmpty(currentOptions.ProviderId))
{
currentOptions.SmartRouting = true;
if (string.IsNullOrEmpty(currentOptions.Routing))
{
currentOptions.Routing = "best";
currentOptions.RoutingDisplayName = Resource.BestSmartRouteDescription;
}
}

TraceEndTime = originalOptions.TraceEndTime;
formAdvanced = new IntentoFormAdvanced(this);
Expand Down

0 comments on commit 9df62bf

Please sign in to comment.