예제 #1
0
    def initGui(self):
        self.setWindowTitle('Seed cache layer')
        layout = QtGui.QVBoxLayout()
        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Close)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        operationLabel = QtGui.QLabel('Operation')
        self.operationBox = QtGui.QComboBox()
        operations = ['Seed', 'Reseed', 'Truncate']
        self.operationBox.addItems(operations)
        horizontalLayout.addWidget(operationLabel)
        horizontalLayout.addWidget(self.operationBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        grisetLabel = QtGui.QLabel('Gridset')
        self.gridsetBox = QtGui.QComboBox()
        self.gridsetBox.addItems(self.layer.gridsets)
        horizontalLayout.addWidget(grisetLabel)
        horizontalLayout.addWidget(self.gridsetBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        formatLabel = QtGui.QLabel('Format')
        self.formatBox = QtGui.QComboBox()
        self.formatBox.addItems(self.layer.mimetypes)
        horizontalLayout.addWidget(formatLabel)
        horizontalLayout.addWidget(self.formatBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        minZoomLabel = QtGui.QLabel('Min zoom')
        self.minZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.minZoomBox.addItems(levels)
        horizontalLayout.addWidget(minZoomLabel)
        horizontalLayout.addWidget(self.minZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        maxZoomLabel = QtGui.QLabel('Max zoom')
        self.maxZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.maxZoomBox.addItems(levels)
        self.maxZoomBox.setCurrentIndex(15)
        horizontalLayout.addWidget(maxZoomLabel)
        horizontalLayout.addWidget(self.maxZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        extentLabel = QtGui.QLabel('Bounding box')
        self.extentPanel = ExtentSelectionPanel(self)
        horizontalLayout.addWidget(extentLabel)
        horizontalLayout.addWidget(self.extentPanel)
        layout.addLayout(horizontalLayout)

        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(600,250)
예제 #2
0
    def initGui(self):
        self.setWindowTitle('Seed cache layer')
        layout = QtGui.QVBoxLayout()
        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                           | QtGui.QDialogButtonBox.Close)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        operationLabel = QtGui.QLabel('Operation')
        self.operationBox = QtGui.QComboBox()
        operations = ['Seed', 'Reseed', 'Truncate']
        self.operationBox.addItems(operations)
        horizontalLayout.addWidget(operationLabel)
        horizontalLayout.addWidget(self.operationBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        grisetLabel = QtGui.QLabel('Gridset')
        self.gridsetBox = QtGui.QComboBox()
        self.gridsetBox.addItems(self.layer.gridsets)
        horizontalLayout.addWidget(grisetLabel)
        horizontalLayout.addWidget(self.gridsetBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        formatLabel = QtGui.QLabel('Format')
        self.formatBox = QtGui.QComboBox()
        self.formatBox.addItems(self.layer.mimetypes)
        horizontalLayout.addWidget(formatLabel)
        horizontalLayout.addWidget(self.formatBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        minZoomLabel = QtGui.QLabel('Min zoom')
        self.minZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.minZoomBox.addItems(levels)
        horizontalLayout.addWidget(minZoomLabel)
        horizontalLayout.addWidget(self.minZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        maxZoomLabel = QtGui.QLabel('Max zoom')
        self.maxZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.maxZoomBox.addItems(levels)
        self.maxZoomBox.setCurrentIndex(15)
        horizontalLayout.addWidget(maxZoomLabel)
        horizontalLayout.addWidget(self.maxZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        extentLabel = QtGui.QLabel('Bounding box')
        self.extentPanel = ExtentSelectionPanel(self)
        horizontalLayout.addWidget(extentLabel)
        horizontalLayout.addWidget(self.extentPanel)
        layout.addLayout(horizontalLayout)

        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(600, 250)
예제 #3
0
class SeedGwcLayerDialog(QtGui.QDialog):

    SEED = 0
    RESEED = 1
    TRUNCATE = 2

    def __init__(self, layer, parent = None):
        super(SeedGwcLayerDialog, self).__init__(parent)
        self.layer = layer
        self.minzoom = None
        self.maxzoom = None
        self.gridset = None
        self.format = None
        self.operation = None
        self.extent = None
        self.initGui()


    def initGui(self):
        self.setWindowTitle('Seed cache layer')
        layout = QtGui.QVBoxLayout()
        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Close)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        operationLabel = QtGui.QLabel('Operation')
        self.operationBox = QtGui.QComboBox()
        operations = ['Seed', 'Reseed', 'Truncate']
        self.operationBox.addItems(operations)
        horizontalLayout.addWidget(operationLabel)
        horizontalLayout.addWidget(self.operationBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        grisetLabel = QtGui.QLabel('Gridset')
        self.gridsetBox = QtGui.QComboBox()
        self.gridsetBox.addItems(self.layer.gridsets)
        horizontalLayout.addWidget(grisetLabel)
        horizontalLayout.addWidget(self.gridsetBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        formatLabel = QtGui.QLabel('Format')
        self.formatBox = QtGui.QComboBox()
        self.formatBox.addItems(self.layer.mimetypes)
        horizontalLayout.addWidget(formatLabel)
        horizontalLayout.addWidget(self.formatBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        minZoomLabel = QtGui.QLabel('Min zoom')
        self.minZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.minZoomBox.addItems(levels)
        horizontalLayout.addWidget(minZoomLabel)
        horizontalLayout.addWidget(self.minZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        maxZoomLabel = QtGui.QLabel('Max zoom')
        self.maxZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.maxZoomBox.addItems(levels)
        self.maxZoomBox.setCurrentIndex(15)
        horizontalLayout.addWidget(maxZoomLabel)
        horizontalLayout.addWidget(self.maxZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        extentLabel = QtGui.QLabel('Bounding box')
        self.extentPanel = ExtentSelectionPanel(self)
        horizontalLayout.addWidget(extentLabel)
        horizontalLayout.addWidget(self.extentPanel)
        layout.addLayout(horizontalLayout)

        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(600,250)


    def okPressed(self):
        operations = ["seed", "reseed", "truncate"]
        self.minzoom = int(self.minZoomBox.currentText())
        self.maxzoom = int(self.maxZoomBox.currentText())
        self.gridset = self.gridsetBox.currentText()
        self.format = self.formatBox.currentText()
        self.operation = operations[self.operationBox.currentIndex()]
        try:
            self.extent =self.extentPanel.getValue()
        except:
            self.extentPanel.text.setStyleSheet("QLineEdit{background: yellow}")
        self.close()

    def cancelPressed(self):
        self.minzoom = None
        self.maxzoom = None
        self.gridset = None
        self.format = None
        self.operation = None
        self.extent = None
        self.close()
예제 #4
0
class SeedGwcLayerDialog(QtGui.QDialog):

    SEED = 0
    RESEED = 1
    TRUNCATE = 2

    def __init__(self, layer, parent=None):
        super(SeedGwcLayerDialog, self).__init__(parent)
        self.layer = layer
        self.minzoom = None
        self.maxzoom = None
        self.gridset = None
        self.format = None
        self.operation = None
        self.extent = None
        self.initGui()

    def initGui(self):
        self.setWindowTitle('Seed cache layer')
        layout = QtGui.QVBoxLayout()
        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                           | QtGui.QDialogButtonBox.Close)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        operationLabel = QtGui.QLabel('Operation')
        self.operationBox = QtGui.QComboBox()
        operations = ['Seed', 'Reseed', 'Truncate']
        self.operationBox.addItems(operations)
        horizontalLayout.addWidget(operationLabel)
        horizontalLayout.addWidget(self.operationBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        grisetLabel = QtGui.QLabel('Gridset')
        self.gridsetBox = QtGui.QComboBox()
        self.gridsetBox.addItems(self.layer.gridsets)
        horizontalLayout.addWidget(grisetLabel)
        horizontalLayout.addWidget(self.gridsetBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        formatLabel = QtGui.QLabel('Format')
        self.formatBox = QtGui.QComboBox()
        self.formatBox.addItems(self.layer.mimetypes)
        horizontalLayout.addWidget(formatLabel)
        horizontalLayout.addWidget(self.formatBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        minZoomLabel = QtGui.QLabel('Min zoom')
        self.minZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.minZoomBox.addItems(levels)
        horizontalLayout.addWidget(minZoomLabel)
        horizontalLayout.addWidget(self.minZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        maxZoomLabel = QtGui.QLabel('Max zoom')
        self.maxZoomBox = QtGui.QComboBox()
        levels = [str(i) for i in range(31)]
        self.maxZoomBox.addItems(levels)
        self.maxZoomBox.setCurrentIndex(15)
        horizontalLayout.addWidget(maxZoomLabel)
        horizontalLayout.addWidget(self.maxZoomBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QtGui.QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        extentLabel = QtGui.QLabel('Bounding box')
        self.extentPanel = ExtentSelectionPanel(self)
        horizontalLayout.addWidget(extentLabel)
        horizontalLayout.addWidget(self.extentPanel)
        layout.addLayout(horizontalLayout)

        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(600, 250)

    def okPressed(self):
        operations = ["seed", "reseed", "truncate"]
        self.minzoom = int(self.minZoomBox.currentText())
        self.maxzoom = int(self.maxZoomBox.currentText())
        self.gridset = self.gridsetBox.currentText()
        self.format = self.formatBox.currentText()
        self.operation = operations[self.operationBox.currentIndex()]
        try:
            self.extent = self.extentPanel.getValue()
        except:
            self.extentPanel.text.setStyleSheet(
                "QLineEdit{background: yellow}")
        self.close()

    def cancelPressed(self):
        self.minzoom = None
        self.maxzoom = None
        self.gridset = None
        self.format = None
        self.operation = None
        self.extent = None
        self.close()