Remove max folder depth restriction, and simplify adding folders and files in the tree

This commit is contained in:
Veronica Berglyd Olsen
2022-04-17 14:44:11 +02:00
parent ebee9ff791
commit 4cfbbf4c68
14 changed files with 87 additions and 132 deletions
-11
View File
@@ -34,7 +34,6 @@ from PyQt5.QtWidgets import (
from novelwriter.core import NWDoc
from novelwriter.enum import nwAlert, nwItemType
from novelwriter.constants import nwConst
from novelwriter.gui.custom import QHelpLabel
logger = logging.getLogger(__name__)
@@ -160,16 +159,6 @@ class GuiDocSplit(QDialog):
), nwAlert.ERROR)
return False
# Check that another folder can be created
parTree = self.theProject.projTree.getItemPath(srcItem.itemParent)
if len(parTree) >= nwConst.MAX_DEPTH - 1:
self.theParent.makeAlert(self.tr(
"Cannot add new folder for the document split. "
"Maximum folder depth has been reached. "
"Please move the file to another level in the project tree."
), nwAlert.ERROR)
return False
msgYes = self.theParent.askQuestion(
self.tr("Split Document"),
"{0}<br><br>{1}".format(