mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Bug fixed: clear project functionality implemented
This commit is contained in:
+17
-3
@@ -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
@@ -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
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
std::vector<Mapping::ptr> getVisibleMappings() const;
|
||||
|
||||
void clearProject();
|
||||
void clearAll();
|
||||
};
|
||||
|
||||
#endif /* MAPPINGMANAGER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user