#include <lvwSums.hpp>
Collaboration diagram for ChecksumsListView:
Public Types | |
enum | Columns { FILE_NAME = 0, DIRECTORY, CHECKSUM_VALUE, STATE } |
Columns enumeration. More... | |
enum | SortOrder { NONE, ASCENDING, DESCENDING } |
Sort order of the column. More... | |
Public Member Functions | |
void | addFiles (const wxArrayString &files) |
Adds files to the list of checksums. | |
void | check () |
Checks the files. | |
ChecksumsListView (wxWindow *parent, wxWindowID id, SumFile *checksumFile, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_REPORT, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxT("checksumslistview")) | |
Constructor, creating and showing a list control. | |
ChecksumsListView () | |
Default constructor. | |
void | DnDFiles (wxCommandEvent &event) |
Processes a drop of files on the list. | |
void | getColumns (Columns cols[LVW_SUMS_NBCOLS]) |
Gets the columns. | |
int | getColumnToSort () const |
Gets the column to be sorted. | |
SortOrder | getSortOrder () const |
Gets to sort order. | |
wxArrayInt | getStates (const bool onlySelected=false) const |
Gets the total of each state in the list of checksums. | |
SumFile * | getSumFile () const |
Gets a pointer on the checksum file. | |
void | init () |
Initializes the list parameters. | |
void | invertSelection () |
Inverts the selection. | |
bool | openChecksumFile (const wxFileName &fileName) |
Open a checksum file. | |
void | recompute () |
Recomputes the checksums. | |
void | reformat () |
Reformats the list. | |
void | removeSelectedChecksums () |
Removes the selected checksums from the list. | |
void | selectAll () |
Selects all the items. | |
void | selectDirectoriesToAdd () |
Open a dialog to select the directories to add to the list. | |
void | selectFilesToAdd () |
Open a dialog to select the files to add to the list. | |
void | selectMatchingFilesToAdd () |
Open a dialog to select files to add from matching patterns. | |
bool | setColumns (Columns newColumns[LVW_SUMS_NBCOLS]) |
Sets the columns. | |
void | setColumnToSort (const int col, const SortOrder newSortOrder) |
Sets the column to be sorted. | |
void | setColumnToSort (const int col) |
Sets the column to be sorted. | |
void | setSortOrder (const SortOrder newSortOrder) |
Sets the sort order. | |
void | setSumFile (SumFile *pSumFile) |
Sets the checksum file. | |
void | sort () |
Sort the list. | |
wxString | sumUpStates (const bool onlySelected=false) const |
Sums up the total of each state in the list of checksums. | |
virtual | ~ChecksumsListView () |
Destructor. | |
Static Public Member Functions | |
wxString | getColumnName (const Columns col) |
Gets the name of a column. | |
Protected Types | |
enum | { ITP_FILESADD = wxID_HIGHEST + 1000, ITP_DIRECTORIESADD, ITP_ADDMATCHINGFILES, ITP_REMOVE } |
Protected Member Functions | |
long | addChecksum (const long key, const wxString &stateMsg) |
Adds a checksum in the list. | |
bool | isInList (const wxString &fileName) |
Indicates if the specified file is present in the list. | |
void | itpAddDirectoriesClick (wxCommandEvent &event) |
Event handler a pop-up menu click on 'Add directories...'. | |
void | itpAddFilesClick (wxCommandEvent &event) |
Event handler a pop-up menu click on 'Add files...'. | |
void | itpAddMatchingFilesClick (wxCommandEvent &event) |
Event handler a pop-up menu click on 'Add matching files...'. | |
void | itpRemoveClick (wxCommandEvent &event) |
Event handler a pop-up menu click on 'Remove'. | |
void | OnRightUp (wxMouseEvent &event) |
Event handler for the context menu demand. | |
void | reformat (Columns oldColumns[LVW_SUMS_NBCOLS]) |
Reformats the list. | |
bool | removeFilesInList (wxArrayString &files, wxArrayString *in=NULL) |
Removes the files that are already in the listview. | |
void | setChecksum (long item, const wxString &stateMsg) |
Sets an item. | |
void | setChecksumState (long item, const ChecksumData::State state, const wxString &msg) |
Sets the state of a checksum. | |
void | ShowContextMenu (const wxPoint &p) |
Shows the context menu. | |
Protected Attributes | |
int | colToSort |
Column to sort. | |
Columns | columns [LVW_SUMS_NBCOLS] |
List of the columns (size = nb elements of enum Columns). | |
SortOrder | sortOrder |
Sort order. | |
SumFile * | sumFile |
Checksums file linked with the list. |
Definition at line 50 of file lvwSums.hpp.
|
Columns enumeration.
Definition at line 84 of file lvwSums.hpp. Referenced by reformat(), and setColumns(). |
|
Sort order of the column.
Definition at line 76 of file lvwSums.hpp. Referenced by getSortOrder(). |
|
Default constructor.
Definition at line 355 of file lvwSums.cpp. |
|
Constructor, creating and showing a list control.
Definition at line 377 of file lvwSums.cpp. |
|
Destructor.
Definition at line 393 of file lvwSums.cpp. References sumFile. |
|
Adds a checksum in the list.
Definition at line 1082 of file lvwSums.cpp. References addChecksum(), SumFile::getChecksumData(), ChecksumData::getState(), setChecksum(), setChecksumState(), and sumFile. Referenced by addChecksum(), addFiles(), and setSumFile(). |
|
Adds files to the list of checksums. This function will search recursively files in subdirectories. All the files and all the directories that are provided in the array must be in absolute path.
Definition at line 809 of file lvwSums.cpp. References addChecksum(), SumFile::addChecksumData(), addFiles(), ChecksumFileCalculator::calculate(), ChecksumsListView::ChecksumProgress::finished(), SumFile::getChecksumCalculator(), getSumFile(), removeFilesInList(), ChecksumsListView::ChecksumProgress::setFileName(), sort(), and sumFile. Referenced by addFiles(), DnDFiles(), frmSums::initializeFromCmdLine(), selectDirectoriesToAdd(), selectFilesToAdd(), and selectMatchingFilesToAdd(). |
|
Checks the files.
Definition at line 1331 of file lvwSums.cpp. References ChecksumFileCalculator::check(), ChecksumsListView::ChecksumProgress::finished(), AppPrefs::get(), ChecksumData::getChecksum(), SumFile::getChecksumCalculator(), SumFile::getChecksumData(), ChecksumData::getFileName(), getSumFile(), AppPrefs::readBool(), setChecksumState(), ChecksumsListView::ChecksumProgress::setFileName(), sort(), sumFile, sumUpStates(), wxCGetFileLength, and wxCOff_t. Referenced by frmSums::initializeFromCmdLine(), frmSums::itmSumsCheckClick(), and openChecksumFile(). |
|
Processes a drop of files on the list.
Definition at line 1640 of file lvwSums.cpp. References addFiles(), DnDFiles(), getSumFile(), and openChecksumFile(). Referenced by DnDFiles(). |
|
Gets the name of a column.
Definition at line 1811 of file lvwSums.cpp. References getColumnName(). Referenced by getColumnName(), init(), and reformat(). |
|
Gets the columns.
Definition at line 1676 of file lvwSums.cpp. References columns, getColumns(), and LVW_SUMS_NBCOLS. Referenced by frmSums::FrameClose(), getColumns(), frmSums::itmSumsSortByClick(), frmSums::itmSumsSortByUpdate(), frmSums::itmToolsConfigureClick(), and SumListCompareFnct(). |
|
Gets the column to be sorted.
Definition at line 476 of file lvwSums.cpp. References colToSort. Referenced by frmSums::FrameClose(), frmSums::itmSumsSortByUpdate(), frmSums::lvwSumsColumnClick(), and SumListCompareFnct(). |
|
Gets to sort order.
Definition at line 441 of file lvwSums.cpp. References sortOrder, and SortOrder. Referenced by frmSums::FrameClose(), frmSums::itmSumsSortByUpdate(), frmSums::lvwSumsColumnClick(), and SumListCompareFnct(). |
|
Gets the total of each state in the list of checksums.
Definition at line 1204 of file lvwSums.cpp. References CD_STATE_COUNT, SumFile::getChecksumData(), ChecksumData::getState(), getStates(), and getSumFile(). Referenced by frmSums::closeAfterInitFromCmdLine(), getStates(), frmSums::saveChecksumFile(), and sumUpStates(). |
|
Gets a pointer on the checksum file.
Definition at line 607 of file lvwSums.cpp. References sumFile. Referenced by addFiles(), check(), frmSums::checkFileBeforeClose(), DnDFiles(), frmSums::FrameClose(), getStates(), frmSums::initializeFromCmdLine(), frmSums::itmFileCloseClick(), frmSums::itmFileOpenRecentClick(), frmSums::itmFileSaveAsClick(), frmSums::itmFileSaveClick(), recompute(), removeSelectedChecksums(), frmSums::saveChecksumFile(), selectDirectoriesToAdd(), selectFilesToAdd(), selectMatchingFilesToAdd(), sort(), SumListCompareFnct(), sumUpStates(), and frmSums::updateTitle(). |
|
Initializes the list parameters.
Definition at line 407 of file lvwSums.cpp. References columns, getColumnName(), and setColumnToSort(). Referenced by ChecksumsListView(). |
|
Inverts the selection.
Definition at line 672 of file lvwSums.cpp. Referenced by frmSums::itmSumsInvertSelectionClick(). |
|
Indicates if the specified file is present in the list. The given file name must be an absolute path.
Definition at line 1051 of file lvwSums.cpp. References SumFile::getChecksumDataBegin(), SumFile::getChecksumDataEnd(), SumFile::getFileName(), isInList(), and sumFile. Referenced by isInList(). |
|
Event handler a pop-up menu click on 'Add directories...'.
Definition at line 1604 of file lvwSums.cpp. References itpAddDirectoriesClick(), and selectDirectoriesToAdd(). Referenced by itpAddDirectoriesClick(). |
|
Event handler a pop-up menu click on 'Add files...'.
Definition at line 1592 of file lvwSums.cpp. References itpAddFilesClick(), and selectFilesToAdd(). Referenced by itpAddFilesClick(). |
|
Event handler a pop-up menu click on 'Add matching files...'.
Definition at line 1616 of file lvwSums.cpp. References itpAddMatchingFilesClick(), and selectMatchingFilesToAdd(). Referenced by itpAddMatchingFilesClick(). |
|
Event handler a pop-up menu click on 'Remove'.
Definition at line 1628 of file lvwSums.cpp. References itpRemoveClick(), and removeSelectedChecksums(). Referenced by itpRemoveClick(). |
|
Event handler for the context menu demand.
Definition at line 1544 of file lvwSums.cpp. References OnRightUp(), and ShowContextMenu(). Referenced by OnRightUp(). |
|
Open a checksum file.
Definition at line 1295 of file lvwSums.cpp. References check(), AppPrefs::get(), AppPrefs::readBool(), and setSumFile(). Referenced by frmSums::initializeFromCmdLine(), frmSums::itmFileOpenClick(), and frmSums::itmFileOpenRecentClick(). |
|
Recomputes the checksums.
Definition at line 1429 of file lvwSums.cpp. References ChecksumFileCalculator::calculate(), ChecksumsListView::ChecksumProgress::finished(), ChecksumData::getChecksum(), SumFile::getChecksumCalculator(), SumFile::getChecksumData(), ChecksumData::getFileName(), getSumFile(), setChecksum(), ChecksumData::setChecksum(), SumFile::setChecksumData(), setChecksumState(), ChecksumsListView::ChecksumProgress::setFileName(), sort(), sumFile, wxCGetFileLength, and wxCOff_t. Referenced by frmSums::itmSumsRecomputeClick(). |
|
Reformats the list.
Definition at line 1520 of file lvwSums.cpp. Referenced by setColumns(). |
|
Reformats the list.
Definition at line 1752 of file lvwSums.cpp. References Columns, columns, getColumnName(), LVW_SUMS_NBCOLS, setChecksum(), and sort(). Referenced by frmSums::initializeFromCmdLine(), frmSums::itmToolsConfigureClick(), and frmSums::saveChecksumFile(). |
|
Removes the files that are already in the listview.
Definition at line 933 of file lvwSums.cpp. References SumFile::getChecksumDataBegin(), SumFile::getChecksumDataCount(), SumFile::getChecksumDataEnd(), SumFile::getFileName(), dlgProgress::isPaused(), removeFilesInList(), removeFilesInListCompare(), sumFile, dlgProgress::Update(), and UPDATE_PROGRESS_DLG. Referenced by addFiles(), and removeFilesInList(). |
|
Removes the selected checksums from the list.
Definition at line 1177 of file lvwSums.cpp. References getSumFile(), SumFile::removeChecksumData(), and sumFile. Referenced by frmSums::itmSumsRemoveClick(), and itpRemoveClick(). |
|
Selects all the items.
Definition at line 654 of file lvwSums.cpp. Referenced by frmSums::itmSumsSelectAllClick(). |
|
Open a dialog to select the directories to add to the list.
Definition at line 719 of file lvwSums.cpp. References addFiles(), SumFile::getFileName(), getSumFile(), and sumFile. Referenced by frmSums::itmSumsAddDirectoriesClick(), and itpAddDirectoriesClick(). |
|
Open a dialog to select the files to add to the list.
Definition at line 690 of file lvwSums.cpp. References addFiles(), wxFileDialogFilterMaker::AddFilter(), SumFile::getFileName(), wxFileDialogFilterMaker::GetFilters(), getSumFile(), and sumFile. Referenced by frmSums::itmSumsAddFilesClick(), and itpAddFilesClick(). |
|
Open a dialog to select files to add from matching patterns.
Definition at line 743 of file lvwSums.cpp. References dlgAddMatchFiles::ArrayMatchPattern::add(), addFiles(), dlgAddMatchFiles::ArrayMatchPattern::getCount(), dlgAddMatchFiles::getMatchPatterns(), and getSumFile(). Referenced by frmSums::itmSumsAddMatchingFilesClick(), and itpAddMatchingFilesClick(). |
|
Sets an item. This function doesn't set the item picture and the data associated with the item.
Definition at line 1109 of file lvwSums.cpp. References columns, AppPrefs::get(), ChecksumData::getChecksum(), SumFile::getChecksumData(), SumFile::getFileName(), ChecksumData::getFileName(), LVW_SUMS_NBCOLS, AppPrefs::readBool(), setChecksum(), and sumFile. Referenced by addChecksum(), recompute(), reformat(), and setChecksum(). |
|
Sets the state of a checksum.
Definition at line 1156 of file lvwSums.cpp. References columns, SumFile::getChecksumData(), LVW_SUMS_NBCOLS, SumFile::setChecksumState(), setChecksumState(), and sumFile. Referenced by addChecksum(), check(), recompute(), and setChecksumState(). |
|
Sets the columns.
Definition at line 1691 of file lvwSums.cpp. References columns, Columns, LVW_SUMS_NBCOLS, reformat(), and setColumns(). Referenced by frmSums::createControls(), frmSums::itmToolsConfigureClick(), and setColumns(). |
|
Sets the column to be sorted.
Definition at line 506 of file lvwSums.cpp. References setColumnToSort(), and setSortOrder(). |
|
Sets the column to be sorted.
Definition at line 489 of file lvwSums.cpp. References colToSort, and setColumnToSort(). Referenced by frmSums::createControls(), init(), frmSums::itmSumsSortByClick(), frmSums::lvwSumsColumnClick(), and setColumnToSort(). |
|
Sets the sort order.
Definition at line 455 of file lvwSums.cpp. References setSortOrder(), and sortOrder. Referenced by frmSums::itmSumsSortByClick(), frmSums::lvwSumsColumnClick(), setColumnToSort(), and setSortOrder(). |
|
Sets the checksum file.
Definition at line 625 of file lvwSums.cpp. References addChecksum(), SumFile::getChecksumDataKeys(), setSumFile(), sort(), and sumFile. Referenced by frmSums::initializeFromCmdLine(), frmSums::itmFileCloseClick(), frmSums::itmFileNewClick(), openChecksumFile(), and setSumFile(). |
|
Shows the context menu.
Definition at line 1557 of file lvwSums.cpp. References ShowContextMenu(), and sumFile. Referenced by OnRightUp(), and ShowContextMenu(). |
|
Sort the list.
Definition at line 589 of file lvwSums.cpp. References getSumFile(), and SumListCompareFnct(). Referenced by addFiles(), check(), frmSums::itmSumsSortByClick(), frmSums::lvwSumsColumnClick(), recompute(), reformat(), and setSumFile(). |
|
Sums up the total of each state in the list of checksums.
Definition at line 1240 of file lvwSums.cpp. References getStates(), getSumFile(), and sumUpStates(). Referenced by check(), and sumUpStates(). |
|
Column to sort.
Definition at line 210 of file lvwSums.hpp. Referenced by getColumnToSort(), and setColumnToSort(). |
|
List of the columns (size = nb elements of enum Columns). Must contain once one of the elements of enum Columns. Definition at line 116 of file lvwSums.hpp. Referenced by getColumns(), init(), reformat(), setChecksum(), setChecksumState(), and setColumns(). |
|
Sort order.
Definition at line 209 of file lvwSums.hpp. Referenced by getSortOrder(), and setSortOrder(). |
|
Checksums file linked with the list.
Definition at line 208 of file lvwSums.hpp. Referenced by addChecksum(), addFiles(), check(), ChecksumsListView(), getSumFile(), isInList(), recompute(), removeFilesInList(), removeSelectedChecksums(), selectDirectoriesToAdd(), selectFilesToAdd(), setChecksum(), setChecksumState(), setSumFile(), ShowContextMenu(), and ~ChecksumsListView(). |