def __init__(self, iface): # pydevd.settrace() self._iface = iface self.plugin_dir = os.path.dirname(__file__) locale = QSettings().value('locale/userLocale')[0:2] locale_path = os.path.join(self.plugin_dir,'i18n','geocsv_{}.qm'.format(locale)) if os.path.exists(locale_path): self.translator = QTranslator() self.translator.load(locale_path) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) NotificationHandler.configureIface(iface) self.settings = QSettings("Editable GeoCSV","editablegeocsv") #container for all csv vector layers self.csvVectorLayers = [] #if the project file is successfully read, reconnect all CsvVectorLayers with its datasource self._iface.projectRead.connect(lambda: GeoCsvReconnectController.getInstance().reconnectCsvVectorLayers(self.csvVectorLayers)) #connect to the qgis refresh button self._connectToRefreshAction()
def __init__(self, iface): # pydevd.settrace() self._iface = iface self.plugin_dir = os.path.dirname(__file__) locale = QSettings().value('locale/userLocale','en')[0:2] locale_path = os.path.join(self.plugin_dir,'i18n','geocsv_{}.qm'.format(locale)) if os.path.exists(locale_path): self.translator = QTranslator() self.translator.load(locale_path) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) NotificationHandler.configureIface(iface) self.settings = QSettings("Editable GeoCSV","editablegeocsv") #container for all csv vector layers self.csvVectorLayers = [] #if the project file is successfully read, reconnect all CsvVectorLayers with its datasource self._iface.projectRead.connect(lambda: GeoCsvReconnectController.getInstance().reconnectCsvVectorLayers(self.csvVectorLayers)) #connect to the qgis refresh button self._connectToRefreshAction()
def _refreshCsvVectorLayers(self): newCsvVectorLayers = [] GeoCsvReconnectController.getInstance().reconnectCsvVectorLayers(newCsvVectorLayers) self.csvVectorLayers = newCsvVectorLayers self._iface.mapCanvas().refresh()