Move the hasProject logic into the shared class

This commit is contained in:
Veronica Berglyd Olsen
2023-08-13 19:23:32 +02:00
parent fd181b18a6
commit 8154293d92
8 changed files with 71 additions and 55 deletions
+13 -1
View File
@@ -26,6 +26,7 @@ from __future__ import annotations
import logging
from typing import TYPE_CHECKING
from pathlib import Path
if TYPE_CHECKING: # pragma: no cover
from novelwriter.guimain import GuiMain
@@ -64,6 +65,10 @@ class SharedData:
raise Exception("UserData class not properly initialised")
return self._project
@property
def hasProject(self) -> bool:
return self.project.isValid
##
# Methods
##
@@ -79,7 +84,14 @@ class SharedData:
logger.debug("SharedData instance initialised")
return
def openProject(self):
def openProject(self, path: str | Path) -> None:
return
def saveProject(self):
return
def closeProject(self, idleTime: float) -> None:
self.project.closeProject(idleTime)
return
##