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

Diff of /trunk/Src/wptKeyManagerDlg.cpp

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

revision 226 by twoaday, Mon Jun 12 13:40:21 2006 UTC revision 248 by twoaday, Fri Jul 28 11:11:09 2006 UTC
# Line 88  struct km_info_s { Line 88  struct km_info_s {
88  typedef struct km_info_s *km_info_t;  typedef struct km_info_s *km_info_t;
89    
90  /* Toolbar button structure. */  /* Toolbar button structure. */
91  struct mybuttons {  struct tb_button_s {
92      long icon;      long icon;
93      long command;      long command;
94      char *text;      char *text;
95  };  };
96    
97  struct mybuttons myb[] = {  /* The buttons in the toolbar. */
98    struct tb_button_s tbb[] = {
99      {IMI_KEY_DELETE, ID_KEYMISC_DELETE, "Delete"},      {IMI_KEY_DELETE, ID_KEYMISC_DELETE, "Delete"},
100      {IMI_KEY_PROPS,  ID_KEYMISC_PROPS,  "Properties"},      {IMI_KEY_PROPS,  ID_KEYMISC_PROPS,  "Properties"},
101      {IMI_KEY_SIGN,   ID_KEYMISC_SIGN,   "Sign"},      {IMI_KEY_SIGN,   ID_KEYMISC_SIGN,   "Sign"},
# Line 172  keylist_subclass_proc (HWND dlg, UINT ms Line 173  keylist_subclass_proc (HWND dlg, UINT ms
173  }  }
174    
175    
176  #define ico2idx(ico) imagelist_getindex((ico))  #define ico2idx(ico) imagelist_getindex ((ico))
177    
178    /* Create a new toolbar window with a pre-defined list of buttons. */
179  static HWND  static HWND
180  load_toolbar (HWND dlg, struct km_info_s *kmi)  create_toolbar (HWND dlg, struct km_info_s *kmi)
181  {  {    
182      HWND tbwnd;      HWND tbwnd;
183      TBSAVEPARAMS tbsp;      TBSAVEPARAMS tbsp;
184      TBBUTTON tb_buttons[] = {      TBBUTTON tb_buttons[] = {
# Line 190  load_toolbar (HWND dlg, struct km_info_s Line 192  load_toolbar (HWND dlg, struct km_info_s
192          {ico2idx (IMI_KEY_FILE_EXPORT), ID_KEYMISC_EXPORT, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},          {ico2idx (IMI_KEY_FILE_EXPORT), ID_KEYMISC_EXPORT, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
193          {ico2idx (IMI_KEY_IMPORT), ID_KEYCTX_PASTE, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},          {ico2idx (IMI_KEY_IMPORT), ID_KEYCTX_PASTE, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
194          {ico2idx (IMI_KEY_EXPORT), ID_KEYCTX_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},          {ico2idx (IMI_KEY_EXPORT), ID_KEYCTX_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
195       };      };
196        
197      tbwnd = CreateWindowEx (0, TOOLBARCLASSNAME, NULL,      tbwnd = CreateWindowEx (0, TOOLBARCLASSNAME, NULL,
198                              WS_CHILD|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT|CCS_ADJUSTABLE,                              WS_CHILD|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT|CCS_ADJUSTABLE,
199                              0, 0, 0, 0, dlg, (HMENU)IDR_WINPT_KMTB, glob_hinst, NULL);                              0, 0, 0, 0, dlg, (HMENU)IDR_WINPT_KMTB, glob_hinst, NULL);
200      if (tbwnd) {      if (!tbwnd)
201          SendMessage (tbwnd, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);          BUG (0);
202          SendMessage (tbwnd, TB_SETIMAGELIST, 0, (LPARAM)glob_imagelist);      SendMessage (tbwnd, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);
203                  SendMessage (tbwnd, TB_AUTOSIZE, 0, 0);      SendMessage (tbwnd, TB_SETIMAGELIST, 0, (LPARAM)glob_imagelist);
204          ShowWindow (tbwnd, SW_SHOW);      SendMessage (tbwnd, TB_AUTOSIZE, 0, 0);
205        ShowWindow (tbwnd, SW_SHOW);
206          /* Restore toolbar */  
207          tbsp.hkr = HKEY_CURRENT_USER;      /* Restore toolbar */
208          tbsp.pszSubKey = "Software\\WinPT";      tbsp.hkr = HKEY_CURRENT_USER;
209          tbsp.pszValueName = "KM_toolbar";      tbsp.pszSubKey = "Software\\WinPT";
210          if (SendMessage(tbwnd, TB_SAVERESTORE, FALSE, (LPARAM)&tbsp ) == 0)      tbsp.pszValueName = "KM_toolbar";
211              SendMessage (tbwnd, TB_ADDBUTTONS, sizeof(tb_buttons) / sizeof(tb_buttons[0]),      if (SendMessage (tbwnd, TB_SAVERESTORE, FALSE, (LPARAM)&tbsp) == 0)
212                           (LONG)&tb_buttons[0]);          SendMessage (tbwnd, TB_ADDBUTTONS,
213       }                       sizeof (tb_buttons) / sizeof (tb_buttons[0]),
214       return tbwnd;                       (LONG)&tb_buttons[0]);
215    
216        return tbwnd;
217  }  }
218    
219    
# Line 220  restore_column_info (struct km_info_s *k Line 224  restore_column_info (struct km_info_s *k
224  {  {
225      WORD *buf;      WORD *buf;
226      HKEY root;      HKEY root;
227      DWORD type;      DWORD type, size, i;
     DWORD size = kmi->lv->cols*sizeof (WORD), i;  
228      LONG ec;      LONG ec;
229    
230        size = kmi->lv->cols*sizeof (WORD);
231      ec = RegOpenKeyEx (HKEY_CURRENT_USER, "Software\\WinPT", 0,      ec = RegOpenKeyEx (HKEY_CURRENT_USER, "Software\\WinPT", 0,
232                         KEY_ALL_ACCESS, &root);                         KEY_ALL_ACCESS, &root);
233      if (ec != ERROR_SUCCESS)      if (ec != ERROR_SUCCESS)
# Line 515  update_default_key_str (HWND dlg) Line 519  update_default_key_str (HWND dlg)
519  void  void
520  update_status_bar (HWND sb, listview_ctrl_t lv)  update_status_bar (HWND sb, listview_ctrl_t lv)
521  {  {
522      char txt_sec[128], txt_pub[128];      char txt_sec[128];
523        char txt_pub[128];
524      int nkeys = 0, nsec = 0;      int nkeys = 0, nsec = 0;
525      int i;      int i;
526    
# Line 535  long CALLBACK Line 540  long CALLBACK
540  separator_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)  separator_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
541  {  {
542      static POINT last_mouse_pos;      static POINT last_mouse_pos;
543        PAINTSTRUCT ps;
544        RECT rect;
545        HPEN hpen;
546    
547      if (msg == WM_CREATE)      if (msg == WM_CREATE)
548          SetWindowLong (hwnd, GWL_USERDATA,          SetWindowLong (hwnd, GWL_USERDATA,
# Line 542  separator_wnd_proc (HWND hwnd, UINT msg, Line 550  separator_wnd_proc (HWND hwnd, UINT msg,
550    
551      switch (msg) {      switch (msg) {
552      case WM_PAINT:      case WM_PAINT:
         PAINTSTRUCT ps;  
         RECT rect;  
         HPEN hpen;  
   
553          GetClientRect (hwnd, &rect);          GetClientRect (hwnd, &rect);
554          BeginPaint (hwnd, &ps);          BeginPaint (hwnd, &ps);
555    
# Line 601  separator_wnd_proc (HWND hwnd, UINT msg, Line 605  separator_wnd_proc (HWND hwnd, UINT msg,
605          if (wparam == MK_LBUTTON) {          if (wparam == MK_LBUTTON) {
606              struct km_info_s *kmi;              struct km_info_s *kmi;
607              POINT p;              POINT p;
             RECT r;  
608    
609              kmi = (struct km_info_s *)GetWindowLong (hwnd, GWL_USERDATA);              kmi = (struct km_info_s *)GetWindowLong (hwnd, GWL_USERDATA);
610              if (kmi == NULL)              if (kmi == NULL)
# Line 612  separator_wnd_proc (HWND hwnd, UINT msg, Line 615  separator_wnd_proc (HWND hwnd, UINT msg,
615              p.y = HIWORD (lparam);              p.y = HIWORD (lparam);
616              ClientToScreen (hwnd, &p);              ClientToScreen (hwnd, &p);
617    
618              GetWindowRect (hwnd, &r);              GetWindowRect (hwnd, &rect);
619              r.top += (short)(p.y - last_mouse_pos.y);              rect.top += (short)(p.y - last_mouse_pos.y);
620              r.bottom += (short)(p.y - last_mouse_pos.y);              rect.bottom += (short)(p.y - last_mouse_pos.y);
621    
622              last_mouse_pos.y = p.y;              last_mouse_pos.y = p.y;
623    
624              /* Apply mouse movement to window. Beware the MoveWindow is relaive              /* Apply mouse movement to window. Beware the MoveWindow is relaive
625                 to parent NOT screen */                 to parent NOT screen */
626              MapWindowPoints (NULL, GetParent(hwnd), (POINT*)&r, 2);              MapWindowPoints (NULL, GetParent(hwnd), (POINT*)&rect, 2);
627              kmi->ypos_sep = r.top;              kmi->ypos_sep = rect.top;
628              kmi->ypercent_sep = 0; /* This forces do_resize_window to use abs. position */              kmi->ypercent_sep = 0; /* This forces do_resize_window to use abs. position */
629              do_resize_window (GetParent (hwnd), kmi);              do_resize_window (GetParent (hwnd), kmi);
630              return 0;              return 0;
# Line 639  regist_sep_wnd (HWND dlg, struct km_info Line 642  regist_sep_wnd (HWND dlg, struct km_info
642      WNDCLASS wndclass;      WNDCLASS wndclass;
643      HWND h;      HWND h;
644    
645        memset (&wndclass, 0, sizeof (wndclass));
646      wndclass.style         = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;      wndclass.style         = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
647      wndclass.lpfnWndProc   = separator_wnd_proc;      wndclass.lpfnWndProc   = separator_wnd_proc;
648      wndclass.cbClsExtra    = 0;      wndclass.cbClsExtra    = 0;
# Line 653  regist_sep_wnd (HWND dlg, struct km_info Line 657  regist_sep_wnd (HWND dlg, struct km_info
657    
658      h = CreateWindowEx (WS_EX_WINDOWEDGE, WINDOWCLASS_SEPARATOR_CHILD, NULL,      h = CreateWindowEx (WS_EX_WINDOWEDGE, WINDOWCLASS_SEPARATOR_CHILD, NULL,
659                          WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,                          WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
660                          0, 400, 2000, 5, dlg, (HMENU) 0, glob_hinst, kmi);                              0, 400, 2000, 5, dlg, (HMENU) 0, glob_hinst, kmi);
661        if (!h)
662            BUG (NULL);
663      ShowWindow (h, SW_SHOW);      ShowWindow (h, SW_SHOW);
664      return h;      return h;
665  }  }
# Line 673  update_ui_items (HWND hwnd, listview_ctr Line 679  update_ui_items (HWND hwnd, listview_ctr
679      HMENU hmenu;      HMENU hmenu;
680      int mult_resids[] = {ID_KEYMISC_PROPS, ID_KEYMISC_SIGN, ID_KEYMISC_EDITKEY,      int mult_resids[] = {ID_KEYMISC_PROPS, ID_KEYMISC_SIGN, ID_KEYMISC_EDITKEY,
681                           ID_KEYMISC_CHECKSIGS, ID_KEYMISC_REVCERT, 0};                           ID_KEYMISC_CHECKSIGS, ID_KEYMISC_REVCERT, 0};
682      int key_selected = 0;      int key_selected;
683      int key_has_sec = 0;      int key_has_sec;
684      int key_inv = 0;      int key_inv = 0;
685      int i, state=0;      int i, state=0;
686    
# Line 875  setup_status_bar (HWND dlg, listview_ctr Line 881  setup_status_bar (HWND dlg, listview_ctr
881      for (i=1; i <= 3; i++)      for (i=1; i <= 3; i++)
882          partpos[i-1] = r.right/3*i;          partpos[i-1] = r.right/3*i;
883      statbar = CreateStatusWindow (WS_CHILD | WS_VISIBLE | CCS_BOTTOM,      statbar = CreateStatusWindow (WS_CHILD | WS_VISIBLE | CCS_BOTTOM,
884                                    "status bar", dlg, KM_SEPARATOR_ID);                                    "WinPT_Status_Bar", dlg, KM_SEPARATOR_ID);
885        if (!statbar)
886            BUG (NULL);
887      ShowWindow (statbar, SW_SHOW);      ShowWindow (statbar, SW_SHOW);
888      SendMessage (statbar, SB_SETPARTS, (WPARAM)3, (LPARAM)partpos);      SendMessage (statbar, SB_SETPARTS, (WPARAM)3, (LPARAM)partpos);
889    
890      update_default_key_str (statbar);      update_default_key_str (statbar);
891      update_status_bar (statbar, lv);      update_status_bar (statbar, lv);
   
892      return statbar;      return statbar;
893  }  }
894    
# Line 952  start_help (HWND dlg, int check) Line 958  start_help (HWND dlg, int check)
958      return file_exist_check (path) == 0? true : false;      return file_exist_check (path) == 0? true : false;
959  }  }
960    
961    
962  /* Translate all menu strings. */  /* Translate all menu strings. */
963  static void  static void
964  translate_menu_strings (HWND dlg)  translate_menu_strings (HWND dlg)
# Line 1016  translate_popupmenu_strings (HMENU popup Line 1023  translate_popupmenu_strings (HMENU popup
1023      set_menu_text (popup, ID_KEYCTX_KEYID_COPY, _("Copy Key ID to Clipboard"));      set_menu_text (popup, ID_KEYCTX_KEYID_COPY, _("Copy Key ID to Clipboard"));
1024      set_menu_text (popup, ID_KEYCTX_FPR_COPY, _("Copy Fingerprint to Clipboard"));      set_menu_text (popup, ID_KEYCTX_FPR_COPY, _("Copy Fingerprint to Clipboard"));
1025      set_menu_text (popup, ID_KEYCTX_KINFO_COPY, _("Copy Key Info to Clipboard"));      set_menu_text (popup, ID_KEYCTX_KINFO_COPY, _("Copy Key Info to Clipboard"));
1026        set_menu_text (popup, ID_KEYCTX_EMAIL_COPY, _("Copy E-Mail to Clipboard"));
1027      set_menu_text (popup, ID_KEYCTX_COPY, _("Copy Key to Clipboard"));      set_menu_text (popup, ID_KEYCTX_COPY, _("Copy Key to Clipboard"));
1028      set_menu_text (popup, ID_KEYCTX_PASTE, _("Paste Key from Clipboard"));      set_menu_text (popup, ID_KEYCTX_PASTE, _("Paste Key from Clipboard"));
1029      set_menu_text (popup, ID_KEYCTX_RECVFROM, _("Refresh from Keyserver"));      set_menu_text (popup, ID_KEYCTX_RECVFROM, _("Refresh from Keyserver"));
# Line 1064  updated_keys_avail (void) Line 1072  updated_keys_avail (void)
1072  static int  static int
1073  find_keypos (listview_ctrl_t lv, gpgme_key_t key)  find_keypos (listview_ctrl_t lv, gpgme_key_t key)
1074  {  {
1075      char keyid[16+1];      char keyid[32+1];
1076      int i;      int i;
1077    
1078      for (i=0; i < listview_count_items (lv, 0); i++) {      for (i=0; i < listview_count_items (lv, 0); i++) {
# Line 1232  copy_key_info (int what, struct km_info_ Line 1240  copy_key_info (int what, struct km_info_
1240          if (!listview_get_item_state (kmi->lv, i))          if (!listview_get_item_state (kmi->lv, i))
1241              continue;              continue;
1242          switch (what) {          switch (what) {
1243    
1244            case ID_KEYCTX_EMAIL_COPY:
1245                key = km_get_key_ptr (kmi->lv, i, NULL);
1246                gpgme_data_write (out, key->uids->email, strlen (key->uids->email));
1247                if (!single) gpgme_data_write (out, "\r\n", 2);
1248                break;
1249    
1250          case ID_KEYCTX_UID_COPY:          case ID_KEYCTX_UID_COPY:
1251              key = km_get_key_ptr (kmi->lv, i, &kci);              key = km_get_key_ptr (kmi->lv, i, &kci);
1252              gpgme_data_write (out, kci->uids->uid, strlen (kci->uids->uid));              gpgme_data_write (out, kci->uids->uid, strlen (kci->uids->uid));
# Line 1327  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1342  keymanager_dlg_proc (HWND dlg, UINT msg,
1342          keylist_proc.current = (WNDPROC)keylist_subclass_proc;          keylist_proc.current = (WNDPROC)keylist_subclass_proc;
1343          keylist_proc.old = (WNDPROC)GetWindowLong(kl, GWL_WNDPROC);          keylist_proc.old = (WNDPROC)GetWindowLong(kl, GWL_WNDPROC);
1344          if (keylist_proc.old) {          if (keylist_proc.old) {
1345              if( !SetWindowLong (kl, GWL_WNDPROC, (LONG)keylist_proc.current)) {              if (!SetWindowLong (kl, GWL_WNDPROC, (LONG)keylist_proc.current)) {
1346                  msg_box (dlg, _("Could not set keylist window procedure."),                  msg_box (dlg, "Could not set keylist window procedure.",
1347                           _("Key Manager"), MB_ERR);                           _("Key Manager"), MB_ERR);
1348                  BUG (NULL);                  BUG (NULL);
1349              }              }
1350          }          }
1351          kmi->statbar = setup_status_bar (dlg, kmi->lv);          kmi->statbar = setup_status_bar (dlg, kmi->lv);
1352          SetWindowLong (dlg, GWL_USERDATA, (LONG)kmi);          SetWindowLong (dlg, GWL_USERDATA, (LONG)kmi);
1353          kmi->toolbar = load_toolbar (dlg, kmi);          kmi->toolbar = create_toolbar (dlg, kmi);
1354          kmi->dlg = dlg;          kmi->dlg = dlg;
1355    
1356          do_center_window (dlg, kmi);          do_center_window (dlg, kmi);
# Line 1380  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1395  keymanager_dlg_proc (HWND dlg, UINT msg,
1395          set_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "KM_Size_Height",          set_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "KM_Size_Height",
1396                          type);                          type);
1397    
1398          /* Remove runtime information. This should be the last action taken here. */          /* Remove runtime information.
1399               This should be the last action taken here. */
1400          delete kmi;          delete kmi;
1401          kmi = NULL;          kmi = NULL;
1402          SetWindowLong (dlg, GWL_USERDATA, 0);          SetWindowLong (dlg, GWL_USERDATA, 0);
# Line 1417  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1433  keymanager_dlg_proc (HWND dlg, UINT msg,
1433          case TBN_GETBUTTONINFO:          case TBN_GETBUTTONINFO:
1434              LPTBNOTIFY lpTbNotify;              LPTBNOTIFY lpTbNotify;
1435              lpTbNotify = (LPTBNOTIFY)lparam;              lpTbNotify = (LPTBNOTIFY)lparam;
1436              if (lpTbNotify->iItem < (sizeof(myb) / sizeof(mybuttons))) {              if (lpTbNotify->iItem < (sizeof(tbb) / sizeof(tb_button_s))) {
1437                  lpTbNotify->tbButton.iBitmap = imagelist_getindex (myb[lpTbNotify->iItem].icon);                  lpTbNotify->tbButton.iBitmap = imagelist_getindex (tbb[lpTbNotify->iItem].icon);
1438                  lpTbNotify->tbButton.idCommand = myb[lpTbNotify->iItem].command;                  lpTbNotify->tbButton.idCommand = tbb[lpTbNotify->iItem].command;
1439                  lpTbNotify->tbButton.fsState = TBSTATE_ENABLED;                  lpTbNotify->tbButton.fsState = TBSTATE_ENABLED;
1440                  lpTbNotify->tbButton.fsStyle = TBSTYLE_BUTTON;                  lpTbNotify->tbButton.fsStyle = TBSTYLE_BUTTON;
1441                  lpTbNotify->tbButton.iString = 0;                  lpTbNotify->tbButton.iString = 0;
1442                  strncpy (lpTbNotify->pszText, myb[lpTbNotify->iItem].text, lpTbNotify->cchText);                  strncpy (lpTbNotify->pszText, tbb[lpTbNotify->iItem].text, lpTbNotify->cchText);
1443                  SetWindowLong(dlg, DWL_MSGRESULT, TRUE);                  SetWindowLong(dlg, DWL_MSGRESULT, TRUE);
1444              }              }
1445              return TRUE;              return TRUE;
# Line 1504  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1520  keymanager_dlg_proc (HWND dlg, UINT msg,
1520              break;              break;
1521    
1522          case NM_RCLICK:          case NM_RCLICK:
1523                if (!wait_for_progress_cb (0))
1524                    break;
1525              if (notify->idFrom == IDC_KEYMISC_KEYLIST) {              if (notify->idFrom == IDC_KEYMISC_KEYLIST) {
1526                  l_idx =listview_get_curr_pos (kmi->lv);                  l_idx =listview_get_curr_pos (kmi->lv);
1527                  if (l_idx == -1)                  if (l_idx == -1)
# Line 1572  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1590  keymanager_dlg_proc (HWND dlg, UINT msg,
1590              if (notify->idFrom == IDC_KEYMISC_KEYLIST) {              if (notify->idFrom == IDC_KEYMISC_KEYLIST) {
1591                  NMLISTVIEW *nft = (LPNMLISTVIEW) lparam;                  NMLISTVIEW *nft = (LPNMLISTVIEW) lparam;
1592                  int sortby = 0;                  int sortby = 0;
1593    
1594                    if (!wait_for_progress_cb (0))
1595                        break;
1596                  switch (nft->iSubItem) {                  switch (nft->iSubItem) {
1597                  case 0:  sortby = KEY_SORT_USERID; break;                  case 0:  sortby = KEY_SORT_USERID; break;
1598                  case 1:  sortby = KEY_SORT_KEYID; break;                  case 1:  sortby = KEY_SORT_KEYID; break;
# Line 1581  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1602  keymanager_dlg_proc (HWND dlg, UINT msg,
1602                  case 6:  sortby = KEY_SORT_OTRUST; break;                  case 6:  sortby = KEY_SORT_OTRUST; break;
1603                  case 7:  sortby = KEY_SORT_CREATED; break;                  case 7:  sortby = KEY_SORT_CREATED; break;
1604                  case 8:  sortby = KEY_SORT_ALGO; break;                  case 8:  sortby = KEY_SORT_ALGO; break;
1605                  default: return TRUE; //sortby = KEY_SORT_USERID; break;                  default: return TRUE; /*sortby userid.*/
1606                  }                  }
1607    
1608                  if ((kmi->keylist_sortby & ~KEYLIST_SORT_DESC) == sortby)                  if ((kmi->keylist_sortby & ~KEYLIST_SORT_DESC) == sortby)
# Line 1636  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1657  keymanager_dlg_proc (HWND dlg, UINT msg,
1657              return FALSE;              return FALSE;
1658          }          }
1659    
1660            /*wait_for_progress_cb ();*/
1661          switch (LOWORD (wparam)) {          switch (LOWORD (wparam)) {
1662          case ID_KEYMISC_QUIT:          case ID_KEYMISC_QUIT:
1663              EndDialog (dlg, TRUE);              EndDialog (dlg, TRUE);
# Line 1701  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1723  keymanager_dlg_proc (HWND dlg, UINT msg,
1723                  return TRUE;                  return TRUE;
1724              }              }
1725              km_get_key (kmi->lv, kmi->lv_idx, &k);              km_get_key (kmi->lv, kmi->lv_idx, &k);
             if (!k.key_pair) {  
                 msg_box (dlg, _("It does not make any sense with a key pair!"),  
                          _("Key Manager"), MB_ERR);  
                 return TRUE;  
             }  
1726              dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYTRUST, dlg,              dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_KEYTRUST, dlg,
1727                                keytrust_dlg_proc, (LPARAM)&k,                                keytrust_dlg_proc, (LPARAM)&k,
1728                                _("List Trust Path"), IDS_WINPT_KEYTRUST);                                _("List Trust Path"), IDS_WINPT_KEYTRUST);
# Line 1938  keymanager_dlg_proc (HWND dlg, UINT msg, Line 1955  keymanager_dlg_proc (HWND dlg, UINT msg,
1955                           _("Key Manager"), MB_INFO);                           _("Key Manager"), MB_INFO);
1956                  listview_select_all (kmi->lv);                  listview_select_all (kmi->lv);
1957              }              }
1958              km_refresh_from_keyserver (kmi->lv, dlg);              if (!km_refresh_from_keyserver (kmi->lv, dlg))
1959              msg_box (dlg, _("Keyserver refresh finished."),                  msg_box (dlg, _("Keyserver refresh finished."),
1960                       _("Key Manager"), MB_OK);                           _("Key Manager"), MB_OK);
1961              break;              break;
1962                                                    
1963          /** Context menu **/          /** Context menu **/
# Line 2015  keymanager_dlg_proc (HWND dlg, UINT msg, Line 2032  keymanager_dlg_proc (HWND dlg, UINT msg,
2032          case ID_KEYCTX_KEYID_COPY:          case ID_KEYCTX_KEYID_COPY:
2033          case ID_KEYCTX_FPR_COPY:          case ID_KEYCTX_FPR_COPY:
2034          case ID_KEYCTX_KINFO_COPY:          case ID_KEYCTX_KINFO_COPY:
2035            case ID_KEYCTX_EMAIL_COPY:
2036              copy_key_info (LOWORD (wparam), kmi);              copy_key_info (LOWORD (wparam), kmi);
2037              break;              break;
2038    
# Line 2076  keymanager_dlg_proc (HWND dlg, UINT msg, Line 2094  keymanager_dlg_proc (HWND dlg, UINT msg,
2094          case ID_GROUP_SHOW:          case ID_GROUP_SHOW:
2095              /* XXX: Implement group manager. */              /* XXX: Implement group manager. */
2096              return TRUE;              return TRUE;
   
             /*  
         case IDCANCEL:  
             EndDialog (dlg, TRUE);  
             return TRUE;  
             */  
2097          }          }
2098                    
2099          break;          break;

Legend:
Removed from v.226  
changed lines
  Added in v.248

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26