/[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 28 by twoaday, Thu Oct 20 12:35:59 2005 UTC revision 34 by twoaday, Wed Oct 26 11:20:09 2005 UTC
# Line 40  Line 40 
40  static subclass_s siglist_proc;  static subclass_s siglist_proc;
41    
42    
43  static int inline  static int
44  is_sig (listview_ctrl_t lv, int pos)  is_sig (listview_ctrl_t lv, int pos)
45  {  {
46      char tmpbuf[256];      char tmpbuf[256];
47    
48      if (pos == -1)      if (pos == -1)
49          pos = listview_get_curr_pos (lv);          pos = listview_get_curr_pos (lv);
50        if (pos == -1)
51            return 0;
52      listview_get_item_text (lv, pos, 0, tmpbuf, 200);      listview_get_item_text (lv, pos, 0, tmpbuf, 200);
53      if (*tmpbuf == ' ')      if (*tmpbuf == ' ')
54          return -1;          return -1;
# Line 54  is_sig (listview_ctrl_t lv, int pos) Line 56  is_sig (listview_ctrl_t lv, int pos)
56  }  }
57    
58    
59    /* Delete the selected signature from list view @lv. The
60       key is given in @key. */
61  static int  static int
62  do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key)  do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key)
63  {  {
# Line 94  do_delsig (HWND dlg, listview_ctrl_t lv, Line 98  do_delsig (HWND dlg, listview_ctrl_t lv,
98          listview_del_item (lv, pos);          listview_del_item (lv, pos);
99      delete ke;      delete ke;
100      key->update = 1; /*update*/      key->update = 1; /*update*/
101      return 0;      return err? -1 : 0;
102  }  }
103    
104    
105    /* Dialog box procedure to display the signature properties. */
106  static BOOL CALLBACK  static BOOL CALLBACK
107  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
108  {  {
# Line 112  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 117  sigprops_dlg_proc (HWND dlg, UINT msg, W
117          const char * alg;          const char * alg;
118          int _class;          int _class;
119      } ctx;      } ctx;
120      const char *fmt_templ = "%s %s signature";      const char *fmt_templ = _("%s %s signature");
121    
122      switch (msg) {      switch (msg) {
123      case WM_SYSCOMMAND:      case WM_SYSCOMMAND:
# Line 141  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 146  sigprops_dlg_proc (HWND dlg, UINT msg, W
146              ctx.alg = "RSA";              ctx.alg = "RSA";
147          else          else
148              ctx.alg = "ELG";              ctx.alg = "ELG";
149          _snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ,          _snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ,
150                     ctx.exportable? "Exportable" : "Non-exportable", ctx.alg);                     ctx.exportable? _("Exportable") : _("Non-exportable"), ctx.alg);
151          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);
152          listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1);          listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1);
153          SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf);          SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf);
# Line 183  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 188  sigprops_dlg_proc (HWND dlg, UINT msg, W
188          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));
189          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));
190          SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired"));          SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired"));
191            SetWindowText (dlg, _("Signature Properties"));
192          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
193          center_window (dlg, NULL);          center_window (dlg, NULL);
194          return TRUE;          return TRUE;
# Line 223  subclass_dlg_proc (HWND dlg, UINT msg, W Line 229  subclass_dlg_proc (HWND dlg, UINT msg, W
229  }  }
230    
231    
232    /* Return 1 if the list view @lv contains non-available keys. */
233  static int  static int
234  check_for_missing_keys (listview_ctrl_t lv)  check_for_missing_keys (listview_ctrl_t lv)
235  {  {
# Line 237  check_for_missing_keys (listview_ctrl_t Line 244  check_for_missing_keys (listview_ctrl_t
244      }      }
245            
246      return 0;      return 0;
247  } /* check_for_missing_keys */  }
248    
249    
250    /* Receive all missing keys marked in the list @lv. */
251  static int  static int
252  recv_missing_keys (HWND dlg, listview_ctrl_t lv)  recv_missing_keys (HWND dlg, listview_ctrl_t lv)
253  {  {
# Line 258  recv_missing_keys (HWND dlg, listview_ct Line 266  recv_missing_keys (HWND dlg, listview_ct
266      }      }
267            
268      return rc;      return rc;
269  } /* recv_missing_keys */  }
270    
271    
272    /* Create a mini popup with available choices. */
273  static void  static void
274  do_create_popup (HWND dlg)  do_create_popup (HWND dlg)
275  {  {
# Line 281  do_create_popup (HWND dlg) Line 290  do_create_popup (HWND dlg)
290  }  }
291    
292    
293    /* Load the key property dialog with the selected key from @lv. */
294  static void  static void
295  do_load_keyprops (HWND dlg, listview_ctrl_t lv)  do_load_keyprops (HWND dlg, listview_ctrl_t lv)
296  {  {
# Line 310  do_load_keyprops (HWND dlg, listview_ctr Line 320  do_load_keyprops (HWND dlg, listview_ctr
320                      keyprops_dlg_proc, (LPARAM)&k);                      keyprops_dlg_proc, (LPARAM)&k);
321  }  }
322    
323      
324    /* Dialog box procedure to list signatures. */
325  BOOL CALLBACK  BOOL CALLBACK
326  keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
327  {  {
# Line 343  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 354  keysig_dlg_proc (HWND dlg, UINT msg, WPA
354          siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC);          siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC);
355          if (siglist_proc.old) {          if (siglist_proc.old) {
356              if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current))  {              if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current))  {
357                  msg_box (dlg, _("Could not set keylist window procedure."), _("Key Manager"), MB_ERR);                  msg_box (dlg, _("Could not set keylist window procedure."),
358                             _("Key Manager"), MB_ERR);
359                  BUG (0);                  BUG (0);
360              }              }
361          }          }
# Line 428  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 440  keysig_dlg_proc (HWND dlg, UINT msg, WPA
440          break;          break;
441      }      }
442      return FALSE;      return FALSE;
443  } /* keysig_dlg_proc */  }

Legend:
Removed from v.28  
changed lines
  Added in v.34

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26