Skip to content

Commit

Permalink
Merge pull request #59 from Ordisoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ordisoftware authored Sep 9, 2019
2 parents 913a6f2 + 4476549 commit 91fa350
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 38 deletions.
3 changes: 3 additions & 0 deletions Project/Hebrew Calendar (vs2017).csproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
<Compile Include="Source\Classes\SQLiteUtility.cs" />
<Compile Include="Source\Enums\ReportFieldType.cs" />
<Compile Include="Source\Enums\EphemerisType.cs" />
<Compile Include="Source\Forms\MainForm.Screensaver.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\Forms\MainForm.LoadData.cs">
<SubType>Form</SubType>
</Compile>
Expand Down
4 changes: 2 additions & 2 deletions Project/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
63 changes: 63 additions & 0 deletions Project/Source/Forms/MainForm.Screensaver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/// <license>
/// This file is part of Ordisoftware Hebrew Calendar.
/// Copyright 2016-2019 Olivier Rogier.
/// See www.ordisoftware.com for more information.
/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
/// If a copy of the MPL was not distributed with this file, You can obtain one at
/// https://mozilla.org/MPL/2.0/.
/// If it is not possible or desirable to put the notice in a particular file,
/// then You may include the notice in a location(such as a LICENSE file in a
/// relevant directory) where a recipient would be likely to look for such a notice.
/// You may add additional accurate notices of copyright ownership.
/// </license>
/// <created> 2016-04 </created>
/// <edited> 2019-01 </edited>
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Ordisoftware.HebrewCalendar
{

public partial class MainForm
{

private const int WM_SYSCOMMAND = 0x0112;
private const int SC_SCREENSAVE = 0xF140;
private const int SPI_GETSCREENSAVERRUNNING = 0x0072;

[DllImport("user32.dll", SetLastError = true)]
static extern bool SystemParametersInfo(int action, int param, ref int retval, int updini);

[StructLayout(LayoutKind.Sequential)]
private struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}

[DllImport("user32.dll")]
private static extern bool GetWindowRect(HandleRef hWnd, [In, Out] ref RECT rect);

[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();

public static bool IsForegroundFullScreen()
{
return IsForegroundFullScreen(null);
}

public static bool IsForegroundFullScreen(Screen screen)
{
if ( screen == null ) screen = Screen.PrimaryScreen;
RECT rect = new RECT();
GetWindowRect(new HandleRef(null, GetForegroundWindow()), ref rect);
return new Rectangle(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top).Contains(screen.Bounds);
}

}

}
4 changes: 4 additions & 0 deletions Project/Source/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ private void LunisolarDaysBindingSource_CurrentItemChanged(object sender, EventA
private void Timer_Tick(object sender, EventArgs e)
{
if ( !TimerReminder.Enabled ) return;
int active = 1;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, ref active, 0);
if ( active != 0 ) return;
if ( IsForegroundFullScreen() ) return;
if ( Program.Settings.ReminderEnabled ) CheckEvents();
if ( Program.Settings.RemindShabat ) CheckShabat();
}
Expand Down
70 changes: 35 additions & 35 deletions Project/Source/Forms/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<value>CalendarMonth</value>
</data>
<data name="&gt;&gt;CalendarMonth.Type" xml:space="preserve">
<value>Calendar.NET.Calendar, Ordisoftware.HebrewCalendar, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>Calendar.NET.Calendar, Ordisoftware.HebrewCalendar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;CalendarMonth.Parent" xml:space="preserve">
<value>PanelViewMonth</value>
Expand Down Expand Up @@ -1244,36 +1244,36 @@
<data name="ActionViewCelebrations.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAbCSURBVFhH7VZ7UNRVFAaLrCmNMnWyxzRmJlY65kgPMq2c
yWrKGnHUXIx0SQh5mEsssLIsLMjDBQFxkcfyfstT1FZAhGURkAUEYdWstAbkKeg0U9M0fZ1z12yYkdQG
+6sz883O3t/93e+c7zzuz+p/m2SzUSgUg3K5H/z8/HrWrFlje339PzEbHx+fvsKiEmySfAYXqSt8feVw
cXF5lp5ZW7bcPbORy30vaxNTYGxsgsTJGS5fuMF9uxdYDalUOp/23DUn7vHy8iqJjdsHXXo2Wk6ZsFW6
DR6eO7BT5gtfuT+no5f23WfZPrkmyGNi41FdW4eTTS3oPN2FL909IfORwz8gELsCVQhUqrBjh3cq77e8
Njl2I/IaIh8aGka9oRFXRkdF5AEKJYKC1VCHhiM8SkNOBFEqnJfTe5OSinu9PTxK4/dpUVtnwMDgEPoH
BvGNvhoXL12CNikFQSo1dkdEIWpPDFghdpSLlN6dajni39sUV1fXLfu1B1B5RI++vsu43D+AQVLg+AkD
Oru6caKuDqFhEdDExCI2PgEJtDcpRUfOaODm5vYFn2E56s5tCh3wuTYxSUTbf3lARD44NIhvL3yHqurj
aDzZjN6+PkSQ7PEJWiSSGimp6UjPzEZ2bj4obb/QOQ9YjrszE+R7NNE4VlMrZGfioeFhdPecw7GqGpEO
roPe3j4Ul5ThQFIq0jKykJWdh9yCQlorR/y+BGzd6ryOzrujWpji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9mBx+ri
ZmPAXIim7A9wofcKzGe/vwmxAfrqWlQePooymmYHisuRk1+EtMw87E/JhCY2CQlhnyNDZgWlfOM1N68d
5o0SSc7KlSv97ezsnIjnbcIbhCWE+YRZBPGRMjNMqfyjr7sAB0Pug8lYio6uc2hpbRMXC0+/qmPHcUh/
DGWHqnGgXI9kXTYR7oMqLBqyAGX/55s9az5Z45ySt8MK2YTQzxzw5rwZTLqQwN+ETxGY8DHCNAL3/40h
9Hiwy5O6CtUUlAZaQZ/yMVraz6ChsUXcbgWFRXSrJVLbKP/QK20RtGYh1r6/PNF2+vSP6d13CG8SOKpX
c3yske1DDkhW4NPX5n5Ka0zGUTLZhJfPw2+v/GhDocoWOu+ZUG94GUrZ9v6vZbKO9evX59nb27tPnTr1
Q9q3qkr9FILWO8DXcU6U1t02MuPraSU5smmdBf4PIl9ug1y5NXK/IQeclsNphd1qeudewXALsyE8Ey5Z
CqXU7nfndx6KpP/LCfaEl/gZ4QnCC8UB81CkeB5ZPi8g2XMBkjzmQyNdAs2WVxDh/DrUTisEuVLiMEb7
5xBu6xuQpZlOYBkdCH8VCI/JhwjsIO+Z8c2apQ1qp2VEtAzKjfbXFGvsz8scX+2QrlqY4/reonyHBbPd
3138tAft5bM437d953OeuCX4JS6Qm30yTSW8SGB1OPcrCOzwUsIigh2BC44j53PY8Uk1zic7wfObBwj/
MtEjBF5nx29ZcP/beLOy+hPlplSbT84MUwAAAABJRU5ErkJggg==
</value>
</data>
<data name="ActionViewCelebrations.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
Expand Down Expand Up @@ -2334,7 +2334,7 @@
<value>LunisolarCalendar</value>
</data>
<data name="&gt;&gt;LunisolarCalendar.Type" xml:space="preserve">
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendar, Ordisoftware.HebrewCalendar, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendar, Ordisoftware.HebrewCalendar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;bindingNavigatorCountItem.Name" xml:space="preserve">
<value>bindingNavigatorCountItem</value>
Expand Down Expand Up @@ -2694,19 +2694,19 @@
<value>LunisolarDaysTableAdapter</value>
</data>
<data name="&gt;&gt;LunisolarDaysTableAdapter.Type" xml:space="preserve">
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.LunisolarDaysTableAdapter, Ordisoftware.HebrewCalendar, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.LunisolarDaysTableAdapter, Ordisoftware.HebrewCalendar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TableAdapterManager.Name" xml:space="preserve">
<value>TableAdapterManager</value>
</data>
<data name="&gt;&gt;TableAdapterManager.Type" xml:space="preserve">
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.TableAdapterManager, Ordisoftware.HebrewCalendar, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.TableAdapterManager, Ordisoftware.HebrewCalendar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;ReportTableAdapter.Name" xml:space="preserve">
<value>ReportTableAdapter</value>
</data>
<data name="&gt;&gt;ReportTableAdapter.Type" xml:space="preserve">
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.ReportTableAdapter, Ordisoftware.HebrewCalendar, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>Ordisoftware.HebrewCalendar.Data.LunisolarCalendarTableAdapters.ReportTableAdapter, Ordisoftware.HebrewCalendar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainForm</value>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ These are Pesa'h or Easter which is the liberation of illusions, Shavuot or Week

## Changelog

#### 2019.09.10 - Version 2.2

- Reminder is disabled if fullscreen or if screen saver is active.

#### 2019.09.04 - Version 2.1

- Improve shabat reminder.
Expand Down
2 changes: 1 addition & 1 deletion Setup/OrdisoftwareHebrewCalendarSetup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define MyAppName "Hebrew Calendar"
#define MyAppNameNoSpace "HebrewCalendar"
#define MyAppVersion "2.1"
#define MyAppVersion "2.2"
#define MyAppPublisher "Ordisoftware"
#define MyAppURL "http://www.ordisoftware.com/projects/hebrew-calendar"
#define MyAppExeName "Ordisoftware.HebrewCalendar.exe"
Expand Down

0 comments on commit 91fa350

Please sign in to comment.