Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

dlgAddMatchFiles Class Reference

Dialog for choosing a new file name. More...

#include <dlgAddMatchFiles.hpp>

Collaboration diagram for dlgAddMatchFiles:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void createControls ()
 Creates and initializes the controls of the dialog.

 dlgAddMatchFiles (wxWindow *parent, const wxString &checksumsFileName=wxEmptyString)
 Creates a new dialog.

 dlgAddMatchFiles ()
 Creates a new dialog.

wxString getChecksumsFileName () const
 Gets the name of the checksums' file where the files will be added.

void getMatchPatterns (ArrayMatchPattern &patterns) const
 Gets the choosed matching patterns.

void setChecksumsFileName (const wxString &fileName)
 Sets the name of the checksums' file where the files will be added.

virtual ~dlgAddMatchFiles ()
 The class descructor.


Static Public Member Functions

wxString getDirectoryConfigKey (const int n)
 Gets the configuration key for the last directories to add.

int getHistoryMaxSize ()
 Get the maximum size of the history of the last match patterns and directories to add.

wxString getMatchPatternConfigKey (const int n)
 Gets the configuration key for the last match patterns to add.

wxString getRootConfigKey ()
 Gets the root configuration key for parameters of this dialog.


Protected Types

enum  {
  LVW_FILES = wxID_HIGHEST + 1, BTN_REMOVE, BTN_ADDLIST, BTN_LOADLIST,
  BTN_SAVELIST, CBO_PATTERN, CBO_DIRECTORY, BTN_BROWSE,
  BTN_ADD_PATTERN, SPN_DEPTH, RBX_SORT_BY, RBX_SORT_ORDER,
  BTN_ADD
}
 Controls IDs. More...

enum  PreferencesKey {
  prGUI_ADD_MATCH_FILES_SORT_BY = 0, prGUI_ADD_MATCH_FILES_SORT_ORDER, prGUI_ADD_MATCH_FILES_DIRECTORY_WIDTH, prGUI_ADD_MATCH_FILES_PATTERN_WIDTH,
  prGUI_ADD_MATCH_FILES_DEPTH_WIDTH, prGUI_ADD_MATCH_FILES_WINDOW_SIZE
}
 Preferences keys. More...


Protected Member Functions

void addPatternToListView (const MatchPattern &pattern)
 Add a pattern to the list view of patterns.

void btnAddClick (wxCommandEvent &event)
 Processes button Add.

void btnAddListClick (wxCommandEvent &event)
 Processes button Add List.

void btnAddPatternClick (wxCommandEvent &event)
 Processes button Add pattern.

void btnBrowseClick (wxCommandEvent &event)
 Processes button Browse.

void btnLoadListClick (wxCommandEvent &event)
 Processes button Load List.

void btnRemoveClick (wxCommandEvent &event)
 Processes button Remove.

void btnSaveListClick (wxCommandEvent &event)
 Processes button Save List.

void cboAddTextEnter (wxCommandEvent &event)
 Event handler for the enter key pressed on a search combo box.

void lvwPatternsColumnClick (wxListEvent &event)
 Processes a click on a header of a column of the list of patterns.

void lvwPatternsDeselectItem (wxListEvent &event)
 Event handler for the deselection of an item.

void lvwPatternsKeyDown (wxListEvent &event)
 Event handler for the key down event.

void lvwPatternsSelectItem (wxListEvent &event)
 Event handler for the selection of an item.

void rbxSortBySelect (wxCommandEvent &event)
 Processes a selection of the column to sort.

void rbxSortOrderSelect (wxCommandEvent &event)
 Processes a selection of the sort order.

void setDialogTitle ()
 Sets the title of the dialog.


Static Protected Member Functions

wxString getConfigKey (const PreferencesKey pk)
 Gets the configuration key corresponding to the given preference key.

long getID ()
 Gets a new unique identifier.


Protected Attributes

wxButton * btnAddPattern
 Add a pattern to the list.

wxButton * btnRemove
 Button for removing patterns.

wxComboBox * cboDirectory
 Directory of the pattern.

wxComboBox * cboPattern
 Pattern to add.

wxString checksumsFileName
 Name of the checksums' file where the files will be added.

wxSortableListViewlvwPatterns
 List of patterns.

ArrayMatchPatternmatchPatterns
 Match patterns given by the validator.

wxRadioBox * rbxSortBy
 Sort by radio box buttons.

wxRadioBox * rbxSortOrder
 Sort order radio box buttons.

wxSpinCtrl * spnDepth
 Search depth.


Static Protected Attributes

long idGen = 0L
 Value for unique identifiers generation.


Static Private Member Functions

