Fix init screen to use alert dialog

To initiate a local password-store, you
need a gpg-key, and now we can tell the user
as much
main
Micke Nordin 3 years ago
parent c541c60aa9
commit 9fc9c77396
Signed by: micke
GPG Key ID: 0DA0A7A5708FE257

@ -8,6 +8,7 @@ from typing import Union
import wx
import wx.lib.scrolledpanel as scrolled
import wx.lib.dialogs as dialogs
import gnupg
from pass_handler import Pass, copy_to_clipboard, get_password_from_path, pass_pull, pass_push, run_command
@ -104,15 +105,18 @@ class PassUi(wx.Frame):
self.sizer.Add(gpg_btn, 0, wx.EXPAND) # pylint: disable=no-member
self.Bind(wx.EVT_BUTTON,
lambda event: self.gpg_button_clicked(), gpg_btn)
if self.gpg_key:
init_btn: wx.Button = wx.Button(self.pnl, label="Init Local Password Store")
git_btn: wx.Button = wx.Button(self.pnl, label="Clone Remote Password Store From Git")
self.sizer.Add(init_btn, 0, wx.EXPAND) # pylint: disable=no-member
self.sizer.Add(git_btn, 0, wx.EXPAND) # pylint: disable=no-member
self.Bind(wx.EVT_BUTTON,
lambda event: self.git_button_clicked(), git_btn)
if self.gpg_key:
self.Bind(wx.EVT_BUTTON,
lambda event: self.init_button_clicked(), init_btn)
else:
self.Bind(wx.EVT_BUTTON,
lambda event: dialogs.alertDialog(message='You must select a GPG key'), init_btn)
def add_push_pull(self):
"""add_push_pull."""

Loading…
Cancel
Save