NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class represents a dialog for creating a package from a set of procedures. More...
#include <packagedialog.hpp>
Public Member Functions | |
PackageDialog (wxWindow *parent, NumeReTerminal *terminal, IconManager *icons) | |
Constructor. More... | |
void | loadProjectFile (const wxString &filename) |
Loads a NumeRe package project file to memory and updates the UI correspondingly. More... | |
void | setMainFile (const wxString &mainfile) |
This function can be used to insert the current mainfile to the dialog. Used by the main window, if the user clicks on "Create package". More... | |
wxArrayString | getProcedures () |
This member function will create a string array containing the procedure files, which are currently part of the list view, and return them. More... | |
wxString | getInstallInfo () |
This member function will create the install information section of the package based upon the setted properties. More... | |
wxString | getPackageName () |
This member function returns the name of the package, as been set by the user. More... | |
wxString | getPackageIdentifier () |
This member function returns the package identifier, which is constructed from the name and only contains lowercase alphanumeric characters and the underscore. More... | |
wxString | getPackageVersion () |
Returns the version of the defined package as a simple string. More... | |
wxString | getDocFile () |
Returns the user-chosen documentation file. More... | |
bool | includeDocs () |
This member function returns whether the user selected the "include docs" property. More... | |
bool | isPlugin () |
This member function returns, whether the user selected a plugin type as install type. More... | |
Private Member Functions | |
void | OnAutoDetect (wxCommandEvent &event) |
This is the event handler for the autodetect button. More... | |
void | OnAddItems (wxCommandEvent &event) |
This is the event handler for the add files button. More... | |
void | OnRemoveItems (wxCommandEvent &event) |
This is the event handler for the remove files button. More... | |
void | OnLoadProjectFile (wxCommandEvent &event) |
Button event handler to load an existing project file. More... | |
void | OnSaveProjectFile (wxCommandEvent &event) |
Button event handler to save a prepared package setting to a project file. More... | |
void | OnCreatePackage (wxCommandEvent &event) |
Called upon clicking on "Create
package" button. Will ask for saving the project. More... | |
void | OnAbort (wxCommandEvent &event) |
Called upon clicking on "Cancel" button. Will ask for saving the project. More... | |
void | OnPropGridChange (wxPropertyGridEvent &event) |
Event handler for all property grid changes. More... | |
void | OnClose (wxCloseEvent &event) |
Event handler, which is called, when the user closes the dialog. More... | |
void | SaveOnClose () |
Evaluates, whether the current project has been saved and prompt the user a saving dialog, if not. More... | |
void | autoDetect (const wxArrayString &mainfiles) |
This function autodetects the dependencies of the passed files by calling the PackageDialog::followBranch() function recursively. More... | |
void | followBranch (const std::string &sFile, std::set< std::string > &fileSet) |
This function will recursively call itself to detect a whole branch of file dependencies. More... | |
void | findLayoutDependencies (const std::string &sFile, std::set< std::string > &fileSet) |
This member function uses the event procedures of a window layout file to create a dependency tree for this layout. More... | |
void | saveProjectFile (const wxString &filename) |
Saves a prepared package configuration as a NumeRe package project file to the HDD. More... | |
void | markUnsaved () |
Marks the current project as modified. More... | |
bool | isSaved () |
Returns true, if the current project is in a saved state. More... | |
Private Attributes | |
wxPropertyGrid * | m_packageProperties |
wxListView * | m_fileList |
NumeReTerminal * | m_terminal |
IconManager * | m_icons |
bool | m_isAutoIncrement |
This class represents a dialog for creating a package from a set of procedures.
Definition at line 36 of file packagedialog.hpp.
PackageDialog::PackageDialog | ( | wxWindow * | parent, |
NumeReTerminal * | terminal, | ||
IconManager * | icons | ||
) |
Constructor.
parent | wxWindow* |
terminal | NumeReTerminal* |
icons | IconManager* |
Definition at line 63 of file packagedialog.cpp.
References _guilang, GroupPanel::CreateButton(), GroupPanel::createGroup(), GroupPanel::CreateListView(), DOCFILE, g_pixelScale, Language::get(), ID_PKGDLG_ABORT, ID_PKGDLG_ADD, ID_PKGDLG_AUTODETECT, ID_PKGDLG_CREATEPACKAGE, ID_PKGDLG_LOADPROJECT, ID_PKGDLG_REMOVE, ID_PKGDLG_SAVEPROJECT, and INCLUDEDOCS.
|
private |
This function autodetects the dependencies of the passed files by calling the PackageDialog::followBranch() function recursively.
mainfiles | const wxArrayString& |
Definition at line 453 of file packagedialog.cpp.
References findLayoutDependencies(), followBranch(), IconManager::GetIconIndex(), m_fileList, m_icons, markUnsaved(), replacePathSeparator(), and resolveIncludes().
Referenced by OnAutoDetect().
|
private |
This member function uses the event procedures of a window layout file to create a dependency tree for this layout.
sFile | const std::string& |
fileSet | std::set<std::string>& |
Definition at line 531 of file packagedialog.cpp.
References followBranch(), and getEventProcedures().
Referenced by autoDetect().
|
private |
This function will recursively call itself to detect a whole branch of file dependencies.
sFile | const std::string& |
fileSet | std::set<std::string>& |
Definition at line 497 of file packagedialog.cpp.
References followBranch(), ProcedureElement::getDependencies(), Dependencies::getDependencyMap(), NumeReTerminal::getKernel(), ProcedureLibrary::getProcedureContents(), NumeReKernel::getProcedureLibrary(), m_terminal, and replacePathSeparator().
Referenced by autoDetect(), findLayoutDependencies(), and followBranch().
wxString PackageDialog::getDocFile | ( | ) |
Returns the user-chosen documentation file.
Definition at line 934 of file packagedialog.cpp.
References DOCFILE, and m_packageProperties.
Referenced by NumeReWindow::OnCreatePackage().
wxString PackageDialog::getInstallInfo | ( | ) |
This member function will create the install information section of the package based upon the setted properties.
Definition at line 815 of file packagedialog.cpp.
References getPackageName(), isPlugin(), m_packageProperties, and sVersion.
Referenced by NumeReWindow::OnCreatePackage().
wxString PackageDialog::getPackageIdentifier | ( | ) |
This member function returns the package identifier, which is constructed from the name and only contains lowercase alphanumeric characters and the underscore.
Definition at line 892 of file packagedialog.cpp.
References getPackageName(), isPlugin(), and toLowerCase().
Referenced by NumeReWindow::OnCreatePackage(), OnLoadProjectFile(), OnSaveProjectFile(), and SaveOnClose().
wxString PackageDialog::getPackageName | ( | ) |
This member function returns the name of the package, as been set by the user.
Definition at line 871 of file packagedialog.cpp.
References m_packageProperties, and name.
Referenced by getInstallInfo(), getPackageIdentifier(), and NumeReWindow::OnCreatePackage().
wxString PackageDialog::getPackageVersion | ( | ) |
Returns the version of the defined package as a simple string.
Definition at line 919 of file packagedialog.cpp.
References m_packageProperties.
wxArrayString PackageDialog::getProcedures | ( | ) |
This member function will create a string array containing the procedure files, which are currently part of the list view, and return them.
Definition at line 794 of file packagedialog.cpp.
References m_fileList.
Referenced by OnAutoDetect(), and NumeReWindow::OnCreatePackage().
bool PackageDialog::includeDocs | ( | ) |
This member function returns whether the user selected the "include docs" property.
Definition at line 947 of file packagedialog.cpp.
References INCLUDEDOCS, and m_packageProperties.
Referenced by NumeReWindow::OnCreatePackage().
bool PackageDialog::isPlugin | ( | ) |
This member function returns, whether the user selected a plugin type as install type.
Definition at line 961 of file packagedialog.cpp.
References m_packageProperties.
Referenced by getInstallInfo(), and getPackageIdentifier().
|
private |
Returns true, if the current project is in a saved state.
Definition at line 758 of file packagedialog.cpp.
Referenced by markUnsaved(), OnLoadProjectFile(), OnPropGridChange(), and SaveOnClose().
void PackageDialog::loadProjectFile | ( | const wxString & | filename | ) |
Loads a NumeRe package project file to memory and updates the UI correspondingly.
filename | const wxString& |
Definition at line 554 of file packagedialog.cpp.
References _guilang, tinyxml2::XMLElement::Attribute(), tinyxml2::XMLElement::BoolAttribute(), DOCFILE, fileExists(), tinyxml2::XMLNode::FirstChildElement(), Language::get(), IconManager::GetIconIndex(), tinyxml2::XMLElement::GetText(), incrementVersion(), tinyxml2::XMLDocument::LoadFile(), m_fileList, m_icons, m_isAutoIncrement, m_packageProperties, markUnsaved(), and tinyxml2::XMLNode::NextSiblingElement().
Referenced by NumeReWindow::OnCreatePackage(), and OnLoadProjectFile().
|
private |
Marks the current project as modified.
Definition at line 744 of file packagedialog.cpp.
References isSaved().
Referenced by autoDetect(), loadProjectFile(), OnAddItems(), OnRemoveItems(), and setMainFile().
|
private |
Called upon clicking on "Cancel" button. Will ask for saving the project.
event | wxCommandEvent& |
Definition at line 345 of file packagedialog.cpp.
References SaveOnClose().
|
private |
This is the event handler for the add files button.
event | wxCommandEvent& |
Definition at line 219 of file packagedialog.cpp.
References _guilang, Language::get(), IconManager::GetIconIndex(), NumeReTerminal::getPathSettings(), m_fileList, m_icons, m_terminal, markUnsaved(), PROCPATH, and replacePathSeparator().
|
private |
This is the event handler for the autodetect button.
event | wxCommandEvent& |
Definition at line 197 of file packagedialog.cpp.
References autoDetect(), and getProcedures().
|
private |
Event handler, which is called, when the user closes the dialog.
event | wxCloseEvent& |
Definition at line 377 of file packagedialog.cpp.
References SaveOnClose().
|
private |
Called upon clicking on "Create package" button. Will ask for saving the project.
event | wxCommandEvent& |
Definition at line 330 of file packagedialog.cpp.
References SaveOnClose().
|
private |
Button event handler to load an existing project file.
event | wxCommandEvent& |
Definition at line 282 of file packagedialog.cpp.
References _guilang, Language::get(), getPackageIdentifier(), NumeReTerminal::getPathSettings(), isSaved(), loadProjectFile(), m_terminal, saveProjectFile(), and SCRIPTPATH.
|
private |
Event handler for all property grid changes.
event | wxPropertyGridEvent& |
Definition at line 360 of file packagedialog.cpp.
References isSaved().
|
private |
This is the event handler for the remove files button.
event | wxCommandEvent& |
Definition at line 259 of file packagedialog.cpp.
References m_fileList, and markUnsaved().
|
private |
Button event handler to save a prepared package setting to a project file.
event | wxCommandEvent& |
Definition at line 312 of file packagedialog.cpp.
References _guilang, Language::get(), getPackageIdentifier(), NumeReTerminal::getPathSettings(), m_terminal, saveProjectFile(), and SCRIPTPATH.
|
private |
Evaluates, whether the current project has been saved and prompt the user a saving dialog, if not.
Definition at line 392 of file packagedialog.cpp.
References _guilang, Language::get(), getPackageIdentifier(), NumeReTerminal::getPathSettings(), isSaved(), m_terminal, saveProjectFile(), and SCRIPTPATH.
Referenced by OnAbort(), OnClose(), and OnCreatePackage().
|
private |
Saves a prepared package configuration as a NumeRe package project file to the HDD.
filename | const wxString& |
Definition at line 649 of file packagedialog.cpp.
References _guilang, Language::get(), VersionControlSystemManager::getRevisions(), tinyxml2::XMLNode::InsertEndChild(), tinyxml2::XMLNode::InsertFirstChild(), m_fileList, m_isAutoIncrement, m_packageProperties, tinyxml2::XMLDocument::NewElement(), tinyxml2::XMLDocument::SaveFile(), tinyxml2::XMLElement::SetAttribute(), tinyxml2::XMLElement::SetText(), and sVersion.
Referenced by OnLoadProjectFile(), OnSaveProjectFile(), and SaveOnClose().
void PackageDialog::setMainFile | ( | const wxString & | mainfile | ) |
This function can be used to insert the current mainfile to the dialog. Used by the main window, if the user clicks on "Create package".
mainfile | const wxString& |
Definition at line 774 of file packagedialog.cpp.
References IconManager::GetIconIndex(), m_fileList, m_icons, markUnsaved(), and replacePathSeparator().
Referenced by NumeReWindow::OnCreatePackage().
|
private |
Definition at line 40 of file packagedialog.hpp.
Referenced by autoDetect(), getProcedures(), loadProjectFile(), OnAddItems(), OnRemoveItems(), saveProjectFile(), and setMainFile().
|
private |
Definition at line 42 of file packagedialog.hpp.
Referenced by autoDetect(), loadProjectFile(), OnAddItems(), and setMainFile().
|
private |
Definition at line 43 of file packagedialog.hpp.
Referenced by loadProjectFile(), and saveProjectFile().
|
private |
Definition at line 39 of file packagedialog.hpp.
Referenced by getDocFile(), getInstallInfo(), getPackageName(), getPackageVersion(), includeDocs(), isPlugin(), loadProjectFile(), and saveProjectFile().
|
private |
Definition at line 41 of file packagedialog.hpp.
Referenced by followBranch(), OnAddItems(), OnLoadProjectFile(), OnSaveProjectFile(), and SaveOnClose().