-
Notifications
You must be signed in to change notification settings - Fork 9
/
CrashDialog.cs
executable file
·68 lines (58 loc) · 2.08 KB
/
CrashDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Drawing;
using System.Windows.Forms;
using FreenetTray.Browsers;
namespace FreenetTray
{
public partial class CrashDialog : Form
{
private readonly Action _nodeStarter;
private readonly Action _logOpener;
private readonly NodeController.CrashType _crashType;
public CrashDialog(NodeController.CrashType crashType, Action nodeStarter, Action logOpener)
{
InitializeComponent();
_nodeStarter = nodeStarter;
_logOpener = logOpener;
_crashType = crashType;
}
private void CrashDialog_Load(object sender, EventArgs e)
{
IconBox.Image = SystemIcons.Exclamation.ToBitmap();
var additional = "\n" + strings.AdditionalCrashInfo + " ";
switch (_crashType)
{
case NodeController.CrashType.WrapperFileNotFound:
additional += string.Format(strings.WrapperFileNotFound, NodeController.WrapperFilename());
break;
case NodeController.CrashType.PathTooLong:
additional += strings.PathTooLong;
break;
case NodeController.CrashType.WrapperCrashed:
additional = "";
break;
}
crashMessageLabel.Text += additional;
}
private void ViewLogButton_Click(object sender, EventArgs e)
{
_logOpener();
}
private void SupportChatButton_Click(object sender, EventArgs e)
{
BrowserUtil.Open(new Uri("https://freenetproject.org/help.html#support"));
}
private void MailingListButton_Click(object sender, EventArgs e)
{
BrowserUtil.Open(new Uri("https://emu.freenetproject.org/cgi-bin/mailman/listinfo/support/"));
}
private void RestartButton_Click(object sender, EventArgs e)
{
_nodeStarter();
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
}
}