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

Diff of /trunk/Src/wptKeyserverSearchDlg.cpp

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

revision 256 by twoaday, Sat Aug 5 10:31:06 2006 UTC revision 262 by twoaday, Sat Sep 30 10:24:34 2006 UTC
# Line 30  Line 30 
30  #include "wptErrors.h"  #include "wptErrors.h"
31  #include "wptTypes.h"  #include "wptTypes.h"
32  #include "wptGPG.h"  #include "wptGPG.h"
 #include "wptContext.h" /* for passphrase_s */  
33  #include "wptDlgs.h"  #include "wptDlgs.h"
34  #include "wptNLS.h"  #include "wptNLS.h"
35  #include "wptKeylist.h"  #include "wptKeylist.h"
36    
37    
38    /* Default threshold for key items. */
39  #define MAX_N_KEYS 64  #define MAX_N_KEYS 64
40    
41    
# Line 58  on_init_dialog (HWND dlg, UINT msg, WPAR Line 58  on_init_dialog (HWND dlg, UINT msg, WPAR
58          {4, 256, (char *)_("User ID")},          {4, 256, (char *)_("User ID")},
59          {0,   0, NULL}          {0,   0, NULL}
60      };      };
     char info[384];  
     int i;  
61      listview_ctrl_t lv = NULL;      listview_ctrl_t lv = NULL;
62            char info[300];
63        int i;
64    
65      SetDlgItemText (dlg, IDC_HKPSEARCH_RECV, _("&Receive"));      SetDlgItemText (dlg, IDC_HKPSEARCH_RECV, _("&Receive"));
66      SetDlgItemText (dlg, IDOK, _("&Cancel"));      SetDlgItemText (dlg, IDOK, _("&Cancel"));
67      _snprintf (info, sizeof (info) - 1,      _snprintf (info, DIM (info) - 1,
68          _("Connect to '%s' to search for \"%s\""),                 _("Connect to '%s' to search for \"%s\""),
69          ((keyserver_ctx *)lparam)->name, ((keyserver_ctx *)lparam)->pattern);                      ((keyserver_ctx *)lparam)->name,
70                    ((keyserver_ctx *)lparam)->pattern);
71      SetDlgItemText (dlg, IDC_HKPSEARCH_INFO, info);      SetDlgItemText (dlg, IDC_HKPSEARCH_INFO, info);
72      SetWindowText (dlg, _("Keyserver Searching"));      SetWindowText (dlg, _("Keyserver Searching"));
73      SetForegroundWindow (dlg);      SetForegroundWindow (dlg);
# Line 112  search_hkp_keys (HWND dlg, keyserver_ctx Line 113  search_hkp_keys (HWND dlg, keyserver_ctx
113          if (!key)          if (!key)
114              continue;              continue;
115    
116          _snprintf (bits, sizeof (bits) - 1, "%d", key->bits);          _snprintf (bits, DIM (bits) - 1, "%d", key->bits);
117          _snprintf (algo, sizeof (algo)-1, "%s",          _snprintf (algo, DIM (algo)-1, "%s",
118                      get_key_pubalgo ((gpgme_pubkey_algo_t)key->algo));                      get_key_pubalgo ((gpgme_pubkey_algo_t)key->algo));
119          _snprintf (keyid, sizeof (keyid)-1, "0x%s", key->keyid);          _snprintf (keyid, DIM (keyid)-1, "0x%s", key->keyid);
120          uid = key->main_uid? key->main_uid->uid : "";          uid = key->main_uid? key->main_uid->uid : "";
121          listview_add_item (lv, " ");          listview_add_item (lv, " ");
122          listview_add_sub_item (lv, 0, KSS_COL_BITS, bits);          listview_add_sub_item (lv, 0, KSS_COL_BITS, bits);
# Line 149  fetch_keys (HWND dlg, listview_ctrl_t lv Line 150  fetch_keys (HWND dlg, listview_ctrl_t lv
150          if (!listview_get_item_state (lv, n))          if (!listview_get_item_state (lv, n))
151              continue;              continue;
152    
153          listview_get_item_text (lv, n, KSS_COL_KEYID, keyid, sizeof (keyid)-1);          listview_get_item_text (lv, n, KSS_COL_KEYID, keyid, DIM (keyid)-1);
154          rc = hkp_recv_key2 (dlg, ksc->name, ksc->port, keyid, 0, &fpr);          rc = hkp_recv_key2 (dlg, ksc->name, ksc->port, keyid, 0, &fpr);
155          if (!rc && fpr != NULL) {          if (!rc && fpr != NULL) {
156              keycache_update (0, fpr);              keycache_update (0, fpr);
# Line 174  hkpsearch_dlg_proc (HWND dlg, UINT msg, Line 175  hkpsearch_dlg_proc (HWND dlg, UINT msg,
175          lv = on_init_dialog (dlg, msg, wparam, lparam);          lv = on_init_dialog (dlg, msg, wparam, lparam);
176          if (search_hkp_keys (dlg, ksc, lv)) {          if (search_hkp_keys (dlg, ksc, lv)) {
177              EndDialog (dlg, FALSE);              EndDialog (dlg, FALSE);
178              return FALSE;              return TRUE;
179          }          }
180          return TRUE;          return TRUE;
181                    
# Line 185  hkpsearch_dlg_proc (HWND dlg, UINT msg, Line 186  hkpsearch_dlg_proc (HWND dlg, UINT msg,
186          }          }
187          return FALSE;          return FALSE;
188                    
     case WM_SYSCOMMAND:  
         if (LOWORD (wparam) == SC_CLOSE)  
             EndDialog (dlg, TRUE);  
         return FALSE;  
           
189      case WM_COMMAND:      case WM_COMMAND:
190          switch (LOWORD (wparam)) {          switch (LOWORD (wparam)) {
191          case IDOK:          case IDOK:

Legend:
Removed from v.256  
changed lines
  Added in v.262

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26