Преглед изворни кода

wxGUI: close dialog on finish by default

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44668 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa пре 14 година
родитељ
комит
6601da6a38

+ 4 - 2
gui/wxpython/gui_modules/goutput.py

@@ -809,8 +809,10 @@ class GMConsole(wx.SplitterWindow):
             
             if hasattr(dialog, "get_dcmd") and \
                     dialog.get_dcmd is None and \
-                    dialog.closebox.IsChecked():
-                time.sleep(1)
+                    dialog.closebox.IsChecked() and \
+                    (event.returncode == 0 or event.aborted):
+                self.cmd_output.Update()
+                time.sleep(2)
                 dialog.Close()
         
     def OnProcessPendingOutputWindowEvents(self, event):

+ 2 - 0
gui/wxpython/gui_modules/menuform.py

@@ -848,6 +848,8 @@ class mainFrame(wx.Frame):
             self.closebox = wx.CheckBox(parent = self.panel,
                                         label = _('Close dialog on finish'), style = wx.NO_BORDER)
             self.closebox.SetValue(UserSettings.Get(group = 'cmd', key = 'closeDlg', subkey = 'enabled'))
+            self.closebox.SetToolTipString(_("Close dialog when command is successfully finished. "
+                                             "Change this settings in Preferences dialog ('Command' tab)."))
             guisizer.Add(item = self.closebox, proportion = 0,
                          flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                          border = 5)

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

@@ -181,7 +181,7 @@ class Settings:
                     'enabled' : False
                     },
                 'closeDlg' : {
-                    'enabled' : False
+                    'enabled' : True
                     },
                 'verbosity' : {
                     'selection' : 'grassenv'
@@ -1370,7 +1370,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         row += 1
         # close
         close = wx.CheckBox(parent=panel, id=wx.ID_ANY,
-                            label=_("Close dialog on finish"),
+                            label=_("Close dialog when command is successfully finished"),
                             name="IsChecked")
         close.SetValue(self.settings.Get(group='cmd', key='closeDlg', subkey='enabled'))
         self.winId['cmd:closeDlg:enabled'] = close.GetId()