From 67e7549eef063efdb670028f67fa95520c54e4d9 Mon Sep 17 00:00:00 2001 From: Jaex Date: Wed, 9 Sep 2015 23:58:31 +0300 Subject: [PATCH] Disable GitHub update check in Steam build --- ShareX.HelpersLib/ShareX.HelpersLib.csproj | 4 +- ShareX/Forms/AboutForm.cs | 4 + .../Forms/ApplicationSettingsForm.Designer.cs | 174 +++++++++--------- ShareX/Forms/ApplicationSettingsForm.cs | 2 +- ShareX/Forms/ApplicationSettingsForm.resx | 4 +- ShareX/Forms/MainForm.cs | 2 +- ShareX/Program.cs | 12 ++ ShareX/ShareX.csproj | 4 +- 8 files changed, 111 insertions(+), 95 deletions(-) diff --git a/ShareX.HelpersLib/ShareX.HelpersLib.csproj b/ShareX.HelpersLib/ShareX.HelpersLib.csproj index 0eeca3942..1d8d8e8ad 100644 --- a/ShareX.HelpersLib/ShareX.HelpersLib.csproj +++ b/ShareX.HelpersLib/ShareX.HelpersLib.csproj @@ -40,7 +40,7 @@ none true bin\Release\ - TRACE + TRACE;RELEASE prompt 4 MinimumRecommendedRules.ruleset @@ -53,7 +53,7 @@ bin\Steam\ - TRACE;Steam + TRACE;STEAM true true AnyCPU diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index 83e6d79be..5b3108146 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -42,7 +42,11 @@ public AboutForm() rtbShareXInfo.AddContextMenu(); rtbCredits.AddContextMenu(); +#if STEAM + uclUpdate.Visible = false; +#else uclUpdate.CheckUpdate(TaskHelpers.CheckUpdate); +#endif lblTeam.Text = "ShareX Team:"; lblBerk.Text = "Jaex (Berk)"; diff --git a/ShareX/Forms/ApplicationSettingsForm.Designer.cs b/ShareX/Forms/ApplicationSettingsForm.Designer.cs index e00b5c2e0..7233c389b 100644 --- a/ShareX/Forms/ApplicationSettingsForm.Designer.cs +++ b/ShareX/Forms/ApplicationSettingsForm.Designer.cs @@ -35,19 +35,23 @@ private void InitializeComponent() this.tpGeneral = new System.Windows.Forms.TabPage(); this.cbShowTray = new System.Windows.Forms.CheckBox(); this.cbTrayIconProgressEnabled = new System.Windows.Forms.CheckBox(); - this.btnChromeSupport = new System.Windows.Forms.Button(); + this.btnLanguages = new ShareX.HelpersLib.MenuButton(); + this.cmsLanguages = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cbRememberMainFormPosition = new System.Windows.Forms.CheckBox(); + this.llTranslators = new System.Windows.Forms.LinkLabel(); + this.cbSilentRun = new System.Windows.Forms.CheckBox(); this.cbTaskbarProgressEnabled = new System.Windows.Forms.CheckBox(); this.cbRememberMainFormSize = new System.Windows.Forms.CheckBox(); - this.cbSilentRun = new System.Windows.Forms.CheckBox(); - this.cbRememberMainFormPosition = new System.Windows.Forms.CheckBox(); + this.lblLanguage = new System.Windows.Forms.Label(); + this.tpIntegration = new System.Windows.Forms.TabPage(); + this.gbSteam = new System.Windows.Forms.GroupBox(); + this.cbSteamShowInApp = new System.Windows.Forms.CheckBox(); + this.gbChrome = new System.Windows.Forms.GroupBox(); + this.btnChromeSupport = new System.Windows.Forms.Button(); this.gbWindows = new System.Windows.Forms.GroupBox(); this.cbStartWithWindows = new System.Windows.Forms.CheckBox(); this.cbSendToMenu = new System.Windows.Forms.CheckBox(); this.cbShellContextMenu = new System.Windows.Forms.CheckBox(); - this.btnLanguages = new ShareX.HelpersLib.MenuButton(); - this.cmsLanguages = new System.Windows.Forms.ContextMenuStrip(this.components); - this.llTranslators = new System.Windows.Forms.LinkLabel(); - this.lblLanguage = new System.Windows.Forms.Label(); this.tpPaths = new System.Windows.Forms.TabPage(); this.lblNotePersonalFolderPath = new System.Windows.Forms.Label(); this.btnOpenScreenshotsFolder = new System.Windows.Forms.Button(); @@ -110,12 +114,11 @@ private void InitializeComponent() this.tpAdvanced = new System.Windows.Forms.TabPage(); this.pgSettings = new System.Windows.Forms.PropertyGrid(); this.tttvMain = new ShareX.HelpersLib.TabToTreeView(); - this.gbChrome = new System.Windows.Forms.GroupBox(); - this.cbSteamShowInApp = new System.Windows.Forms.CheckBox(); - this.tpIntegration = new System.Windows.Forms.TabPage(); - this.gbSteam = new System.Windows.Forms.GroupBox(); this.tcSettings.SuspendLayout(); this.tpGeneral.SuspendLayout(); + this.tpIntegration.SuspendLayout(); + this.gbSteam.SuspendLayout(); + this.gbChrome.SuspendLayout(); this.gbWindows.SuspendLayout(); this.tpPaths.SuspendLayout(); this.tpProxy.SuspendLayout(); @@ -134,9 +137,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.nudRetryUpload)).BeginInit(); this.tpPrint.SuspendLayout(); this.tpAdvanced.SuspendLayout(); - this.gbChrome.SuspendLayout(); - this.tpIntegration.SuspendLayout(); - this.gbSteam.SuspendLayout(); this.SuspendLayout(); // // tcSettings @@ -181,12 +181,39 @@ private void InitializeComponent() this.cbTrayIconProgressEnabled.UseVisualStyleBackColor = true; this.cbTrayIconProgressEnabled.CheckedChanged += new System.EventHandler(this.cbTrayIconProgressEnabled_CheckedChanged); // - // btnChromeSupport + // btnLanguages // - resources.ApplyResources(this.btnChromeSupport, "btnChromeSupport"); - this.btnChromeSupport.Name = "btnChromeSupport"; - this.btnChromeSupport.UseVisualStyleBackColor = true; - this.btnChromeSupport.Click += new System.EventHandler(this.btnChromeSupport_Click); + resources.ApplyResources(this.btnLanguages, "btnLanguages"); + this.btnLanguages.Menu = this.cmsLanguages; + this.btnLanguages.MenuX0 = true; + this.btnLanguages.Name = "btnLanguages"; + this.btnLanguages.UseVisualStyleBackColor = true; + // + // cmsLanguages + // + this.cmsLanguages.Name = "cmsLanguages"; + resources.ApplyResources(this.cmsLanguages, "cmsLanguages"); + // + // cbRememberMainFormPosition + // + resources.ApplyResources(this.cbRememberMainFormPosition, "cbRememberMainFormPosition"); + this.cbRememberMainFormPosition.Name = "cbRememberMainFormPosition"; + this.cbRememberMainFormPosition.UseVisualStyleBackColor = true; + this.cbRememberMainFormPosition.CheckedChanged += new System.EventHandler(this.cbRememberMainFormPosition_CheckedChanged); + // + // llTranslators + // + resources.ApplyResources(this.llTranslators, "llTranslators"); + this.llTranslators.Name = "llTranslators"; + this.llTranslators.TabStop = true; + this.llTranslators.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llTranslators_LinkClicked); + // + // cbSilentRun + // + resources.ApplyResources(this.cbSilentRun, "cbSilentRun"); + this.cbSilentRun.Name = "cbSilentRun"; + this.cbSilentRun.UseVisualStyleBackColor = true; + this.cbSilentRun.CheckedChanged += new System.EventHandler(this.cbSilentRun_CheckedChanged); // // cbTaskbarProgressEnabled // @@ -202,19 +229,46 @@ private void InitializeComponent() this.cbRememberMainFormSize.UseVisualStyleBackColor = true; this.cbRememberMainFormSize.CheckedChanged += new System.EventHandler(this.cbRememberMainFormSize_CheckedChanged); // - // cbSilentRun + // lblLanguage // - resources.ApplyResources(this.cbSilentRun, "cbSilentRun"); - this.cbSilentRun.Name = "cbSilentRun"; - this.cbSilentRun.UseVisualStyleBackColor = true; - this.cbSilentRun.CheckedChanged += new System.EventHandler(this.cbSilentRun_CheckedChanged); + resources.ApplyResources(this.lblLanguage, "lblLanguage"); + this.lblLanguage.Name = "lblLanguage"; // - // cbRememberMainFormPosition + // tpIntegration // - resources.ApplyResources(this.cbRememberMainFormPosition, "cbRememberMainFormPosition"); - this.cbRememberMainFormPosition.Name = "cbRememberMainFormPosition"; - this.cbRememberMainFormPosition.UseVisualStyleBackColor = true; - this.cbRememberMainFormPosition.CheckedChanged += new System.EventHandler(this.cbRememberMainFormPosition_CheckedChanged); + this.tpIntegration.Controls.Add(this.gbSteam); + this.tpIntegration.Controls.Add(this.gbChrome); + this.tpIntegration.Controls.Add(this.gbWindows); + resources.ApplyResources(this.tpIntegration, "tpIntegration"); + this.tpIntegration.Name = "tpIntegration"; + this.tpIntegration.UseVisualStyleBackColor = true; + // + // gbSteam + // + this.gbSteam.Controls.Add(this.cbSteamShowInApp); + resources.ApplyResources(this.gbSteam, "gbSteam"); + this.gbSteam.Name = "gbSteam"; + this.gbSteam.TabStop = false; + // + // cbSteamShowInApp + // + resources.ApplyResources(this.cbSteamShowInApp, "cbSteamShowInApp"); + this.cbSteamShowInApp.Name = "cbSteamShowInApp"; + this.cbSteamShowInApp.UseVisualStyleBackColor = true; + // + // gbChrome + // + this.gbChrome.Controls.Add(this.btnChromeSupport); + resources.ApplyResources(this.gbChrome, "gbChrome"); + this.gbChrome.Name = "gbChrome"; + this.gbChrome.TabStop = false; + // + // btnChromeSupport + // + resources.ApplyResources(this.btnChromeSupport, "btnChromeSupport"); + this.btnChromeSupport.Name = "btnChromeSupport"; + this.btnChromeSupport.UseVisualStyleBackColor = true; + this.btnChromeSupport.Click += new System.EventHandler(this.btnChromeSupport_Click); // // gbWindows // @@ -246,31 +300,6 @@ private void InitializeComponent() this.cbShellContextMenu.UseVisualStyleBackColor = true; this.cbShellContextMenu.CheckedChanged += new System.EventHandler(this.cbShellContextMenu_CheckedChanged); // - // btnLanguages - // - resources.ApplyResources(this.btnLanguages, "btnLanguages"); - this.btnLanguages.Menu = this.cmsLanguages; - this.btnLanguages.MenuX0 = true; - this.btnLanguages.Name = "btnLanguages"; - this.btnLanguages.UseVisualStyleBackColor = true; - // - // cmsLanguages - // - this.cmsLanguages.Name = "cmsLanguages"; - resources.ApplyResources(this.cmsLanguages, "cmsLanguages"); - // - // llTranslators - // - resources.ApplyResources(this.llTranslators, "llTranslators"); - this.llTranslators.Name = "llTranslators"; - this.llTranslators.TabStop = true; - this.llTranslators.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llTranslators_LinkClicked); - // - // lblLanguage - // - resources.ApplyResources(this.lblLanguage, "lblLanguage"); - this.lblLanguage.Name = "lblLanguage"; - // // tpPaths // this.tpPaths.Controls.Add(this.lblNotePersonalFolderPath); @@ -740,35 +769,6 @@ private void InitializeComponent() this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.tttvMain.TreeViewSize = 175; // - // gbChrome - // - this.gbChrome.Controls.Add(this.btnChromeSupport); - resources.ApplyResources(this.gbChrome, "gbChrome"); - this.gbChrome.Name = "gbChrome"; - this.gbChrome.TabStop = false; - // - // cbSteamShowInApp - // - resources.ApplyResources(this.cbSteamShowInApp, "cbSteamShowInApp"); - this.cbSteamShowInApp.Name = "cbSteamShowInApp"; - this.cbSteamShowInApp.UseVisualStyleBackColor = true; - // - // tpIntegration - // - this.tpIntegration.Controls.Add(this.gbSteam); - this.tpIntegration.Controls.Add(this.gbChrome); - this.tpIntegration.Controls.Add(this.gbWindows); - resources.ApplyResources(this.tpIntegration, "tpIntegration"); - this.tpIntegration.Name = "tpIntegration"; - this.tpIntegration.UseVisualStyleBackColor = true; - // - // gbSteam - // - this.gbSteam.Controls.Add(this.cbSteamShowInApp); - resources.ApplyResources(this.gbSteam, "gbSteam"); - this.gbSteam.Name = "gbSteam"; - this.gbSteam.TabStop = false; - // // ApplicationSettingsForm // resources.ApplyResources(this, "$this"); @@ -784,6 +784,10 @@ private void InitializeComponent() this.tcSettings.ResumeLayout(false); this.tpGeneral.ResumeLayout(false); this.tpGeneral.PerformLayout(); + this.tpIntegration.ResumeLayout(false); + this.gbSteam.ResumeLayout(false); + this.gbSteam.PerformLayout(); + this.gbChrome.ResumeLayout(false); this.gbWindows.ResumeLayout(false); this.gbWindows.PerformLayout(); this.tpPaths.ResumeLayout(false); @@ -808,10 +812,6 @@ private void InitializeComponent() this.tpPrint.ResumeLayout(false); this.tpPrint.PerformLayout(); this.tpAdvanced.ResumeLayout(false); - this.gbChrome.ResumeLayout(false); - this.tpIntegration.ResumeLayout(false); - this.gbSteam.ResumeLayout(false); - this.gbSteam.PerformLayout(); this.ResumeLayout(false); } diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index e2899e628..793df20fe 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -281,7 +281,7 @@ private void cbStartWithWindows_CheckedChanged(object sender, EventArgs e) string filePath; -#if Steam +#if STEAM filePath = Helpers.GetAbsolutePath("../ShareX_Launcher.exe"); #else filePath = Application.ExecutablePath; diff --git a/ShareX/Forms/ApplicationSettingsForm.resx b/ShareX/Forms/ApplicationSettingsForm.resx index 265bc4847..76fce0533 100644 --- a/ShareX/Forms/ApplicationSettingsForm.resx +++ b/ShareX/Forms/ApplicationSettingsForm.resx @@ -442,13 +442,13 @@ 16, 24 - 233, 17 + 246, 17 13 - While ShareX open show "In-app" in Steam + While ShareX is open, show "In-app" in Steam cbSteamShowInApp diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index 777d20be8..858d549ec 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -672,7 +672,7 @@ private void UpdateUploaderMenuNames() private void ConfigureAutoUpdate() { -#if !DEBUG +#if RELEASE lock (updateTimerLock) { if (Program.Settings.AutoCheckUpdate) diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 3a5d315fd..9c3ca83d4 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -41,6 +41,18 @@ internal static class Program { public static bool IsBeta = true; + public static bool IsSteamBuild + { + get + { +#if STEAM + return true; +#else + return false; +#endif + } + } + public static string Title { get diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index f7f7d0ba8..8b122f1fa 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -54,7 +54,7 @@ none true bin\Release\ - TRACE + TRACE;RELEASE prompt 4 MinimumRecommendedRules.ruleset @@ -68,7 +68,7 @@ bin\Steam\ - TRACE;Steam + TRACE;STEAM true AnyCPU Off