diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-04-26 01:46:55 +0300 |
---|---|---|
committer | Lluis Sanchez <llsan@microsoft.com> | 2017-05-05 00:22:41 +0300 |
commit | 4c89c22837e4af3cbb07b90d0e5f842a2ab26d60 (patch) | |
tree | 16a98f26cb61688e728ee5f75a2b92b9f2780635 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs | |
parent | e5688b75c8712328ad2928183de023891e305b9f (diff) |
Allow branding privacy and EULA URLs
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs | 75 |
1 files changed, 30 insertions, 45 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs index 1afb9ce108..48f32f860b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs @@ -68,52 +68,37 @@ namespace MonoDevelop.Ide.Gui.Dialogs MarginLeft = 12 }); - infoBox.PackStart (new Xwt.Label () { - Markup = string.Format ("<b>{0}</b>", GettextCatalog.GetString ("License")), - MarginTop = 6, - }); - var cbox = new Xwt.HBox () { - Spacing = 0, - MarginLeft = 12 - }; - var linkLabel = new Xwt.Label { - Markup = "<span underline='true'>License Terms</span>", - Cursor = Xwt.CursorType.Hand, - }; - if (IdeTheme.UserInterfaceTheme == Theme.Light) - linkLabel.Markup = string.Format ("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); - - linkLabel.ButtonReleased += (sender, e) => { - var binDir = System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetEntryAssembly ().Location); - string licensePath = System.IO.Path.Combine (binDir, "branding", "License.txt"); - if (Platform.IsMac) { - var appDir = System.IO.Path.GetFullPath (System.IO.Path.Combine (binDir, "..", "..", "..", "..", "..")); - if (appDir.EndsWith (".app", StringComparison.Ordinal)) { - licensePath = System.IO.Path.Combine (appDir, "Contents", "License.txt"); - } - } - if (!File.Exists (licensePath)) { - MessageService.ShowError ("License file is missing"); - } else { - DesktopService.OpenFile (licensePath); + if (BrandingService.LicenseTermsUrl != null) { + infoBox.PackStart (new Xwt.Label () { + Markup = string.Format ("<b>{0}</b>", GettextCatalog.GetString ("License")), + MarginTop = 6, + }); + + var linkLabel = new Xwt.Label { + Markup = "<span underline='true'>License Terms</span>", + Cursor = Xwt.CursorType.Hand, + MarginLeft = 12 + }; + if (IdeTheme.UserInterfaceTheme == Theme.Light) + linkLabel.Markup = string.Format ("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); + + linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl (BrandingService.LicenseTermsUrl); + infoBox.PackStart (linkLabel); + + if (BrandingService.PrivacyStatementUrl != null) { + linkLabel = new Xwt.Label { + Markup = string.Format ("<span underline='true'>{0}</span>", GettextCatalog.GetString ("Privacy Statement")), + Cursor = Xwt.CursorType.Hand, + MarginLeft = 12 + }; + + if (IdeTheme.UserInterfaceTheme == Theme.Light) + linkLabel.Markup = string.Format ("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); + + linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl (BrandingService.PrivacyStatementUrl); + infoBox.PackStart (linkLabel); } - }; - cbox.PackStart (linkLabel); - infoBox.PackStart (cbox); - - linkLabel = new Xwt.Label { - Markup = string.Format ("<span underline='true'>{0}</span>", GettextCatalog.GetString ("Privacy Statement")), - Cursor = Xwt.CursorType.Hand, - MarginLeft = 12 - }; - - //TODO: factor out - const string PRIVACY_URL = "https://go.microsoft.com/fwlink/?LinkID=824704"; - - if (IdeTheme.UserInterfaceTheme == Theme.Light) - linkLabel.Markup = string.Format ("<span color='#5C2D91'>{0}</span>", linkLabel.Markup); - linkLabel.ButtonReleased += (sender, e) => DesktopService.ShowUrl (PRIVACY_URL); - infoBox.PackStart (linkLabel); + } infoBox.PackStart (new Xwt.Label () { Markup = string.Format ("<b>{0}</b>", GettextCatalog.GetString ("Copyright")), |