/[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 204 by twoaday, Wed Apr 26 06:37:23 2006 UTC revision 213 by twoaday, Thu May 11 13:32:56 2006 UTC
# Line 116  do_delsig (HWND dlg, listview_ctrl_t lv, Line 116  do_delsig (HWND dlg, listview_ctrl_t lv,
116  BOOL CALLBACK  BOOL CALLBACK
117  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
118  {  {
119      static gpgme_key_sig_t ks;      gpgme_key_sig_t ks;
120      gpgme_key_t issuer;      winpt_key_s issuer;
121      char tmpbuf[256];      char tmpbuf[256];
122      struct {      static struct {
123          unsigned int exportable:1;          unsigned int exportable:1;
124          unsigned int expired:1;          unsigned int expired:1;
125          unsigned int nrev:1;          unsigned int nrev:1;
# Line 146  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 146  sigprops_dlg_proc (HWND dlg, UINT msg, W
146          SetDlgItemText (dlg, IDC_SIGPROPS_EXPSTR, _("Expire date"));          SetDlgItemText (dlg, IDC_SIGPROPS_EXPSTR, _("Expire date"));
147          SetDlgItemText (dlg, IDC_SIGPROPS_KEYINF, _("Issuer key"));          SetDlgItemText (dlg, IDC_SIGPROPS_KEYINF, _("Issuer key"));
148          SetDlgItemText (dlg, IDC_SIGPROPS_KEYIDINF, _("Issuer key ID"));          SetDlgItemText (dlg, IDC_SIGPROPS_KEYIDINF, _("Issuer key ID"));
149            SetDlgItemText (dlg, IDC_SIGPROPS_POLICINF, _("Policy URL"));
150          ks = (gpgme_key_sig_t)lparam;          ks = (gpgme_key_sig_t)lparam;
151          if (!ks)          if (!ks)
152              BUG (0);              BUG (0);
# Line 165  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 166  sigprops_dlg_proc (HWND dlg, UINT msg, W
166                     ctx.exportable? _("Exportable") : _("Non-exportable"), ctx.alg);                     ctx.exportable? _("Exportable") : _("Non-exportable"), ctx.alg);
167          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);          SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf);
168                    
169          SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, ks->keyid+8);          _snprintf (tmpbuf, DIM (tmpbuf)-1, "0x%s", ks->keyid+8);
170            SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf);
171          SetDlgItemInt (dlg, IDC_SIGPROPS_CLASS, ctx._class, FALSE);          SetDlgItemInt (dlg, IDC_SIGPROPS_CLASS, ctx._class, FALSE);
172          if (ctx.exportable)          if (ctx.exportable)
173              CheckDlgButton (dlg, IDC_SIGPROPS_EXP, BST_CHECKED);              CheckDlgButton (dlg, IDC_SIGPROPS_EXP, BST_CHECKED);
174          if (!get_pubkey (ks->keyid+8, &issuer))          memset (&issuer, 0, sizeof (issuer));
175              s = issuer->uids->uid;          if (!winpt_get_pubkey (ks->keyid+8, &issuer))
176                s = issuer.ext->uids->uid;
177          else          else
178              s = _("  user ID not found");              s = _("  user ID not found");
179          SetDlgItemText_utf8 (dlg, IDC_SIGPROPS_ISSUER, s);          SetDlgItemText (dlg, IDC_SIGPROPS_ISSUER, s);
180          if (ks->expires == 0) {          if (ks->expires == 0) {
181              ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPSTR), SW_HIDE);              ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPSTR), SW_HIDE);
182              ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), SW_HIDE);              ShowWindow (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE), SW_HIDE);
# Line 187  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 190  sigprops_dlg_proc (HWND dlg, UINT msg, W
190              tm = localtime (&tmp);              tm = localtime (&tmp);
191              memset (&st, 0, sizeof st);              memset (&st, 0, sizeof st);
192              st.wYear = tm->tm_year+1900;              st.wYear = tm->tm_year+1900;
193              st.wMonth = tm->tm_mon;              st.wMonth = tm->tm_mon+1;
194              st.wDay = tm->tm_mday;              st.wDay = tm->tm_mday;
195              DateTime_SetSystemtime (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE),              DateTime_SetSystemtime (GetDlgItem (dlg, IDC_SIGPROPS_EXPDATE),
196                                      GDT_VALID, &st);                                      GDT_VALID, &st);
# Line 202  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 205  sigprops_dlg_proc (HWND dlg, UINT msg, W
205              if (ctx.expired)              if (ctx.expired)
206                  CheckDlgButton (dlg, IDC_SIGPROPS_EXPIRED, BST_CHECKED);                  CheckDlgButton (dlg, IDC_SIGPROPS_EXPIRED, BST_CHECKED);
207          }          }
208            /* XXX (gpgme): \r at the end of the notation value. */
209            if (ks->notations && !ks->notations->name && ks->notations->value)
210                SetDlgItemText (dlg, IDC_SIGPROPS_POLIC, ks->notations->value);
211    
212          SetDlgItemText (dlg, IDC_SIGPROPS_EXP, _("Exportable"));          SetDlgItemText (dlg, IDC_SIGPROPS_EXP, _("Exportable"));
213          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));          SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably"));
214          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));          SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked"));
# Line 212  sigprops_dlg_proc (HWND dlg, UINT msg, W Line 219  sigprops_dlg_proc (HWND dlg, UINT msg, W
219          return TRUE;          return TRUE;
220    
221      case WM_COMMAND:      case WM_COMMAND:
222            if (HIWORD (wparam) == BN_CLICKED) {
223                switch (LOWORD (wparam)) {
224                case IDC_SIGPROPS_EXP:
225                    CheckDlgButton (dlg, IDC_SIGPROPS_EXP,
226                                     ctx.exportable? BST_CHECKED : BST_UNCHECKED);
227                    return TRUE;
228    
229                case IDC_SIGPROPS_EXPIRED:
230                    CheckDlgButton (dlg, IDC_SIGPROPS_EXPIRED,
231                                    ctx.expired? BST_CHECKED : BST_UNCHECKED);
232                    return TRUE;
233    
234                case IDC_SIGPROPS_REV:
235                    CheckDlgButton (dlg, IDC_SIGPROPS_REV,
236                                    ctx.rev? BST_CHECKED : BST_UNCHECKED);
237                    return TRUE;
238    
239                case IDC_SIGPROPS_NREV:
240                    CheckDlgButton (dlg, IDC_SIGPROPS_NREV,
241                                    ctx.nrev? BST_CHECKED : BST_UNCHECKED);
242                    return TRUE;
243                }
244            }
245    
246          switch (LOWORD (wparam)) {          switch (LOWORD (wparam)) {
247          case IDOK:          case IDOK:
248              EndDialog (dlg, TRUE);              EndDialog (dlg, TRUE);
# Line 344  static void Line 375  static void
375  do_load_keyprops (HWND dlg, listview_ctrl_t lv)  do_load_keyprops (HWND dlg, listview_ctrl_t lv)
376  {  {
377      winpt_key_s k;      winpt_key_s k;
     gpgme_key_t key;  
378      char keyid[32] = {0};      char keyid[32] = {0};
379      char status[64] = {0}, creation[64] = {0};      char status[64] = {0}, creation[64] = {0};
380      int n = listview_get_curr_pos (lv);      int n = listview_get_curr_pos (lv);
# Line 361  do_load_keyprops (HWND dlg, listview_ctr Line 391  do_load_keyprops (HWND dlg, listview_ctr
391              return;              return;
392      }      }
393            
394      if ((strlen (keyid) < 3 ||get_pubkey (keyid, &key))) {      memset (&k, 0, sizeof k);
395        if ((strlen (keyid) < 3 || winpt_get_pubkey (keyid, &k))) {
396          if (strlen (creation) > 0)          if (strlen (creation) > 0)
397              msg_box (dlg, _("Key not found in keyring."), _("Key Manager"), MB_INFO);              msg_box (dlg, _("Key not found in keyring."), _("Key Manager"), MB_INFO);
398          return;          return;
399      }      }
     memset (&k, 0, sizeof k);  
     k.keyid = keyid;  
400      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_KEYPROPS, dlg,      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_KEYPROPS, dlg,
401                      keyprops_dlg_proc, (LPARAM)&k);                      keyprops_dlg_proc, (LPARAM)&k);
402  }  }
# Line 391  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 420  keysig_dlg_proc (HWND dlg, UINT msg, WPA
420              BUG (0);              BUG (0);
421          if (k->uid)          if (k->uid)
422              _snprintf (inf, DIM (inf)-1, _("Signature List for \"%s\""), k->uid);              _snprintf (inf, DIM (inf)-1, _("Signature List for \"%s\""), k->uid);
423          SetWindowText_utf8 (dlg, inf);          SetWindowText (dlg, inf);
424          SetDlgItemText (dlg, IDC_KEYSIG_RECVKEY, _("&Receive Key"));          SetDlgItemText (dlg, IDC_KEYSIG_RECVKEY, _("&Receive Key"));
425          SetDlgItemText (dlg, IDC_KEYSIG_SIGPROPS, _("&Properties"));          SetDlgItemText (dlg, IDC_KEYSIG_SIGPROPS, _("&Properties"));
426    
# Line 497  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 526  keysig_dlg_proc (HWND dlg, UINT msg, WPA
526              }              }
527              return TRUE;              return TRUE;
528                            
529            case IDCANCEL:
530                EndDialog (dlg, FALSE);
531                return TRUE;
532    
533          case IDOK:          case IDOK:
534              EndDialog (dlg, TRUE);              EndDialog (dlg, TRUE);
535              return TRUE;              return TRUE;

Legend:
Removed from v.204  
changed lines
  Added in v.213

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26