Kaynağa Gözat

wxGUI/wxIClass: fixed starting wxiclass, fixed trying to use non-existing undo tool in wxiclass

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50176 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 yıl önce
ebeveyn
işleme
69eb445ed7
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      gui/wxpython/vdigit/toolbars.py

+ 6 - 1
gui/wxpython/vdigit/toolbars.py

@@ -24,6 +24,7 @@ from core.debug         import Debug
 from core.settings      import UserSettings
 from core.gcmd          import GError
 from icons.icon         import MetaIcon
+from iclass.digit       import IClassVDigit
 
 class VDigitToolbar(BaseToolbar):
     """!Toolbar for digitization
@@ -376,6 +377,10 @@ class VDigitToolbar(BaseToolbar):
         
         @param enable False for disable
         """
+        # iclass has no undo, we need to check it
+        if self.FindById(self.undo) is None:
+            return
+        
         if enable:
             if self.GetToolEnabled(self.undo) is False:
                 self.EnableTool(self.undo, True)
@@ -733,7 +738,7 @@ class VDigitToolbar(BaseToolbar):
         if 'map' in self.parent.toolbars:
             self.parent.toolbars['map'].combo.SetValue (_('Digitize'))
         
-        if self.digitClass != "iclass.digit.IClassWindow":
+        if self.digitClass != IClassVDigit:
             lmgr = self.parent.GetLayerManager()
             if lmgr:
                 lmgr.toolbars['tools'].Enable('vdigit', enable = False)