Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Add projects outside project root to dropdowns

manongjohn8138f88b4643
diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cpp
index d861571d7..1e907cce9 100644
--- a/toonz/sources/toonz/projectpopup.cpp
+++ b/toonz/sources/toonz/projectpopup.cpp
@@ -368,7 +368,14 @@ void ProjectPopup::updateChooseProjectCombo() {
}
}
}
-
+ // Add in project of current project if outside known Project root folders
+ TProjectP currentProject = TProjectManager::instance()->getCurrentProject();
+ TFilePath currentProjectFP = currentProject->getProjectPath();
+ if (m_projectPaths.indexOf(currentProjectFP) == -1) {
+ m_projectPaths.push_back(currentProjectFP);
+ m_chooseProjectCombo->addItem(
+ QString::fromStdString(currentProject->getName().getName()));
+ }
for (int i = 0; i < m_projectPaths.size(); i++) {
if (TProjectManager::instance()->getCurrentProjectPath() ==
m_projectPaths[i]) {
diff --git a/toonz/sources/toonz/startuppopup.cpp b/toonz/sources/toonz/startuppopup.cpp
index 967bd1225..262277bd8 100644
--- a/toonz/sources/toonz/startuppopup.cpp
+++ b/toonz/sources/toonz/startuppopup.cpp
@@ -527,6 +527,14 @@ void StartupPopup::updateProjectCB() {
}
}
}
+ // Add in project of current project if outside known Project root folders
+ TProjectP currentProject = TProjectManager::instance()->getCurrentProject();
+ TFilePath currentProjectFP = currentProject->getProjectPath();
+ if (m_projectPaths.indexOf(currentProjectFP) == -1) {
+ m_projectPaths.push_back(currentProjectFP);
+ m_projectsCB->addItem(
+ QString::fromStdString(currentProject->getName().getName()));
+ }
int i;
for (i = 0; i < m_projectPaths.size(); i++) {
if (TProjectManager::instance()->getCurrentProjectPath() ==
diff --git a/toonz/sources/toonzlib/toonzscene.cpp b/toonz/sources/toonzlib/toonzscene.cpp
index b0e43ac81..5644db31f 100644
--- a/toonz/sources/toonzlib/toonzscene.cpp
+++ b/toonz/sources/toonzlib/toonzscene.cpp
@@ -1290,7 +1290,7 @@ TXshLevel *ToonzScene::loadLevel(const TFilePath &actualPath,
TFilePath ToonzScene::decodeFilePath(const TFilePath &path) const {
TProject *project = getProject();
- bool projectIsEmpty = false;
+ bool projectIsEmpty = project->getFolderCount() ? false : true;
TFilePath fp = path;
std::wstring head;