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

Diff of /trunk/Src/wptKeylist.cpp

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

revision 228 by twoaday, Thu Jun 15 11:37:53 2006 UTC revision 271 by twoaday, Sun Nov 5 08:57:45 2006 UTC
# Line 221  get_key_created (long timestamp) Line 221  get_key_created (long timestamp)
221    
222      if (timestamp < 1)      if (timestamp < 1)
223          return "????" "-??" "-??";          return "????" "-??" "-??";
224      dat = get_locale_date (timestamp, timebuf, sizeof (timebuf)-1);      dat = get_locale_date (timestamp, timebuf, DIM (timebuf)-1);
225      if (dat)      if (dat)
226          return dat;          return dat;
227      /* Fallback if locate date conversion failed. */      /* Fallback if locate date conversion failed. */
228      warp = localtime (&timestamp);      warp = localtime (&timestamp);
229      _snprintf (timebuf, sizeof timebuf - 1, "%04d-%02d-%02d",      _snprintf (timebuf, DIM (timebuf) - 1, "%04d-%02d-%02d",
230                 warp->tm_year + 1900, warp->tm_mon + 1, warp->tm_mday);                 warp->tm_year + 1900, warp->tm_mon + 1, warp->tm_mday);
231      return timebuf;      return timebuf;
232  }  }
# Line 242  get_key_expire_date (long timestamp) Line 242  get_key_expire_date (long timestamp)
242    
243      if (timestamp == 0)      if (timestamp == 0)
244          return _("Never");          return _("Never");
245      dat = get_locale_date (timestamp, timebuf, sizeof (timebuf)-1);      dat = get_locale_date (timestamp, timebuf, DIM (timebuf)-1);
246      if (dat)      if (dat)
247          return dat;          return dat;
248      warp = localtime (&timestamp);      warp = localtime (&timestamp);
249      _snprintf (timebuf, sizeof timebuf -1, "%04d-%02d-%02d",      _snprintf (timebuf, DIM (timebuf) -1, "%04d-%02d-%02d",
250                 warp->tm_year + 1900, warp->tm_mon + 1, warp->tm_mday);                 warp->tm_year + 1900, warp->tm_mon + 1, warp->tm_mday);
251      return timebuf;      return timebuf;
252  }  }
# Line 283  get_key_size (gpgme_key_t key, int keyid Line 283  get_key_size (gpgme_key_t key, int keyid
283      if (n > 1) {      if (n > 1) {
284          k = get_nth_key (key, n-1);          k = get_nth_key (key, n-1);
285          size_sub = k->length;          size_sub = k->length;
286          _snprintf (size_id, sizeof (size_id) - 1, "%d/%d",          _snprintf (size_id, DIM (size_id) - 1, "%d/%d",
287                      size_main, size_sub);                      size_main, size_sub);
288          return size_id;          return size_id;
289      }      }
290      _snprintf( size_id, sizeof (size_id) - 1, "%d", size_main );      _snprintf (size_id, DIM (size_id) - 1, "%d", size_main);
291      return size_id;      return size_id;
292  }  }
293    
# Line 594  keylist_build (listview_ctrl_t *r_lv, HW Line 594  keylist_build (listview_ctrl_t *r_lv, HW
594      {7, 72, (char *)_("Creation")},      {7, 72, (char *)_("Creation")},
595      {0, 0, NULL}      {0, 0, NULL}
596      };      };
597      HICON ico[2];      HICON ico[4];
598      listview_ctrl_t lv;      listview_ctrl_t lv;
599      listview_column_t col;      listview_column_t col;
600      int j, n = 0, ext_chk = 0;      int j, n = 0, ext_chk = 0;
# Line 622  keylist_build (listview_ctrl_t *r_lv, HW Line 622  keylist_build (listview_ctrl_t *r_lv, HW
622          listview_set_chkbox_style (lv);              listview_set_chkbox_style (lv);    
623      ico[0] = LoadIcon (glob_hinst, (LPCTSTR)IDI_PUBKEY);      ico[0] = LoadIcon (glob_hinst, (LPCTSTR)IDI_PUBKEY);
624      ico[1] = LoadIcon (glob_hinst, (LPCTSTR)IDI_KEYPAIR);      ico[1] = LoadIcon (glob_hinst, (LPCTSTR)IDI_KEYPAIR);
625      listview_set_image_list (lv, 22, 14, ico, 2);      ico[2] = LoadIcon (glob_hinst, (LPCTSTR)IDI_SORT_DOWNARROW);
626        ico[3] = LoadIcon (glob_hinst, (LPCTSTR)IDI_SORT_UPARROW);
627        listview_set_image_list (lv, 22, 14, ico, 4);
628      listview_del_all_items (lv);      listview_del_all_items (lv);
629    
630      *r_lv = lv;      *r_lv = lv;
# Line 768  do_addkey (listview_ctrl_t lv, struct ke Line 770  do_addkey (listview_ctrl_t lv, struct ke
770          listview_add_sub_item (lv, 0, idx++, attr);          listview_add_sub_item (lv, 0, idx++, attr);
771      k = get_nth_key (key, keyidx);      k = get_nth_key (key, keyidx);
772      if (k && k->keyid) {      if (k && k->keyid) {
773          _snprintf (fmt, sizeof fmt -1, "0x%s", k->keyid + 8);          _snprintf (fmt, DIM (fmt) -1, "0x%s", k->keyid + 8);
774          listview_add_sub_item (lv, 0, idx++, fmt);          listview_add_sub_item (lv, 0, idx++, fmt);
775      }      }
776      if (list > 0) {      if (list > 0) {
# Line 829  keylist_upd_col (listview_ctrl_t lv, int Line 831  keylist_upd_col (listview_ctrl_t lv, int
831              continue;              continue;
832          switch (col) {          switch (col) {
833          case KM_COL_KEYID:          case KM_COL_KEYID:
834              _snprintf (buf, sizeof (buf)-1, "0x%s", key->subkeys->keyid+8);              _snprintf (buf, DIM (buf)-1, "0x%s", key->subkeys->keyid+8);
835              listview_add_sub_item (lv, i, col, buf);              listview_add_sub_item (lv, i, col, buf);
836              break;              break;
837    
# Line 999  key_check_validity (gpgme_key_t key) Line 1001  key_check_validity (gpgme_key_t key)
1001     fully trusted. @r_count returns the number of selected keys.     fully trusted. @r_count returns the number of selected keys.
1002     Return value: the key list on success, NULL otherwise. */     Return value: the key list on success, NULL otherwise. */
1003  gpgme_key_t*  gpgme_key_t*
1004  keylist_get_recipients (listview_ctrl_t lv, int *r_force_trust, int *r_count)  keylist_get_recipients (listview_ctrl_t lv, int *r_force_trust, size_t *r_count)
1005  {  {
1006      key_array_s *ka = NULL;      key_array_s *ka = NULL;
1007      keycache_s *c;      keycache_s *c;
1008      gpgme_key_t *keybuf, key;      gpgme_key_t *keybuf, key;
1009      int count = 0, force_trust = 0;      size_t count = 0;
1010        int force_trust = 0;
1011      int n, j, ka_pos = 0, rc = 0;      int n, j, ka_pos = 0, rc = 0;
1012      int k_pos=0;      int k_pos=0;
1013    
# Line 1079  keylist_get_keyflags (gpgme_key_t key) Line 1082  keylist_get_keyflags (gpgme_key_t key)
1082    
1083    
1084  gpgme_key_t*  gpgme_key_t*
1085  keylist_enum_recipients (listview_ctrl_t lv,  int listype, int *r_count)  keylist_enum_recipients (listview_ctrl_t lv,  int listype, size_t *r_count)
1086  {  {
1087      struct keycache_s *c;      struct keycache_s *c;
1088      gpgme_key_t *rset;      gpgme_key_t *rset;
1089      gpgme_key_t key;      gpgme_key_t key;
1090      int i, n, id, k_pos=0;      size_t k_pos = 0;
1091        int i, n, id;
1092    
1093      n = listview_count_items (lv, 0);      n = listview_count_items (lv, 0);
1094      if (!n)      if (!n)

Legend:
Removed from v.228  
changed lines
  Added in v.271

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26