Using Common
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Common;
|
||||
|
||||
namespace GUI;
|
||||
|
||||
sealed public partial class MainForm : Form
|
||||
@@ -43,8 +45,8 @@ sealed public partial class MainForm : Form
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CopyAndNotify(string? line, string fileName)
|
||||
{
|
||||
private void CopyAndNotify(string? line, string fileName)
|
||||
{
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (line != null)
|
||||
@@ -56,13 +58,13 @@ sealed public partial class MainForm : Form
|
||||
{
|
||||
pb.Run("./ToastNotification.exe", "\"Error\" \"No password copied\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Decrypt(object sender, EventArgs e)
|
||||
{
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text);
|
||||
pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user