Browse Source

wxGUI/vdigit: fix display attributes (update https://trac.osgeo.org/grass/changeset/33249)
close dialog properly
(merge from devbr6, https://trac.osgeo.org/grass/changeset/33251)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33252 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 years ago
parent
commit
a7468baaae

+ 1 - 1
gui/wxpython/gui_modules/goutput.py

@@ -193,7 +193,7 @@ class GMConsole(wx.Panel):
         """
         if Debug.get_level() == 0:
             # don't redirect when debugging is enabled
-            # sys.stdout = self.cmd_stdout
+            sys.stdout = self.cmd_stdout
             sys.stderr = self.cmd_stderr
             
             return True

+ 5 - 5
gui/wxpython/gui_modules/mapdisp.py

@@ -1199,9 +1199,9 @@ class BufferedWindow(MapWindow, wx.Window):
                             if digitClass.driver.SelectLineByPoint(coords,
                                                                    digitClass.GetSelectType()) is not None:
                                 self.parent.dialogs['attributes'] = dbm.DisplayAttributesDialog(parent=self, map=map,
-                                                                                           cats=digitClass.GetLineCats(),
-                                                                                           line=digitClass.driver.GetSelected()[0],
-                                                                                           action="update")
+                                                                                                cats=digitClass.GetLineCats(),
+                                                                                                line=digitClass.driver.GetSelected()[0],
+                                                                                                action="update")
 
                     else:
                         # update currently open dialog
@@ -1218,13 +1218,13 @@ class BufferedWindow(MapWindow, wx.Window):
                                 line = digitClass.driver.GetSelected()[0]
                             # upgrade dialog
                             self.parent.dialogs['attributes'].UpdateDialog(cats=digitClass.GetLineCats(),
-                                                                      line=line)
+                                                                           line=line)
 
                     if self.parent.dialogs['attributes']:
                         line = self.parent.dialogs['attributes'].GetLine()
                         if self.parent.dialogs['attributes'].mapDBInfo and line:
                             # highlight feature & re-draw map
-                            digitClass.driver.SetSelected([line])
+                            digitClass.driver.SetSelected(line)
                             if not self.parent.dialogs['attributes'].IsShown():
                                 self.parent.dialogs['attributes'].Show()
                         else:

+ 7 - 7
gui/wxpython/gui_modules/toolbars.py

@@ -592,13 +592,7 @@ class VDigitToolbar(AbstractToolbar):
         # close dialogs if still open
         if self.settingsDialog:
             self.settingsDialog.OnCancel(None)
-
-        if self.parent.dialogs['category']:
-            self.parent.dialogs['category'].OnCancel(None)
-
-        if self.parent.dialogs['attributes']:
-            self.parent.dialogs['attributes'].OnCancel(None)
-
+        
         # disable the toolbar
         self.parent.RemoveToolbar ("vdigit")
 
@@ -1097,6 +1091,12 @@ class VDigitToolbar(AbstractToolbar):
         # disable pseudodc for vector map layer
         self.parent.MapWindow.pdcVector = None
         self.parent.digit.driver.SetDevice(None)
+
+        # close dialogs
+        for dialog in ('attributes', 'category'):
+            if self.parent.dialogs[dialog]:
+                self.parent.dialogs[dialog].Close()
+                self.parent.dialogs[dialog] = None
         
         self.parent.digit.__del__() # FIXME: destructor is not called here (del)
         self.parent.digit = None