diff --git a/nw/gui/docdetails.py b/nw/gui/docdetails.py index 2bd9e9ef..9851d590 100644 --- a/nw/gui/docdetails.py +++ b/nw/gui/docdetails.py @@ -29,8 +29,8 @@ class GuiDocDetails(QFrame): C_FLAGS = 2 C_HANDLE = 3 - def __init__(self, theProject): - QFrame.__init__(self) + def __init__(self, theParent, theProject): + QFrame.__init__(self, theParent) logger.debug("Initialising DocDetails ...") self.mainConf = nw.CONFIG diff --git a/nw/gui/doctree.py b/nw/gui/doctree.py index 1edc84c7..0c4b12ab 100644 --- a/nw/gui/doctree.py +++ b/nw/gui/doctree.py @@ -62,6 +62,10 @@ class GuiDocTree(QTreeWidget): self.setDragEnabled(True) self.setDragDropMode(QAbstractItemView.InternalMove) + # Set Multiple Selection by CTRL + self.setSelectionMode(QAbstractItemView.ExtendedSelection) + self.setSelectionBehavior(QAbstractItemView.SelectRows) + for colN in range(len(self.mainConf.treeColWidth)): self.setColumnWidth(colN,self.mainConf.treeColWidth[colN]) diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index 9c11c600..f6a2aba9 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -15,13 +15,14 @@ import nw from os import path from PyQt5.QtWidgets import QStatusBar, QLabel, QFrame +from PyQt5.QtGui import QIcon logger = logging.getLogger(__name__) class GuiMainStatus(QStatusBar): - def __init__(self): - QStatusBar.__init__(self) + def __init__(self, theParent): + QStatusBar.__init__(self, theParent) logger.debug("Initialising GuiMainStatus ...") @@ -41,6 +42,12 @@ class GuiMainStatus(QStatusBar): self.setCounts(0,0,0) self.setDocHandleCount(None) + self.setSizeGripEnabled(True) + + return + + def setStatus(self, theMessage, timeOut=10.0): + self.showMessage(theMessage, int(timeOut*1000)) return def setCounts(self, cC, wC, pC): diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 96ae0fc5..cf38e902 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -39,7 +39,7 @@ class GuiMain(QMainWindow): logger.debug("Initialising GUI ...") self.mainConf = nw.CONFIG - self.theProject = NWProject() + self.theProject = NWProject(self) self.theDocument = NWDoc(self.theProject, self) self.resize(*self.mainConf.winGeometry) @@ -48,10 +48,10 @@ class GuiMain(QMainWindow): # Main GUI Elements self.docEditor = GuiDocEditor(self) - self.docDetails = GuiDocDetails(self.theProject) + self.docDetails = GuiDocDetails(self, self.theProject) self.treeView = GuiDocTree(self, self.theProject) self.mainMenu = GuiMainMenu(self, self.theProject) - self.statusBar = GuiMainStatus() + self.statusBar = GuiMainStatus(self) # Assemble Main Window self.stackPane = QStackedWidget() diff --git a/nw/project/document.py b/nw/project/document.py index d2fbd62b..483a3377 100644 --- a/nw/project/document.py +++ b/nw/project/document.py @@ -46,12 +46,14 @@ class NWDoc(): if path.isfile(docPath): with open(docPath,mode="r") as inFile: - return inFile.read() + theDoc = inFile.read() else: logger.debug("The requested document does not exist.") return "" - return None + self.theParent.statusBar.setStatus("Opened Document: %s" % self.theItem.itemName) + + return theDoc def saveDocument(self, docText): @@ -78,6 +80,8 @@ class NWDoc(): if path.isfile(docTemp): unlink(docTemp) + self.theParent.statusBar.setStatus("Saved Document: %s" % self.theItem.itemName) + return True ## diff --git a/nw/project/project.py b/nw/project/project.py index fa92ca02..91ddd01e 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -28,10 +28,11 @@ logger = logging.getLogger(__name__) class NWProject(): - def __init__(self): + def __init__(self, theParent): # Internal self.mainConf = nw.CONFIG + self.theParent = theParent # Project Settings self.projTree = None @@ -182,6 +183,7 @@ class NWProject(): self._makeStatusIcons() self.mainConf.setRecent(self.projPath) + self.theParent.statusBar.setStatus("Opened Project: %s" % self.projName) self._scanProjectFolder() @@ -242,6 +244,7 @@ class NWProject(): return False self.mainConf.setRecent(self.projPath) + self.theParent.statusBar.setStatus("Saved Project: %s" % self.projName) return True