Beispiel #1
0
    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':
                        datetime_to_str(
                            self.getTimeLayerManager().getCurrentTimePosition(),
                            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()}

            TimeManagerProjectHandler.writeSettings(settings)
    def writeSettings(self, doc):
        """write all relevant settings to the project file XML """
        if not self.getTimeLayerManager().isEnabled():
            #QgsProject.instance().clearProperties() #FIXME this may clear non Time Manager
            # custom properties too
            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':
                datetime_to_str(
                    self.getTimeLayerManager().getCurrentTimePosition(),
                    DEFAULT_FORMAT),
                'timeFrameType':
                self.getTimeLayerManager().getTimeFrameType(),
                'timeFrameSize':
                self.getTimeLayerManager().getTimeFrameSize(),
                'active':
                self.getTimeLayerManager().isEnabled()
            }

            TimeManagerProjectHandler.writeSettings(settings)
Beispiel #3
0
 def sendAnimationOptions(self):
     path = self.animationDialog.lineEdit.text()
     if path == "":
         self.showAnimationOptions()
     TimeManagerProjectHandler.set_plugin_setting(conf.LAST_ANIMATION_PATH_TAG, path)
     delay_millis = self.animationDialog.spinBoxDelay.value()
     export_gif = self.animationDialog.radioAnimatedGif.isChecked()
     export_video = self.animationDialog.radioVideo.isChecked()
     do_clear = self.animationDialog.clearCheckBox.isChecked()
     self.signalExportVideo.emit(path, delay_millis, export_gif, export_video, do_clear)
 def sendAnimationOptions(self):
     path = self.animationDialog.lineEdit.text()
     if path == "":
         self.showAnimationOptions()
     TimeManagerProjectHandler.set_plugin_setting(conf.LAST_ANIMATION_PATH_TAG, path)
     delay_millis = self.animationDialog.spinBoxDelay.value()
     export_gif = self.animationDialog.radioAnimatedGif.isChecked()
     export_video = self.animationDialog.radioVideo.isChecked()
     do_clear = self.animationDialog.clearCheckBox.isChecked()
     self.signalExportVideo.emit(path, delay_millis, export_gif, export_video, do_clear)
