[GRASS-SVN] r34364 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 18 08:17:43 EST 2008


Author: martinl
Date: 2008-11-18 08:17:43 -0500 (Tue, 18 Nov 2008)
New Revision: 34364

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: fix multiple layer/dbtable/dbcolumn
       background map available from layer contextual menu


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2008-11-18 13:16:49 UTC (rev 34363)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2008-11-18 13:17:43 UTC (rev 34364)
@@ -476,8 +476,9 @@
             # Thread aborted (using our convention of None return)
             self.WriteLog(_('Please note that the data are left in incosistent stage '
                             'and can be corrupted'), self.cmd_output.StyleWarning)
-            self.WriteCmdLog('(%s) %s' % (str(time.ctime()),
-                                          _('Command aborted')))
+            self.WriteCmdLog('(%s) %s (%d sec)' % (str(time.ctime()),
+                                                   _('Command aborted'),
+                                                   (time.time() - event.time)))
             # pid=self.cmdThread.requestId)
         else:
             try:

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-11-18 13:16:49 UTC (rev 34363)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-11-18 13:17:43 UTC (rev 34364)
@@ -1185,44 +1185,48 @@
                                              'dbcolumn',
                                              'layer',
                                              'layer_all'):
-                    if p.get('prompt', '') in ('layer',
-                                               'layer_all'):
-                        if p.get('prompt', '') == 'layer_all':
-                            all = True
-                        else:
-                            all = False
-                        if p.get('age', 'old_layer') == 'old_layer':
-                            win = gselect.LayerSelect(parent=which_panel,
-                                                      all=all)
+                    if p.get('multiple', 'no') == 'yes':
+                        win = wx.TextCtrl(parent=which_panel, value = p.get('default',''),
+                                          size=globalvar.DIALOG_TEXTCTRL_SIZE)
+                    else:
+                        if p.get('prompt', '') in ('layer',
+                                                   'layer_all'):
+                            if p.get('prompt', '') == 'layer_all':
+                                all = True
+                            else:
+                                all = False
+                            if p.get('age', 'old_layer') == 'old_layer':
+                                win = gselect.LayerSelect(parent=which_panel,
+                                                          all=all)
+                                p['wxGetValue'] = win.GetStringSelection
+                                win.Bind(wx.EVT_CHOICE, self.OnUpdateSelection)
+                                win.Bind(wx.EVT_CHOICE, self.OnSetValue)
+                            else:
+                                win = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY,
+                                                  min=1, max=100, initial=1)
+                                win.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
+                                
+                        elif p.get('prompt', '') == 'dbdriver':
+                            win = gselect.DriverSelect(parent=which_panel,
+                                                       choices=p['values'],
+                                                       value=p['default'])
                             p['wxGetValue'] = win.GetStringSelection
-                            win.Bind(wx.EVT_CHOICE, self.OnUpdateSelection)
-                            win.Bind(wx.EVT_CHOICE, self.OnSetValue)
-                        else:
-                            win = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY,
-                                              min=1, max=100, initial=1)
-                            win.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
-
-                    elif p.get('prompt', '') == 'dbdriver':
-                        win = gselect.DriverSelect(parent=which_panel,
-                                                   choices=p['values'],
-                                                   value=p['default'])
-                        p['wxGetValue'] = win.GetStringSelection
-                        win.Bind(wx.EVT_COMBOBOX, self.OnUpdateSelection)
-                        win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
-                    elif p.get('prompt', '') == 'dbname':
-                        win = gselect.DatabaseSelect(parent=which_panel,
-                                                     value=p['default'])
-                        win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
-                        win.Bind(wx.EVT_TEXT, self.OnSetValue)
-                    elif p.get('prompt', '') == 'dbtable':
-                        win = gselect.TableSelect(parent=which_panel)
-                        p['wxGetValue'] = win.GetStringSelection
-                        win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
-                    elif p.get('prompt', '') == 'dbcolumn':
-                        win = gselect.ColumnSelect(parent=which_panel)
-                        p['wxGetValue'] = win.GetStringSelection
-                        win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
-                    
+                            win.Bind(wx.EVT_COMBOBOX, self.OnUpdateSelection)
+                            win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                        elif p.get('prompt', '') == 'dbname':
+                            win = gselect.DatabaseSelect(parent=which_panel,
+                                                         value=p['default'])
+                            win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
+                            win.Bind(wx.EVT_TEXT, self.OnSetValue)
+                        elif p.get('prompt', '') == 'dbtable':
+                            win = gselect.TableSelect(parent=which_panel)
+                            p['wxGetValue'] = win.GetStringSelection
+                            win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                        elif p.get('prompt', '') == 'dbcolumn':
+                            win = gselect.ColumnSelect(parent=which_panel)
+                            p['wxGetValue'] = win.GetStringSelection
+                            win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
+                            
                     p['wxId'] = win.GetId()
                     
                     which_sizer.Add(item=win, proportion=0,

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-18 13:16:49 UTC (rev 34363)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-18 13:17:43 UTC (rev 34364)
@@ -291,17 +291,21 @@
             layer = self.GetPyData(self.layer_selected)[0]['maplayer']
             # enable editing only for vector map layers available in the current mapset
             digitToolbar = self.mapdisplay.toolbars['vdigit']
+            if digitToolbar:
+                # background vector map
+                self.popupMenu.Append(self.popupID14,
+                                      text=_("Use as background vector map"),
+                                      kind=wx.ITEM_CHECK)
+                self.Bind(wx.EVT_MENU, self.OnSetBgMap, id=self.popupID14)
+                if UserSettings.Get(group='vdigit', key='bgmap', subkey='value',
+                                    internal=True) == layer.GetName():
+                    self.popupMenu.Check(self.popupID14, True)
+            
             if layer.GetMapset() != grassenv.GetGRASSVariable("MAPSET"):
                 # only vector map in current mapset can be edited
                 self.popupMenu.Enable (self.popupID5, False)
                 self.popupMenu.Enable (self.popupID6, False)
             elif digitToolbar and digitToolbar.GetLayer():
-                # background vector map
-                self.popupMenu.Append(self.popupID14,
-                                      text=_("Use as background vector map"),
-                                      kind=wx.ITEM_CHECK)
-                self.Bind(wx.EVT_MENU, self.OnSetBgMap, id=self.popupID14)
-
                 # vector map already edited
                 vdigitLayer = digitToolbar.GetLayer()
                 if vdigitLayer is layer:
@@ -320,10 +324,7 @@
                     self.popupMenu.Enable(self.popupID6, False)
                     # enable 'bgmap'
                     self.popupMenu.Enable(self.popupID14, True)
-                    if UserSettings.Get(group='vdigit', key='bgmap', subkey='value',
-                                        internal=True) == layer.GetName():
-                        self.popupMenu.Check(self.popupID14, True)
-                
+            
             self.popupMenu.Append(self.popupID7, _("Metadata"))
             self.Bind (wx.EVT_MENU, self.OnMetadata, id=self.popupID7)
 



More information about the grass-commit mailing list