void addLineToComboBox (wxComboBox *cboBox, const int maxLines)
 Adds a file or a directory or a match pattern to a combo box.

void getLastDirectoryAndFilter (const wxString &configKey, wxString &lastDirKey, wxString &lastDir, wxFileDialogFilterMaker &fltMaker)
 Gets the last directory used and the filter for the open or save dialog.

void readMatchPatternsFile (const wxString &fileName, ArrayMatchPattern &patterns)
 Reads a file of matching patterns.


Detailed Description

Dialog for choosing a new file name.

If no name of checksums' file is given to the constructor, give one with the setChecksumsFileName() method before showing the dialog.

Definition at line 54 of file dlgAddMatchFiles.hpp.


Member Enumeration Documentation

anonymous enum [protected]
 

Controls IDs.

Definition at line 130 of file dlgAddMatchFiles.hpp.

enum dlgAddMatchFiles::PreferencesKey [protected]
 

Preferences keys.

Definition at line 185 of file dlgAddMatchFiles.hpp.


Constructor & Destructor Documentation

dlgAddMatchFiles::dlgAddMatchFiles  ) 
 

Creates a new dialog.

Definition at line 918 of file dlgAddMatchFiles.cpp.

References createControls(), matchPatterns, and setChecksumsFileName().

dlgAddMatchFiles::dlgAddMatchFiles wxWindow *  parent,
const wxString &  checksumsFileName = wxEmptyString
 

Creates a new dialog.

Parameters:
parent Parent of the dialog.
checksumsFileName Name of the checksums' file in which the matched file will be added.

Definition at line 934 of file dlgAddMatchFiles.cpp.

References createControls(), getConfigKey(), matchPatterns, and setChecksumsFileName().

dlgAddMatchFiles::~dlgAddMatchFiles  )  [virtual]
 

The class descructor.

Definition at line 1114 of file dlgAddMatchFiles.cpp.

References matchPatterns.


Member Function Documentation

void dlgAddMatchFiles::addLineToComboBox wxComboBox *  cboBox,
const int  maxLines
[static, private]
 

Adds a file or a directory or a match pattern to a combo box.

Parameters:
cboBox The combobox.
maxLines The number of maximum lines in the combobox.

Definition at line 1415 of file dlgAddMatchFiles.cpp.

References addLineToComboBox(), and compareFileName().

Referenced by addLineToComboBox(), and btnAddPatternClick().

void dlgAddMatchFiles::addPatternToListView const MatchPattern pattern  )  [protected]
 

Add a pattern to the list view of patterns.

If the pattern is already are in the list, it is not added.

Parameters:
pattern Pattern to be added to the listview.

Definition at line 1644 of file dlgAddMatchFiles.cpp.

References addPatternToListView(), dlgAddMatchFiles::MatchPattern::getDepth(), dlgAddMatchFiles::MatchPattern::getDirectory(), getID(), dlgAddMatchFiles::MatchPattern::getPattern(), lvwPatterns, patternsListCmpFnct(), dlgAddMatchFiles::MatchPattern::setDepth(), dlgAddMatchFiles::MatchPattern::setDirectory(), and dlgAddMatchFiles::MatchPattern::setPattern().

Referenced by addPatternToListView(), btnAddListClick(), btnAddPatternClick(), and btnLoadListClick().

void dlgAddMatchFiles::btnAddClick wxCommandEvent &  event  )  [protected]
 

Processes button Add.

Parameters:
event The event's parameters

Definition at line 1611 of file dlgAddMatchFiles.cpp.

References btnAddClick(), wxSortableListView::GetColumnToSort(), getConfigKey(), wxSortableListView::GetSortOrder(), and lvwPatterns.

Referenced by btnAddClick().

void dlgAddMatchFiles::btnAddListClick wxCommandEvent &  event  )  [protected]
 

Processes button Add List.

Parameters:
event The event's parameters

Definition at line 1258 of file dlgAddMatchFiles.cpp.

References addPatternToListView(), btnAddListClick(), dlgAddMatchFiles::ArrayMatchPattern::getCount(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), and readMatchPatternsFile().

Referenced by btnAddListClick().

void dlgAddMatchFiles::btnAddPatternClick wxCommandEvent &  event  )  [protected]
 

Processes button Add pattern.

Parameters:
event The event's parameters

Definition at line 1455 of file dlgAddMatchFiles.cpp.

References addLineToComboBox(), addPatternToListView(), btnAddPatternClick(), cboDirectory, cboPattern, getDirectoryConfigKey(), getHistoryMaxSize(), getMatchPatternConfigKey(), and spnDepth.

Referenced by btnAddPatternClick().

