示例#1
0
文件: fse.py 项目: IGNF/saisie_carhab
 def select_file(self, file_name):
     if file_name in ["polygon", "polyline", "point"]:
         path = execFileDialog("*.shp")
     else:
         path = execFileDialog("*.csv")
     if path:
         line_edt = self.ui.findChild(QLineEdit, file_name)
         line_edt.setText(path)
示例#2
0
 def openJob(self):
     '''Open an existing job.'''
     
     selectedFileName = execFileDialog('*.sqlite')
     if selectedFileName:
         carhabLayer = CarhabLayer(selectedFileName)
         CarhabLayerRegistry.instance().addCarhabLayer(carhabLayer)
示例#3
0
 def run(self):
     """Specific stuff at tool activating."""
     if not iface.mapCanvas().currentLayer():
         no_vector_lyr_msg()
         return
     # Retrieve shapefile selected by the user
     selectedFileName = execFileDialog()
     if selectedFileName:
         self.launch_import(selectedFileName)
示例#4
0
文件: fse.py 项目: IGNF/saisie_carhab
 def valid(self):
     iface.removeDockWidget(self.ui)
     sqlite = execFileDialog("*.sqlite", "Créer une couche de sortie", "save")
     wk_lyr = JobManager().create_carhab_lyr(sqlite)
     for lyr in wk_lyr.getQgisLayers():
         if lyr.name().endswith("_polygon"):
             this_lyr = lyr
             iface.mapCanvas().setCurrentLayer(lyr)
     shp_path = self.ui.findChild(QLineEdit, this_lyr.name().split("_")[-1]).text()
     lyr = ImportLayer().createQgisVectorLayer(shp_path)
     #        thread = QThread()
     worker = ImportJob(lyr)
     #        worker.moveToThread(thread)
     #        thread.start()
     #        thread.wait()
     #        worker.run()
     worker.start()
     print "worker started"
     worker.wait()
     print "finished"
示例#5
0
 def createJob(self):
     '''Create new job.'''
     
     selectedFileName = execFileDialog('*.sqlite', 'Enregistrer sous...', 'save')
     if selectedFileName:
         self.create_carhab_lyr(selectedFileName)
示例#6
0
 def select_file(self, catalog_name):
     catalog_path = execFileDialog('*.csv')
     self.catalog[catalog_name] = catalog_path
     if catalog_path:
         line_edt = self.ui.findChild(QLineEdit, catalog_name)
         line_edt.setText(catalog_path)