Revision 593 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/tools/photo2shape/photo2shape.py

View differences:

photo2shape.py
19 19
from org.gvsig.fmap.dal import DALLocator
20 20
from org.gvsig.fmap.dal import DataTypes
21 21

  
22
from org.gvsig.fmap.mapcontext import MapContextLocator
22 23

  
23 24
from imagegpsmetadata import ImageGPSMetadata
24 25
from libs.relpath import relpath
......
125 126
      store.insert(feature)
126 127

  
127 128
    store.finishEditing()
128
    if self.__addLayerToView:
129
    if self.__addLayerToView and currentView()!=None:
129 130
      layer = MapContextLocator.getMapContextManager().createLayer(
130 131
        self.__outputFile.getName(),
131 132
        store
......
161 162
    self.hide()
162 163

  
163 164
  def btnMakeShape_click(self, *args):
165
    if currentView() == None and self.chkInsertLayer.isSelected() :
166
      msgbox("Need a view to add layer to it.")
167
      return
168

  
164 169
    if self.chkRemoveShape.isSelected():
165 170
      try:
166 171
        f = os.path.splitext(self.txtOutputFile.getText())[0]

Also available in: Unified diff