[GRASS-SVN] r55507 - in grass/trunk/gui/wxpython: lmgr nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 24 01:55:37 PDT 2013


Author: annakrat
Date: 2013-03-24 01:55:37 -0700 (Sun, 24 Mar 2013)
New Revision: 55507

Modified:
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/lmgr/toolbars.py
   grass/trunk/gui/wxpython/nviz/preferences.py
Log:
wxGUI/wxNviz: fix preferences dialog

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2013-03-24 08:36:53 UTC (rev 55506)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2013-03-24 08:55:37 UTC (rev 55507)
@@ -71,6 +71,7 @@
 from gui_core.forms        import GUI
 from gcp.manager           import GCPWizard
 from nviz.main             import haveNviz
+from nviz.preferences      import NvizPreferencesDialog
 from mapswipe.frame        import SwipeMapFrame
 from rlisetup.frame        import RLiSetupFrame
 
@@ -108,6 +109,7 @@
         # list of open dialogs
         self.dialogs        = dict()
         self.dialogs['preferences'] = None
+        self.dialogs['nvizPreferences'] = None
         self.dialogs['atm'] = list()
         
         # create widgets
@@ -1393,6 +1395,15 @@
         
         self.dialogs['preferences'].ShowModal()
         
+    def OnNvizPreferences(self, event):
+        """!Show nviz preferences"""
+        if not self.dialogs['nvizPreferences']:
+            dlg = NvizPreferencesDialog(parent = self, giface = self._giface)
+            self.dialogs['nvizPreferences'] = dlg
+            self.dialogs['nvizPreferences'].CenterOnScreen()
+
+        self.dialogs['nvizPreferences'].Show()
+
     def OnHelp(self, event):
         """!Show help
         """

Modified: grass/trunk/gui/wxpython/lmgr/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/toolbars.py	2013-03-24 08:36:53 UTC (rev 55506)
+++ grass/trunk/gui/wxpython/lmgr/toolbars.py	2013-03-24 08:55:37 UTC (rev 55507)
@@ -23,7 +23,6 @@
 """
 
 from core.gcmd          import RunCommand
-from nviz.preferences   import NvizPreferencesDialog
 from gui_core.toolbars  import BaseToolbar, BaseIcons
 from icons.icon         import MetaIcon
 
@@ -242,7 +241,7 @@
                                       self.OnNvizCmd),
                                      (None, ),
                                      ("settings", icons["settings"],
-                                      self.OnSettings),
+                                      self.parent.OnNvizPreferences),
                                      ("help", icons["help"],
                                       self.OnHelp))
                                     )
@@ -260,9 +259,3 @@
             log = self.lmgr.GetLogWindow()
             log.RunCmd(['g.manual',
                         'entry=wxGUI.Nviz'])
-        
-    def OnSettings(self, event):
-        """!Show nviz notebook page"""
-        if not self.settingsDialog:
-            self.settingsDialog = NvizPreferencesDialog(parent = self.parent)
-        self.settingsDialog.Show()

Modified: grass/trunk/gui/wxpython/nviz/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/preferences.py	2013-03-24 08:36:53 UTC (rev 55506)
+++ grass/trunk/gui/wxpython/nviz/preferences.py	2013-03-24 08:55:37 UTC (rev 55507)
@@ -28,9 +28,9 @@
 
 class NvizPreferencesDialog(PreferencesBaseDialog):
     """!Nviz preferences dialog"""
-    def __init__(self, parent, title = _("3D view settings"),
+    def __init__(self, parent, giface, title = _("3D view default settings"),
                  settings = UserSettings):
-        PreferencesBaseDialog.__init__(self, parent = parent, title = title,
+        PreferencesBaseDialog.__init__(self, parent = parent, title = title, giface = giface,
                                        settings = settings)
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_nviz.ico'), wx.BITMAP_TYPE_ICO))
 



More information about the grass-commit mailing list