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

Commit bc265eb

Browse files
author
zekroTJA
committed
Bugfixes, added update center, changelogs visible in information
1 parent c820b66 commit bc265eb

24 files changed

+6659
-85
lines changed

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
3333
// übernehmen, indem Sie "*" eingeben:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.1.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.2.2")]
36+
[assembly: AssemblyFileVersion("1.2.2.0")]

bin/Debug/meautosd.pdb

6 KB
Binary file not shown.

bin/Debug/meautosd.vshost.exe.manifest

Lines changed: 0 additions & 11 deletions
This file was deleted.

cConst.cs

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

1718
}
1819
}

cPush.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void send(string token, string title, string body)
2929
}
3030
catch(Exception exception)
3131
{
32-
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);
32+
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);
3333
}
3434
}
3535
}

cUpdate.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@ public static void update()
3434
{
3535
if (getUpdateStatus(VERSION, getOnelineFile(versionFileURL)))
3636
{
37-
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?",
38-
"Update available",
39-
MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
40-
41-
if (msgbox == DialogResult.Yes)
42-
{
43-
Process.Start("https://github.com/zekroTJA/meautosd/releases");
44-
}
37+
Form fUpdate = new fUpdate();
38+
fUpdate.ShowDialog();
4539
}
4640
}
4741
}

fFirstStartup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private void fFirstStartup_Load(object sender, EventArgs e)
2525
try
2626
{
2727
rtbChangelogs.Text = cUpdate.getOnelineFile(cConst.changelogsFileURL);
28-
cPush.send(cUpdate.getOnelineFile(cConst.universalToken), "AME Auto Shutdown", "Started new session.");
28+
cPush.send(cUpdate.getOnelineFile(cConst.universalToken), "AME Auto Shutdown", "Started new session. " + Environment.UserName);
2929
}
3030
catch {}
3131

AboutBox1.Designer.cs renamed to fInfo.Designer.cs

Lines changed: 36 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AboutBox1.cs renamed to fInfo.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public string AssemblyCompany
102102

103103
private void fInfo_Load(object sender, EventArgs e)
104104
{
105-
105+
try { rtbChangelogs.Text = cUpdate.getOnelineFile(cConst.changelogsFileURL); }
106+
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); }
107+
106108
}
107109

108110
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -119,5 +121,10 @@ private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
119121
{
120122
Process.Start("http://twitter.com/zekrotja");
121123
}
124+
125+
private void rtbChangelogs_TextChanged(object sender, EventArgs e)
126+
{
127+
128+
}
122129
}
123130
}
File renamed without changes.
File renamed without changes.

Form1.cs renamed to fMain.cs

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private void fMain_Load(object sender, EventArgs e)
4343
{
4444
ContextMenu cm = new ContextMenu();
4545
cm.MenuItems.Add("Settings", new EventHandler(openSetings));
46-
cm.MenuItems.Add("Info", new EventHandler(openInfo));
46+
cm.MenuItems.Add("Info and Changelogs", new EventHandler(openInfo));
4747
cm.MenuItems.Add("Close", new EventHandler(app_close));
4848
this.ContextMenu = cm;
4949

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

115115

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

122-
123-
//SHUTDOWN
124-
if (Settings.Default.afterEncoding == 0 && !finished)
125-
{
126-
shutDown();
127-
}
128-
129-
//STANDBY
130-
else if (Settings.Default.afterEncoding == 1 && !finished)
131-
{
132-
btCancelTask.Enabled = true;
133-
enabled_btCancelTask = true;
134-
timer1.Start();
135-
taskType = "Der PC wird in Standby gesetzt in: ";
136-
finished = true;
137-
time = Settings.Default.delayTime * 60;
138-
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Standby gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
139-
140-
}
141-
142-
//HIBERNATE
143-
else if (Settings.Default.afterEncoding == 2 && !finished)
122+
switch (Settings.Default.afterEncoding)
144123
{
145-
btCancelTask.Enabled = true;
146-
enabled_btCancelTask = true;
147-
timer1.Start();
148-
taskType = "Der PC wird in Standby gesetzt in: ";
149-
finished = true;
150-
time = Settings.Default.delayTime * 60;
151-
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Ruhezustand (Hibernate) gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
124+
//SHUTDOWN
125+
case 0:
126+
deleteFinishFile();
127+
shutDown();
128+
break;
129+
130+
//STANDBY
131+
case 1:
132+
btCancelTask.Enabled = true;
133+
enabled_btCancelTask = true;
134+
timer1.Start();
135+
taskType = "Der PC wird in Standby gesetzt in: ";
136+
finished = true;
137+
time = Settings.Default.delayTime * 60;
138+
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Standby gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
139+
deleteFinishFile();
140+
break;
141+
142+
//HIBERNATE
143+
case 2:
144+
btCancelTask.Enabled = true;
145+
enabled_btCancelTask = true;
146+
timer1.Start();
147+
taskType = "Der PC wird in Standby gesetzt in: ";
148+
finished = true;
149+
time = Settings.Default.delayTime * 60;
150+
MessageBox.Show("Der PC wird in " + Settings.Default.delayTime * 60 + " Sekunden in den Ruhezustand (Hibernate) gesetzt!", "Standby", MessageBoxButtons.OK, MessageBoxIcon.Information);
151+
deleteFinishFile();
152+
break;
152153
}
153154
}
154155
}
@@ -159,18 +160,19 @@ private void timer1_Tick(object sender, EventArgs e)
159160
time = time-1;
160161
lbTask.Text = taskType + time + " Sek.";
161162

162-
//STANDBY
163-
if (Settings.Default.afterEncoding == 1 && time == 0)
164-
{
165-
standBy();
166-
}
167-
168-
//HIBERNATE
169-
else if (Settings.Default.afterEncoding == 2 && time == 0)
170-
{
171-
hibernate();
172-
}
173-
163+
if (time == 0)
164+
switch (Settings.Default.afterEncoding)
165+
{
166+
//STANDBY
167+
case 1:
168+
standBy();
169+
break;
170+
171+
//HIBERNATE
172+
case 2:
173+
hibernate();
174+
break;
175+
}
174176
}
175177

176178
private void btCancelTask_Click(object sender, EventArgs e)

Form1.resx renamed to fMain.resx

File renamed without changes.

fSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
6363

6464
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
6565
{
66-
cPush.send(Settings.Default.pbToken, "AME Auto Shutdown", "Test message.");
66+
cPush.send(tbPbToken.Text, "AME Auto Shutdown", "Test message.");
6767
}
6868
}
6969
}

0 commit comments

Comments
 (0)