Added open and save status messages to the status bar.
This commit is contained in:
@@ -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
|
||||
|
||||
##
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user