Skip to content

Commit

Permalink
1.3.1 - Alert only shows when pressing the button.
Browse files Browse the repository at this point in the history
The ShareX error alert only pops up when you press the function.
  • Loading branch information
reedhaffner committed Sep 27, 2019
1 parent b609fbd commit 924664d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ShareX/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ static void Main(string[] args)
// Alert user that ShareX was unable to be found.
else
{
MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error);
Globals.xpath = null;
}

SDWrapper.Run(args);
}
}
Expand Down
9 changes: 8 additions & 1 deletion ShareX/ScreenRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using WindowsInput;

namespace ShareX
Expand Down Expand Up @@ -56,6 +56,13 @@ public ScreenRecord(SDConnection connection, InitialPayload payload) : base(conn
public override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed");

if (Globals.xpath == null)
{
MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

if (inputRunning)
{
return;
Expand Down
8 changes: 7 additions & 1 deletion ShareX/Screenshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using WindowsInput;

namespace ShareX
Expand Down Expand Up @@ -56,6 +56,12 @@ public Screenshot(SDConnection connection, InitialPayload payload) : base(connec
public override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed");

if (Globals.xpath == null)
{
MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (inputRunning)
{
return;
Expand Down
8 changes: 7 additions & 1 deletion ShareX/Workflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using WindowsInput;

namespace ShareX
Expand Down Expand Up @@ -56,6 +56,12 @@ public Workflow(SDConnection connection, InitialPayload payload) : base(connecti
public override void KeyPressed(KeyPayload payload)
{
Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed");
if (Globals.xpath == null)
{
MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

if (inputRunning)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion ShareX/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"Name": "ShareX",
"Icon": "Images/pluginIcon",
"URL": "https://reedhaffner.com/",
"Version": "1.3",
"Version": "1.3.1",
"CodePath": "com.reedhaffner.sharex",
"Category": "ShareX",
"CategoryIcon": "Images/categoryIcon",
Expand Down

0 comments on commit 924664d

Please sign in to comment.