Esempio n. 1
0
    def openMap(fileName=None):

        if not fileName or fileName is None:
            fileName = QtGui.QFileDialog.getOpenFileName(
                None, 'Open map...', Serializer.getHomeDir(),
                'Map (*.map *.db)')
            if not fileName or fileName is None or str(fileName[0]) is "":
                return

        QProgressBar = QtGui.QProgressDialog(window)
        QProgressBar.setMinimum(0)
        QProgressBar.setMaximum(100)
        QProgressBar.setLabelText('Loading %s' % fileName)
        QProgressBar.setFixedWidth(250)

        QProgressBar.show()

        clearMap()
        Serializer.mapFile = fileName
        result = Serializer.loadMap(window, window.mapView(), QProgressBar,
                                    application)
        updateTitle()
        QProgressBar.setValue(100)
        QProgressBar.hide()
        QProgressBar.destroy()
        QProgressBar = None
        return result
Esempio n. 2
0
    def dumpMap():
        if Serializer.mapFile is None:
            fileName = QtGui.QFileDialog.getSaveFileNameAndFilter(None, 'Save map...', Serializer.getHomeDir(), 'Map (*.map *.db)')

            if str(fileName[0]) is "":
                return
            Serializer.mapFile = str(fileName[0])
        Serializer.saveMap('123', mapModel)
Esempio n. 3
0
    def openMap(fileName=None):

        if not fileName or fileName is None:
            fileName = QtGui.QFileDialog.getOpenFileName(None, 'Open map...', Serializer.getHomeDir(), 'Map (*.map *.db)')
            if not fileName or fileName is None or str(fileName[0]) is "":
                    return

        QProgressBar = QtGui.QProgressDialog(window)
        QProgressBar.setMinimum(0)
        QProgressBar.setMaximum(100)
        QProgressBar.setLabelText('Loading %s' % fileName)
        QProgressBar.setFixedWidth(250)

        QProgressBar.show()

        clearMap()
        Serializer.mapFile = fileName
        result = Serializer.loadMap(window, window.mapView(), QProgressBar, application)
        updateTitle()
        QProgressBar.setValue(100)
        QProgressBar.hide()
        QProgressBar.destroy()
        QProgressBar = None
        return result