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

Diff of /trunk/Src/wptFileManagerDlg.cpp

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

revision 29 by twoaday, Thu Oct 20 12:35:59 2005 UTC revision 30 by twoaday, Sat Oct 22 10:17:59 2005 UTC
# Line 411  file_manager_dlg_proc (HWND dlg, UINT ms Line 411  file_manager_dlg_proc (HWND dlg, UINT ms
411          set_menu_text (menu, ID_FILEMISC_DECRYPT, _("&Decrypt") );          set_menu_text (menu, ID_FILEMISC_DECRYPT, _("&Decrypt") );
412          set_menu_text (menu, ID_FILEMISC_SIGN, _("&Sign") );          set_menu_text (menu, ID_FILEMISC_SIGN, _("&Sign") );
413          set_menu_text (menu, ID_FILEMISC_SIGNENC, _("Sign && Encrypt") );          set_menu_text (menu, ID_FILEMISC_SIGNENC, _("Sign && Encrypt") );
414          set_menu_text (menu, ID_FILEMISC_VERIFY, _("&Verify") );          set_menu_text (menu, ID_FILEMISC_VERIFY, _("&Verify") );        
         set_menu_text (menu, ID_FILEMISC_WIPE, _("&Wipe") );  
415          set_menu_text (menu, ID_FILEMISC_SYMENC, _("S&ymmetric") );          set_menu_text (menu, ID_FILEMISC_SYMENC, _("S&ymmetric") );
416          set_menu_text (menu, ID_FILEMISC_IMPORT, _("&Import") );          set_menu_text (menu, ID_FILEMISC_IMPORT, _("&Import") );
417          set_menu_text (menu, ID_FILEMISC_EXPORT, _("E&xport") );          set_menu_text (menu, ID_FILEMISC_EXPORT, _("E&xport") );
418          set_menu_text (menu, ID_FILEMISC_QUIT, _("Exit"));          set_menu_text (menu, ID_FILEMISC_QUIT, _("Exit"));
419          set_menu_text (menu, ID_FILEMISC_CLEAR, _("&Reset") );          set_menu_text (menu, ID_FILEMISC_CLEAR, _("&Reset") );
420          set_menu_text (menu, ID_FILEMISC_ONTOP, _("Always on Top"));          set_menu_text (menu, ID_FILEMISC_ONTOP, _("Always on Top"));
421          set_menu_text (menu, ID_FILEMISC_PASTE _("&Paste"));          set_menu_text (menu, ID_FILEMISC_PASTE, _("&Paste"));
422          set_menu_text (menu, ID_FILEMISC_SELALL _("&Select All"));          set_menu_text (menu, ID_FILEMISC_SELALL, _("&Select All"));
423          set_menu_text (menu, ID_FILEMISC_PREFS _("&Preferences"));          set_menu_text (menu, ID_FILEMISC_PREFS, _("&Preferences"));
424            set_menu_text (menu, ID_FILEMISC_SEND, _("Send as Mail"));
425            set_menu_text (menu, ID_FILEMISC_LIST, _("&List Packets"));
426            set_menu_text (menu, ID_FILEMISC_WIPE_FREES, _("Wipe Free Space"));
427            set_menu_text (menu, ID_FILEMISC_WIPE, _("&Wipe"));    
428    
429          fl = GetDlgItem (dlg, IDC_FILE_LIST);          fl = GetDlgItem (dlg, IDC_FILE_LIST);
430          filelist_proc.dlg = dlg;          filelist_proc.dlg = dlg;
431          filelist_proc.current = (WNDPROC)filelist_subclass_proc;          filelist_proc.current = (WNDPROC)filelist_subclass_proc;
# Line 517  file_manager_dlg_proc (HWND dlg, UINT ms Line 521  file_manager_dlg_proc (HWND dlg, UINT ms
521              EndDialog( dlg, TRUE );              EndDialog( dlg, TRUE );
522          return FALSE;          return FALSE;
523                    
524        case WM_INITMENUPOPUP:
525            if ((UINT)LOWORD (lparam) == 0) {
526                HMENU hm = (HMENU)wparam;
527                set_menu_text_bypos (hm, 2, _("&Calc Digest"));
528            }
529            return FALSE;
530    
531      case WM_COMMAND:      case WM_COMMAND:
532          switch( LOWORD( wparam ) ) {                  switch( LOWORD( wparam ) ) {        
533          case ID_FILEMISC_QUIT:          case ID_FILEMISC_QUIT:
# Line 650  add_files_from_lv (HWND dlg, listview_ct Line 661  add_files_from_lv (HWND dlg, listview_ct
661  }  }
662    
663    
664    /* Dialog box procedure to confirm that files shall be deleted. */
665  BOOL CALLBACK  BOOL CALLBACK
666  file_secdel_confirm_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  file_secdel_confirm_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
667  {  {
# Line 661  file_secdel_confirm_dlg_proc (HWND dlg, Line 673  file_secdel_confirm_dlg_proc (HWND dlg,
673          if (!ctx)          if (!ctx)
674              BUG (NULL);              BUG (NULL);
675          add_files_from_lv (dlg, ctx->lv_files);          add_files_from_lv (dlg, ctx->lv_files);
676            SetWindowText (dlg, _("Are you sure you want to secure delete these files?"));
677            SetDlgItemText (dlg, IDYES, _("&Yes"));
678            SetDlgItemText (dlg, IDNO, _("&No"));
679          break;          break;
680    
681      case WM_COMMAND:      case WM_COMMAND:
682          switch( LOWORD( wparam ) ) {          switch (LOWORD (wparam)) {
683          case IDYES:          case IDYES:
684              ctx->yes = 1;              ctx->yes = 1;
685              EndDialog( dlg, TRUE );              EndDialog (dlg, TRUE);
686              break;              break;
687    
688          case IDNO:          case IDNO:
689              ctx->yes = 0;              ctx->yes = 0;
690              EndDialog( dlg, FALSE );              EndDialog (dlg, FALSE);
691              break;              break;
692          }          }
693          break;          break;
694      }      }
695    
696      return FALSE;      return FALSE;
697  } /* file_secdel_confirm_dlg_proc */  }
698    
699    
700    /* Wipe callback. @ctx is a window handle @off is the current offset
701       and @n is the total size. */
702  static void  static void
703  wipe_cb (void * ctx, ui64 off, ui64 n)  wipe_cb (void *ctx, ui64 off, ui64 n)
704  {      {    
705      SendDlgItemMessage ((HWND)ctx, IDC_SPACE_PROGRESS, PBM_SETPOS,      SendDlgItemMessage ((HWND)ctx, IDC_SPACE_PROGRESS, PBM_SETPOS,
706                          (WPARAM) (off*100/n), 0);                          (WPARAM) (off*100/n), 0);
707      SetDlgItemInt ((HWND)ctx, IDC_SPACE_OFF, (UINT)(off/1024), FALSE);      SetDlgItemInt ((HWND)ctx, IDC_SPACE_OFF, (UINT)(off/1024), FALSE);
708      SetDlgItemInt ((HWND)ctx, IDC_SPACE_N, (UINT)(n/1024), FALSE);      SetDlgItemInt ((HWND)ctx, IDC_SPACE_N, (UINT)(n/1024), FALSE);
709  } /* wipe_cb */  }
710    
711    
712    /* Call the wipe free space method asynchron. */
713  static DWORD WINAPI  static DWORD WINAPI
714  wipe_thread (void * ctx)  wipe_thread (void *ctx)
715  {      {    
716      thread_ctx_t a = (thread_ctx_t)ctx;      thread_ctx_t a = (thread_ctx_t)ctx;
717      int rc;      int rc;
718    
719      rc = wipe_freespace (a->drive, &a->fd, wipe_cb, a->dlg);      rc = wipe_freespace (a->drive, &a->fd, wipe_cb, a->dlg);
720      SetDlgItemText (a->dlg, IDC_SPACE_INFO,      SetDlgItemText (a->dlg, IDC_SPACE_INFO,
721                      rc? _("Operation Status: Error") : _("Operation Status: Done."));                      rc? _("Operation Status: Error") :
722                            _("Operation Status: Done."));
723      if (rc)      if (rc)
724          msg_box (a->dlg, winpt_strerror (rc), _("Wipe Free Space"), MB_ERR);          msg_box (a->dlg, winpt_strerror (rc), _("Wipe Free Space"), MB_ERR);
725      else      else
726          MessageBeep (MB_OK);          MessageBeep (MB_OK);
727      ExitThread (0);      ExitThread (0);
728      return 0;      return 0;
729  } /* wipe_thread */  }
730    
731    
732  static void  static void

Legend:
Removed from v.29  
changed lines
  Added in v.30

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26