/[winpt]/trunk/Src/wptFileManager.cpp
ViewVC logotype

Diff of /trunk/Src/wptFileManager.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 119 by twoaday, Fri Dec 9 08:04:51 2005 UTC revision 129 by twoaday, Fri Dec 30 13:56:10 2005 UTC
# Line 21  Line 21 
21  /* TODO:  /* TODO:
22   *    check_armor_type: we should check the whole file and not only the first line!   *    check_armor_type: we should check the whole file and not only the first line!
23   */   */
24    
25  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
26  #include <config.h>  #include <config.h>
27  #endif  #endif
# Line 49  Line 50 
50  #include "wptRegistry.h"  #include "wptRegistry.h"
51  #include "wptImport.h"  #include "wptImport.h"
52  #include "wptCrypto.h"  #include "wptCrypto.h"
53    #include "wptKeyManager.h"
54  #include "openpgp.h"  #include "openpgp.h"
55    
56  #define op_begin()  SetCursor (LoadCursor (NULL, IDC_WAIT))  #define op_begin()  SetCursor (LoadCursor (NULL, IDC_WAIT))
# Line 1669  leave: Line 1671  leave:
1671  }  }
1672    
1673    
 /* Generate a user friendly file name based on the key @k. */  
 static char*  
 gen_key_outname (gpgme_key_t k)  
 {  
     char *p;  
     size_t i;  
   
     p = new char[strlen (k->uids->name)+1+8];  
     if (!p)      
         BUG (NULL);  
     sprintf (p, "%s.asc", k->uids->name);  
     for (i=0; i < strlen (p); i++) {  
         if (p[i] == ' ')  
             p[i] = '_';  
     }  
     return p;  
 }  
   
   
1674  /* Export the selected keys from the File Manager to a file. */  /* Export the selected keys from the File Manager to a file. */
1675  int  int
1676  fm_export (fm_state_t c)  fm_export (fm_state_t c)
# Line 1707  fm_export (fm_state_t c) Line 1690  fm_export (fm_state_t c)
1690      }      }
1691    
1692      if (rset[1] == NULL) /* count == 1*/      if (rset[1] == NULL) /* count == 1*/
1693          p = gen_key_outname (rset[0]);          p = km_gen_export_filename (rset[0]->subkeys->keyid+8, 0);
1694    
1695      name = get_filesave_dlg (c->dlg, _("Choose Name for Key File"),      name = get_filesave_dlg (c->dlg, _("Choose Name for Key File"),
1696                               NULL, p? p : NULL);                               NULL, p? p : NULL);

Legend:
Removed from v.119  
changed lines
  Added in v.129

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26