From 8df2a6af321fc9c87f5373dc78f3424834d8d5c7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 19 Mar 2013 20:07:02 +0100 Subject: [PATCH 1/8] fixed bug 1146964 Fixes: https://launchpad.net/bugs/1146964 --- openlp/core/ui/exceptionform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index c2f082569..2dfa80b0d 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -219,7 +219,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): self,translate('ImagePlugin.ExceptionDialog', 'Select Attachment'), SettingsManager.get_last_dir(u'exceptions'), - u'%s (*.*) (*)' % UiStrings().AllFiles) + u'%s (*.*)' % UiStrings().AllFiles) log.info(u'New files(s) %s', unicode(files)) if files: self.fileAttachment = unicode(files) From e2c81aaf009ed0262c6343b96ec65fad2a3ef74f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 19 Mar 2013 20:22:10 +0100 Subject: [PATCH 2/8] replaced other file masks --- openlp/core/ui/advancedtab.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 68791aca5..85e472245 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -662,7 +662,7 @@ class AdvancedTab(SettingsTab): u'background-color: %s' % self.defaultColor) def onDefaultBrowseButtonClicked(self): - file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(), + file_filters = u'%s;;%s (*.*)' % (get_images_filter(), UiStrings().AllFiles) filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.AdvancedTab', 'Open File'), '', diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f73e03ed0..2cb7bf55e 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -536,7 +536,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Background Image button pushed. """ images_filter = get_images_filter() - images_filter = u'%s;;%s (*.*) (*)' % ( + images_filter = u'%s;;%s (*.*)' % ( images_filter, UiStrings().AllFiles) filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeWizard', 'Select Image'), u'', diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 2fc786add..c0ff61edf 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -62,7 +62,7 @@ class ImageMediaItem(MediaManagerItem): self.onNewPrompt = translate('ImagePlugin.MediaItem', 'Select Image(s)') file_formats = get_images_filter() - self.onNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, + self.onNewFileMasks = u'%s;;%s (*.*)' % (file_formats, UiStrings().AllFiles) self.replaceAction.setText(UiStrings().ReplaceBG) self.replaceAction.setToolTip(UiStrings().ReplaceLiveBG) From caf1290a16c37acaefa611ff0db6bb2342021f75 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Fri, 5 Apr 2013 23:31:23 +0200 Subject: [PATCH 3/8] Fixed bug #1160506 - use download settings exlusively from download.cfg. --- openlp/core/ui/firsttimeform.py | 51 ++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index fc375cdb4..05837f04b 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -57,6 +57,9 @@ class ThemeScreenshotThread(QtCore.QThread): def run(self): themes = self.parent().config.get(u'themes', u'files') themes = themes.split(u',') + themes_dir = self.parent().config.get(u'themes', u'directory') + tmp_dir = os.path.join(unicode(gettempdir(), get_filesystem_encoding()), + u'openlp') config = self.parent().config for theme in themes: # Stop if the wizard has been cancelled. @@ -65,9 +68,8 @@ class ThemeScreenshotThread(QtCore.QThread): 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') - urllib.urlretrieve(u'%s%s' % (self.parent().web, screenshot), - os.path.join(unicode(gettempdir(), get_filesystem_encoding()), - u'openlp', screenshot)) + urllib.urlretrieve(u'%s%s' % (self.parent().baseurl, themes_dir + '/' + screenshot), + os.path.join(tmp_dir, screenshot)) item = QtGui.QListWidgetItem(title, self.parent().themesListWidget) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename)) item.setCheckState(QtCore.Qt.Unchecked) @@ -85,13 +87,25 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): QtGui.QWizard.__init__(self, parent) self.setupUi(self) self.screens = screens - # check to see if we have web access - self.web = u'http://openlp.org/files/frw/' self.config = SafeConfigParser() + # The following url should contain 'download.cfg' or redirect OpenLP + # to the right url of 'download.cfg' file. + # 'download.cfg' file contains definitions for everything that is + # available for download into OpenLP in FirstTimeWizard. + self.web = u'http://openlp.org/files/frw/' + # Base url for dowloading resource files (songs, themes, bibles). + # These files could be hosted on different places and thus the base + # url is defined in 'download.cfg' file. + self.baseurl = None + # Check to see if we have web access self.webAccess = get_web_page(u'%s%s' % (self.web, u'download.cfg')) if self.webAccess: files = self.webAccess.read() self.config.readfp(io.BytesIO(files)) + self.baseurl = self.config.get(u'general', u'base url') + # Ensure url ends with '/'. + if not self.baseurl.endswith('/'): + self.baseurl += '/' self.updateScreenListCombo() self.downloadCancelled = False self.downloading = unicode(translate('OpenLP.FirstTimeWizard', @@ -123,14 +137,14 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): # Check if this is a re-run of the wizard. self.hasRunWizard = Settings().value( u'general/has run wizard', QtCore.QVariant(False)).toBool() - # Sort out internet access for downloads + # Sort out internet access for downloads. if self.webAccess: songs = self.config.get(u'songs', u'languages') songs = songs.split(u',') for song in songs: title = unicode(self.config.get( u'songs_%s' % song, u'title'), u'utf8') - filename = unicode(self.config.get( + filename = unicode(self.config.get( u'songs_%s' % song, u'filename'), u'utf8') item = QtGui.QListWidgetItem(title, self.songsListWidget) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename)) @@ -280,6 +294,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): Download a file given a URL. The file is retrieved in chunks, giving the ability to cancel the download at any point. """ + log.debug(u'Downloading %s' % url) block_count = 0 block_size = 4096 urlfile = urllib2.urlopen(url) @@ -348,13 +363,18 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self.max_progress = 0 self.finishButton.setVisible(False) Receiver.send_message(u'openlp_process_events') + # Directory name appended to base download url as the name + # is found in download.cfg file. + songs_dir = unicode(self.config.get(u'songs', u'directory'), u'utf8') + bibles_dir = unicode(self.config.get(u'bibles', u'directory'), u'utf8') + themes_dir = unicode(self.config.get(u'themes', u'directory'), u'utf8') # Loop through the songs list and increase for each selected item for i in xrange(self.songsListWidget.count()): Receiver.send_message(u'openlp_process_events') item = self.songsListWidget.item(i) if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s' % (self.web, filename)) + size = self._getFileSize(u'%s%s/%s' % (self.baseurl, songs_dir, filename)) self.max_progress += size # Loop through the Bibles list and increase for each selected item iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget) @@ -363,7 +383,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): item = iterator.value() if item.parent() and item.checkState(0) == QtCore.Qt.Checked: filename = item.data(0, QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s' % (self.web, filename)) + size = self._getFileSize(u'%s%s/%s' % (self.baseurl, bibles_dir, filename)) self.max_progress += size iterator += 1 # Loop through the themes list and increase for each selected item @@ -372,7 +392,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): item = self.themesListWidget.item(i) if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s' % (self.web, filename)) + size = self._getFileSize(u'%s%s/%s' % (self.baseurl, themes_dir, filename)) self.max_progress += size if self.max_progress: # Add on 2 for plugins status setting plus a "finished" point. @@ -448,6 +468,11 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): unicode(gettempdir(), get_filesystem_encoding()), u'openlp') bibles_destination = AppLocation.get_section_data_path(u'bibles') themes_destination = AppLocation.get_section_data_path(u'themes') + # Directory name appended to base download url as the name + # is found in download.cfg file. + songs_dir = unicode(self.config.get(u'songs', u'directory'), u'utf8') + bibles_dir = unicode(self.config.get(u'bibles', u'directory'), u'utf8') + themes_dir = unicode(self.config.get(u'themes', u'directory'), u'utf8') # Download songs for i in xrange(self.songsListWidget.count()): item = self.songsListWidget.item(i) @@ -457,7 +482,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self.previous_size = 0 destination = os.path.join(songs_destination, unicode(filename)) - self.urlGetFile(u'%s%s' % (self.web, filename), destination) + self.urlGetFile(u'%s%s/%s' % (self.baseurl, songs_dir, filename), destination) # Download Bibles bibles_iterator = QtGui.QTreeWidgetItemIterator( self.biblesTreeWidget) @@ -467,7 +492,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): bible = unicode(item.data(0, QtCore.Qt.UserRole).toString()) self._incrementProgressBar(self.downloading % bible, 0) self.previous_size = 0 - self.urlGetFile(u'%s%s' % (self.web, bible), + self.urlGetFile(u'%s%s/%s' % (self.baseurl, bibles_dir, bible), os.path.join(bibles_destination, bible)) bibles_iterator += 1 # Download themes @@ -477,7 +502,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): theme = unicode(item.data(QtCore.Qt.UserRole).toString()) self._incrementProgressBar(self.downloading % theme, 0) self.previous_size = 0 - self.urlGetFile(u'%s%s' % (self.web, theme), + self.urlGetFile(u'%s%s/%s' % (self.baseurl, themes_dir, theme), os.path.join(themes_destination, theme)) # Set Default Display if self.displayComboBox.currentIndex() != -1: From 1c4c2e363623c491750f85c75c4a62dc9bcd51a8 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Tue, 9 Apr 2013 11:53:42 +0200 Subject: [PATCH 4/8] Bug #1160506 - wrap url constructions into join_url() function. --- openlp/core/ui/firsttimeform.py | 24 ++++++++++++------------ openlp/core/utils/__init__.py | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 05837f04b..0742a92b6 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -42,7 +42,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \ check_directory_exists from openlp.core.lib.settings import Settings -from openlp.core.utils import get_web_page, AppLocation, get_filesystem_encoding +from openlp.core.utils import get_web_page, AppLocation, join_url, \ + get_filesystem_encoding from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage log = logging.getLogger(__name__) @@ -68,7 +69,8 @@ class ThemeScreenshotThread(QtCore.QThread): 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') - urllib.urlretrieve(u'%s%s' % (self.parent().baseurl, themes_dir + '/' + screenshot), + urllib.urlretrieve(join_url(self.parent().baseurl, + themes_dir, screenshot), os.path.join(tmp_dir, screenshot)) item = QtGui.QListWidgetItem(title, self.parent().themesListWidget) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename)) @@ -103,9 +105,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): files = self.webAccess.read() self.config.readfp(io.BytesIO(files)) self.baseurl = self.config.get(u'general', u'base url') - # Ensure url ends with '/'. - if not self.baseurl.endswith('/'): - self.baseurl += '/' self.updateScreenListCombo() self.downloadCancelled = False self.downloading = unicode(translate('OpenLP.FirstTimeWizard', @@ -144,7 +143,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): for song in songs: title = unicode(self.config.get( u'songs_%s' % song, u'title'), u'utf8') - filename = unicode(self.config.get( + filename = unicode(self.config.get( u'songs_%s' % song, u'filename'), u'utf8') item = QtGui.QListWidgetItem(title, self.songsListWidget) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename)) @@ -374,7 +373,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): item = self.songsListWidget.item(i) if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s/%s' % (self.baseurl, songs_dir, filename)) + size = self._getFileSize(join_url(self.baseurl, songs_dir, filename)) self.max_progress += size # Loop through the Bibles list and increase for each selected item iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget) @@ -383,7 +382,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): item = iterator.value() if item.parent() and item.checkState(0) == QtCore.Qt.Checked: filename = item.data(0, QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s/%s' % (self.baseurl, bibles_dir, filename)) + size = self._getFileSize(join_url(self.baseurl, bibles_dir, filename)) self.max_progress += size iterator += 1 # Loop through the themes list and increase for each selected item @@ -392,7 +391,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): item = self.themesListWidget.item(i) if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() - size = self._getFileSize(u'%s%s/%s' % (self.baseurl, themes_dir, filename)) + size = self._getFileSize(join_url(self.baseurl, themes_dir, filename)) self.max_progress += size if self.max_progress: # Add on 2 for plugins status setting plus a "finished" point. @@ -482,7 +481,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self.previous_size = 0 destination = os.path.join(songs_destination, unicode(filename)) - self.urlGetFile(u'%s%s/%s' % (self.baseurl, songs_dir, filename), destination) + self.urlGetFile(join_url(self.baseurl, songs_dir, filename), + destination) # Download Bibles bibles_iterator = QtGui.QTreeWidgetItemIterator( self.biblesTreeWidget) @@ -492,7 +492,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): bible = unicode(item.data(0, QtCore.Qt.UserRole).toString()) self._incrementProgressBar(self.downloading % bible, 0) self.previous_size = 0 - self.urlGetFile(u'%s%s/%s' % (self.baseurl, bibles_dir, bible), + self.urlGetFile(join_url(self.baseurl, bibles_dir, bible), os.path.join(bibles_destination, bible)) bibles_iterator += 1 # Download themes @@ -502,7 +502,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): theme = unicode(item.data(QtCore.Qt.UserRole).toString()) self._incrementProgressBar(self.downloading % theme, 0) self.previous_size = 0 - self.urlGetFile(u'%s%s/%s' % (self.baseurl, themes_dir, theme), + self.urlGetFile(join_url(self.baseurl, themes_dir, theme), os.path.join(themes_destination, theme)) # Set Default Display if self.displayComboBox.currentIndex() != -1: diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 085760817..6f8bf610b 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -37,6 +37,7 @@ import re from subprocess import Popen, PIPE import sys import urllib2 +import urlparse from openlp.core.lib.settings import Settings @@ -364,6 +365,25 @@ def get_images_filter(): return IMAGES_FILTER +def join_url(base, *args): + """ + Join one or more url components with the base url. + + ``base`` + Base url containing top level domain. + e.g. http://www.example.org + + ``args`` + url components to be appended to the base url. + """ + # Remove leading and trailing slash from components. + # Also ensure QString is converted to unicode(). + args = [unicode(x).strip('/') for x in args] + url = urlparse.urljoin(base, '/'.join(args)) + print url + return url + + def split_filename(path): """ Return a list of the parts in a given path. From 576524b8734beb2ba35ff503db55f007e0975642 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Thu, 11 Apr 2013 12:06:44 +0200 Subject: [PATCH 5/8] Bug #1160506 - remove print statement. --- openlp/core/utils/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 6f8bf610b..664f98d8c 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -379,9 +379,7 @@ def join_url(base, *args): # Remove leading and trailing slash from components. # Also ensure QString is converted to unicode(). args = [unicode(x).strip('/') for x in args] - url = urlparse.urljoin(base, '/'.join(args)) - print url - return url + return urlparse.urljoin(base, '/'.join(args)) def split_filename(path): From fd48e98598ac4a739cc3c61525b5dd5af70f0a4e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 18 Apr 2013 19:53:01 +0200 Subject: [PATCH 6/8] fixed bug-1170435 Fixes: https://launchpad.net/bugs/1170435 --- openlp/plugins/songs/forms/editsongform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index b9dbd2c03..d94df45fa 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -608,7 +608,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for verse in verses: if not verse in order: verses_not_used.append(verse) - self.warningLabel.setVisible(len(verses_not_used) > 0) + self.warningLabel.setVisible(len(verses_not_used) > 0 and bool(text)) def __extractVerseOrder(self, verse_order): order = [] From e1085a17982d0a609f8e2655bc8c696995eb20ce Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 14 Jun 2013 11:54:59 +0200 Subject: [PATCH 7/8] increased possible min/max line spacing Fixes: https://launchpad.net/bugs/645452 --- openlp/core/ui/themewizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 8e9d698c1..b31d55fa2 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -180,8 +180,8 @@ class Ui_ThemeWizard(object): self.lineSpacingLabel = QtGui.QLabel(self.mainAreaPage) self.lineSpacingLabel.setObjectName(u'LineSpacingLabel') self.lineSpacingSpinBox = QtGui.QSpinBox(self.mainAreaPage) - self.lineSpacingSpinBox.setMinimum(-50) - self.lineSpacingSpinBox.setMaximum(50) + self.lineSpacingSpinBox.setMinimum(-250) + self.lineSpacingSpinBox.setMaximum(250) self.lineSpacingSpinBox.setObjectName(u'LineSpacingSpinBox') self.mainAreaLayout.addRow(self.lineSpacingLabel, self.lineSpacingSpinBox) From 1b7d5f2f0e12bf92e3ab9174681446cab1887630 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 16 Jun 2013 19:19:32 +0200 Subject: [PATCH 8/8] added second warning --- openlp/plugins/songs/forms/editsongdialog.py | 8 ++++---- openlp/plugins/songs/forms/editsongform.py | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 8f8954c44..3c8a7f175 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -283,7 +283,6 @@ class Ui_EditSongDialog(object): self.bottomLayout.setObjectName(u'bottomLayout') self.warningLabel = QtGui.QLabel(editSongDialog) self.warningLabel.setObjectName(u'warningLabel') - self.warningLabel.setVisible(False) self.bottomLayout.addWidget(self.warningLabel) self.buttonBox = create_button_box(editSongDialog, u'buttonBox', [u'cancel', u'save']) @@ -355,9 +354,10 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', '&Remove')) self.audioRemoveAllButton.setText( translate('SongsPlugin.EditSongForm', 'Remove &All')) - self.warningLabel.setText( - translate('SongsPlugin.EditSongForm', 'Warning:' - ' Not all of the verses are in use.')) + self.notAlllVersesUsed = translate('SongsPlugin.EditSongForm', 'Warning:' + ' Not all of the verses are in use.') + self.noVerseOrder = translate('SongsPlugin.EditSongForm', 'Warning:' + ' You have not entered a verse order.') def editSongDialogComboBox(parent, name): """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index d94df45fa..7593e4a95 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -349,6 +349,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason) # Hide or show the preview button. self.previewButton.setVisible(preview) + # Check if all verse tags are used. + self.onVerseOrderTextChanged(self.verseOrderEdit.text()) def tagRows(self): """ @@ -608,7 +610,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for verse in verses: if not verse in order: verses_not_used.append(verse) - self.warningLabel.setVisible(len(verses_not_used) > 0 and bool(text)) + label_text = u'' + if not self.verseOrderEdit.text(): + label_text = self.noVerseOrder + elif verses_not_used: + label_text = self.notAlllVersesUsed + self.warningLabel.setText(label_text) def __extractVerseOrder(self, verse_order): order = []