~openlp-core/openlp/trunk

« back to all changes in this revision

Viewing changes to openlp/plugins/images/imageplugin.py

  • Committer: Tim Bentley
  • Author(s): tim.bentley at gmail
  • Date: 2015-11-05 19:05:19 UTC
  • mfrom: (2558.4.23 gen1)
  • Revision ID: tim.bentley@gmail.com-20151105190519-onunvcuag7tpd3yn
First merge for 2.4.

A Number of small bug fixes which could be done in 2.2.
Clean up all the 2.0 to 2.2 migrations stuff.
Create a 2.2 to 2.4 migration for settings.
Fix problems with the Tag test so you do not need to restart a branch each time we do a release.

lp:~trb143/openlp/bugs-2_4b (revision 2578)
[SUCCESS] https//ci.openlp.io/job/Branch-01-Pull/1164/
[SUCCESS] https//ci.openlp.io/job/Branch-02-Functional-Tests/1087/
[SUCCESS] https//ci.openlp.io/job/Branch-03-Interface-Tests/1028/...

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
                               'provided by the theme.')
68
68
        return about_text
69
69
 
70
 
    def app_startup(self):
71
 
        """
72
 
        Perform tasks on application startup.
73
 
        """
74
 
        # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed
75
 
        Plugin.app_startup(self)
76
 
        # Convert old settings-based image list to the database.
77
 
        files_from_config = Settings().get_files_from_config(self)
78
 
        if files_from_config:
79
 
            for file in files_from_config:
80
 
                filename = os.path.split(file)[1]
81
 
                thumb = os.path.join(self.media_item.service_path, filename)
82
 
                try:
83
 
                    os.remove(thumb)
84
 
                except:
85
 
                    pass
86
 
            log.debug('Importing images list from old config: %s' % files_from_config)
87
 
            self.media_item.save_new_images_list(files_from_config)
88
 
 
89
70
    def upgrade_settings(self, settings):
90
71
        """
91
72
        Upgrade the settings of this plugin.
92
73
 
93
74
        :param settings: The Settings object containing the old settings.
94
75
        """
95
 
        # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed
96
 
        files_from_config = settings.get_files_from_config(self)
97
 
        if files_from_config:
98
 
            log.debug('Importing images list from old config: %s' % files_from_config)
99
 
            self.media_item.save_new_images_list(files_from_config)
 
76
        pass
100
77
 
101
78
    def set_plugin_text_strings(self):
102
79
        """