Преглед на файлове

address digitizer backround map issue #467 (#494)

Anna Petrasova преди 5 години
родител
ревизия
69c69f735e
променени са 3 файла, в които са добавени 25 реда и са изтрити 13 реда
  1. 20 7
      gui/wxpython/gui_core/dialogs.py
  2. 4 5
      gui/wxpython/vdigit/wxdigit.py
  3. 1 1
      gui/wxpython/vdigit/wxdisplay.py

+ 20 - 7
gui/wxpython/gui_core/dialogs.py

@@ -224,18 +224,21 @@ class VectorDialog(SimpleDialog):
         """
         SimpleDialog.__init__(self, parent, title)
 
-        self.element = Select(
-            parent=self.panel,
-            id=wx.ID_ANY,
-            size=globalvar.DIALOG_GSELECT_SIZE,
-            type='vector',
-            layerTree=layerTree,
-            validator=MapValidator())
+        self.element = self._selection_widget(layerTree)
         self.element.SetFocus()
 
         self.warning = _("Name of vector map is missing.")
         wx.CallAfter(self._layout)
 
+    def _selection_widget(self, layerTree):
+        return Select(parent=self.panel,
+                      id=wx.ID_ANY,
+                      size=globalvar.DIALOG_GSELECT_SIZE,
+                      type='vector',
+                      layerTree=layerTree,
+                      fullyQualified=True
+                      )
+
     def _layout(self):
         """Do layout"""
         self.dataSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY,
@@ -322,6 +325,16 @@ class NewVectorDialog(VectorDialog):
 
         self.warning = _("Name of new vector map is missing.")
 
+    def _selection_widget(self, layerTree):
+        return Select(parent=self.panel,
+                      id=wx.ID_ANY,
+                      size=globalvar.DIALOG_GSELECT_SIZE,
+                      type='vector',
+                      layerTree=layerTree,
+                      fullyQualified=False,
+                      validator=MapValidator()
+                      )
+
     def OnTable(self, event):
         if self.keycol:
             self.keycol.Enable(event.IsChecked())

+ 4 - 5
gui/wxpython/vdigit/wxdigit.py

@@ -266,12 +266,11 @@ class IVDigit:
         name = create_string_buffer(GNAME_MAX)
         mapset = create_string_buffer(GMAPSET_MAX)
         if not G_name_is_fully_qualified(bgmap, name, mapset):
-            name = str(bgmap)
-            mapset = str(G_find_vector2(bgmap, ''))
+            name = bgmap
+            mapset = grass.decode(G_find_vector2(bgmap, ''))
         else:
-            name = str(name.value)
-            mapset = str(mapset.value)
-
+            name = grass.decode(name.value)
+            mapset = grass.decode(mapset.value)
         if (name == Vect_get_name(self.poMapInfo) and
                 mapset == Vect_get_mapset(self.poMapInfo)):
             self.poBgMapInfo = self.popoBgMapInfo = None

+ 1 - 1
gui/wxpython/vdigit/wxdisplay.py

@@ -1000,7 +1000,7 @@ class DisplayDriver:
         :return: map_info
         :return: None on error
         """
-        Debug.msg("DisplayDriver.OpenMap(): name=%s mapset=%s updated=%d",
+        Debug.msg(1, "DisplayDriver.OpenMap(): name=%s mapset=%s updated=%d",
                   name, mapset, update)
         if not self.mapInfo:
             self.mapInfo = Map_info()