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

Diff of /trunk/Src/wptKeysigDlg.cpp

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

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC
# Line 54  is_sig (listview_ctrl_t lv, int pos) Line 54  is_sig (listview_ctrl_t lv, int pos)
54  }  }
55    
56    
57    /* Delete the selected signature from list view @lv. The
58       key is given in @key. */
59  static int  static int
60  do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key)  do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key)
61  {  {
# Line 87  do_delsig (HWND dlg, listview_ctrl_t lv, Line 89  do_delsig (HWND dlg, listview_ctrl_t lv,
89      ke = new GpgKeyEdit (key->keyid);      ke = new GpgKeyEdit (key->keyid);
90      if (!ke)      if (!ke)
91          BUG (NULL);              BUG (NULL);    
92      err = ke->deleteUseridSignature (uidno, signo);      err = ke->delUseridSignature (uidno, signo);
93      if (err)      if (err)
94          msg_box (dlg, gpgme_strerror (err), _("Key Manager"), MB_ERR);          msg_box (dlg, gpgme_strerror (err), _("Key Manager"), MB_ERR);
95      else      else
96          listview_del_item (lv, pos);          listview_del_item (lv, pos);
97      delete ke;      delete ke;
98      key->update = 1; /*update*/      key->update = 1; /*update*/
99      return 0;      return err? -1 : 0;
100  }  }
101    
102    
103    /* Dialog box procedure to display the signature properties. */
104  static BOOL CALLBACK  static BOOL CALLBACK
105  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
106  {  {
# Line 112  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 115  sigprops_dlg_proc (HWND dlg, UINT msg, W
115          const char * alg;          const char * alg;
116          int _class;          int _class;
117      } ctx;      } ctx;
118      const char * fmt_templ = "%s %s signature";      const char *fmt_templ = _("%s %s signature");
119    
120      switch (msg) {      switch (msg) {
121      case WM_SYSCOMMAND:      case WM_SYSCOMMAND:
# Line 141  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 144  sigprops_dlg_proc (HWND dlg, UINT msg, W
144              ctx.alg = "RSA";              ctx.alg = "RSA";
145          else          else
146              ctx.alg = "ELG";              ctx.alg = "ELG";
147          _snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ,          _snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ,
148                     ctx.exportable? "Exportable" : "Non-exportable", ctx.alg);                     ctx.exportable? _("Exportable") : _("Non-exportable"), ctx.alg);
149          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);
150          listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1);          listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1);
151          SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf);          SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf);
# Line 183  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 186  sigprops_dlg_proc (HWND dlg, UINT msg, W
186          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));
187          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));
188          SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired"));          SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired"));
189            SetWindowText (dlg, _("Signature Properties"));
190          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
191          center_window (dlg, NULL);          center_window (dlg, NULL);
192          return TRUE;          return TRUE;
# Line 223  subclass_dlg_proc (HWND dlg, UINT msg, W Line 227  subclass_dlg_proc (HWND dlg, UINT msg, W
227  }  }
228    
229    
230    /* Return 1 if the list view @lv contains non-available keys. */
231  static int  static int
232  check_for_missing_keys (listview_ctrl_t lv)  check_for_missing_keys (listview_ctrl_t lv)
233  {  {
# Line 237  check_for_missing_keys (listview_ctrl_t Line 242  check_for_missing_keys (listview_ctrl_t
242      }      }
243            
244      return 0;      return 0;
245  } /* check_for_missing_keys */  }
246    
247    
248    /* Receive all missing keys marked in the list @lv. */
249  static int  static int
250  recv_missing_keys (HWND dlg, listview_ctrl_t lv)  recv_missing_keys (HWND dlg, listview_ctrl_t lv)
251  {  {
# Line 258  recv_missing_keys (HWND dlg, listview_ct Line 264  recv_missing_keys (HWND dlg, listview_ct
264      }      }
265            
266      return rc;      return rc;
267  } /* recv_missing_keys */  }
268    
269    
270    /* Create a mini popup with available choices. */
271  static void  static void
272  do_create_popup (HWND dlg)  do_create_popup (HWND dlg)
273  {  {
# Line 271  do_create_popup (HWND dlg) Line 278  do_create_popup (HWND dlg)
278      hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT_KEYSIG_CTX));      hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT_KEYSIG_CTX));
279      sm = GetSubMenu (hm, 0);      sm = GetSubMenu (hm, 0);
280    
281        set_menu_text (sm, ID_SIGCTX_PROPS, _("Signature &Properties"));
282        set_menu_text (sm, ID_SIGCTX_KEYPROPS, _("Signing &Key Properties"));
283    
284      TrackPopupMenu (sm, TPM_RIGHTALIGN, p.x, p.y, 0, dlg, NULL);      TrackPopupMenu (sm, TPM_RIGHTALIGN, p.x, p.y, 0, dlg, NULL);
285    
286      DestroyMenu (hm);      DestroyMenu (hm);
# Line 278  do_create_popup (HWND dlg) Line 288  do_create_popup (HWND dlg)
288  }  }
289    
290    
291    /* Load the key property dialog with the selected key from @lv. */
292  static void  static void
293  do_load_keyprops (HWND dlg, listview_ctrl_t lv)  do_load_keyprops (HWND dlg, listview_ctrl_t lv)
294  {  {
# Line 307  do_load_keyprops (HWND dlg, listview_ctr Line 318  do_load_keyprops (HWND dlg, listview_ctr
318                      keyprops_dlg_proc, (LPARAM)&k);                      keyprops_dlg_proc, (LPARAM)&k);
319  }  }
320    
321      
322    /* Dialog box procedure to list signatures. */
323  BOOL CALLBACK  BOOL CALLBACK
324  keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
325  {  {
# Line 340  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 352  keysig_dlg_proc (HWND dlg, UINT msg, WPA
352          siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC);          siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC);
353          if (siglist_proc.old) {          if (siglist_proc.old) {
354              if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current))  {              if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current))  {
355                  msg_box (dlg, _("Could not set keylist window procedure."), _("Key Manager"), MB_ERR);                  msg_box (dlg, _("Could not set keylist window procedure."),
356                             _("Key Manager"), MB_ERR);
357                  BUG (0);                  BUG (0);
358              }              }
359          }          }
# Line 425  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 438  keysig_dlg_proc (HWND dlg, UINT msg, WPA
438          break;          break;
439      }      }
440      return FALSE;      return FALSE;
441  } /* keysig_dlg_proc */  }

Legend:
Removed from v.23  
changed lines
  Added in v.32

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26