Esempio n. 1
0
 def app_startup(self):
     """
     Perform tasks on application startup.
     """
     Plugin.app_startup(self)
     # Convert old settings-based image list to the database.
     files_from_config = Settings().get_files_from_config(self)
     if files_from_config:
         log.debug('Importing images list from old config: %s' % files_from_config)
         self.media_item.save_new_images_list(files_from_config)
Esempio n. 2
0
 def app_startup(self):
     """
     Perform tasks on application startup
     """
     Plugin.app_startup(self)
     if self.manager.old_bible_databases:
         if QtGui.QMessageBox.information(self.main_window,
             translate('OpenLP', 'Information'),
             translate('OpenLP', 'Bible format has changed.\nYou have to upgrade your existing Bibles.\n'
                 'Should OpenLP upgrade now?'),
             QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) == \
                 QtGui.QMessageBox.Yes:
             self.onToolsUpgradeItemTriggered()
Esempio n. 3
0
 def app_startup(self):
     """
     Perform tasks on application startup.
     """
     # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed
     Plugin.app_startup(self)
     # Convert old settings-based image list to the database.
     files_from_config = Settings().get_files_from_config(self)
     if files_from_config:
         for file in files_from_config:
             filename = os.path.split(file)[1]
             thumb = os.path.join(self.media_item.service_path, filename)
             try:
                 os.remove(thumb)
             except:
                 pass
         log.debug('Importing images list from old config: %s' % files_from_config)
         self.media_item.save_new_images_list(files_from_config)
Esempio n. 4
0
 def app_startup(self):
     """
     Perform tasks on application startup.
     """
     # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed
     Plugin.app_startup(self)
     # Convert old settings-based image list to the database.
     files_from_config = Settings().get_files_from_config(self)
     if files_from_config:
         for file in files_from_config:
             filename = os.path.split(file)[1]
             thumb = os.path.join(self.media_item.service_path, filename)
             try:
                 os.remove(thumb)
             except:
                 pass
         log.debug('Importing images list from old config: %s' %
                   files_from_config)
         self.media_item.save_new_images_list(files_from_config)
Esempio n. 5
0
 def app_startup(self):
     """
     Do a couple of things when the app starts up. In this particular case
     we want to check if we have the old "Use Phonon" setting, and convert
     it to "enable Phonon" and "make it the first one in the list".
     """
     Plugin.app_startup(self)
     settings = Settings()
     settings.beginGroup(self.settingsSection)
     if settings.contains(u'use phonon'):
         log.info(u'Found old Phonon setting')
         players = self.media_controller.mediaPlayers.keys()
         has_phonon = u'phonon' in players
         if settings.value(u'use phonon')  and has_phonon:
             log.debug(u'Converting old setting to new setting')
             new_players = []
             if players:
                 new_players = [player for player in players if player != u'phonon']
             new_players.insert(0, u'phonon')
             self.media_controller.mediaPlayers[u'phonon'].isActive = True
             settings.setValue(u'players', u','.join(new_players))
             self.settingsTab.load()
         settings.remove(u'use phonon')
     settings.endGroup()