void btnBrowse_Click(object sender, EventArgs e)
  {
    string defaultFilename = PGPUI.MakeSafeFilename("revoke " + PGPUI.GetKeyName(keyToRevoke) + ".txt");

    SaveFileDialog sfd = new SaveFileDialog();
    sfd.DefaultExt      = ".txt";
    sfd.FileName        = defaultFilename;
    sfd.Filter          = "Text Files (*.txt)|*.txt|ASCII Files (*.asc)|*.asc|All Files (*.*)|*.*";
    sfd.OverwritePrompt = true;
    sfd.Title           = "Save Revocation Certificate";
    sfd.SupportMultiDottedExtensions = true;
    if(sfd.ShowDialog() == DialogResult.OK) txtFile.Text = sfd.FileName;
  }
Beispiel #2
0
  void btnBrowse_Click(object sender, EventArgs e)
  {
    string suffix;
    if(options.GetItemChecked(0) && options.GetItemChecked(1)) suffix = "pub-sec";
    else if(options.GetItemChecked(1)) suffix = "sec";
    else suffix = "pub";

    string ext = options.GetItemChecked(2) ? ".pgp" : ".txt";

    string defaultFilename =
      PGPUI.MakeSafeFilename((keyList.Items.Count == 1 ? keyList.Items[0].ToString() : "Exported keys") + "." +
                             suffix + ext);

    SaveFileDialog sfd = new SaveFileDialog();
    sfd.DefaultExt      = ".txt";
    sfd.FileName        = defaultFilename;
    sfd.Filter          = "Text Files (*.txt)|*.txt|ASCII Files (*.asc)|*.asc|PGP Files (*.pgp)|*.pgp|All Files (*.*)|*.*";
    sfd.FilterIndex     = options.GetItemChecked(2) ? 3 : 1;
    sfd.OverwritePrompt = true;
    sfd.Title           = "Save Exported Keys";
    sfd.SupportMultiDottedExtensions = true;
    if(sfd.ShowDialog() == DialogResult.OK) txtFile.Text = sfd.FileName;
  }