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
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)
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