Beispiel #1
0
    def __init__(self, parent=None):
        super(SettingsDialog, self).__init__(parent)
        self.setupUi(self)

        # Settings tab settings
        self.siteCodeEdit.setText(Settings.siteCode())
        self.styleFolderCheck.setChecked(Settings.useCustomStyles())
        if Settings.useCustomStyles():
            self.styleFolderEdit.setEnabled(True)
            self.styleFolderButton.setEnabled(True)
        self.styleFolderButton.clicked.connect(self._selectStyleFolder)
        self.arkUrlEdit.setText(Settings.arkUrl())
        if Settings.isSettingsConfigured():
            self.useArkCheck.setEnabled(False)
        self.logUpdatesCheck.setChecked(Settings.logUpdates())

        # Drawings tab settings
        self.drawingTransparencySpin.setValue(Settings.drawingTransparency())
        self.georefFolderCheck.setChecked(Settings.useGeorefFolder())
        self.contextDrawingFolderCheck.setChecked(Settings.useCustomDrawingPath('context'))
        if Settings.useCustomDrawingPath('context'):
            self.contextDrawingFolderEdit.setEnabled(True)
            self.contextDrawingFolderButton.setEnabled(True)
        self.contextDrawingFolderEdit.setText(Settings.drawingPath('context'))
        self.contextDrawingFolderButton.clicked.connect(self._selectContextDrawingFolder)
        if Settings.useCustomDrawingPath('plan'):
            self.planDrawingFolderEdit.setEnabled(True)
            self.planDrawingFolderButton.setEnabled(True)
        self.planDrawingFolderEdit.setText(Settings.drawingPath('plan'))
        self.planDrawingFolderButton.clicked.connect(self._selectPlanDrawingFolder)
        if Settings.useCustomDrawingPath('section'):
            self.sectionDrawingFolderEdit.setEnabled(True)
            self.sectionDrawingFolderButton.setEnabled(True)
        self.sectionDrawingFolderEdit.setText(Settings.drawingPath('section'))
        self.sectionDrawingFolderButton.clicked.connect(self._selectSectionDrawingFolder)
Beispiel #2
0
 def loadGeoLayer(self, geoFile, zoomToLayer=True):
     # TODO Check if already loaded, remove old one?
     self.geoLayer = QgsRasterLayer(geoFile.absoluteFilePath(), geoFile.completeBaseName())
     self.geoLayer.renderer().setOpacity(Settings.drawingTransparency() / 100.0)
     QgsMapLayerRegistry.instance().addMapLayer(self.geoLayer)
     if (self.drawingsGroupIndex < 0):
         self.drawingsGroupIndex = layers.createLayerGroup(
             self._plugin.iface, self.drawingsGroupName, Config.projectGroupName)
     self._plugin.legendInterface().moveLayer(self.geoLayer, self.drawingsGroupIndex)
     if zoomToLayer:
         self._plugin.mapCanvas().setExtent(self.geoLayer.extent())