void dlgAddMatchFiles::btnBrowseClick wxCommandEvent &  event  )  [protected]
 

Processes button Browse.

Parameters:
event The event's parameters

Definition at line 1384 of file dlgAddMatchFiles.cpp.

References btnBrowseClick(), cboDirectory, getChecksumsFileName(), and AppPrefs::getUserDocumentsDirName().

Referenced by btnBrowseClick().

void dlgAddMatchFiles::btnLoadListClick wxCommandEvent &  event  )  [protected]
 

Processes button Load List.

Parameters:
event The event's parameters

Definition at line 1290 of file dlgAddMatchFiles.cpp.

References addPatternToListView(), btnLoadListClick(), dlgAddMatchFiles::ArrayMatchPattern::getCount(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), lvwPatterns, and readMatchPatternsFile().

Referenced by btnLoadListClick().

void dlgAddMatchFiles::btnRemoveClick wxCommandEvent &  event  )  [protected]
 

Processes button Remove.

Parameters:
event The event's parameters

Definition at line 1130 of file dlgAddMatchFiles.cpp.

References btnRemoveClick(), and lvwPatterns.

Referenced by btnRemoveClick().

void dlgAddMatchFiles::btnSaveListClick wxCommandEvent &  event  )  [protected]
 

Processes button Save List.

Parameters:
event The event's parameters

Definition at line 1328 of file dlgAddMatchFiles.cpp.

References btnSaveListClick(), getAppName(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), and lvwPatterns.

Referenced by btnSaveListClick().

void dlgAddMatchFiles::cboAddTextEnter wxCommandEvent &  event  )  [protected]
 

Event handler for the enter key pressed on a search combo box.

Parameters:
event Event parameters.

Definition at line 1545 of file dlgAddMatchFiles.cpp.

References btnAddPattern, and cboAddTextEnter().

Referenced by cboAddTextEnter().

void dlgAddMatchFiles::createControls  ) 
 

Creates and initializes the controls of the dialog.

Definition at line 962 of file dlgAddMatchFiles.cpp.

References btnAddPattern, btnRemove, cboDirectory, cboPattern, CONTROL_SPACE, wxSortableListView::GetColumnToSort(), getConfigKey(), getDirectoryConfigKey(), getHistoryMaxSize(), getMatchPatternConfigKey(), wxSortableListView::GetSortOrder(), lvwPatterns, matchPatterns, rbxSortBy, rbxSortOrder, wxSortableListView::SetColumnToSort(), wxSortableListView::SetSortOrder(), and spnDepth.

Referenced by dlgAddMatchFiles().

wxString dlgAddMatchFiles::getChecksumsFileName  )  const
 

Gets the name of the checksums' file where the files will be added.

Returns:
The name of the checksums' file where the files will be added.

Definition at line 1722 of file dlgAddMatchFiles.cpp.

References checksumsFileName.

Referenced by btnBrowseClick(), and setDialogTitle().

wxString dlgAddMatchFiles::getConfigKey const PreferencesKey  pk  )  [static, protected]
 

Gets the configuration key corresponding to the given preference key.

Parameters:
pk The preference key to get.
Returns:
The configuration key corresponding to the given preference key or an empty string if the preference key is invalid.

Definition at line 1807 of file dlgAddMatchFiles.cpp.

References getConfigKey(), and getRootConfigKey().

Referenced by btnAddClick(), createControls(), dlgAddMatchFiles(), and getConfigKey().

wxString dlgAddMatchFiles::getDirectoryConfigKey const int  n  )  [static]
 

Gets the configuration key for the last directories to add.

Parameters:
n The nth history configuration key to get.
Returns:
The configuration key for the last directories to add.

Definition at line 1776 of file dlgAddMatchFiles.cpp.

References getDirectoryConfigKey(), getHistoryMaxSize(), and getRootConfigKey().

Referenced by btnAddPatternClick(), createControls(), and getDirectoryConfigKey().

int dlgAddMatchFiles::getHistoryMaxSize  )  [inline, static]
 

Get the maximum size of the history of the last match patterns and directories to add.

Returns:
The maximum size of the history of the match patterns and directories to add.

Definition at line 1793 of file dlgAddMatchFiles.cpp.

Referenced by btnAddPatternClick(), createControls(), getDirectoryConfigKey(), and getMatchPatternConfigKey().

long dlgAddMatchFiles::getID  )  [static, protected]
 

Gets a new unique identifier.

Returns:
A new unique identifier.

Definition at line 1845 of file dlgAddMatchFiles.cpp.

References idGen.

Referenced by addPatternToListView(), and dlgAddMatchFiles::PatternsListValidator::TransferToWindow().

