Sfoglia il codice sorgente

pyedit:use modified to see we need to ask before replacing content

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68400 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 9 anni fa
parent
commit
b2b8c9a6a0
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      gui/wxpython/gui_core/pyedit.py

+ 1 - 3
gui/wxpython/gui_core/pyedit.py

@@ -360,8 +360,6 @@ class PyEditController(object):
         else:
             self.SaveAs()
 
-    # TODO: it should be probably used with replacing, when this gives what we
-    # want?
     def IsModified(self):
         """Check if python script has been modified"""
         return self.body.modified
@@ -425,7 +423,7 @@ class PyEditController(object):
             message = _("Replace the current content by the file content?")
         else:
             message = by_message
-        if not self.IsEmpty():
+        if not self.IsEmpty() and self.IsModified():
             dlg = wx.MessageDialog(
                 parent=self.guiparent, message=message,
                 caption=_("Replace content"),