Merge pull request #5420 from larsbrubaker/main
default to include printing
This commit is contained in:
commit
ea6ced10d1
2 changed files with 23 additions and 8 deletions
|
|
@ -563,11 +563,25 @@ namespace MatterHackers.MatterControl
|
||||||
printer.Dispose();
|
printer.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LaunchBrowser(string targetUri)
|
public static void LaunchBrowser(string targetUri)
|
||||||
{
|
{
|
||||||
|
string AddQueryPram(string url, string key, string value)
|
||||||
|
{
|
||||||
|
if (url.Contains("?"))
|
||||||
|
{
|
||||||
|
return url + "&" + key + "=" + value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return url + "?" + key + "=" + value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UiThread.RunOnIdle(() =>
|
UiThread.RunOnIdle(() =>
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(OemSettings.Instance.AffiliateCode)
|
var affiliateCode = OemSettings.Instance.AffiliateCode;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(affiliateCode)
|
||||||
&& targetUri.Contains("matterhackers.com"))
|
&& targetUri.Contains("matterhackers.com"))
|
||||||
{
|
{
|
||||||
string internalLink = "";
|
string internalLink = "";
|
||||||
|
|
@ -578,14 +592,15 @@ namespace MatterHackers.MatterControl
|
||||||
targetUri = targetUri.Substring(0, targetUri.Length - internalLink.Length);
|
targetUri = targetUri.Substring(0, targetUri.Length - internalLink.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetUri.Contains("?"))
|
// if the affiliateCode is only numbers, we assume it is a tracking code
|
||||||
|
if (affiliateCode.All(char.IsDigit))
|
||||||
{
|
{
|
||||||
targetUri += $"&aff={OemSettings.Instance.AffiliateCode}";
|
targetUri = AddQueryPram(targetUri, "aff", affiliateCode);
|
||||||
}
|
}
|
||||||
else
|
else // it is an RCODE
|
||||||
{
|
{
|
||||||
targetUri += $"?aff={OemSettings.Instance.AffiliateCode}";
|
targetUri = AddQueryPram(targetUri, "rcode", affiliateCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
targetUri += internalLink;
|
targetUri += internalLink;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace MatterHackers.MatterControl.SettingsManagement
|
||||||
|
|
||||||
public bool ShowShopButton = true;
|
public bool ShowShopButton = true;
|
||||||
|
|
||||||
public bool DesignToolsOnly = true;
|
public bool DesignToolsOnly = false;
|
||||||
|
|
||||||
public bool CheckForUpdatesOnFirstRun = false;
|
public bool CheckForUpdatesOnFirstRun = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue