[GRASS-SVN] r54958 - grass/trunk/gui/wxpython/lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Feb 6 09:10:13 PST 2013
Author: martinl
Date: 2013-02-06 09:10:13 -0800 (Wed, 06 Feb 2013)
New Revision: 54958
Modified:
grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI/layer manager: do not show workspace extension in the title
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2013-02-06 17:00:33 UTC (rev 54957)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2013-02-06 17:10:13 UTC (rev 54958)
@@ -87,33 +87,32 @@
self.parent = parent
self.baseTitle = title
self.iconsize = (16, 16)
+
+ self.displayIndex = 0 # index value for map displays and layer trees
+ self.currentPage = None # currently selected page for layer tree notebook
+ self.currentPageNum = None # currently selected page number for layer tree notebook
+ self.workspaceFile = workspace # workspace file
+ self.workspaceChanged = False # track changes in workspace
+ self.gcpmanagement = None # reference to GCP class or None
wx.Frame.__init__(self, parent = parent, id = id, size = size,
style = style, **kwargs)
-
- self.SetTitle(self.baseTitle)
+ self._setTitle()
self.SetName("LayerManager")
-
+
self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
-
+
self._giface = LayerManagerGrassInterface(self)
-
+
self._auimgr = wx.aui.AuiManager(self)
-
- # initialize variables
- self.displayIndex = 0 # index value for map displays and layer trees
- self.currentPage = None # currently selected page for layer tree notebook
- self.currentPageNum = None # currently selected page number for layer tree notebook
- self.workspaceFile = workspace # workspace file
- self.workspaceChanged = False # track changes in workspace
- self.gcpmanagement = None # reference to GCP class or None
+
# list of open dialogs
self.dialogs = dict()
self.dialogs['preferences'] = None
self.dialogs['atm'] = list()
- # creating widgets
+ # create widgets
self._createMenuBar()
self.statusbar = self.CreateStatusBar(number = 1)
self.notebook = self._createNoteBook()
@@ -199,7 +198,7 @@
if self.workspaceFile:
# load given workspace file
if self.LoadWorkspaceFile(self.workspaceFile):
- self.SetTitle(self.baseTitle + " - " + os.path.basename(self.workspaceFile))
+ self._setTitle()
else:
self.workspaceFile = None
else:
@@ -223,6 +222,13 @@
if self.currentPage:
self.GetMapDisplay().Raise()
wx.CallAfter(self.Raise)
+
+ def _setTitle(self):
+ """!Set frame title"""
+ if self.workspaceFile:
+ self.SetTitle(self.baseTitle + " - " + os.path.splitext(os.path.basename(self.workspaceFile))[0])
+ else:
+ self.SetTitle(self.baseTitle)
def _createMenuBar(self):
"""!Creates menu bar"""
@@ -362,7 +368,7 @@
self.workspaceChanged = True
if self.workspaceFile:
- self.SetTitle(self.baseTitle + " - " + os.path.basename(self.workspaceFile) + '*')
+ self._setTitle()
def OnLocationWizard(self, event):
"""!Launch location wizard"""
@@ -1033,7 +1039,7 @@
# no workspace file loaded
self.workspaceFile = None
self.workspaceChanged = False
- self.SetTitle(self.baseTitle)
+ self._setTitle()
def OnWorkspaceOpen(self, event = None):
"""!Open file with workspace definition"""
@@ -1055,7 +1061,7 @@
self.LoadWorkspaceFile(filename)
self.workspaceFile = filename
- self.SetTitle(self.baseTitle + " - " + os.path.basename(self.workspaceFile))
+ self._setTitle()
def LoadWorkspaceFile(self, filename):
"""!Load layer tree definition stored in GRASS Workspace XML file (gxw)
@@ -1251,7 +1257,7 @@
self.SaveToWorkspaceFile(filename)
self.workspaceFile = filename
- self.SetTitle(self.baseTitle + " - " + os.path.basename(self.workspaceFile))
+ self._setTitle()
def OnWorkspaceSave(self, event = None):
"""!Save file with workspace definition"""
@@ -1265,7 +1271,7 @@
else:
Debug.msg(4, "GMFrame.OnWorkspaceSave(): filename=%s" % self.workspaceFile)
self.SaveToWorkspaceFile(self.workspaceFile)
- self.SetTitle(self.baseTitle + " - " + os.path.basename(self.workspaceFile))
+ self._setTitle()
self.workspaceChanged = False
else:
self.OnWorkspaceSaveAs()
@@ -1308,7 +1314,7 @@
self.OnDisplayCloseAll()
self.workspaceFile = None
self.workspaceChanged = False
- self.SetTitle(self.baseTitle)
+ self._setTitle()
self.displayIndex = 0
self.currentPage = None
More information about the grass-commit
mailing list