setting frame title now
This commit is contained in:
parent
54fe2d800a
commit
827585febc
|
|
@ -157,6 +157,14 @@ class LevelEditorBase(DirectObject):
|
|||
self.loadSettings()
|
||||
self.reset()
|
||||
|
||||
def setTitleWithFilename(self, filename=""):
|
||||
import pdb;pdb.set_trace()
|
||||
title = self.ui.appname
|
||||
if filename != "":
|
||||
filenameshort = os.path.basename(filename)
|
||||
title = title + " (%s)"%filenameshort
|
||||
self.ui.SetLabel(title)
|
||||
|
||||
def removeNodePathHook(self, nodePath):
|
||||
if nodePath is None:
|
||||
return
|
||||
|
|
@ -283,6 +291,7 @@ class LevelEditorBase(DirectObject):
|
|||
self.resetOrthoCam(self.ui.frontView)
|
||||
self.resetOrthoCam(self.ui.leftView)
|
||||
self.fNeedToSave = False
|
||||
self.setTitleWithFilename()
|
||||
|
||||
def resetOrthoCam(self, view):
|
||||
base.direct.drList[base.camList.index(NodePath(view.camNode))].orthoFactor = 0.1
|
||||
|
|
|
|||
|
|
@ -444,6 +444,7 @@ class LevelEditorUIBase(WxAppShell):
|
|||
dialog = wx.FileDialog(None, "Choose a file", os.getcwd(), "", "*.py", wx.OPEN)
|
||||
if dialog.ShowModal() == wx.ID_OK:
|
||||
self.editor.load(dialog.GetPath())
|
||||
self.editor.setTitleWithFilename(dialog.GetPath())
|
||||
dialog.Destroy()
|
||||
|
||||
def onSave(self, evt=None):
|
||||
|
|
@ -458,6 +459,7 @@ class LevelEditorUIBase(WxAppShell):
|
|||
result = True
|
||||
if dialog.ShowModal() == wx.ID_OK:
|
||||
self.editor.saveAs(dialog.GetPath())
|
||||
self.editor.setTitleWithFilename(dialog.GetPath())
|
||||
else:
|
||||
result = False
|
||||
dialog.Destroy()
|
||||
|
|
|
|||
Loading…
Reference in New Issue