diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index aa39e779b..9705e13df 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -109,6 +109,7 @@ class Renderer(object): self.global_theme_data = \ self.themeManager.getThemeData(self.global_theme) self.theme_data = None + self._cache_background_image(self.global_theme_data) def set_service_theme(self, service_theme): """ @@ -119,6 +120,21 @@ class Renderer(object): """ self.service_theme = service_theme self.theme_data = None + self._cache_background_image(self.themeManager.getThemeData + (service_theme)) + + def _cache_background_image(self, temp_theme): + """ + Adds a background image to the image cache if necessary. + + ``temp_theme`` + The theme object containing the theme data. + """ + # if No file do not update cache + if temp_theme.background_filename: + self.imageManager.add_image(temp_theme.theme_name, + temp_theme.background_filename, u'theme', + QtGui.QColor(temp_theme.background_border_color)) def set_override_theme(self, override_theme, override_levels=False): """ @@ -163,11 +179,7 @@ class Renderer(object): self.theme_data = self.themeManager.getThemeData(theme) self._calculate_default() self._build_text_rectangle(self.theme_data) - # if No file do not update cache - if self.theme_data.background_filename: - self.imageManager.add_image(self.theme_data.theme_name, - self.theme_data.background_filename, u'theme', - QtGui.QColor(self.theme_data.background_border_color)) + self._cache_background_image(self.theme_data) return self._rect, self._rect_footer def generate_preview(self, theme_data, force_page=False): diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index c0472cce8..9707886a9 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -80,6 +80,10 @@ class UiStrings(object): self.Help = translate('OpenLP.Ui', 'Help') self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours') + self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', + 'Singular') + self.IFSs = translate('OpenLP.Ui', 'Invalid File Selected', 'Singular') + self.IFSp = translate('OpenLP.Ui', 'Invalid Files Selected', 'Plural') self.Image = translate('OpenLP.Ui', 'Image') self.Import = translate('OpenLP.Ui', 'Import') self.LayoutStyle = translate('OpenLP.Ui', 'Layout style:') diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 5926733a8..c675312ef 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -56,6 +56,9 @@ class ThemeScreenshotThread(QtCore.QThread): themes = themes.split(u',') config = self.parent().config for theme in themes: + # Stop if the wizard has been cancelled. + if self.parent().downloadCancelled: + return title = config.get(u'theme_%s' % theme, u'title') filename = config.get(u'theme_%s' % theme, u'filename') screenshot = config.get(u'theme_%s' % theme, u'screenshot') @@ -86,7 +89,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): files = self.webAccess.read() self.config.readfp(io.BytesIO(files)) self.updateScreenListCombo() - self.downloadCanceled = False + self.downloadCancelled = False self.downloading = unicode(translate('OpenLP.FirstTimeWizard', 'Downloading %s...')) QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL('clicked()'), @@ -242,11 +245,12 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): Process the triggering of the cancel button. """ if self.lastId == FirstTimePage.NoInternet or \ - (self.lastId <= FirstTimePage.Plugins and \ - not self.hasRunWizard): + (self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard): QtCore.QCoreApplication.exit() sys.exit() - self.downloadCanceled = True + self.downloadCancelled = True + while self.themeScreenshotThread.isRunning(): + time.sleep(0.1) Receiver.send_message(u'cursor_normal') def onNoInternetFinishButtonClicked(self): @@ -272,7 +276,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): filesize = urlfile.headers["Content-Length"] filename = open(fpath, "wb") # Download until finished or canceled. - while not self.downloadCanceled: + while not self.downloadCancelled: data = urlfile.read(block_size) if not data: break @@ -280,8 +284,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): block_count += 1 self._downloadProgress(block_count, block_size, filesize) filename.close() - # Delete file if canceled, it may be a partial file. - if self.downloadCanceled: + # Delete file if cancelled, it may be a partial file. + if self.downloadCancelled: os.remove(fpath) def _buildThemeScreenshots(self): diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 801a7abe7..d7fbf4aaa 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -44,20 +44,9 @@ class WizardStrings(object): # Applications/Formats we import from or export to. These get used in # multiple places but do not need translating unless you find evidence of # the writers translating their own product name. - CCLI = u'CCLI/SongSelect' CSV = u'CSV' - DB = u'DreamBeam' - EW = u'EasyWorship' - ES = u'EasySlides' - FP = u'Foilpresenter' - OL = u'OpenLyrics' OS = u'OpenSong' OSIS = u'OSIS' - PS = u'PowerSong 1.0' - SB = u'SongBeamer' - SoF = u'Songs of Fellowship' - SSP = u'SongShow Plus' - WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') @@ -76,10 +65,12 @@ class WizardStrings(object): PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') - YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' + YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify one ' + '%s file to import from.', 'A file type e.g. OpenSong')) + YouSpecifyFiles = unicode(translate('OpenLP.Ui', 'You need to specify at ' 'least one %s file to import from.', 'A file type e.g. OpenSong')) - YouSpecifyFolder = unicode(translate('OpenLP.Ui', 'You need to specify a ' - '%s folder to import from.', 'A file type e.g. OpenSong')) + YouSpecifyFolder = unicode(translate('OpenLP.Ui', 'You need to specify one ' + '%s folder to import from.', 'A song format e.g. PowerSong')) class OpenLPWizard(QtGui.QWizard): diff --git a/openlp/plugins/remotes/html/index.html b/openlp/plugins/remotes/html/index.html index c2aa38b05..fc8b37441 100644 --- a/openlp/plugins/remotes/html/index.html +++ b/openlp/plugins/remotes/html/index.html @@ -164,7 +164,7 @@ ${search} -