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

Diff of /trunk/Src/wptFileVerifyDlg.cpp

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

revision 218 by twoaday, Mon Apr 3 17:10:47 2006 UTC revision 219 by twoaday, Sat May 27 08:56:00 2006 UTC
# Line 34  Line 34 
34  #include "wptTypes.h"  #include "wptTypes.h"
35  #include "wptKeyserver.h"  #include "wptKeyserver.h"
36    
37  static listview_ctrl_t dlg_lv = NULL;  static verlist_ctrl_t dlg_vlv = NULL;
38  static HWND dlg_wnd = NULL;             /* handle to the dialog box window */  static HWND dlg_wnd = NULL;             /* handle to the dialog box window */
39  static HANDLE dlg_event = NULL;         /* event for the dialog. */  static HANDLE dlg_event = NULL;         /* event for the dialog. */
40    
# Line 43  static HANDLE dlg_event = NULL;                /* even Line 43  static HANDLE dlg_event = NULL;                /* even
43  static BOOL CALLBACK  static BOOL CALLBACK
44  file_verify_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  file_verify_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
45  {  {
46      static listview_ctrl_t lv = NULL;      static verlist_ctrl_t vlv = NULL;
     int rc = 0;  
47            
48      switch (msg) {      switch (msg) {
49      case WM_INITDIALOG:      case WM_INITDIALOG:
50          SetWindowText (dlg, _("File Verify"));          SetWindowText (dlg, _("File Verify"));
51          SetDlgItemText (dlg, IDC_VERIFY_SAVE, _("&Save"));          SetDlgItemText (dlg, IDC_VERIFY_SAVE, _("&Save"));
52          rc = verlist_build (&lv, GetDlgItem (dlg, IDC_VERIFY_SIGLIST), 1);          verlist_build (&vlv, GetDlgItem (dlg, IDC_VERIFY_SIGLIST), 1);
53          if (rc)          verlist_set_info_control (vlv, GetDlgItem (dlg, IDC_VERIFY_INFO));
             BUG (dlg);  
54          EnableWindow (GetDlgItem (dlg, IDC_VERIFY_SAVE), FALSE);          EnableWindow (GetDlgItem (dlg, IDC_VERIFY_SAVE), FALSE);
55          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
56          dlg_lv = lv;          dlg_vlv = vlv;
57          dlg_wnd = dlg;          dlg_wnd = dlg;
58          return TRUE;          return TRUE;
59                    
60      case WM_DESTROY:      case WM_DESTROY:
61          if (lv) {          if (vlv) {
62              listview_release (lv);              verlist_delete (vlv);
63              lv = NULL;                                vlv = NULL;
64          }          }
65          dlg_lv = NULL;          dlg_vlv = NULL;
66          dlg_wnd = NULL;          dlg_wnd = NULL;
67          return FALSE;          return FALSE;
68    
# Line 75  file_verify_dlg_proc (HWND dlg, UINT msg Line 73  file_verify_dlg_proc (HWND dlg, UINT msg
73          if (notify && notify->code == NM_DBLCLK &&          if (notify && notify->code == NM_DBLCLK &&
74              notify->idFrom == IDC_VERIFY_SIGLIST) {              notify->idFrom == IDC_VERIFY_SIGLIST) {
75              char buf[64];              char buf[64];
76              listview_get_item_text (lv, listview_get_curr_pos (lv), 4, buf, 63);              int  tmp;
77    
78                tmp = listview_get_curr_pos (vlv->lv);
79                listview_get_item_text (vlv->lv, tmp, 4, buf, 63);
80              if (strlen (buf) == 10 && buf[0] == '0' && buf[1] == 'x') {              if (strlen (buf) == 10 && buf[0] == '0' && buf[1] == 'x') {
81                  rc = msg_box (dlg, _("Do you want to retrieve the key?"),                  tmp = msg_box (dlg, _("Do you want to retrieve the key?"),
82                                _("Verify"), MB_QUEST_ASK);                                _("Verify"), MB_QUEST_ASK);
83                  if (rc == IDYES) {                  if (tmp == IDYES) {
84                      if (!hkp_recv_key (dlg, default_keyserver,                      if (!hkp_recv_key (dlg, default_keyserver,
85                                         default_keyserver_port, buf, 0, 0))                                         default_keyserver_port, buf, 0, 0))
86                          keycache_update (0, buf);                          keycache_update (0, buf);
# Line 88  file_verify_dlg_proc (HWND dlg, UINT msg Line 89  file_verify_dlg_proc (HWND dlg, UINT msg
89    
90          }          }
91          break;          break;
   
     case WM_SYSCOMMAND:  
         if (LOWORD (wparam) == SC_CLOSE)  
             EndDialog (dlg, TRUE);  
         return FALSE;  
92                    
93      case WM_COMMAND:      case WM_COMMAND:
94          switch (LOWORD (wparam)) {          switch (LOWORD (wparam)) {
95            case IDCANCEL:
96                EndDialog (dlg, FALSE);
97                break;
98    
99          case IDOK:          case IDOK:
100              if (dlg_event)              if (dlg_event)
101                  SetEvent (dlg_event);                  SetEvent (dlg_event);
# Line 158  file_verify_create_dlg (void) Line 158  file_verify_create_dlg (void)
158  void  void
159  file_verify_add_state (file_sig_ctx_t c)  file_verify_add_state (file_sig_ctx_t c)
160  {  {
161      if (!dlg_lv)      if (!dlg_vlv)
162          return;          return;
163      ResetEvent (dlg_event);      ResetEvent (dlg_event);
164      verlist_add_sig_log (dlg_lv, c);      verlist_add_sig_log (dlg_vlv, c);
165  }  }
166    
167    

Legend:
Removed from v.218  
changed lines
  Added in v.219

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26