From 3d3114b56dabc026d35793c71a879c41bf788d95 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 15 Jul 2011 19:38:09 +0200 Subject: [PATCH 1/3] fixed copyright Fixes: https://launchpad.net/bugs/810633 --- scripts/check_dependencies.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index bf9e97d88..7048ceeab 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -5,7 +5,12 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2011 Raoul Snyman # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan # +# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, # +# Armin Köhler, Joshua Millar, Stevan Pettit, Andreas Preikschat, Mattias # +# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, # +# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # From bc5d2cce46768b25d23067619fdd7ad4e94eb31d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 15 Jul 2011 20:18:11 +0200 Subject: [PATCH 2/3] removed zip support for OpenSong importer Fixes: https://launchpad.net/bugs/795027 --- openlp/plugins/songs/lib/opensongimport.py | 44 ++-------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 3c8b46d4e..834255fd0 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -28,7 +28,6 @@ import logging import os import re -from zipfile import ZipFile from lxml import objectify from lxml.etree import Error, LxmlError @@ -110,48 +109,13 @@ class OpenSongImport(SongImport): SongImport.__init__(self, manager, **kwargs) def do_import(self): - """ - Import either each of the files in self.import_source - each element of - which can be either a single opensong file, or a zipfile containing - multiple opensong files. - """ - numfiles = 0 - for filename in self.import_source: - ext = os.path.splitext(filename)[1] - if ext.lower() == u'.zip': - z = ZipFile(filename, u'r') - numfiles += len(z.infolist()) - z.close() - else: - numfiles += 1 - log.debug(u'Total number of files: %d', numfiles) - self.import_wizard.progressBar.setMaximum(numfiles) + self.import_wizard.progressBar.setMaximum(len(self.import_source)) for filename in self.import_source: if self.stop_import_flag: return - ext = os.path.splitext(filename)[1] - if ext.lower() == u'.zip': - log.debug(u'Zipfile found %s', filename) - z = ZipFile(filename, u'r') - for song in z.infolist(): - if self.stop_import_flag: - z.close() - return - parts = os.path.split(song.filename) - if parts[-1] == u'': - # No final part => directory - continue - log.info(u'Zip importing %s', parts[-1]) - song_file = z.open(song) - self.do_import_file(song_file) - song_file.close() - z.close() - else: - # not a zipfile - log.info(u'Direct import %s', filename) - song_file = open(filename) - self.do_import_file(song_file) - song_file.close() + song_file = open(filename) + self.do_import_file(song_file) + song_file.close() def do_import_file(self, file): """ From b51f9b2a0c524502d951ba20d026941465f8b565 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 16 Jul 2011 09:20:13 +0200 Subject: [PATCH 3/3] - do not set a service modified when using the up/down arrows to change the selected service item - only set the service modified when an item is selected while using the 'move button' and 'delete button' --- openlp/core/ui/servicemanager.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index f6c069525..c6dfe77aa 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -802,7 +802,6 @@ class ServiceManager(QtGui.QWidget): # Top Item was selected so set the last one if setLastItem: lastItem.setSelected(True) - self.setModified() def onMoveSelectionDown(self): """ @@ -824,7 +823,6 @@ class ServiceManager(QtGui.QWidget): serviceIterator += 1 if setSelected: firstItem.setSelected(True) - self.setModified() def onCollapseAll(self): """ @@ -863,12 +861,12 @@ class ServiceManager(QtGui.QWidget): Move the current ServiceItem to the top of the list. """ item, child = self.findServiceItem() - if item < len(self.serviceItems) and item is not -1: + if item < len(self.serviceItems) and item != -1: temp = self.serviceItems[item] self.serviceItems.remove(self.serviceItems[item]) self.serviceItems.insert(0, temp) self.repaintServiceList(0, child) - self.setModified() + self.setModified() def onServiceUp(self): """ @@ -880,31 +878,31 @@ class ServiceManager(QtGui.QWidget): self.serviceItems.remove(self.serviceItems[item]) self.serviceItems.insert(item - 1, temp) self.repaintServiceList(item - 1, child) - self.setModified() + self.setModified() def onServiceDown(self): """ Move the current ServiceItem one position down in the list. """ item, child = self.findServiceItem() - if item < len(self.serviceItems) and item is not -1: + if item < len(self.serviceItems) and item != -1: temp = self.serviceItems[item] self.serviceItems.remove(self.serviceItems[item]) self.serviceItems.insert(item + 1, temp) self.repaintServiceList(item + 1, child) - self.setModified() + self.setModified() def onServiceEnd(self): """ Move the current ServiceItem to the bottom of the list. """ item, child = self.findServiceItem() - if item < len(self.serviceItems) and item is not -1: + if item < len(self.serviceItems) and item != -1: temp = self.serviceItems[item] self.serviceItems.remove(self.serviceItems[item]) self.serviceItems.insert(len(self.serviceItems), temp) self.repaintServiceList(len(self.serviceItems) - 1, child) - self.setModified() + self.setModified() def onDeleteFromService(self): """ @@ -914,7 +912,7 @@ class ServiceManager(QtGui.QWidget): if item != -1: self.serviceItems.remove(self.serviceItems[item]) self.repaintServiceList(item - 1, -1) - self.setModified() + self.setModified() def repaintServiceList(self, serviceItem, serviceItemChild): """