#include <appprefs.hpp>
Collaboration diagram for AppPrefs:
Public Member Functions | |
wxString | getConfigKey (const int key) const |
Gets the key of the preference in the configuration file. | |
bool | read (const int key, wxSize &s) const |
Reads a wxSize value from the key. | |
bool | read (const int key, wxPoint &p) const |
Reads a wxPoint value from the key. | |
bool | read (const int key, wxRect &r) const |
Reads a wxRect value from the key. | |
bool | read (const int key, bool &b) const |
Reads a boolean value from the key. | |
bool | read (const int key, double &d) const |
Reads a double value from the key. | |
bool | read (const int key, long &l) const |
Reads a long integer value from the key. | |
bool | read (const int key, wxString &str) const |
Reads a string from the key. | |
bool | readBool (const int key, const bool def=false) const |
Reads a boolean value from the key. | |
double | readDouble (const int key, const double def=-1.0) const |
Reads a double value from the key. | |
long | readLong (const int key, const long def=-1L) const |
Reads a long integer value from the key. | |
wxPoint | readPoint (const int key, const wxPoint &def=wxPoint(0, 0)) const |
Reads a wxPoint value from the key. | |
wxRect | readRect (const int key, const wxRect &def=wxRect(0, 0, 0, 0)) const |
Reads a wxRect value from the key. | |
wxSize | readSize (const int key, const wxSize &def=wxSize(0, 0)) const |
Reads a wxSize value from the key. | |
wxString | readString (const int key, const wxString &def=wxEmptyString) const |
Reads a string from the key. | |
bool | write (const int key, const wxSize &s) |
Write a wxSize value in the preference given by the key. | |
bool | write (const int key, const wxPoint &p) |
Write a wxPoint value in the preference given by the key. | |
bool | write (const int key, const wxRect &r) |
Write a wxRect value in the preference given by the key. | |
bool | write (const int key, const bool b) |
Write a boolean value in the preference given by the key. | |
bool | write (const int key, const double d) |
Write a double value in the preference given by the key. | |
bool | write (const int key, const long l) |
Write a long integer value in the preference given by the key. | |
bool | write (const int key, const wxString &str) |
Write a string in the preference given by the key. | |
Static Public Member Functions | |
void | cleanupGlobal () |
Cleans up the global instance. | |
AppPrefs * | get () |
Gets a pointer on the global preferences. | |
wxString | getConfigPathName () |
Gets the full path of the file which contains the application's preferences. | |
wxRect | getDefaultMainWindowRect () |
Gets the default rects of the main window. | |
wxString | getLanguagesPathName () |
Gets the full path of the file which contains the application's languages settings. | |
wxString | getUserDocumentsDirName () |
Gets the directory where the user stores its documents. | |
Protected Member Functions | |
AppPrefs (const AppPrefs &source) | |
Copy constructor. | |
AppPrefs () | |
Default constructor. | |
void | clone (const AppPrefs &source) |
Clones the source instance in this instance. | |
void | init () |
Inits the instance. | |
AppPrefs & | operator= (const AppPrefs &source) |
Assignment operator. | |
Static Protected Member Functions | |
wxString | getConfigDir () |
Gets the full name of the directory where the preferences of the application are stored. | |
wxString | getConfigDirName () |
Gets the name of the directory which contains the application's preferences. | |
wxString | getConfigFileName () |
Gets the name of the file which contains the application's preferences. | |
wxString | getLanguagesFileName () |
Gets the name of the file which contains the application's languages settings. | |
AppPrefs * | set (AppPrefs *pAppPrefs) |
Sets the global preferences. | |
Protected Attributes | |
HashPrefs | prefs |
Hashmap that contains the data of preferences. | |
Static Protected Attributes | |
wxString | configDir |
Full name of the directory which contains the application's preferences. | |
wxString | configFileName |
Name of the file which contains the application preferences. | |
AppPrefs * | global = NULL |
Global preferences. |
You can't create directly an instance of this class. In order to get one, use the method get()
. Use the method cleanupGlobal()
at the end of the program to clean up the memory.
Don't use the method get()
(and more generally don't create an instance of AppPrefs) before setting a correct global configuration file (see wxConfig
in the wxWidgets documentation).
Use the methods read
and write
to get and set the values of the preferences.
Definition at line 227 of file appprefs.hpp.
|
Default constructor.
Definition at line 967 of file appprefs.cpp. References init(). Referenced by get(). |
|
Copy constructor.
Definition at line 1106 of file appprefs.cpp. References clone(). |
|
Cleans up the global instance.
Use the It is safe to call this static method if no global preferences have been set. Definition at line 1596 of file appprefs.cpp. References set(). Referenced by CkSumsApp::CleanUpAppResources(). |
|
Clones the source instance in this instance.
Definition at line 1093 of file appprefs.cpp. References clone(), and prefs. Referenced by AppPrefs(), clone(), and operator=(). |
|
|
Gets the full name of the directory where the preferences of the application are stored.
Definition at line 1611 of file appprefs.cpp. References addPathSeparatorAtEnd(), configDir, dirExists(), getConfigDirName(), and getConfigFileName(). Referenced by getConfigPathName(). |
|
Gets the name of the directory which contains the application's preferences.
Definition at line 1715 of file appprefs.cpp. References APP_NAME. Referenced by getConfigDir(). |
|
Gets the name of the file which contains the application's preferences.
Definition at line 1685 of file appprefs.cpp. References APP_NAME, and configFileName. Referenced by getConfigDir(), and getConfigPathName(). |
|
Gets the key of the preference in the configuration file.
Definition at line 1134 of file appprefs.cpp. References getConfigKey(), and prefs. Referenced by getConfigKey(), and dlgConfigure::getSFVGeneratorIdentifierConfigKey(). |
|
Gets the full path of the file which contains the application's preferences.
Definition at line 1728 of file appprefs.cpp. References addPathSeparatorAtEnd(), getConfigDir(), and getConfigFileName(). |
|
Gets the default rects of the main window.
Definition at line 1785 of file appprefs.cpp. Referenced by frmSums::createControls(), and init(). |
|
Gets the name of the file which contains the application's languages settings.
Definition at line 1702 of file appprefs.cpp. Referenced by getLanguagesPathName(). |
|
Gets the full path of the file which contains the application's languages settings.
Definition at line 1742 of file appprefs.cpp. References getLanguagesFileName(). |
|
Gets the directory where the user stores its documents.
This method looks for the
Definition at line 1811 of file appprefs.cpp. Referenced by dlgFilesSelector::btnAddClick(), dlgFilesSelector::btnBrowseClick(), dlgAddMatchFiles::btnBrowseClick(), dlgFilesSelector::getLastDirectoryAndFilter(), and dlgAddMatchFiles::getLastDirectoryAndFilter(). |
|
Inits the instance. This method creates the preferences that will be valid and associates to them an unique integer key. The preferences values are read from the configuration file if it's available, else default values are used. Definition at line 983 of file appprefs.cpp. References getDefaultMainWindowRect(), and prefs. Referenced by AppPrefs(). |
|
Assignment operator.
Definition at line 1118 of file appprefs.cpp. References clone(), and operator=(). Referenced by operator=(). |
|
Reads a wxSize value from the key.
Definition at line 1389 of file appprefs.cpp. |
|
Reads a wxPoint value from the key.
Definition at line 1350 of file appprefs.cpp. |
|
Reads a wxRect value from the key.
Definition at line 1311 of file appprefs.cpp. |
|
Reads a boolean value from the key.
Definition at line 1272 of file appprefs.cpp. |
|
Reads a double value from the key.
Definition at line 1233 of file appprefs.cpp. |
|
Reads a long integer value from the key.
Definition at line 1194 of file appprefs.cpp. |
|
Reads a string from the key.
Definition at line 1155 of file appprefs.cpp. Referenced by read(), readBool(), readDouble(), readLong(), readPoint(), readRect(), readSize(), and readString(). |
|
Reads a boolean value from the key.
Definition at line 1291 of file appprefs.cpp. References read(), and readBool(). Referenced by ChecksumsListView::check(), dlgMultiCheck::checkChecksumsFiles(), dlgMultiCheck::checkFile(), frmSums::closeAfterInitFromCmdLine(), frmSums::createControls(), dlgConfigure::createControls(), frmSums::FrameClose(), frmSums::initializeFromCmdLine(), ChecksumsListView::openChecksumFile(), readBool(), frmSums::saveChecksumFile(), ChecksumsListView::setChecksum(), SumListCompareFnct(), SFVFile::write(), and MD5File::write(). |
|
Reads a double value from the key.
Definition at line 1252 of file appprefs.cpp. References read(), and readDouble(). Referenced by readDouble(). |
|
Reads a long integer value from the key.
Definition at line 1213 of file appprefs.cpp. References read(), and readLong(). Referenced by frmSums::closeAfterInitFromCmdLine(), frmSums::createControls(), dlgNewFile::createControls(), dlgConfigure::createControls(), dlgResultsProgress::getColour(), ChecksumFileCalculator::initBufferSize(), frmSums::initializeFromCmdLine(), SFVFile::read(), MD5File::read(), readLong(), SFVFile::write(), and MD5File::write(). |
|
Reads a wxPoint value from the key.
Definition at line 1369 of file appprefs.cpp. References read(), and readPoint(). Referenced by frmSums::createControls(), and readPoint(). |
|
Reads a wxRect value from the key.
Definition at line 1330 of file appprefs.cpp. References read(), and readRect(). Referenced by readRect(). |
|
Reads a wxSize value from the key.
Definition at line 1408 of file appprefs.cpp. References read(), and readSize(). Referenced by frmSums::createControls(), dlgBatchCreation::dlgBatchCreation(), dlgConfigure::dlgConfigure(), dlgMultiCheck::dlgMultiCheck(), and readSize(). |
|
Reads a string from the key.
Definition at line 1174 of file appprefs.cpp. References read(), and readString(). Referenced by dlgNewFile::createControls(), dlgConfigure::createControls(), CkSumsApp::InitLocale(), frmSums::itmFileOpenClick(), frmSums::itmFileSaveAsClick(), readString(), Languages::setLocale(), and SFVFile::write(). |
|
Sets the global preferences.
Definition at line 1578 of file appprefs.cpp. Referenced by cleanupGlobal(), and set(). |
|
Write a wxSize value in the preference given by the key.
Definition at line 1542 of file appprefs.cpp. |
|
Write a wxPoint value in the preference given by the key.
Definition at line 1523 of file appprefs.cpp. |
|
Write a wxRect value in the preference given by the key.
Definition at line 1504 of file appprefs.cpp. |
|
Write a boolean value in the preference given by the key.
Definition at line 1485 of file appprefs.cpp. |
|
Write a double value in the preference given by the key.
Definition at line 1466 of file appprefs.cpp. |
|
Write a long integer value in the preference given by the key.
Definition at line 1447 of file appprefs.cpp. |
|
Write a string in the preference given by the key.
Definition at line 1428 of file appprefs.cpp. References prefs, and write(). Referenced by dlgMultiCheck::btnCancelClick(), dlgBatchCreation::btnCancelClick(), frmSums::FrameClose(), frmSums::itmFileNewClick(), frmSums::itmFileOpenClick(), frmSums::itmFileSaveAsClick(), frmSums::itmToolsConfigureClick(), frmSums::itmToolsShowStatusbarClick(), frmSums::itmToolsShowToolbarClick(), and write(). |
|
Full name of the directory which contains the application's preferences.
Definition at line 959 of file appprefs.cpp. Referenced by getConfigDir(). |
|
Name of the file which contains the application preferences.
Definition at line 960 of file appprefs.cpp. Referenced by getConfigFileName(). |
|
Global preferences.
Definition at line 958 of file appprefs.cpp. |
|
Hashmap that contains the data of preferences.
Definition at line 230 of file appprefs.hpp. Referenced by clone(), getConfigKey(), init(), read(), and write(). |