BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
new project dialog window More...
Public Types | |
enum | Mode { CREATE , SAVE } |
Public Member Functions | |
NewProjectDialog (QWidget *parent, Mode mode, const QString &workingDirectory="", const QString &projectName="") | |
QString | getProjectFileName () const |
QString | getWorkingDirectory () const |
void | setProjectName (const QString &text) |
void | setWorkingDirectory (const QString &text) |
Private Slots | |
void | checkIfProjectNameIsValid (const QString &projectName) |
Checks whether project name is valid and sets warning state accordingly. More... | |
void | checkIfProjectPathIsValid (const QString &dirname) |
Checks whether ProjectPath is valid and sets warning state accordingly. More... | |
void | createProjectDir () |
creates directory with selected ProjectName in selected ProjectPath More... | |
void | onBrowseDirectory () |
calls directory selection dialog More... | |
Private Member Functions | |
QString | getProjectName () const |
void | setValidProjectName (bool status) |
sets flags whether project name is valid and then updates color of LineEdit and warning message More... | |
void | setValidProjectPath (bool status) |
sets flags wether project path is valid and then updates color of LineEdit and warning message More... | |
void | updateWarningStatus () |
updates warning label depending on validity of project name and path More... | |
Private Attributes | |
QPushButton * | m_browseButton |
QPushButton * | m_cancelButton |
QPushButton * | m_createButton |
QLineEdit * | m_projectNameEdit |
bool | m_valid_projectName |
bool | m_valid_projectPath |
QLabel * | m_warningLabel |
QLineEdit * | m_workDirEdit |
new project dialog window
Definition at line 24 of file newprojectdialog.h.
NewProjectDialog::NewProjectDialog | ( | QWidget * | parent, |
Mode | mode, | ||
const QString & | workingDirectory = "" , |
||
const QString & | projectName = "" |
||
) |
Definition at line 23 of file newprojectdialog.cpp.
References checkIfProjectNameIsValid(), checkIfProjectPathIsValid(), CREATE, createProjectDir(), m_browseButton, m_cancelButton, m_createButton, m_projectNameEdit, m_warningLabel, m_workDirEdit, onBrowseDirectory(), ProjectUtils::projectName(), setProjectName(), and setWorkingDirectory().
|
privateslot |
Checks whether project name is valid and sets warning state accordingly.
There should not be the directory with such name in ProjectPath
Definition at line 143 of file newprojectdialog.cpp.
References getWorkingDirectory(), ProjectUtils::projectDir(), ProjectUtils::projectName(), setValidProjectName(), and updateWarningStatus().
Referenced by NewProjectDialog(), and onBrowseDirectory().
|
privateslot |
Checks whether ProjectPath is valid and sets warning state accordingly.
Corresponding directory should exists.
Definition at line 130 of file newprojectdialog.cpp.
References ProjectUtils::exists(), setValidProjectPath(), setWorkingDirectory(), and updateWarningStatus().
Referenced by NewProjectDialog(), and onBrowseDirectory().
|
privateslot |
creates directory with selected ProjectName in selected ProjectPath
Definition at line 201 of file newprojectdialog.cpp.
References getProjectName(), getWorkingDirectory(), and m_warningLabel.
Referenced by NewProjectDialog().
QString NewProjectDialog::getProjectFileName | ( | ) | const |
Definition at line 107 of file newprojectdialog.cpp.
References getProjectName(), getWorkingDirectory(), ProjectUtils::projectDir(), and ProjectDocument::projectFileExtension().
Referenced by ProjectManager::acquireProjectFileName().
|
inlineprivate |
Definition at line 46 of file newprojectdialog.h.
References m_projectNameEdit.
Referenced by createProjectDir(), getProjectFileName(), onBrowseDirectory(), and updateWarningStatus().
QString NewProjectDialog::getWorkingDirectory | ( | ) | const |
Definition at line 92 of file newprojectdialog.cpp.
References m_workDirEdit.
Referenced by ProjectManager::acquireProjectFileName(), checkIfProjectNameIsValid(), createProjectDir(), getProjectFileName(), onBrowseDirectory(), and updateWarningStatus().
|
privateslot |
calls directory selection dialog
Definition at line 116 of file newprojectdialog.cpp.
References checkIfProjectNameIsValid(), checkIfProjectPathIsValid(), getProjectName(), and getWorkingDirectory().
Referenced by NewProjectDialog().
void NewProjectDialog::setProjectName | ( | const QString & | text | ) |
Definition at line 102 of file newprojectdialog.cpp.
References m_projectNameEdit.
Referenced by NewProjectDialog().
|
private |
sets flags whether project name is valid and then updates color of LineEdit and warning message
Definition at line 152 of file newprojectdialog.cpp.
References m_projectNameEdit, and m_valid_projectName.
Referenced by checkIfProjectNameIsValid().
|
private |
sets flags wether project path is valid and then updates color of LineEdit and warning message
Definition at line 166 of file newprojectdialog.cpp.
References m_valid_projectPath, and m_workDirEdit.
Referenced by checkIfProjectPathIsValid().
void NewProjectDialog::setWorkingDirectory | ( | const QString & | text | ) |
Definition at line 97 of file newprojectdialog.cpp.
References m_workDirEdit.
Referenced by NewProjectDialog(), and checkIfProjectPathIsValid().
|
private |
updates warning label depending on validity of project name and path
Definition at line 179 of file newprojectdialog.cpp.
References getProjectName(), getWorkingDirectory(), m_createButton, m_valid_projectName, m_valid_projectPath, and m_warningLabel.
Referenced by checkIfProjectNameIsValid(), and checkIfProjectPathIsValid().
|
private |
Definition at line 54 of file newprojectdialog.h.
Referenced by NewProjectDialog().
|
private |
Definition at line 56 of file newprojectdialog.h.
Referenced by NewProjectDialog().
|
private |
Definition at line 57 of file newprojectdialog.h.
Referenced by NewProjectDialog(), and updateWarningStatus().
|
private |
Definition at line 52 of file newprojectdialog.h.
Referenced by NewProjectDialog(), getProjectName(), setProjectName(), and setValidProjectName().
|
private |
Definition at line 59 of file newprojectdialog.h.
Referenced by setValidProjectName(), and updateWarningStatus().
|
private |
Definition at line 60 of file newprojectdialog.h.
Referenced by setValidProjectPath(), and updateWarningStatus().
|
private |
Definition at line 55 of file newprojectdialog.h.
Referenced by NewProjectDialog(), createProjectDir(), and updateWarningStatus().
|
private |
Definition at line 53 of file newprojectdialog.h.
Referenced by NewProjectDialog(), getWorkingDirectory(), setValidProjectPath(), and setWorkingDirectory().