/[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 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 65 by twoaday, Thu Nov 3 16:55:25 2005 UTC
# Line 23  Line 23 
23  #endif  #endif
24    
25  #include <windows.h>  #include <windows.h>
 #include <windows.h>  
26  #include <commctrl.h>  #include <commctrl.h>
27  #include <time.h>  #include <time.h>
28    
29  #include "../resource.h"  #include "resource.h"
30  #include "wptGPG.h"  #include "wptGPG.h"
31  #include "wptCommonCtl.h"  #include "wptCommonCtl.h"
32  #include "wptContext.h" /* for passphrase_s */  #include "wptContext.h" /* for passphrase_s */
33  #include "wptDlgs.h"  #include "wptDlgs.h"
34  #include "wptW32API.h"  #include "wptW32API.h"
35  #include "wptNLS.h"  #include "wptNLS.h"
36  #include "wptKeyList.h"  #include "wptKeylist.h"
37  #include "wptKeyserver.h"  #include "wptKeyserver.h"
38  #include "wptUTF8.h"  #include "wptUTF8.h"
39  #include "wptTypes.h"  #include "wptTypes.h"
# Line 256  check_for_missing_keys (listview_ctrl_t Line 255  check_for_missing_keys (listview_ctrl_t
255  static int  static int
256  recv_missing_keys (HWND dlg, listview_ctrl_t lv)  recv_missing_keys (HWND dlg, listview_ctrl_t lv)
257  {  {
258      int i, n, rc;      int i, n, rc=0;
259      char id[128], keyid[18+1];      char id[128], keyid[18+1];
260            
261      n = listview_count_items (lv, 0);      n = listview_count_items (lv, 0);
# Line 350  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 349  keysig_dlg_proc (HWND dlg, UINT msg, WPA
349          #endif          #endif
350          lv = siglist_load (GetDlgItem (dlg, IDC_KEYSIG_LIST), k->keyid);          lv = siglist_load (GetDlgItem (dlg, IDC_KEYSIG_LIST), k->keyid);
351          if (!check_for_missing_keys (lv))          if (!check_for_missing_keys (lv))
352              EnableWindow (GetDlgItem( dlg, IDC_KEYSIG_RECVKEY ), FALSE);              EnableWindow (GetDlgItem (dlg, IDC_KEYSIG_RECVKEY), FALSE);
353          k->callback.ctl = lv;          k->callback.ctl = lv;
354          sl = GetDlgItem (dlg, IDC_KEYSIG_LIST);          sl = GetDlgItem (dlg, IDC_KEYSIG_LIST);
355          siglist_proc.dlg = dlg;          siglist_proc.dlg = dlg;
# Line 384  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 383  keysig_dlg_proc (HWND dlg, UINT msg, WPA
383          return FALSE;          return FALSE;
384    
385      case WM_NOTIFY:      case WM_NOTIFY:
386          NMHDR * notify;          NMHDR *notify;
387                    
388          notify = (NMHDR *)lparam;          notify = (NMHDR *)lparam;
389          if( notify && notify->code == NM_DBLCLK          if (notify && notify->code == NM_DBLCLK
390              && notify->idFrom == IDC_KEYSIG_LIST )              && notify->idFrom == IDC_KEYSIG_LIST)
391              do_load_keyprops (dlg, lv);              do_load_keyprops (dlg, lv);
392          if (notify && notify->code == NM_RCLICK &&          if (notify && notify->code == NM_RCLICK &&
393              notify->idFrom == IDC_KEYSIG_LIST)              notify->idFrom == IDC_KEYSIG_LIST)
394              do_create_popup (dlg);              do_create_popup (dlg);
395            if (notify && notify->code == LVN_ITEMCHANGED &&
396                ((LPNMLISTVIEW)lparam)->uNewState) {
397                idx = listview_get_curr_pos (lv);
398                listview_get_item_text (lv, idx, 1, inf, DIM (inf)-1);
399                EnableWindow (GetDlgItem (dlg, IDC_KEYSIG_RECVKEY),
400                              strcmp (inf, "NOKEY") == 0? TRUE: FALSE);
401            }
402          break;          break;
403                    
404      case WM_COMMAND:      case WM_COMMAND:
# Line 415  keysig_dlg_proc (HWND dlg, UINT msg, WPA Line 421  keysig_dlg_proc (HWND dlg, UINT msg, WPA
421                                  _("Key Manager"), MB_YESNO|MB_INFO );                                  _("Key Manager"), MB_YESNO|MB_INFO );
422                  if (id == IDYES) {                  if (id == IDYES) {
423                      rc = recv_missing_keys (dlg, lv);                      rc = recv_missing_keys (dlg, lv);
424                      if( !rc )                      if (!rc)
425                          keycache_set_reload (1);                          keycache_set_reload (1);
426                      return TRUE;                      return TRUE;
427                  }                  }
428                  return TRUE;                  return TRUE;
429              }              }
             listview_get_item_text (lv, idx, 1, inf, DIM (inf)-1);  
             if (strcmp (inf, "NOKEY"))  
                 return FALSE;  
430              listview_get_item_text (lv, idx, 4, keyid, DIM (keyid)-1);              listview_get_item_text (lv, idx, 4, keyid, DIM (keyid)-1);
431              rc = hkp_recv_key (dlg, default_keyserver, default_keyserver_port, keyid, 0, 0);              rc = hkp_recv_key (dlg, default_keyserver, default_keyserver_port, keyid, 0, 0);
432              if (!rc)              if (!rc)
433                  keycache_set_reload (1);                  keycache_update (0, keyid);
434              return TRUE;              return TRUE;
435    
436          case IDC_KEYSIG_SIGPROPS:          case IDC_KEYSIG_SIGPROPS:

Legend:
Removed from v.36  
changed lines
  Added in v.65

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26