Ejemplo n.º 1
0
 def populateConnectionList(self):
     self.cmbConnections.blockSignals(True)
     self.cmbConnections.clear()
     keys = QgsOWSConnection.connectionList("SOS")
     self.cmbConnections.addItems (keys)
     self.cmbConnections.blockSignals(False)
     index = self.cmbConnections.findText(QgsOWSConnection.selectedConnection("SOS"))
     self.cmbConnections.setCurrentIndex(index)
     self.on_cmbConnections_currentIndexChanged (QgsOWSConnection.selectedConnection("SOS"))
     QgsDebug ("populateConnectionList: selectedConnection = {}".format(QgsOWSConnection.selectedConnection("SOS")))
Ejemplo n.º 2
0
 def on_btnDelete_clicked(self):
     msg = str(
         self.
         tr("Are you sure you want to remove the %s connection and all associated settings?"
            )) % (self.cmbConnections.currentText())
     result = QtGui.QMessageBox.information(
         self, self.tr("Confirm Delete"), msg,
         QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
     if result == QtGui.QMessageBox.Ok:
         QgsOWSConnection.deleteConnection(
             "SOS", self.cmbConnections.currentText())
         self.populateConnectionList()
Ejemplo n.º 3
0
 def on_btnConnect_clicked(self):
     self.cmbOfferings.clear()
     self.htmlView.setText ("")
     self.btnAdd.setEnabled(False)
     self.btnConnect.setEnabled(False)
     
     connection = QgsOWSConnection("SOS", QgsOWSConnection.selectedConnection("SOS"))
     url = str(connection.uri().param('url'))
     
     QgsMessageLog.logMessage(self.tr("Connecting to {url}").format(url=url), "SosClient", QgsMessageLog.INFO)
     
     if url != "" :
         self.executeRequest(SensorObservationService.capabilitiesUrl(url), self.capabilitiesRequest)
Ejemplo n.º 4
0
 def on_cmbConnections_currentIndexChanged (self, text):
     text = str(text)
     if QgsOWSConnection.selectedConnection("SOS") != text:
         QgsOWSConnection.setSelectedConnection("SOS", text)
         
     if text != "":
         self.btnConnect.setEnabled(True)
         self.btnEdit.setEnabled(True)
         self.btnDelete.setEnabled(True)
     else:
         self.btnConnect.setEnabled(False)
         self.btnEdit.setEnabled(False)
         self.btnDelete.setEnabled(False)
Ejemplo n.º 5
0
    def on_cmbConnections_currentIndexChanged(self, text):
        text = str(text)
        if QgsOWSConnection.selectedConnection("SOS") != text:
            QgsOWSConnection.setSelectedConnection("SOS", text)

        if text != "":
            self.btnConnect.setEnabled(True)
            self.btnEdit.setEnabled(True)
            self.btnDelete.setEnabled(True)
        else:
            self.btnConnect.setEnabled(False)
            self.btnEdit.setEnabled(False)
            self.btnDelete.setEnabled(False)
Ejemplo n.º 6
0
 def populateConnectionList(self):
     self.cmbConnections.blockSignals(True)
     self.cmbConnections.clear()
     keys = QgsOWSConnection.connectionList("SOS")
     self.cmbConnections.addItems(keys)
     self.cmbConnections.blockSignals(False)
     index = self.cmbConnections.findText(
         QgsOWSConnection.selectedConnection("SOS"))
     self.cmbConnections.setCurrentIndex(index)
     self.on_cmbConnections_currentIndexChanged(
         QgsOWSConnection.selectedConnection("SOS"))
     QgsDebug("populateConnectionList: selectedConnection = {}".format(
         QgsOWSConnection.selectedConnection("SOS")))
Ejemplo n.º 7
0
    def on_btnConnect_clicked(self):
        self.cmbOfferings.clear()
        self.htmlView.setText("")
        self.btnAdd.setEnabled(False)
        self.btnConnect.setEnabled(False)

        connection = QgsOWSConnection(
            "SOS", QgsOWSConnection.selectedConnection("SOS"))
        url = str(connection.uri().param('url'))

        QgsMessageLog.logMessage(
            self.tr("Connecting to {url}").format(url=url), "SosClient",
            QgsMessageLog.INFO)

        if url != "":
            self.executeRequest(SensorObservationService.capabilitiesUrl(url),
                                self.capabilitiesRequest)
Ejemplo n.º 8
0
 def on_btnDelete_clicked(self):
     msg = str (self.tr("Are you sure you want to remove the %s connection and all associated settings?")) % (self.cmbConnections.currentText())
     result = QtGui.QMessageBox.information(self, self.tr("Confirm Delete"), msg, QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
     if result == QtGui.QMessageBox.Ok :
         QgsOWSConnection.deleteConnection("SOS", self.cmbConnections.currentText())
         self.populateConnectionList()