def __init__(self, parent=None, tabIndex=0): QDialog.__init__(self, parent) self.ui = Ui_Settings() self.ui.setupUi(self) self.ui.tabWidget.setCurrentIndex(tabIndex) self.initSettings()
def __init__(self, plugin): self.plugin = plugin self.iface = self.plugin.iface self.canvas = self.plugin.iface.mapCanvas() self.maxVal = 100 self.minVal = 0 self.serverUrl = 'http://gisak.vsb.cz/patrac/' self.currentStep = 1 userPluginPath = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "python/plugins/qgis_patrac" systemPluginPath = QgsApplication.prefixPath() + "python/plugins/qgis_patrac" if QFileInfo(userPluginPath).exists(): self.pluginPath = userPluginPath else: self.pluginPath = systemPluginPath QDockWidget.__init__(self, None) self.setupUi(self) self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea) # Button GetArea self.btnGetArea.clicked.connect(self.runExpertGetArea) # Sliders self.sliderStart.valueChanged.connect(self.__updateSpinStart) self.spinStart.valueChanged.connect(self.__updateSliderStart) self.sliderEnd.valueChanged.connect(self.__updateSpinEnd) self.spinEnd.valueChanged.connect(self.__updateSliderEnd) # Button of places management self.tbtnDefinePlaces.clicked.connect(self.definePlaces) # Button of GetSectors self.tbtnGetSectors.clicked.connect(self.runExpertGetSectors) self.tbtnRecalculateSectors.clicked.connect(self.recalculateSectorsExpert) self.tbtnExportSectors.clicked.connect(self.exportSectors) self.tbtnReportExportSectors.clicked.connect(self.runExpertReportExportSectors) self.tbtnShowSettings.clicked.connect(self.showSettings) self.tbtnExtendRegion.clicked.connect(self.extendRegion) self.tbtnImportPaths.clicked.connect(self.showImportGpx) #self.tbtnShowSearchers.clicked.connect(self.showPeopleSimulation) self.tbtnShowSearchers.clicked.connect(self.showPeople) self.tbtnShowSearchersTracks.clicked.connect(self.showPeopleTracks) self.tbtnShowMessage.clicked.connect(self.showMessage) self.tbtnInsertFinal.clicked.connect(self.insertFinal) # Dialogs and tools are defined here self.settingsdlg = Ui_Settings(self.pluginPath, self) self.coordsdlg = Ui_Coords() self.pointtool = PointMapTool(self.plugin.iface.mapCanvas()) self.progresstool = ProgressMapTool(self.plugin.iface.mapCanvas(), self.plugin.iface) self.setStepsConnection() # Help show self.helpShow.clicked.connect(self.showHelp) self.currentTool = self.iface.mapCanvas().mapTool() self.personType = 1 self.Utils = Utils(self) self.Project = Project(self) self.Printing = Printing(self) self.Area = Area(self) self.Sectors = Sectors(self) self.Hds = Hds(self) self.Styles = Styles(self) self.sectorsUniqueStyle.clicked.connect(self.setSectorsUniqueValuesStyle) self.sectorsSingleStyle.clicked.connect(self.setSectorsSingleValuesStyle) self.sectorsLabelsOn.clicked.connect(self.setSectorsLabelsOn) self.sectorsLabelsOff.clicked.connect(self.setSectorsLabelsOff) self.sectorsProgressStyle.clicked.connect(self.setSectorsProgressStyle) self.sectorsUnitsStyle.clicked.connect(self.setSectorsUnitsStyle) self.sectorsProgress.clicked.connect(self.setSectorsProgress)