Pārlūkot izejas kodu

wxGUI: generate 'close' checkbox only for commands which have some output

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44830 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 gadi atpakaļ
vecāks
revīzija
d63da4abd6

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

@@ -809,6 +809,7 @@ class GMConsole(wx.SplitterWindow):
             
             if hasattr(dialog, "get_dcmd") and \
                     dialog.get_dcmd is None and \
+                    hasattr(dialog, "closebox") and \
                     dialog.closebox.IsChecked() and \
                     (event.returncode == 0 or event.aborted):
                 self.cmd_output.Update()

+ 6 - 1
gui/wxpython/gui_modules/menuform.py

@@ -855,7 +855,12 @@ class mainFrame(wx.Frame):
                              flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                              border = 5)
         
-        if self.get_dcmd is None:
+        closeBox = False
+        for p in self.task.params:
+            if p.get('age', 'old') ==  'new':
+                closeBox = True
+        
+        if self.get_dcmd is None and closeBox:
             # close dialog when command is terminated
             self.closebox = wx.CheckBox(parent = self.panel,
                                         label = _('Close dialog on finish'), style = wx.NO_BORDER)