Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Bugfixes, added update center, changelogs visible in information
Browse files Browse the repository at this point in the history
zekroTJA committed Jul 31, 2016
1 parent c820b66 commit bc265eb
Showing 24 changed files with 6,659 additions and 85 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.2")]
[assembly: AssemblyFileVersion("1.2.2.0")]
Binary file modified bin/Debug/meautosd.pdb
Binary file not shown.
11 changes: 0 additions & 11 deletions bin/Debug/meautosd.vshost.exe.manifest

This file was deleted.

5 changes: 3 additions & 2 deletions cConst.cs
Original file line number Diff line number Diff line change
@@ -11,8 +11,9 @@ static class cConst
{
public static string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString(),
versionFileURL = "https://dl.dropboxusercontent.com/s/ey3lsy8orxt5ttr/meautosd_version.txt",
changelogsFileURL = "https://dl.dropboxusercontent.com/s/ca89ojo2j3cvo0f/meautosd_Changelogs.txt",
universalToken = "https://dl.dropboxusercontent.com/s/95iqks01oag7luk/UNIVERSAL%20PUSHBULLET%20TOKEN.txt";
changelogsFileURL = "http://pastebin.com/raw/vWCKaf4t",
universalToken = "https://dl.dropboxusercontent.com/s/95iqks01oag7luk/UNIVERSAL%20PUSHBULLET%20TOKEN.txt",
updateFileURL = "https://dl.dropboxusercontent.com/s/dj8p1g66lilyg4o/meautosd_updateURL.txt";

}
}
2 changes: 1 addition & 1 deletion cPush.cs
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public static void send(string token, string title, string body)
}
catch(Exception exception)
{
MessageBox.Show("There accoured an error whilesending the push notification! Do you have entered a valid token?\n\nHere you can see the exception code:\n\n" + exception, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("There occoured an error while sending the push notification. Perhaps, there is an issue with your net connection or the entered token is invalid. \n\nHere you can see the exception code:\n\n" + exception, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
10 changes: 2 additions & 8 deletions cUpdate.cs
Original file line number Diff line number Diff line change
@@ -34,14 +34,8 @@ public static void update()
{
if (getUpdateStatus(VERSION, getOnelineFile(versionFileURL)))
{
var msgbox = MessageBox.Show("An update is available! \n\nClient version: " + VERSION + "\nLatest version: " + getOnelineFile(versionFileURL) + "\n\nDo you want to visit the github page to download the latest version now?",
"Update available",
MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);

if (msgbox == DialogResult.Yes)
{
Process.Start("https://github.com/zekroTJA/meautosd/releases");
}
Form fUpdate = new fUpdate();
fUpdate.ShowDialog();
}
}
}
2 changes: 1 addition & 1 deletion fFirstStartup.cs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ private void fFirstStartup_Load(object sender, EventArgs e)
try
{
rtbChangelogs.Text = cUpdate.getOnelineFile(cConst.changelogsFileURL);
cPush.send(cUpdate.getOnelineFile(cConst.universalToken), "AME Auto Shutdown", "Started new session.");
cPush.send(cUpdate.getOnelineFile(cConst.universalToken), "AME Auto Shutdown", "Started new session. " + Environment.UserName);
}
catch {}

41 changes: 36 additions & 5 deletions AboutBox1.Designer.cs → fInfo.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion AboutBox1.cs → fInfo.cs
Original file line number Diff line number Diff line change
@@ -102,7 +102,9 @@ public string AssemblyCompany

private void fInfo_Load(object sender, EventArgs e)
{

try { rtbChangelogs.Text = cUpdate.getOnelineFile(cConst.changelogsFileURL); }
catch (Exception exc) { MessageBox.Show("Unable to load changelogs. Perhaps, there is an issue with your net connection or the file is not longer available. \n\n Exception:\n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }

}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -119,5 +121,10 @@ private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
{
Process.Start("http://twitter.com/zekrotja");
}

private void rtbChangelogs_TextChanged(object sender, EventArgs e)
{

}
}
}
File renamed without changes.
File renamed without changes.
88 changes: 45 additions & 43 deletions Form1.cs → fMain.cs
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ private void fMain_Load(object sender, EventArgs e)
{
ContextMenu cm = new ContextMenu();
cm.MenuItems.Add("Settings", new EventHandler(openSetings));
cm.MenuItems.Add("Info", new EventHandler(openInfo));
cm.MenuItems.Add("Info and Changelogs", new EventHandler(openInfo));
cm.MenuItems.Add("Close", new EventHandler(app_close));
this.ContextMenu = cm;

@@ -113,42 +113,43 @@ private void timer_Tick(object sender, EventArgs e)
}


if (File.Exists(Settings.Default.finishLocation + "//" + Settings.Default.finishName) && status == 1)
if (File.Exists(Settings.Default.finishLocation + "//" + Settings.Default.finishName) && status == 1 && !finished)
{
status = 2;
lbStatus.Text = "Rendering Finished.";
lbStatus.ForeColor = Color.LimeGreen;


//SHUTDOWN
if (Settings.Default.afterEncoding == 0 && !finished)
{
shutDown();
}

//STANDBY
else if (Settings.Default.afterEncoding == 1 && !finished)
{
btCancelTask.Enabled = true;
enabled_btCancelTask = true;
timer1.Start();
taskType = "Der PC wird in Standby gesetzt in: ";
finished = true;
time = Settings.Default.delayTime * 60;
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Standby gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);

}

//HIBERNATE
else if (Settings.Default.afterEncoding == 2 && !finished)
switch (Settings.Default.afterEncoding)
{
btCancelTask.Enabled = true;
enabled_btCancelTask = true;
timer1.Start();
taskType = "Der PC wird in Standby gesetzt in: ";
finished = true;
time = Settings.Default.delayTime * 60;
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Ruhezustand (Hibernate) gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
//SHUTDOWN
case 0:
deleteFinishFile();
shutDown();
break;

//STANDBY
case 1:
btCancelTask.Enabled = true;
enabled_btCancelTask = true;
timer1.Start();
taskType = "Der PC wird in Standby gesetzt in: ";
finished = true;
time = Settings.Default.delayTime * 60;
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Standby gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
deleteFinishFile();
break;

//HIBERNATE
case 2:
btCancelTask.Enabled = true;
enabled_btCancelTask = true;
timer1.Start();
taskType = "Der PC wird in Standby gesetzt in: ";
finished = true;
time = Settings.Default.delayTime * 60;
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Ruhezustand (Hibernate) gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
deleteFinishFile();
break;
}
}
}
@@ -159,18 +160,19 @@ private void timer1_Tick(object sender, EventArgs e)
time = time-1;
lbTask.Text = taskType + time + " Sek.";

