Bläddra i källkod

wxGUI: attempt to fix https://trac.osgeo.org/grass/ticket/1700

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52798 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 år sedan
förälder
incheckning
6e223830fe

+ 9 - 9
gui/wxpython/gui_core/dialogs.py

@@ -2653,13 +2653,13 @@ class SymbolDialog(wx.Dialog):
         
         self.infoLabel.SetLabel(event.name)
         
-    def GetSelectedSymbol(self, fullPath = False):
-        """!Returns currently selected symbol.
-        
-        @param fullPath true to return absolute path to symbol,
-        otherwise returns e.g. 'basic/x'
+    def GetSelectedSymbolName(self):
+        """!Returns currently selected symbol name (e.g. 'basic/x').
+        """ 
+        # separator must be '/' and not dependent on OS
+        return self.selectedDir + '/' + self.selected
+
+    def GetSelectedSymbolPath(self):
+        """!Returns currently selected symbol full path.
         """
-        if fullPath:
-            return os.path.join(self.symbolPath, self.selectedDir, self.selected)
-            
-        return os.path.join(self.selectedDir, self.selected)
+        return os.path.join(self.symbolPath, self.selectedDir, self.selected)

+ 2 - 2
gui/wxpython/gui_core/forms.py

@@ -1890,8 +1890,8 @@ class CmdPanel(wx.Panel):
                 dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
                                    currentSymbol = p['value'])
                 if dlg.ShowModal() == wx.ID_OK:
-                    img = dlg.GetSelectedSymbol(fullPath = True)
-                    p['value'] = dlg.GetSelectedSymbol(fullPath = False)
+                    img = dlg.GetSelectedSymbolPath()
+                    p['value'] = dlg.GetSelectedSymbolName()
                     
                     bitmapButton = wx.FindWindowById(p['wxId'][0])
                     label = wx.FindWindowById(p['wxId'][1])

+ 2 - 2
gui/wxpython/gui_core/preferences.py

@@ -1447,8 +1447,8 @@ class PreferencesDialog(PreferencesBaseDialog):
         dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
                            currentSymbol = label.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
-            img = dlg.GetSelectedSymbol(fullPath = True)
-            label.SetLabel(dlg.GetSelectedSymbol(fullPath = False))
+            img = dlg.GetSelectedSymbolPath()
+            label.SetLabel(dlg.GetSelectedSymbolName())
             bb.SetBitmapLabel(wx.Bitmap(img + '.png'))
 
     def OnEnableWheelZoom(self, event):

+ 4 - 4
gui/wxpython/psmap/dialogs.py

@@ -2260,8 +2260,8 @@ class VPropertiesDialog(PsmapDialog):
         dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
                            currentSymbol = self.symbolName.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
-            img = dlg.GetSelectedSymbol(fullPath = True)
-            name = dlg.GetSelectedSymbol(fullPath = False)
+            img = dlg.GetSelectedSymbolPath()
+            name = dlg.GetSelectedSymbolName()
             self.symbolButton.SetBitmapLabel(wx.Bitmap(img + '.png'))
             self.symbolName.SetLabel(name)
             
@@ -4714,8 +4714,8 @@ class PointDialog(PsmapDialog):
         dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
                            currentSymbol = self.symbolLabel.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
-            img = dlg.GetSelectedSymbol(fullPath = True)
-            name = dlg.GetSelectedSymbol(fullPath = False)
+            img = dlg.GetSelectedSymbolPath()
+            name = dlg.GetSelectedSymbolName()
             self.symbolButton.SetBitmapLabel(wx.Bitmap(img + '.png'))
             self.symbolLabel.SetLabel(name)