Kaynağa Gözat

wxGUI: don't close GroupDialog when no group selected (OnOk)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48913 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 yıl önce
ebeveyn
işleme
bdbb2977cd
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 5 3
      gui/wxpython/gui_modules/gdialogs.py

+ 5 - 3
gui/wxpython/gui_modules/gdialogs.py

@@ -1162,7 +1162,7 @@ class GroupDialog(wx.Dialog):
         if not group:
             gcmd.GMessage(parent = self,
                           message = _("No group selected."))
-            return
+            return False
         
         groups = self.GetExistGroups()
         if group in groups:
@@ -1175,14 +1175,16 @@ class GroupDialog(wx.Dialog):
             
         self.groupChanged = False
         
+        return True
+        
     def OnApply(self, event):
         """!Apply changes"""
         self.ApplyChanges(showResult = True)
         
     def OnOk(self, event):
         """!Apply changes and close dialog"""
-        self.ApplyChanges(showResult = False)
-        self.OnClose(event)
+        if self.ApplyChanges(showResult = False):
+            self.OnClose(event)
         
     def OnClose(self, event):
         """!Close dialog"""