Skip to content

Commit

Permalink
Notify users of successful re-encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Geluk committed Sep 7, 2017
1 parent b0a830e commit 4c1d86f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pass-winmenu/embedded/default-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ notifications:
password-copied: true
# ...a new password has been generated:
password-generated: true
# ...a password has been edited:
password-updated: true
# ...changes are pushed to Git
git-push: true
# ...changes are pulled from Git
Expand Down
2 changes: 2 additions & 0 deletions pass-winmenu/include/packaged-config-nogpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ notifications:
password-copied: true
# ...a new password has been generated:
password-generated: true
# ...a password has been edited:
password-updated: true
# ...changes are pushed to Git
git-push: true
# ...changes are pulled from Git
Expand Down
2 changes: 2 additions & 0 deletions pass-winmenu/include/packaged-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ notifications:
password-copied: true
# ...a new password has been generated:
password-generated: true
# ...a password has been edited:
password-updated: true
# ...changes are pushed to Git
git-push: true
# ...changes are pulled from Git
Expand Down
1 change: 1 addition & 0 deletions pass-winmenu/src/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ internal class NotificationTypesConfig
{
public bool PasswordCopied { get; set; } = true;
public bool PasswordGenerated { get; set; } = false;
public bool PasswordUpdated { get; set; } = true;
public bool GitPush { get; set; } = true;
public bool GitPull { get; set; } = true;
public bool NoSshKeyFound { get; set; } = true;
Expand Down
10 changes: 9 additions & 1 deletion pass-winmenu/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,14 @@ private void EditWithEditWindow(string selectedFile)
File.Delete(passwordManager.GetPasswordFilePath(selectedFile));
passwordManager.EncryptText(window.PasswordContent.Text, selectedFile);
git?.EditPassword(selectedFile);
if (ConfigManager.Config.Notifications.Types.PasswordUpdated)
{
RaiseNotification($"Password file \"{selectedFile}\" has been updated.", ToolTipIcon.Info);
}
}
catch (Exception e)
{
ShowErrorWindow($"Unable to save your password (encyrption failed): {e.Message}");
ShowErrorWindow($"Unable to save your password (encryption failed): {e.Message}");
}
}
}
Expand Down Expand Up @@ -768,6 +772,10 @@ private void EditWithTextEditor(string selectedFile)
passwordManager.EncryptFile(decryptedFile);
File.Delete(decryptedFile);
git?.EditPassword(selectedFile);
if (ConfigManager.Config.Notifications.Types.PasswordUpdated)
{
RaiseNotification($"Password file \"{selectedFile}\" has been updated.", ToolTipIcon.Info);
}
}
else
{
Expand Down

0 comments on commit 4c1d86f

Please sign in to comment.