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)
def openJob(self): '''Open an existing job.''' selectedFileName = execFileDialog('*.sqlite') if selectedFileName: carhabLayer = CarhabLayer(selectedFileName) CarhabLayerRegistry.instance().addCarhabLayer(carhabLayer)
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)
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"
def createJob(self): '''Create new job.''' selectedFileName = execFileDialog('*.sqlite', 'Enregistrer sous...', 'save') if selectedFileName: self.create_carhab_lyr(selectedFileName)
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)