void dlgAddMatchFiles::getLastDirectoryAndFilter const wxString &  configKey,
wxString &  lastDirKey,
wxString &  lastDir,
wxFileDialogFilterMaker fltMaker
[static, private]
 

Gets the last directory used and the filter for the open or save dialog.

Parameters:
configKey Configuration key for the last directory.
lastDirKey String that will contains the full configuration key for the last directory.
lastDir String that will contains the last directory.
fltMaker Filter that will contains the filters for the open or save dialog.

Definition at line 1152 of file dlgAddMatchFiles.cpp.

References wxFileDialogFilterMaker::AddFilter(), getLastDirectoryAndFilter(), getRootConfigKey(), and AppPrefs::getUserDocumentsDirName().

Referenced by btnAddListClick(), btnLoadListClick(), btnSaveListClick(), and getLastDirectoryAndFilter().

wxString dlgAddMatchFiles::getMatchPatternConfigKey const int  n  )  [static]
 

Gets the configuration key for the last match patterns to add.

Parameters:
n The nth history configuration key to get.
Returns:
The configuration key for the last match patterns to add.

Definition at line 1760 of file dlgAddMatchFiles.cpp.

References getHistoryMaxSize(), getMatchPatternConfigKey(), and getRootConfigKey().

Referenced by btnAddPatternClick(), createControls(), and getMatchPatternConfigKey().

void dlgAddMatchFiles::getMatchPatterns ArrayMatchPattern patterns  )  const
 

Gets the choosed matching patterns.

The given array of matching patterns is erased. The matching array could contains directories with both relative and absolute paths.

Parameters:
patterns The array which will contain the patterns.

Definition at line 1709 of file dlgAddMatchFiles.cpp.

References getMatchPatterns(), and matchPatterns.

Referenced by getMatchPatterns(), and ChecksumsListView::selectMatchingFilesToAdd().

wxString dlgAddMatchFiles::getRootConfigKey  )  [inline, static]
 

Gets the root configuration key for parameters of this dialog.

Returns:
The root configuration key for parameters of this dialog.

Definition at line 1747 of file dlgAddMatchFiles.cpp.

Referenced by getConfigKey(), getDirectoryConfigKey(), getLastDirectoryAndFilter(), and getMatchPatternConfigKey().

void dlgAddMatchFiles::lvwPatternsColumnClick wxListEvent &  event  )  [protected]
 

Processes a click on a header of a column of the list of patterns.

Parameters:
event Event parameters.

Definition at line 1578 of file dlgAddMatchFiles.cpp.

References wxSortableListView::GetColumnToSort(), wxSortableListView::GetSortOrder(), lvwPatterns, lvwPatternsColumnClick(), patternsListCmpFnct(), rbxSortBy, rbxSortOrder, wxSortableListView::SetColumnToSort(), and wxSortableListView::SetSortOrder().

Referenced by lvwPatternsColumnClick().

void dlgAddMatchFiles::lvwPatternsDeselectItem wxListEvent &  event  )  [protected]
 

Event handler for the deselection of an item.

Parameters:
event Event parameters.

Definition at line 1495 of file dlgAddMatchFiles.cpp.

References btnRemove, lvwPatterns, and lvwPatternsDeselectItem().

Referenced by lvwPatternsDeselectItem().

void dlgAddMatchFiles::lvwPatternsKeyDown wxListEvent &  event  )  [protected]
 

Event handler for the key down event.

Parameters:
event Event parameters.

Definition at line 1558 of file dlgAddMatchFiles.cpp.

References btnRemove, and lvwPatternsKeyDown().

Referenced by lvwPatternsKeyDown().

void dlgAddMatchFiles::lvwPatternsSelectItem wxListEvent &  event  )  [protected]
 

Event handler for the selection of an item.

Parameters:
event Event parameters.

Definition at line 1483 of file dlgAddMatchFiles.cpp.

References btnRemove, and lvwPatternsSelectItem().

Referenced by lvwPatternsSelectItem().

void dlgAddMatchFiles::rbxSortBySelect wxCommandEvent &  event  )  [protected]
 

Processes a selection of the column to sort.

Parameters:
event Event parameters.

Definition at line 1508 of file dlgAddMatchFiles.cpp.

References lvwPatterns, patternsListCmpFnct(), rbxSortBySelect(), and wxSortableListView::SetColumnToSort().

Referenced by rbxSortBySelect().

void dlgAddMatchFiles::rbxSortOrderSelect wxCommandEvent &  event  )  [protected]
 

Processes a selection of the sort order.

Parameters:
event Event parameters.

