Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit d1c8057

Browse files
author
Nicolas Teichtweier
committed
added update notifications
1 parent 807104e commit d1c8057

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

JiraTimeTracker/JTT.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
using System.Threading.Tasks;
99
using System.Windows.Forms;
1010
using System.IO;
11+
using System.Net.Http;
1112

1213
namespace JiraTimeTracker
1314
{
1415
public partial class JTT : Form
1516
{
17+
18+
private string version = "1.4";
19+
20+
1621
private ConnectionHandler connectionHandler;
1722
private JTT form;
1823
private CConsole cConsole;
@@ -30,6 +35,7 @@ private void JTT_Load(object sender, EventArgs e)
3035
form.MinimizeBox = false;
3136
form.MaximizeBox = false;
3237
InitializeOutput();
38+
CheckForUpdate();
3339
}
3440

3541
private JTT SetActiveForm()
@@ -157,6 +163,16 @@ private void LoadConfigButton_Click(object sender, EventArgs e)
157163
CheckForConfig();
158164
}
159165

166+
private void CheckForUpdate()
167+
{
168+
var client = new HttpClient();
169+
var result = client.GetStringAsync("http://jtt.mightypotato.de/get_version.php").Result;
170+
if(result != version)
171+
{
172+
MessageBox.Show("There is an Update availabe at github.com/TehMightyPotato/JiraTimeTracker \r\n Please consider updating!");
173+
}
174+
}
175+
160176
private bool CheckForConfig()
161177
{
162178
if (File.Exists(Directory.GetCurrentDirectory() + "/conf.cfg"))
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

get_version.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$version = "1.4";
3+
echo $version;
4+
?>

0 commit comments

Comments
 (0)