Beispiel #5
0
    def readSettings(self):
        """load and restore settings from project file"""
        # list of settings to restore and their types (needed so that project handler can read
        # them)

        settings = TimeManagerProjectHandler.readSettings(self.METASETTINGS)

        restore_functions = {
            'mode': (self.setArchaeology, 0),
            'digits': (time_util.setArchDigits, conf.DEFAULT_DIGITS),
            'currentMapTimePosition':
            (self.restoreTimePositionFromSettings, None),
            'animationFrameLength':
            (self.setAnimationFrameLength, DEFAULT_FRAME_LENGTH),
            'playBackwards': (self.setPlayBackwards, 0),
            'loopAnimation': (self.setLoopAnimation, 0),
            'timeLayerManager': (self.restoreSettingTimeLayerManager, None),
            'timeLayerList': (self.restoreTimeLayers, None),
            'timeFrameType': (self.restoreTimeFrameType, DEFAULT_FRAME_UNIT),
            'timeFrameSize':
            (self.guiControl.setTimeFrameSize, DEFAULT_FRAME_SIZE),
            'active': (self.setActive, 0),
            'labelFormat':
            (self.guiControl.setLabelFormat, time_util.DEFAULT_FORMAT),
        }

        for setting_name in self.METASETTINGS.keys():
            restore_function, default_value = restore_functions[setting_name]
            if setting_name not in settings:
                setting_value = default_value
            else:
                setting_value = settings[setting_name]
            restore_function(setting_value)
    def readSettings(self):
        """load and restore settings from project file"""
        # list of settings to restore and their types (needed so that project handler can read
        # them)

        settings = TimeManagerProjectHandler.readSettings(self.METASETTINGS)

        restore_functions={
                 'mode': (self.setArchaeology, 0),
                 'digits': (time_util.setArchDigits, conf.DEFAULT_DIGITS),
                 'currentMapTimePosition': (self.restoreTimePositionFromSettings,None),
                 'animationFrameLength': (self.setAnimationFrameLength,DEFAULT_FRAME_LENGTH),
                 'playBackwards': (self.setPlayBackwards,0),
                 'loopAnimation': (self.setLoopAnimation,0),
                 'timeLayerManager': (self.restoreSettingTimeLayerManager,None),
                 'timeLayerList': (self.restoreTimeLayers,None),
                 'timeFrameType': (self.restoreTimeFrameType,DEFAULT_FRAME_UNIT),
                 'timeFrameSize': (self.guiControl.setTimeFrameSize,DEFAULT_FRAME_SIZE),
                 'active': (self.setActive,0),
        }

        for setting_name in self.METASETTINGS.keys():
            restore_function,default_value = restore_functions[setting_name]
            if setting_name not in settings:
                setting_value = default_value
            else:
                setting_value = settings[setting_name]
            restore_function(setting_value)
    def selectAnimationFolder(self):

        prev_directory = TimeManagerProjectHandler.plugin_setting(conf.LAST_ANIMATION_PATH_TAG)
        if prev_directory:
            self.animationDialog.lineEdit.setText(QtGui.QFileDialog.getExistingDirectory(directory=prev_directory))
        else:
            self.animationDialog.lineEdit.setText(QtGui.QFileDialog.getExistingDirectory())
    def readSettings(self):
        """load and restore settings from project file"""
        # list of settings to restore and their types (needed so that project handler can read
        # them)

        settings = TimeManagerProjectHandler.readSettings(self.METASETTINGS)

        #QgsMessageLog.logMessage("Read settings "+str(settings))

        restore_functions = {
            'currentMapTimePosition':
            (self.restoreTimePositionFromSettings, None),
            'animationFrameLength':
            (self.setAnimationFrameLength, DEFAULT_FRAME_LENGTH),
            'playBackwards': (self.setPlayBackwards, 0),
            'loopAnimation': (self.setLoopAnimation, 0),
            'timeLayerManager': (self.restoreSettingTimeLayerManager, None),
            'timeLayerList': (self.restoreTimeLayers, None),
            'timeFrameType':
            (self.guiControl.setTimeFrameType, DEFAULT_FRAME_UNIT),
            'timeFrameSize':
            (self.guiControl.setTimeFrameSize, DEFAULT_FRAME_SIZE),
            'active': (self.setActive, 0)
        }

        for setting_name in self.METASETTINGS.keys():
            restore_function, default_value = restore_functions[setting_name]
            if setting_name not in settings:
                setting_value = default_value
            else:
                setting_value = settings[setting_name]
            restore_function(setting_value)
Beispiel #9
0
    def readSettings(self):
        """Load and restore settings from project file"""
        settings = TimeManagerProjectHandler.readSettings(self.METASETTINGS)
        restore_functions = {
            'mode': (self.setArchaeology, 0),
            'digits': (time_util.setArchDigits, conf.DEFAULT_DIGITS),
            'currentMapTimePosition':
            (self.restoreTimePositionFromSettings, None),
            'animationFrameLength':
            (self.setAnimationFrameLength, conf.DEFAULT_FRAME_LENGTH),
            'playBackwards': (self.setPlayBackwards, 0),
            'loopAnimation': (self.setLoopAnimation, 0),
            'timeLayerManager': (self.restoreSettingTimeLayerManager, None),
            'timeLayerList': (self.restoreTimeLayers, None),
            'timeFrameType':
            (self.restoreTimeFrameType, conf.DEFAULT_FRAME_UNIT),
            'timeFrameSize':
            (self.guiControl.setTimeFrameSize, conf.DEFAULT_FRAME_SIZE),
            'active': (self.setActive, 0),
            'labelFormat': (self.guiControl.setLabelFormat,
                            time_util.DEFAULT_FORMAT),
            'labelFont': (self.guiControl.setLabelFont,
                          time_util.DEFAULT_LABEL_FONT),
            'labelSize': (self.guiControl.setLabelSize,
                          time_util.DEFAULT_LABEL_SIZE),
            'labelColor': (self.guiControl.setLabelColor,
                           time_util.DEFAULT_LABEL_COLOR),
            'labelBgColor': (self.guiControl.setLabelBgColor,
                             time_util.DEFAULT_LABEL_BGCOLOR),
            'labelPlacement': (self.guiControl.setLabelPlacement,
                               time_util.DEFAULT_LABEL_PLACEMENT),
        }

        for setting_name in self.METASETTINGS.keys():
            if restore_functions.has_key(setting_name):
                restore_function, default_value = restore_functions[
                    setting_name]
                if setting_name not in settings:
                    setting_value = default_value
                else:
                    setting_value = settings[setting_name]
                restore_function(setting_value)