mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
Added In-app option
This commit is contained in:
parent
67e7549eef
commit
37c340a2f0
3 changed files with 66 additions and 40 deletions
1
ShareX/Forms/ApplicationSettingsForm.Designer.cs
generated
1
ShareX/Forms/ApplicationSettingsForm.Designer.cs
generated
|
@ -255,6 +255,7 @@ private void InitializeComponent()
|
|||
resources.ApplyResources(this.cbSteamShowInApp, "cbSteamShowInApp");
|
||||
this.cbSteamShowInApp.Name = "cbSteamShowInApp";
|
||||
this.cbSteamShowInApp.UseVisualStyleBackColor = true;
|
||||
this.cbSteamShowInApp.CheckedChanged += new System.EventHandler(this.cbSteamShowInApp_CheckedChanged);
|
||||
//
|
||||
// gbChrome
|
||||
//
|
||||
|
|
|
@ -29,6 +29,7 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.UploadersLib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
@ -65,15 +66,18 @@ private void LoadSettings()
|
|||
cbShowTray.Checked = Program.Settings.ShowTray;
|
||||
cbSilentRun.Enabled = Program.Settings.ShowTray;
|
||||
cbSilentRun.Checked = Program.Settings.SilentRun;
|
||||
cbStartWithWindows.Checked = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.Startup); //RegistryHelper.CheckStartWithWindows();
|
||||
cbSendToMenu.Checked = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.SendTo);
|
||||
cbShellContextMenu.Checked = RegistryHelpers.CheckShellContextMenu();
|
||||
cbTrayIconProgressEnabled.Checked = Program.Settings.TrayIconProgressEnabled;
|
||||
cbTaskbarProgressEnabled.Enabled = TaskbarManager.IsPlatformSupported;
|
||||
cbTaskbarProgressEnabled.Checked = Program.Settings.TaskbarProgressEnabled;
|
||||
cbRememberMainFormPosition.Checked = Program.Settings.RememberMainFormPosition;
|
||||
cbRememberMainFormSize.Checked = Program.Settings.RememberMainFormSize;
|
||||
|
||||
// Integration
|
||||
cbStartWithWindows.Checked = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.Startup); //RegistryHelper.CheckStartWithWindows();
|
||||
cbShellContextMenu.Checked = RegistryHelpers.CheckShellContextMenu();
|
||||
cbSendToMenu.Checked = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.SendTo);
|
||||
cbSteamShowInApp.Checked = File.Exists(Helpers.GetAbsolutePath("Steam"));
|
||||
|
||||
// Paths
|
||||
txtPersonalFolderPath.Text = Program.ReadPersonalPathConfig();
|
||||
UpdatePersonalFolderPathPreview();
|
||||
|
@ -273,40 +277,6 @@ private void cbSilentRun_CheckedChanged(object sender, EventArgs e)
|
|||
Program.Settings.SilentRun = cbSilentRun.Checked;
|
||||
}
|
||||
|
||||
private void cbStartWithWindows_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
//RegistryHelper.SetStartWithWindows(cbStartWithWindows.Checked);
|
||||
|
||||
string filePath;
|
||||
|
||||
#if STEAM
|
||||
filePath = Helpers.GetAbsolutePath("../ShareX_Launcher.exe");
|
||||
#else
|
||||
filePath = Application.ExecutablePath;
|
||||
#endif
|
||||
|
||||
ShortcutHelpers.SetShortcut(cbStartWithWindows.Checked, Environment.SpecialFolder.Startup, filePath, "-silent");
|
||||
}
|
||||
}
|
||||
|
||||
private void cbSendToMenu_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
ShortcutHelpers.SetShortcut(cbSendToMenu.Checked, Environment.SpecialFolder.SendTo, Application.ExecutablePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void cbShellContextMenu_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
RegistryHelpers.SetShellContextMenu(cbShellContextMenu.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
private void cbTrayIconProgressEnabled_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Program.Settings.TrayIconProgressEnabled = cbTrayIconProgressEnabled.Checked;
|
||||
|
@ -332,12 +302,67 @@ private void cbRememberMainFormSize_CheckedChanged(object sender, EventArgs e)
|
|||
Program.Settings.RememberMainFormSize = cbRememberMainFormSize.Checked;
|
||||
}
|
||||
|
||||
#endregion General
|
||||
|
||||
#region Integration
|
||||
|
||||
private void cbStartWithWindows_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
//RegistryHelper.SetStartWithWindows(cbStartWithWindows.Checked);
|
||||
|
||||
string filePath;
|
||||
|
||||
#if STEAM
|
||||
filePath = Helpers.GetAbsolutePath("../ShareX_Launcher.exe");
|
||||
#else
|
||||
filePath = Application.ExecutablePath;
|
||||
#endif
|
||||
|
||||
ShortcutHelpers.SetShortcut(cbStartWithWindows.Checked, Environment.SpecialFolder.Startup, filePath, "-silent");
|
||||
}
|
||||
}
|
||||
|
||||
private void cbShellContextMenu_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
RegistryHelpers.SetShellContextMenu(cbShellContextMenu.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
private void cbSendToMenu_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
ShortcutHelpers.SetShortcut(cbSendToMenu.Checked, Environment.SpecialFolder.SendTo, Application.ExecutablePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnChromeSupport_Click(object sender, EventArgs e)
|
||||
{
|
||||
new ChromeForm().Show();
|
||||
}
|
||||
|
||||
#endregion General
|
||||
private void cbSteamShowInApp_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loaded)
|
||||
{
|
||||
string path = Helpers.GetAbsolutePath("Steam");
|
||||
|
||||
if (cbSteamShowInApp.Checked)
|
||||
{
|
||||
File.Create(path).Dispose();
|
||||
}
|
||||
else if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Integration
|
||||
|
||||
#region Paths
|
||||
|
||||
|
|
|
@ -571,7 +571,7 @@
|
|||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="cbSendToMenu.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>16, 48</value>
|
||||
<value>16, 72</value>
|
||||
</data>
|
||||
<data name="cbSendToMenu.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>181, 17</value>
|
||||
|
@ -601,7 +601,7 @@
|
|||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="cbShellContextMenu.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>16, 72</value>
|
||||
<value>16, 48</value>
|
||||
</data>
|
||||
<data name="cbShellContextMenu.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>359, 17</value>
|
||||
|
|
Loading…
Reference in a new issue