From 36ccd4a2caaf3a9fef0e80af0a9a8b5d81412615 Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Fri, 22 Jul 2011 18:58:42 -0400 Subject: [PATCH 1/8] modified windows build script to add --noupx option to pyinstaller --- scripts/windows-builder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 9c96fe251..9c7d27106 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -179,6 +179,7 @@ def run_pyinstaller(): pyinstaller = Popen((python_exe, pyi_build, u'--noconfirm', u'--windowed', + u'--noupx', u'-o', branch_path, u'-i', win32_icon, u'-p', branch_path, From c813b3142765bbaf90ced09f402220fd38c5dadb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 23 Jul 2011 06:48:55 +0100 Subject: [PATCH 2/8] Correct up and down selection for service manage panel Fixes: https://launchpad.net/bugs/805084 --- openlp/core/ui/servicemanager.py | 51 +++++++++----------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c6dfe77aa..dd7720331 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -781,48 +781,25 @@ class ServiceManager(QtGui.QWidget): def onMoveSelectionUp(self): """ - Moves the selection up the window. Called by the up arrow. + Moves the cursor selection up the window. + Called by the up arrow. """ - serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) - tempItem = None - setLastItem = False - while serviceIterator.value(): - if serviceIterator.value().isSelected() and tempItem is None: - setLastItem = True - serviceIterator.value().setSelected(False) - if serviceIterator.value().isSelected(): - # We are on the first record - if tempItem: - tempItem.setSelected(True) - serviceIterator.value().setSelected(False) - else: - tempItem = serviceIterator.value() - lastItem = serviceIterator.value() - serviceIterator += 1 - # Top Item was selected so set the last one - if setLastItem: - lastItem.setSelected(True) + item = self.serviceManagerList.currentItem() + itemBefore = self.serviceManagerList.itemAbove(item) + if itemBefore is None: + return + self.serviceManagerList.setCurrentItem(itemBefore) def onMoveSelectionDown(self): """ - Moves the selection down the window. Called by the down arrow. + Moves the cursor selection down the window. + Called by the down arrow. """ - serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) - firstItem = None - setSelected = False - while serviceIterator.value(): - if not firstItem: - firstItem = serviceIterator.value() - if setSelected: - setSelected = False - serviceIterator.value().setSelected(True) - elif serviceIterator.value() and \ - serviceIterator.value().isSelected(): - serviceIterator.value().setSelected(False) - setSelected = True - serviceIterator += 1 - if setSelected: - firstItem.setSelected(True) + item = self.serviceManagerList.currentItem() + itemAfter = self.serviceManagerList.itemBelow(item) + if itemAfter is None: + return + self.serviceManagerList.setCurrentItem(itemAfter) def onCollapseAll(self): """ From 5448e6ae7985346ddacb63d9298fd055aea0f75e Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Sat, 23 Jul 2011 08:11:11 -0400 Subject: [PATCH 3/8] Removed documentation references to UPX from windos=builder.py --- scripts/windows-builder.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 9c7d27106..b7bf70472 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -46,12 +46,6 @@ PyEnchant Inno Setup 5 Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5" -UPX - This is used to compress DLLs and EXEs so that they take up less space, but - still function exactly the same. To install UPX, download it from - http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then - add that directory to your PATH environment variable. - Sphinx This is used to build the documentation. The documentation trunk must be at the same directory level as Openlp trunk and named "documentation" From 90c18b6bfd42a4fa512cb68f1a52f77d7d5bdbba Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Sat, 23 Jul 2011 17:29:24 -0400 Subject: [PATCH 4/8] changed plugin names to lowercase, removed .lower() from appropriate code --- openlp/core/lib/mediamanageritem.py | 6 +++--- openlp/core/lib/plugin.py | 2 +- openlp/core/ui/mediadockmanager.py | 4 ++-- openlp/plugins/alerts/alertsplugin.py | 2 +- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/custom/customplugin.py | 2 +- openlp/plugins/images/imageplugin.py | 2 +- openlp/plugins/media/mediaplugin.py | 2 +- openlp/plugins/presentations/presentationplugin.py | 2 +- openlp/plugins/remotes/remoteplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 2 +- openlp/plugins/songusage/songusageplugin.py | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 0cc25717c..66bf89f49 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -96,7 +96,7 @@ class MediaManagerItem(QtGui.QWidget): self.plugin = plugin visible_title = self.plugin.getString(StringContent.VisibleName) self.title = unicode(visible_title[u'title']) - self.settingsSection = self.plugin.name.lower() + self.settingsSection = self.plugin.name self.icon = None if icon: self.icon = build_icon(icon) @@ -113,7 +113,7 @@ class MediaManagerItem(QtGui.QWidget): self.retranslateUi() self.auto_select_id = -1 QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'%s_service_load' % self.plugin.name.lower()), + QtCore.SIGNAL(u'%s_service_load' % self.plugin.name), self.serviceLoad) def requiredIcons(self): @@ -558,7 +558,7 @@ class MediaManagerItem(QtGui.QWidget): QtGui.QMessageBox.information(self, UiStrings().NISs, translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.')) - elif self.plugin.name.lower() == serviceItem.name.lower(): + elif self.plugin.name == serviceItem.name: self.generateSlideData(serviceItem) self.plugin.serviceManager.addServiceItem(serviceItem, replace=True) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index ec5e44f8e..5b9f2185e 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -152,7 +152,7 @@ class Plugin(QtCore.QObject): self.version = version else: self.version = get_application_version()[u'version'] - self.settingsSection = self.name.lower() + self.settingsSection = self.name self.icon = None self.media_item_class = media_item_class self.settings_tab_class = settings_tab_class diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index 3eb5a899c..cc6cc92bc 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -66,7 +66,7 @@ class MediaDockManager(object): match = False for dock_index in range(0, self.media_dock.count()): if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name.lower(): + media_item.plugin.name: match = True break if not match: @@ -84,6 +84,6 @@ class MediaDockManager(object): for dock_index in range(0, self.media_dock.count()): if self.media_dock.widget(dock_index): if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name.lower(): + media_item.plugin.name: self.media_dock.widget(dock_index).setVisible(False) self.media_dock.removeItem(dock_index) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 228031842..21db1972a 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -43,7 +43,7 @@ class AlertsPlugin(Plugin): log.info(u'Alerts Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Alerts', plugin_helpers, + Plugin.__init__(self, u'alerts', plugin_helpers, settings_tab_class=AlertsTab) self.weight = -3 self.icon_path = u':/plugins/plugin_alerts.png' diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index da7658c12..619581b17 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -41,7 +41,7 @@ class BiblePlugin(Plugin): log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Bibles', plugin_helpers, + Plugin.__init__(self, u'bibles', plugin_helpers, BibleMediaItem, BiblesTab) self.weight = -9 self.icon_path = u':/plugins/plugin_bibles.png' diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 7b7c939b1..e9260f926 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -46,7 +46,7 @@ class CustomPlugin(Plugin): log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Custom', plugin_helpers, + Plugin.__init__(self, u'custom', plugin_helpers, CustomMediaItem, CustomTab) self.weight = -5 self.manager = Manager(u'custom', init_schema) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index b92a804fd..1ddbe8357 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -36,7 +36,7 @@ class ImagePlugin(Plugin): log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Images', plugin_helpers, ImageMediaItem) + Plugin.__init__(self, u'images', plugin_helpers, ImageMediaItem) self.weight = -7 self.icon_path = u':/plugins/plugin_images.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 308ebd959..c215b1be0 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -39,7 +39,7 @@ class MediaPlugin(Plugin): log.info(u'%s MediaPlugin loaded', __name__) def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Media', plugin_helpers, + Plugin.__init__(self, u'media', plugin_helpers, MediaMediaItem, MediaTab) self.weight = -6 self.icon_path = u':/plugins/plugin_media.png' diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 2990862e1..a97f82159 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -52,7 +52,7 @@ class PresentationPlugin(Plugin): """ log.debug(u'Initialised') self.controllers = {} - Plugin.__init__(self, u'Presentations', plugin_helpers) + Plugin.__init__(self, u'presentations', plugin_helpers) self.weight = -8 self.icon_path = u':/plugins/plugin_presentations.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index a120becba..dfaff9675 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -39,7 +39,7 @@ class RemotesPlugin(Plugin): """ remotes constructor """ - Plugin.__init__(self, u'Remotes', plugin_helpers, + Plugin.__init__(self, u'remotes', plugin_helpers, settings_tab_class=RemoteTab) self.icon_path = u':/plugins/plugin_remote.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e514b2937..8a773be90 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -57,7 +57,7 @@ class SongsPlugin(Plugin): """ Create and set up the Songs plugin. """ - Plugin.__init__(self, u'Songs', plugin_helpers, SongMediaItem, SongsTab) + Plugin.__init__(self, u'songs', plugin_helpers, SongMediaItem, SongsTab) self.weight = -10 self.manager = Manager(u'songs', init_schema) self.icon_path = u':/plugins/plugin_songs.png' diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index cc143b986..a657d700d 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -45,7 +45,7 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'SongUsage', plugin_helpers) + Plugin.__init__(self, u'songusage', plugin_helpers) self.weight = -4 self.icon = build_icon(u':/plugins/plugin_songusage.png') self.activeIcon = build_icon(u':/songusage/song_usage_active.png') From 0d9f6a946e94925d572e1629d692726938233ada Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Sun, 24 Jul 2011 15:41:33 -0400 Subject: [PATCH 5/8] modified slidecontroller to "reset" the loop button when new item is sent live --- openlp/core/ui/slidecontroller.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 9d35c1166..0f83cbc30 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -508,6 +508,11 @@ class SlideController(QtGui.QWidget): self.mediabar.setVisible(False) self.toolbar.makeWidgetsInvisible([u'Song Menu']) self.toolbar.makeWidgetsInvisible(self.loopList) + # Reset the button + self.playSlidesOnce.setChecked(False) + self.playSlidesOnce.setIcon(build_icon(u':/media/media_time.png')) + self.playSlidesLoop.setChecked(False) + self.playSlidesLoop.setIcon(build_icon(u':/media/media_time.png')) if item.is_text(): if QtCore.QSettings().value( self.parent().songsSettingsSection + u'/display songbar', From 0bd821aaa584969551e0523227682861110c8f87 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 26 Jul 2011 17:44:24 +0200 Subject: [PATCH 6/8] docstrings clean ups --- openlp/plugins/remotes/lib/httpserver.py | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 836b3d0ae..f5054fadd 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -150,9 +150,7 @@ class HttpResponse(object): class HttpServer(object): """ - Ability to control OpenLP via a webbrowser - e.g. http://localhost:4316/send/slidecontroller_live_next - http://localhost:4316/send/alerts_text?q=your%20alert%20text + Ability to control OpenLP via a webbrowser. """ def __init__(self, plugin): """ @@ -230,6 +228,7 @@ class HttpServer(object): log.debug(u'close http server') self.server.close() + class HttpConnection(object): """ A single connection, this handles communication between the server @@ -287,9 +286,12 @@ class HttpConnection(object): """ self.template_vars = { 'app_title': translate('RemotePlugin.Mobile', 'OpenLP 2.0 Remote'), - 'stage_title': translate('RemotePlugin.Mobile', 'OpenLP 2.0 Stage View'), - 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), - 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), + 'stage_title': translate('RemotePlugin.Mobile', + 'OpenLP 2.0 Stage View'), + 'service_manager': translate('RemotePlugin.Mobile', + 'Service Manager'), + 'slide_controller': translate('RemotePlugin.Mobile', + 'Slide Controller'), 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), 'search': translate('RemotePlugin.Mobile', 'Search'), 'back': translate('RemotePlugin.Mobile', 'Back'), @@ -301,7 +303,8 @@ class HttpConnection(object): 'text': translate('RemotePlugin.Mobile', 'Text'), 'show_alert': translate('RemotePlugin.Mobile', 'Show Alert'), 'go_live': translate('RemotePlugin.Mobile', 'Go Live'), - 'add_to_service': translate('RemotePlugin.Mobile', 'Add To Service'), + 'add_to_service': translate('RemotePlugin.Mobile', + 'Add To Service'), 'no_results': translate('RemotePlugin.Mobile', 'No Results'), 'options': translate('RemotePlugin.Mobile', 'Options') } @@ -397,7 +400,7 @@ class HttpConnection(object): if self.parent.current_item else u'' } return HttpResponse(json.dumps({u'results': result}), - {u'Content-Type': u'application/json'}) + {u'Content-Type': u'application/json'}) def display(self, action): """ @@ -483,10 +486,11 @@ class HttpConnection(object): def pluginInfo(self, action): """ - Return plugin related information, based on the action + Return plugin related information, based on the action. - ``action`` - The action to perform - if 'search' return a list of plugin names which support search + ``action`` + The action to perform. If *search* return a list of plugin names + which support search. """ if action == u'search': searches = [] @@ -501,10 +505,10 @@ class HttpConnection(object): def search(self, type): """ - Return a list of items that match the search text + Return a list of items that match the search text. ``type`` - The plugin name to search in. + The plugin name to search in. """ text = json.loads(self.url_params[u'data'][0])[u'request'][u'text'] plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type) @@ -528,7 +532,7 @@ class HttpConnection(object): def add_to_service(self, type): """ - Add item of type ``type`` to the end of the service + Add item of type ``type`` to the end of the service. """ id = json.loads(self.url_params[u'data'][0])[u'request'][u'id'] plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type) From 6aec735be4c6375b9bfa6e25e79749e67e1bcc8b Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 27 Jul 2011 19:05:43 +0200 Subject: [PATCH 7/8] corrections --- openlp/plugins/remotes/lib/httpserver.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index f5054fadd..c9cba12cf 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -150,11 +150,11 @@ class HttpResponse(object): class HttpServer(object): """ - Ability to control OpenLP via a webbrowser. + Ability to control OpenLP via a web browser. """ def __init__(self, plugin): """ - Initialise the httpserver, and start the server + Initialise the httpserver, and start the server. """ log.debug(u'Initialise httpserver') self.plugin = plugin @@ -168,9 +168,9 @@ class HttpServer(object): def start_tcp(self): """ - Start the http server, use the port in the settings default to 4316 + Start the http server, use the port in the settings default to 4316. Listen out for slide and song changes so they can be broadcast to - clients. Listen out for socket connections + clients. Listen out for socket connections. """ log.debug(u'Start TCP server') port = QtCore.QSettings().value( @@ -193,20 +193,20 @@ class HttpServer(object): def slide_change(self, row): """ - Slide change listener. Store the item and tell the clients + Slide change listener. Store the item and tell the clients. """ self.current_slide = row def item_change(self, items): """ - Item (song) change listener. Store the slide and tell the clients + Item (song) change listener. Store the slide and tell the clients. """ self.current_item = items[0] def new_connection(self): """ A new http connection has been made. Create a client object to handle - communication + communication. """ log.debug(u'new http connection') socket = self.server.nextPendingConnection() @@ -223,7 +223,7 @@ class HttpServer(object): def close(self): """ - Close down the http server + Close down the http server. """ log.debug(u'close http server') self.server.close() @@ -232,7 +232,7 @@ class HttpServer(object): class HttpConnection(object): """ A single connection, this handles communication between the server - and the client + and the client. """ def __init__(self, parent, socket): """ From 746001c485d9358dceff0dc4cb4042d29c2dfcbf Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 27 Jul 2011 20:12:54 +0200 Subject: [PATCH 8/8] corrections --- openlp/plugins/remotes/lib/httpserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index c9cba12cf..1545986f0 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -304,7 +304,7 @@ class HttpConnection(object): 'show_alert': translate('RemotePlugin.Mobile', 'Show Alert'), 'go_live': translate('RemotePlugin.Mobile', 'Go Live'), 'add_to_service': translate('RemotePlugin.Mobile', - 'Add To Service'), + 'Add to Service'), 'no_results': translate('RemotePlugin.Mobile', 'No Results'), 'options': translate('RemotePlugin.Mobile', 'Options') }