[GRASS-SVN] r39296 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 26 18:12:28 EDT 2009


Author: cmbarton
Date: 2009-09-26 18:12:27 -0400 (Sat, 26 Sep 2009)
New Revision: 39296

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/profile.py
Log:
First set of fixes to profile setting bugs

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/profile.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/profile.py	2009-09-26 22:10:59 UTC (rev 39295)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/profile.py	2009-09-26 22:12:27 UTC (rev 39296)
@@ -693,16 +693,11 @@
         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()
+        if btnval == wx.ID_SAVE or btnval == wx.ID_CANCEL:
+            dlg.Destroy()
 
-            self.SetGraphStyle()
-            if self.profile:
-                self.DrawPlot()
-
-        dlg.Destroy()
-
     def PrintMenu(self, event):
         """
         Print options and output menu
@@ -1413,13 +1408,18 @@
         fileSettings['profile'] = UserSettings.Get(group='profile')
         file = UserSettings.SaveToFile(fileSettings)
         self.parent.parent.gismanager.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()



More information about the grass-commit mailing list