BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
new project dialog window
Definition at line 24 of file NewProjectDialog.h.
Public Member Functions | |
NewProjectDialog (QWidget *parent, const QString &workingDirectory="", const QString &projectName="") | |
QString | getProjectFileName () const |
QString | getWorkingDirectory () const |
void | setWorkingDirectory (const QString &text) |
Private Slots | |
void | checkIfProjectNameIsValid (const QString &projectName) |
Checks whether project name is valid and sets warning state accordingly. There should not be the directory with such name in ProjectPath. More... | |
void | checkIfProjectPathIsValid (const QString &dirname) |
Checks whether ProjectPath is valid and sets warning state accordingly. Corresponding directory should exists. 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 |
NewProjectDialog::NewProjectDialog | ( | QWidget * | parent, |
const QString & | workingDirectory = "" , |
||
const QString & | projectName = "" |
||
) |
Definition at line 25 of file NewProjectDialog.cpp.
References checkIfProjectNameIsValid(), checkIfProjectPathIsValid(), createProjectDir(), m_browseButton, m_cancelButton, m_createButton, m_projectNameEdit, m_warningLabel, m_workDirEdit, onBrowseDirectory(), GUI::Project::Utils::projectName(), 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(), GUI::Project::Utils::projectDir(), GUI::Project::Utils::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 setValidProjectPath(), setWorkingDirectory(), and updateWarningStatus().
Referenced by NewProjectDialog(), and onBrowseDirectory().
|
privateslot |
creates directory with selected ProjectName in selected ProjectPath
Definition at line 193 of file NewProjectDialog.cpp.
References getProjectName(), getWorkingDirectory(), and m_warningLabel.
Referenced by NewProjectDialog().
QString NewProjectDialog::getProjectFileName | ( | ) | const |
Definition at line 103 of file NewProjectDialog.cpp.
References getProjectName(), getWorkingDirectory(), GUI::Project::Utils::projectDir(), and GUI::Project::Utils::projectFileExtension.
Referenced by ProjectManager::acquireProjectFileName().
|
inlineprivate |
Definition at line 42 of file NewProjectDialog.h.
References m_projectNameEdit.
Referenced by createProjectDir(), getProjectFileName(), onBrowseDirectory(), and updateWarningStatus().
QString NewProjectDialog::getWorkingDirectory | ( | ) | const |
Definition at line 93 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 111 of file NewProjectDialog.cpp.
References appSettings, checkIfProjectNameIsValid(), checkIfProjectPathIsValid(), getProjectName(), getWorkingDirectory(), and ApplicationSettings::useNativeFileDialog().
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, m_valid_projectName, and m_valid_projectPath.
Referenced by checkIfProjectNameIsValid().
|
private |
sets flags wether project path is valid and then updates color of LineEdit and warning message
Definition at line 162 of file NewProjectDialog.cpp.
References m_valid_projectPath, and m_workDirEdit.
Referenced by checkIfProjectPathIsValid().
void NewProjectDialog::setWorkingDirectory | ( | const QString & | text | ) |
Definition at line 98 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 171 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 50 of file NewProjectDialog.h.
Referenced by NewProjectDialog().
|
private |
Definition at line 52 of file NewProjectDialog.h.
Referenced by NewProjectDialog().
|
private |
Definition at line 53 of file NewProjectDialog.h.
Referenced by NewProjectDialog(), and updateWarningStatus().
|
private |
Definition at line 48 of file NewProjectDialog.h.
Referenced by NewProjectDialog(), getProjectName(), and setValidProjectName().
|
private |
Definition at line 55 of file NewProjectDialog.h.
Referenced by setValidProjectName(), and updateWarningStatus().
|
private |
Definition at line 56 of file NewProjectDialog.h.
Referenced by setValidProjectName(), setValidProjectPath(), and updateWarningStatus().
|
private |
Definition at line 51 of file NewProjectDialog.h.
Referenced by NewProjectDialog(), createProjectDir(), and updateWarningStatus().
|
private |
Definition at line 49 of file NewProjectDialog.h.
Referenced by NewProjectDialog(), getWorkingDirectory(), setValidProjectPath(), and setWorkingDirectory().