Bug fixed: clear project functionality implemented

This commit is contained in:
Tats
2014-01-12 04:15:04 -05:00
parent c4889055bf
commit b2ac8e9423
3 changed files with 23 additions and 7 deletions
+17 -3
View File
@@ -286,8 +286,20 @@ void MainWindow::updateStatusBar()
bool MainWindow::clearProject()
{
// TODO: implement (possibly preferably iteratively calling remove() methods on paints and mappings
// once they will be made available).
// Close property panel.
propertyPanel->close();
// Empty list widgets.
mappingList->clear();
paintList->clear();
// Clear list of mappers.
mappers.clear();
// Clear model.
mappingManager->clearAll();
return true;
}
uid MainWindow::createImagePaint(uid paintId, QString uri, float x, float y)
@@ -709,6 +721,7 @@ bool MainWindow::loadFile(const QString &fileName)
// Clear current project.
clearProject();
// Read new project
ProjectReader reader(this);
if (! reader.readFile(&file))
{
@@ -722,6 +735,7 @@ bool MainWindow::loadFile(const QString &fileName)
statusBar()->showMessage(tr("File loaded"), 2000);
setCurrentFile(fileName);
}
return true;
}
@@ -866,7 +880,7 @@ void MainWindow::addMappingItem(uint mappingId)
void MainWindow::clearWindow()
{
// TODO: implement clearWindow()
clearProject();
}
void MainWindow::updateAll()
+5 -3
View File
@@ -102,8 +102,10 @@ void MappingManager::reorderMappings(std::vector<uid> mappingIds)
//{
//}
void MappingManager::clearProject()
void MappingManager::clearAll()
{
std::cout << "TODO: implement MappingManager::clearProject() !!!" << std::endl;
// We also need to update the GUI accordingly!
paintVector.clear();
mappingVector.clear();
paintMap.clear();
mappingMap.clear();
}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
std::vector<Mapping::ptr> getVisibleMappings() const;
void clearProject();
void clearAll();
};
#endif /* MAPPINGMANAGER_H_ */