def writeSettings(self): """Write all relevant settings to the project file XML """ if not self.getTimeLayerManager().isEnabled(): return (timeLayerManagerSettings, timeLayerList) = self.getTimeLayerManager().getSaveString() if timeLayerManagerSettings is not None: settings = {'animationFrameLength': self.animationFrameLength, 'playBackwards': self.playBackwards, 'loopAnimation': self.loopAnimation, 'timeLayerManager': timeLayerManagerSettings, 'timeLayerList': timeLayerList, 'currentMapTimePosition': time_util.datetime_to_str( self.getTimeLayerManager().getCurrentTimePosition(), time_util.DEFAULT_FORMAT ), 'timeFrameType': self.getTimeLayerManager().getTimeFrameType(), 'timeFrameSize': self.getTimeLayerManager().getTimeFrameSize(), 'active': self.getTimeLayerManager().isEnabled(), 'mode': int(time_util.is_archaelogical()), 'digits': time_util.getArchDigits(), 'labelFormat': self.guiControl.getLabelFormat(), 'labelFont': self.guiControl.getLabelFont(), 'labelSize': self.guiControl.getLabelSize(), 'labelColor': self.guiControl.getLabelColor(), 'labelBgColor': self.guiControl.getLabelBgColor(), 'labelPlacement': self.guiControl.getLabelPlacement()} TimeManagerProjectHandler.writeSettings(settings)
def updateTimePositionFromTextBox(self, date): if not self.propagateGuiChanges: return if time_util.is_archaelogical(): bcdate = bcdate_util.BCDate.from_str(date, strict_zeros=False) bcdate.setDigits(bcdate_util.getGlobalDigitSetting()) self.getTimeLayerManager().setCurrentTimePosition(bcdate) else: self.getTimeLayerManager().setCurrentTimePosition(time_util.QDateTime_to_datetime(date))
def updateTimePositionFromTextBox(self, date): if not self.propagateGuiChanges: return if time_util.is_archaelogical(): bcdate = bcdate_util.BCDate.from_str(date, strict_zeros=False) bcdate.setDigits(bcdate_util.getGlobalDigitSetting()) self.getTimeLayerManager().setCurrentTimePosition(bcdate) else: self.getTimeLayerManager().setCurrentTimePosition( time_util.QDateTime_to_datetime(date))
def writeSettings(self): """Write all relevant settings to the project file XML """ if not self.getTimeLayerManager().isEnabled(): return (timeLayerManagerSettings, timeLayerList) = self.getTimeLayerManager().getSaveString() if timeLayerManagerSettings is not None: settings = { 'animationFrameLength': self.animationFrameLength, 'playBackwards': self.playBackwards, 'loopAnimation': self.loopAnimation, 'timeLayerManager': timeLayerManagerSettings, 'timeLayerList': timeLayerList, 'currentMapTimePosition': time_util.datetime_to_str( self.getTimeLayerManager().getCurrentTimePosition(), time_util.DEFAULT_FORMAT), 'timeFrameType': self.getTimeLayerManager().getTimeFrameType(), 'timeFrameSize': self.getTimeLayerManager().getTimeFrameSize(), 'active': self.getTimeLayerManager().isEnabled(), 'mode': int(time_util.is_archaelogical()), 'digits': time_util.getArchDigits(), 'labelFormat': self.guiControl.getLabelFormat(), 'labelFont': self.guiControl.getLabelFont(), 'labelSize': self.guiControl.getLabelSize(), 'labelColor': self.guiControl.getLabelColor(), 'labelBgColor': self.guiControl.getLabelBgColor(), 'labelPlacement': self.guiControl.getLabelPlacement() } TimeManagerProjectHandler.writeSettings(settings)
def toggleArchaeology(self): """Toggle archaeology mode on/off""" if time_util.is_archaelogical(): self.setArchaeology(False) else: self.guiControl.showArchOptions()
def getTimeWidget(self): if time_util.is_archaelogical(): return self.bcdateSpinBox else: return self.dock.dateTimeEditCurrentTime