Procházet zdrojové kódy

backport profile bug fix from develbranch_6 https://trac.osgeo.org/grass/changeset/39257

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39288 15284696-431f-4ddb-bdfa-cd5b030d7da7
Michael Barton před 15 roky
rodič
revize
e433e87a05
1 změnil soubory, kde provedl 11 přidání a 11 odebrání
  1. 11 11
      gui/wxpython/gui_modules/profile.py

+ 11 - 11
gui/wxpython/gui_modules/profile.py

@@ -703,15 +703,10 @@ class ProfileFrame(wx.Frame):
         Calls OptDialog class.
         """
         dlg = OptDialog(parent=self, id=wx.ID_ANY, title=_('Profile settings'))
+        btnval = dlg.ShowModal()
 
-        if dlg.ShowModal() == wx.ID_OK:
-            dlg.UpdateSettings()
-
-            self.SetGraphStyle()
-            if self.profile:
-                self.DrawPlot()
-
-        dlg.Destroy()
+        if btnval == wx.ID_SAVE or btnval == wx.ID_CANCEL:
+            dlg.Destroy()
 
     def PrintMenu(self, event):
         """
@@ -1423,13 +1418,18 @@ class OptDialog(wx.Dialog):
         fileSettings['profile'] = UserSettings.Get(group='profile')
         file = UserSettings.SaveToFile(fileSettings)
         self.parent.parent.GetLayerManager().goutput.WriteLog(_('Profile settings saved to file \'%s\'.') % file)
+        self.parent.SetGraphStyle()
+        if self.parent.profile:
+            self.parent.DrawPlot()
         self.Close()
 
     def OnApply(self, event):
-        """!Button 'Apply' pressed"""
+        """!Button 'Apply' pressed. Does not close dialog"""
         self.UpdateSettings()
-        self.Close()
-
+        self.parent.SetGraphStyle()
+        if self.parent.profile:
+            self.parent.DrawPlot()
+        
     def OnCancel(self, event):
         """!Button 'Cancel' pressed"""
         self.Close()