Beispiel #1
0
        private void EditPass_Clicked(object?sender, EventArgs e)
        {
            var passwd = GtkHelper.GetSelectedValue <PasswordEntry?>(this.LvPasswords, 2);

            if (passwd.HasValue)
            {
                using var dlg = PasswordDialog.CreateFromGladeFile(this, this.group);
                dlg.SetPassword(passwd.Value);
                dlg.Run();
                dlg.Destroy();
                if (dlg.Result)
                {
                    var password = new PasswordEntry
                    {
                        Host     = dlg.Host,
                        User     = dlg.UserName,
                        Password = dlg.Password
                    };
                    if (LvPasswords.Selection.GetSelected(out var iter))
                    {
                        passwordStore.SetValues(iter, password.Host, password.User, password);
                    }
                }
            }
        }
Beispiel #2
0
 private void AddPass_Clicked(object?sender, EventArgs e)
 {
     using var dlg = PasswordDialog.CreateFromGladeFile(this, this.group);
     dlg.Run();
     dlg.Destroy();
     if (dlg.Result)
     {
         var password = new PasswordEntry
         {
             Host     = dlg.Host,
             User     = dlg.UserName,
             Password = dlg.Password
         };
         passwordStore.AppendValues(password.Host, password.User, password);
     }
 }