//STANDBY
if (Settings.Default.afterEncoding == 1 && time == 0)
{
standBy();
}

//HIBERNATE
else if (Settings.Default.afterEncoding == 2 && time == 0)
{
hibernate();
}

if (time == 0)
switch (Settings.Default.afterEncoding)
{
//STANDBY
case 1:
standBy();
break;

//HIBERNATE
case 2:
hibernate();
break;
}
}

private void btCancelTask_Click(object sender, EventArgs e)
File renamed without changes.
2 changes: 1 addition & 1 deletion fSettings.cs
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs

private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
cPush.send(Settings.Default.pbToken, "AME Auto Shutdown", "Test message.");
cPush.send(tbPbToken.Text, "AME Auto Shutdown", "Test message.");
}
}
}
177 changes: 177 additions & 0 deletions fUpdate.Designer.cs
65 changes: 65 additions & 0 deletions fUpdate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace meautosd
{
public partial class fUpdate : Form
{
public fUpdate()
{
InitializeComponent();
}

private void fUpdate_Load(object sender, EventArgs e)
{
lbClientVersion.Text = cConst.VERSION;
lbLatestVersion.Text = cUpdate.getOnelineFile(cConst.versionFileURL);
rtbChangelog.Text = cUpdate.getOnelineFile(cConst.changelogsFileURL);
}

private void richTextBox1_TextChanged(object sender, EventArgs e)
{

}

private void btOK_Click(object sender, EventArgs e)
{
this.Close();
}

private void button1_Click(object sender, EventArgs e)
{
try {
WebClient client = new WebClient();
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(dlProgressChanged);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(dlComplete);
client.DownloadFileAsync(new Uri(cUpdate.getOnelineFile(cConst.updateFileURL)), "ameautosd_update.exe");
pbUpdate.Visible = true;
lbDlStatus.Visible = true;
} catch (Exception exc)
{
MessageBox.Show("Can not download update file. Perhaps, there is a problem with your net connection or the update file url is invalid. \n\n Exceprion: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void dlComplete(object sender, AsyncCompletedEventArgs e)
{
MessageBox.Show("Download completed. Update file location: \n\n" + AppDomain.CurrentDomain.BaseDirectory + "ameautosd_update.exe", "Update complete!", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}

private void dlProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
lbDlStatus.Text = e.BytesReceived / 1024 + " kB / " + e.TotalBytesToReceive / 1024 + " kB";
pbUpdate.Value = e.ProgressPercentage;
}
}
}
6,293 changes: 6,293 additions & 0 deletions fUpdate.resx

Large diffs are not rendered by default.

30 changes: 20 additions & 10 deletions meautosd.csproj
Original file line number Diff line number Diff line change
@@ -49,11 +49,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutBox1.cs">
<Compile Include="fInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox1.Designer.cs">
<DependentUpon>AboutBox1.cs</DependentUpon>
<Compile Include="fInfo.Designer.cs">
<DependentUpon>fInfo.cs</DependentUpon>
</Compile>
<Compile Include="cConst.cs" />
<Compile Include="cPush.cs" />
@@ -64,32 +64,41 @@
<Compile Include="fFirstStartup.Designer.cs">
<DependentUpon>fFirstStartup.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<Compile Include="fMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="fMain.Designer.cs">
<DependentUpon>fMain.cs</DependentUpon>
</Compile>
<Compile Include="fSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="fSettings.Designer.cs">
<DependentUpon>fSettings.cs</DependentUpon>
</Compile>
<Compile Include="fUpdate.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="fUpdate.Designer.cs">
<DependentUpon>fUpdate.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="AboutBox1.resx">
<DependentUpon>AboutBox1.cs</DependentUpon>
<EmbeddedResource Include="fInfo.resx">
<DependentUpon>fInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="fFirstStartup.resx">
<DependentUpon>fFirstStartup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<EmbeddedResource Include="fMain.resx">
<DependentUpon>fMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="fSettings.resx">
<DependentUpon>fSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="fUpdate.resx">
<DependentUpon>fUpdate.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -99,6 +108,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
1 change: 1 addition & 0 deletions obj/Debug/meautosd.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -10,3 +10,4 @@ C:\Users\Ringo Hoffmann\Documents\Visual Studio 2015\Projects\meautosd\meautosd\
C:\Users\Ringo Hoffmann\Documents\Visual Studio 2015\Projects\meautosd\meautosd\obj\Debug\meautosd.fInfo.resources
C:\Users\Ringo Hoffmann\documents\visual studio 2015\Projects\meautosd\meautosd\obj\Debug\meautosd.csprojResolveAssemblyReference.cache
C:\Users\Ringo Hoffmann\documents\visual studio 2015\Projects\meautosd\meautosd\obj\Debug\meautosd.fFirstStartup.resources
C:\Users\Ringo Hoffmann\documents\visual studio 2015\Projects\meautosd\meautosd\obj\Debug\meautosd.fUpdate.resources
Binary file modified obj/Debug/meautosd.csproj.GenerateResource.Cache
Binary file not shown.
Binary file added obj/Debug/meautosd.fUpdate.resources
Binary file not shown.
Binary file modified obj/Debug/meautosd.pdb
Binary file not shown.
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="PushBulletSharp" version="2.3.3" targetFramework="net452" />
</packages>

0 comments on commit bc265eb

Please sign in to comment.