Skip to content

Commit

Permalink
change to proper handling of no configured breaks, update how tray me…
Browse files Browse the repository at this point in the history
…ssages are handled
  • Loading branch information
ouoertheo committed Oct 26, 2020
1 parent 370052c commit afdf9fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 48 deletions.
44 changes: 0 additions & 44 deletions TomeScreenClient/App - Copy.config

This file was deleted.

9 changes: 6 additions & 3 deletions TomeScreenClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,10 @@ private async static void getActivity(string _user)
FileLogger.Log("Server response: " + JsonSerializer.Serialize(data),1);
TimeSpan duration;
TimeSpan timeTilBreak;
string trayString = "";


if (data.nextBreak != 0)
if (data.nextBreak != -1)
{
// break early warning
if (data.freeTimeLeft < 300000 && !breakNotification)
Expand All @@ -305,6 +306,7 @@ private async static void getActivity(string _user)
breakNotification = false;
}
timeTilBreak = TimeSpan.FromMilliseconds(data.freeTimeLeft);
trayString += "Next Break: " + timeTilBreak.ToString() + "\r\n";
} else {
timeTilBreak = TimeSpan.Zero;
FileLogger.Log("No break cofigured", 2);
Expand All @@ -315,15 +317,16 @@ private async static void getActivity(string _user)
{
duration = TimeSpan.FromMilliseconds(data.total * -1);
FileLogger.Log("getActivity data: " + duration.ToString(), 1);
MyCustomApplicationContext.setTooltip("Total: -" + duration.ToString() + "\r\n Next Break: " + timeTilBreak.ToString());
trayString += "Total: -" + duration.ToString();
LockWorkStation();
}
else
{
duration = TimeSpan.FromMilliseconds(data.total);
FileLogger.Log("getActivity data: " + duration.ToString(), 1);
MyCustomApplicationContext.setTooltip("Total: " + duration.ToString() + "\r\n Next Break: " + timeTilBreak.ToString());
trayString += "Total: " + duration.ToString();
}
MyCustomApplicationContext.setTooltip(trayString);

} catch (Exception e) {
FileLogger.Log(e.Message, 1);
Expand Down
1 change: 0 additions & 1 deletion TomeScreenClient/TomeScreenClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="App - Copy.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down

0 comments on commit afdf9fc

Please sign in to comment.