Definition at line 1521 of file dlgAddMatchFiles.cpp.

References lvwPatterns, patternsListCmpFnct(), rbxSortOrderSelect(), and wxSortableListView::SetSortOrder().

Referenced by rbxSortOrderSelect().

void dlgAddMatchFiles::readMatchPatternsFile const wxString &  fileName,
ArrayMatchPattern patterns
[static, private]
 

Reads a file of matching patterns.

Parameters:
fileName Name of the file to read.
patterns Array of patterns in which the read patterns will be stored. The array is not erased before adding patterns.

Definition at line 1178 of file dlgAddMatchFiles.cpp.

References dlgAddMatchFiles::ArrayMatchPattern::add(), and readMatchPatternsFile().

Referenced by btnAddListClick(), btnLoadListClick(), and readMatchPatternsFile().

void dlgAddMatchFiles::setChecksumsFileName const wxString &  fileName  ) 
 

Sets the name of the checksums' file where the files will be added.

Parameters:
fileName The name of the checksums' file where the files will be added.

Definition at line 1734 of file dlgAddMatchFiles.cpp.

References checksumsFileName, setChecksumsFileName(), and setDialogTitle().

Referenced by dlgAddMatchFiles(), and setChecksumsFileName().

void dlgAddMatchFiles::setDialogTitle  )  [protected]
 

Sets the title of the dialog.

This method is called when the name of the checksums' file is modified.

Definition at line 1104 of file dlgAddMatchFiles.cpp.

References getChecksumsFileName().

Referenced by setChecksumsFileName().


Member Data Documentation

wxButton* dlgAddMatchFiles::btnAddPattern [protected]
 

Add a pattern to the list.

Definition at line 87 of file dlgAddMatchFiles.hpp.

Referenced by cboAddTextEnter(), and createControls().

wxButton* dlgAddMatchFiles::btnRemove [protected]
 

Button for removing patterns.

Definition at line 84 of file dlgAddMatchFiles.hpp.

Referenced by createControls(), lvwPatternsDeselectItem(), lvwPatternsKeyDown(), and lvwPatternsSelectItem().

wxComboBox* dlgAddMatchFiles::cboDirectory [protected]
 

Directory of the pattern.

Definition at line 89 of file dlgAddMatchFiles.hpp.

Referenced by btnAddPatternClick(), btnBrowseClick(), and createControls().

wxComboBox* dlgAddMatchFiles::cboPattern [protected]
 

Pattern to add.

Definition at line 88 of file dlgAddMatchFiles.hpp.

Referenced by btnAddPatternClick(), and createControls().

wxString dlgAddMatchFiles::checksumsFileName [protected]
 

Name of the checksums' file where the files will be added.

Definition at line 91 of file dlgAddMatchFiles.hpp.

Referenced by getChecksumsFileName(), and setChecksumsFileName().

long dlgAddMatchFiles::idGen = 0L [static, protected]
 

Value for unique identifiers generation.

Definition at line 911 of file dlgAddMatchFiles.cpp.

Referenced by getID().

wxSortableListView* dlgAddMatchFiles::lvwPatterns [protected]
 

List of patterns.

Definition at line 82 of file dlgAddMatchFiles.hpp.

Referenced by addPatternToListView(), btnAddClick(), btnLoadListClick(), btnRemoveClick(), btnSaveListClick(), createControls(), lvwPatternsColumnClick(), lvwPatternsDeselectItem(), rbxSortBySelect(), and rbxSortOrderSelect().

ArrayMatchPattern* dlgAddMatchFiles::matchPatterns [protected]
 

Match patterns given by the validator.

Definition at line 83 of file dlgAddMatchFiles.hpp.

Referenced by createControls(), dlgAddMatchFiles(), getMatchPatterns(), and ~dlgAddMatchFiles().

wxRadioBox* dlgAddMatchFiles::rbxSortBy [protected]
 

Sort by radio box buttons.

Definition at line 85 of file dlgAddMatchFiles.hpp.

Referenced by createControls(), and lvwPatternsColumnClick().

wxRadioBox* dlgAddMatchFiles::rbxSortOrder [protected]
 

Sort order radio box buttons.

Definition at line 86 of file dlgAddMatchFiles.hpp.

Referenced by createControls(), and lvwPatternsColumnClick().

wxSpinCtrl* dlgAddMatchFiles::spnDepth [protected]
 

Search depth.

Definition at line 90 of file dlgAddMatchFiles.hpp.

Referenced by btnAddPatternClick(), and createControls().


The documentation for this class was generated from the following files:
Generated on Sun May 30 13:38:03 2004 for wxChecksums by doxygen 1.3.7