Commit 85d48f81 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Renaming method to something more explicit

Adding doc while at it.
parent f1fda8e6
......@@ -203,7 +203,7 @@ void MainWindow::on_actionSave_As_triggered()
void MainWindow::on_actionLoad_Project_triggered()
{
ProjectManager* pm = ProjectManager::getInstance();
pm->loadProject( pm->loadProjectFile() );
pm->loadProject( pm->acquireProjectFileName() );
}
void MainWindow::createStatusBar()
......
......@@ -128,7 +128,7 @@ void WelcomePage::loadRecentsProjects()
void WelcomePage::loadProject()
{
ProjectManager* pm = ProjectManager::getInstance();
QString projectPath = pm->loadProjectFile();
QString projectPath = pm->acquireProjectFileName();
if ( projectPath.isEmpty() ) return;
......
......@@ -134,7 +134,7 @@ void ProjectManager::parseProjectNode( const QDomElement &node )
void ProjectManager::loadProject( const QString& fileName )
{
if ( fileName.length() == 0 )
if ( fileName.isEmpty() == true )
return;
if ( closeProject() == false )
......@@ -166,7 +166,7 @@ void ProjectManager::loadProject( const QString& fileName )
SettingsManager::getInstance()->loadSettings( "project", root.firstChildElement( "project" ) );
}
QString ProjectManager::loadProjectFile()
QString ProjectManager::acquireProjectFileName()
{
QString fileName =
QFileDialog::getOpenFileName( NULL, "Enter the output file name",
......
......@@ -42,10 +42,22 @@ public:
void loadProject( const QString& fileName );
void newProject( const QString& projectName );
QString loadProjectFile();
/**
* \brief Ask the user for the project file she wants to load.
*
* \return The project to load.
*/
QString acquireProjectFileName();
void saveProject( bool saveAs = false );
bool needSave() const;
QStringList recentsProjects() const;
/**
* \brief Ask the project manager to close current project.
*
* This can fail, as the user will be asked if he wants to save the current project.
* If she selects discard, the project closing procedure is aborted.
* \return true if the project has been closed. false otherwise.
*/
bool closeProject();
bool askForSaveIfModified();
bool loadEmergencyBackup();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment