openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #02837
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Refactors, cleanups and fixes:
* Move VersionThread (it doesn't belong in mainwindow).
* Add formparent plugin_helper as a reference to mainwindow for plugins to parent their forms.
* Stop setting plugins inactive then active by default (all now inactive unless set active).
* Fix presentation file extension handling (Bug #605655)
* Refactor view mode handling code
* Whitespace
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/31442
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw 2010-07-30 16:13:17 +0000
+++ openlp.pyw 2010-07-31 00:52:46 +0000
@@ -32,12 +32,12 @@
from PyQt4 import QtCore, QtGui
-log = logging.getLogger()
-
from openlp.core.lib import Receiver
from openlp.core.resources import qInitResources
from openlp.core.ui import MainWindow, SplashScreen, ScreenList
-from openlp.core.utils import AppLocation, LanguageManager
+from openlp.core.utils import AppLocation, LanguageManager, VersionThread
+
+log = logging.getLogger()
application_stylesheet = u"""
QMainWindow::separator
@@ -141,7 +141,7 @@
# now kill the splashscreen
self.splash.finish(self.mainWindow)
self.mainWindow.repaint()
- self.mainWindow.versionThread()
+ VersionThread(self.mainWindow, app_version).start()
return self.exec_()
def main():
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2010-07-27 09:32:52 +0000
+++ openlp/core/lib/plugin.py 2010-07-31 00:52:46 +0000
@@ -133,6 +133,7 @@
self.mediadock = plugin_helpers[u'toolbox']
self.displayManager = plugin_helpers[u'displaymanager']
self.pluginManager = plugin_helpers[u'pluginmanager']
+ self.formparent = plugin_helpers[u'formparent']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_add_service_item' % self.name),
self.processAddServiceEvent)
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2010-07-27 09:32:52 +0000
+++ openlp/core/lib/pluginmanager.py 2010-07-31 00:52:46 +0000
@@ -77,7 +77,6 @@
startdepth = len(os.path.abspath(plugin_dir).split(os.sep))
log.debug(u'finding plugins in %s at depth %d',
unicode(plugin_dir), startdepth)
-
for root, dirs, files in os.walk(plugin_dir):
for name in files:
if name.endswith(u'.py') and not name.startswith(u'__'):
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2010-07-28 13:36:29 +0000
+++ openlp/core/ui/mainwindow.py 2010-07-31 00:52:46 +0000
@@ -25,8 +25,6 @@
###############################################################################
import logging
-import time
-import re
from PyQt4 import QtCore, QtGui
@@ -34,8 +32,7 @@
ThemeManager, SlideController, PluginForm, MediaDockManager, DisplayManager
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
SettingsManager, PluginManager, Receiver, translate
-from openlp.core.utils import check_latest_version, AppLocation, add_actions, \
- LanguageManager
+from openlp.core.utils import AppLocation, add_actions, LanguageManager
log = logging.getLogger(__name__)
@@ -58,49 +55,6 @@
font-weight: bold;
}
"""
-class VersionThread(QtCore.QThread):
- """
- A special Qt thread class to fetch the version of OpenLP from the website.
- This is threaded so that it doesn't affect the loading time of OpenLP.
- """
- def __init__(self, parent, app_version):
- QtCore.QThread.__init__(self, parent)
- self.parent = parent
- self.app_version = app_version
- self.version_splitter = re.compile(
- r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))?')
-
- def run(self):
- """
- Run the thread.
- """
- time.sleep(1)
- Receiver.send_message(u'maindisplay_blank_check')
- version = check_latest_version(self.app_version)
- remote_version = {}
- local_version = {}
- match = self.version_splitter.match(version)
- if match:
- remote_version[u'major'] = int(match.group(1))
- remote_version[u'minor'] = int(match.group(2))
- remote_version[u'release'] = int(match.group(3))
- if len(match.groups()) > 3 and match.group(4):
- remote_version[u'revision'] = int(match.group(4))
- match = self.version_splitter.match(self.app_version[u'full'])
- if match:
- local_version[u'major'] = int(match.group(1))
- local_version[u'minor'] = int(match.group(2))
- local_version[u'release'] = int(match.group(3))
- if len(match.groups()) > 3 and match.group(4):
- local_version[u'revision'] = int(match.group(4))
- if remote_version[u'major'] > local_version[u'major'] or \
- remote_version[u'minor'] > local_version[u'minor'] or \
- remote_version[u'release'] > local_version[u'release']:
- Receiver.send_message(u'openlp_version_check', u'%s' % version)
- elif remote_version.get(u'revision') and \
- local_version.get(u'revision') and \
- remote_version[u'revision'] > local_version[u'revision']:
- Receiver.send_message(u'openlp_version_check', u'%s' % version)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
@@ -578,20 +532,15 @@
QtCore.SIGNAL(u'triggered()'),
self.ThemeManagerContents.onExportTheme)
QtCore.QObject.connect(self.ViewMediaManagerItem,
- QtCore.SIGNAL(u'triggered(bool)'),
- self.toggleMediaManager)
+ QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
QtCore.QObject.connect(self.ViewServiceManagerItem,
- QtCore.SIGNAL(u'triggered(bool)'),
- self.toggleServiceManager)
+ QtCore.SIGNAL(u'triggered(bool)'), self.toggleServiceManager)
QtCore.QObject.connect(self.ViewThemeManagerItem,
- QtCore.SIGNAL(u'triggered(bool)'),
- self.toggleThemeManager)
+ QtCore.SIGNAL(u'triggered(bool)'), self.toggleThemeManager)
QtCore.QObject.connect(self.ViewPreviewPanel,
- QtCore.SIGNAL(u'toggled(bool)'),
- self.setPreviewPanelVisibility)
+ QtCore.SIGNAL(u'toggled(bool)'), self.setPreviewPanelVisibility)
QtCore.QObject.connect(self.ViewLivePanel,
- QtCore.SIGNAL(u'toggled(bool)'),
- self.setLivePanelVisibility)
+ QtCore.SIGNAL(u'toggled(bool)'), self.setLivePanelVisibility)
QtCore.QObject.connect(self.MediaManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.ViewMediaManagerItem.setChecked)
@@ -609,8 +558,7 @@
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
QtCore.QObject.connect(self.SettingsConfigureItem,
QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
- QtCore.QObject.connect(self.FileNewItem,
- QtCore.SIGNAL(u'triggered()'),
+ QtCore.QObject.connect(self.FileNewItem, QtCore.SIGNAL(u'triggered()'),
self.ServiceManagerContents.onNewService)
QtCore.QObject.connect(self.FileOpenItem,
QtCore.SIGNAL(u'triggered()'),
@@ -623,22 +571,18 @@
self.ServiceManagerContents.onSaveService)
#i18n set signals for languages
QtCore.QObject.connect(self.AutoLanguageItem,
- QtCore.SIGNAL(u'toggled(bool)'),
- self.setAutoLanguage)
+ QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
QtCore.QObject.connect(self.ModeDefaultItem,
- QtCore.SIGNAL(u'triggered()'),
- self.onModeDefaultItemClicked)
+ QtCore.SIGNAL(u'triggered()'), self.setViewMode)
QtCore.QObject.connect(self.ModeSetupItem,
- QtCore.SIGNAL(u'triggered()'),
- self.onModeSetupItemClicked)
+ QtCore.SIGNAL(u'triggered()'), self.onModeSetupItemClicked)
QtCore.QObject.connect(self.ModeLiveItem,
- QtCore.SIGNAL(u'triggered()'),
- self.onModeLiveItemClicked)
+ QtCore.SIGNAL(u'triggered()'), self.onModeLiveItemClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck)
+ QtCore.SIGNAL(u'openlp_version_check'), self.versionNotice)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -663,6 +607,7 @@
self.plugin_helpers[u'toolbox'] = self.mediaDockManager
self.plugin_helpers[u'displaymanager'] = self.displayManager
self.plugin_helpers[u'pluginmanager'] = self.plugin_manager
+ self.plugin_helpers[u'formparent'] = self
self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers)
# hook methods have to happen after find_plugins. Find plugins needs
# the controllers hence the hooks have moved from setupUI() to here
@@ -699,12 +644,11 @@
LanguageManager.AutoLanguage = value
LanguageManager.set_language(self.LanguageGroup.checkedAction())
- def versionCheck(self, version):
+ def versionNotice(self, version):
"""
- Checks the version of the Application called from openlp.pyw
+ Notifies the user that a newer version of OpenLP is available.
Triggered by delay thread.
"""
- app_version = self.applicationVersion[u'full']
version_text = unicode(translate('OpenLP.MainWindow',
'Version %s of OpenLP is now available for download (you are '
'currently running version %s). \n\nYou can download the latest '
@@ -712,16 +656,13 @@
'<a href="http://openlp.org/">http://openlp.org/</a>.'))
QtGui.QMessageBox.question(self,
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
- version_text % (version, app_version),
- QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
- QtGui.QMessageBox.Ok)
+ version_text % (version, self.applicationVersion[u'full']))
def show(self):
"""
Show the main form, as well as the display form
"""
QtGui.QWidget.show(self)
- #screen_number = self.getMonitorNumber()
self.displayManager.setup()
if self.displayManager.mainDisplay.isVisible():
self.displayManager.mainDisplay.setFocus()
@@ -749,13 +690,6 @@
'The Main Display has been blanked out'))
settings.endGroup()
- def versionThread(self):
- """
- Start an initial setup thread to delay notifications
- """
- vT = VersionThread(self, self.applicationVersion)
- vT.start()
-
def onHelpWebSiteClicked(self):
"""
Load the OpenLP website
@@ -783,35 +717,28 @@
"""
self.settingsForm.exec_()
- def onModeDefaultItemClicked(self):
- """
- Put OpenLP into "Default" view mode.
- """
- self.MediaManagerDock.setVisible(True)
- self.ServiceManagerDock.setVisible(True)
- self.ThemeManagerDock.setVisible(True)
- self.setPreviewPanelVisibility(True)
- self.setLivePanelVisibility(True)
-
def onModeSetupItemClicked(self):
"""
Put OpenLP into "Setup" view mode.
"""
- self.MediaManagerDock.setVisible(True)
- self.ServiceManagerDock.setVisible(True)
- self.ThemeManagerDock.setVisible(False)
- self.setPreviewPanelVisibility(True)
- self.setLivePanelVisibility(False)
+ self.setViewMode(True, True, False, True, False)
def onModeLiveItemClicked(self):
"""
Put OpenLP into "Live" view mode.
"""
- self.MediaManagerDock.setVisible(False)
- self.ServiceManagerDock.setVisible(True)
- self.ThemeManagerDock.setVisible(False)
- self.setPreviewPanelVisibility(False)
- self.setLivePanelVisibility(True)
+ self.setViewMode(False, True, False, False, True)
+
+ def setViewMode(self, media=True, service=True, theme=True, preview=True,
+ live=True):
+ """
+ Set OpenLP to a different view mode.
+ """
+ self.MediaManagerDock.setVisible(media)
+ self.ServiceManagerDock.setVisible(service)
+ self.ThemeManagerDock.setVisible(theme)
+ self.setPreviewPanelVisibility(preview)
+ self.setLivePanelVisibility(live)
def screenChanged(self):
"""
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2010-07-27 09:32:52 +0000
+++ openlp/core/utils/__init__.py 2010-07-31 00:52:46 +0000
@@ -27,20 +27,66 @@
The :mod:`utils` module provides the utility libraries for OpenLP
"""
+import logging
import os
+import re
import sys
-import logging
+import time
import urllib2
from datetime import datetime
from PyQt4 import QtGui, QtCore
import openlp
-from openlp.core.lib import translate
+from openlp.core.lib import Receiver, translate
log = logging.getLogger(__name__)
images_filter = None
+class VersionThread(QtCore.QThread):
+ """
+ A special Qt thread class to fetch the version of OpenLP from the website.
+ This is threaded so that it doesn't affect the loading time of OpenLP.
+ """
+ def __init__(self, parent, app_version):
+ QtCore.QThread.__init__(self, parent)
+ self.app_version = app_version
+ self.version_splitter = re.compile(
+ r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))?')
+
+ def run(self):
+ """
+ Run the thread.
+ """
+ time.sleep(1)
+ Receiver.send_message(u'maindisplay_blank_check')
+ version = check_latest_version(self.app_version)
+ remote_version = {}
+ local_version = {}
+ match = self.version_splitter.match(version)
+ if match:
+ remote_version[u'major'] = int(match.group(1))
+ remote_version[u'minor'] = int(match.group(2))
+ remote_version[u'release'] = int(match.group(3))
+ if len(match.groups()) > 3 and match.group(4):
+ remote_version[u'revision'] = int(match.group(4))
+ match = self.version_splitter.match(self.app_version[u'full'])
+ if match:
+ local_version[u'major'] = int(match.group(1))
+ local_version[u'minor'] = int(match.group(2))
+ local_version[u'release'] = int(match.group(3))
+ if len(match.groups()) > 3 and match.group(4):
+ local_version[u'revision'] = int(match.group(4))
+ if remote_version[u'major'] > local_version[u'major'] or \
+ remote_version[u'minor'] > local_version[u'minor'] or \
+ remote_version[u'release'] > local_version[u'release']:
+ Receiver.send_message(u'openlp_version_check', u'%s' % version)
+ elif remote_version.get(u'revision') and \
+ local_version.get(u'revision') and \
+ remote_version[u'revision'] > local_version[u'revision']:
+ Receiver.send_message(u'openlp_version_check', u'%s' % version)
+
+
class AppLocation(object):
"""
The :class:`AppLocation` class is a static class which retrieves a
=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py 2010-07-28 13:15:39 +0000
+++ openlp/plugins/alerts/alertsplugin.py 2010-07-31 00:52:46 +0000
@@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
from openlp.plugins.alerts.lib.db import init_schema
@@ -45,8 +45,7 @@
self.icon = build_icon(u':/plugins/plugin_alerts.png')
self.alertsmanager = AlertsManager(self)
self.manager = Manager(u'alerts', init_schema)
- self.alertForm = AlertForm(self.manager, self)
- self.status = PluginStatus.Active
+ self.alertForm = AlertForm(self)
def getSettingsTab(self):
"""
=== modified file 'openlp/plugins/alerts/forms/alertform.py'
--- openlp/plugins/alerts/forms/alertform.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/alerts/forms/alertform.py 2010-07-31 00:52:46 +0000
@@ -35,14 +35,14 @@
"""
Provide UI for the alert system
"""
- def __init__(self, manager, parent):
+ def __init__(self, plugin):
"""
Initialise the alert form
"""
- self.manager = manager
- self.parent = parent
+ self.manager = plugin.manager
+ self.parent = plugin
self.item_id = None
- QtGui.QDialog.__init__(self, None)
+ QtGui.QDialog.__init__(self, plugin.formparent)
self.setupUi(self)
QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'),
self.onDisplayClicked)
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2010-07-28 13:15:39 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2010-07-31 00:52:46 +0000
@@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__)
@@ -41,8 +41,6 @@
self.weight = -9
self.icon_path = u':/plugins/plugin_bibles.png'
self.icon = build_icon(self.icon_path)
- # Register the bible Manager.
- self.status = PluginStatus.Active
self.manager = None
def initialise(self):
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/custom/customplugin.py 2010-07-31 00:52:46 +0000
@@ -28,7 +28,7 @@
from forms import EditCustomForm
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema
@@ -53,7 +53,6 @@
self.edit_custom_form = EditCustomForm(self.custommanager)
self.icon_path = u':/plugins/plugin_custom.png'
self.icon = build_icon(self.icon_path)
- self.status = PluginStatus.Active
def getSettingsTab(self):
return CustomTab(self.name)
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2010-07-27 20:35:50 +0000
+++ openlp/plugins/images/imageplugin.py 2010-07-31 00:52:46 +0000
@@ -26,7 +26,7 @@
import logging
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__)
@@ -39,7 +39,6 @@
self.weight = -7
self.icon_path = u':/plugins/plugin_images.png'
self.icon = build_icon(self.icon_path)
- self.status = PluginStatus.Active
def getMediaManagerItem(self):
# Create the MediaManagerItem object
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/media/mediaplugin.py 2010-07-31 00:52:46 +0000
@@ -28,7 +28,7 @@
from PyQt4.phonon import Phonon
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.plugins.media.lib import MediaMediaItem
log = logging.getLogger(__name__)
@@ -43,7 +43,6 @@
self.icon = build_icon(self.icon_path)
# passed with drag and drop messages
self.dnd_id = u'Media'
- self.status = PluginStatus.Active
self.audio_list = u''
self.video_list = u''
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py 2010-07-31 00:52:46 +0000
@@ -69,8 +69,8 @@
"""
log.debug(u'Initialising')
PresentationController.__init__(self, plugin, u'Impress')
- self.supports = [u'.odp']
- self.alsosupports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
+ self.supports = [u'odp']
+ self.alsosupports = [u'ppt', u'pps', u'pptx', u'ppsx']
self.process = None
self.desktop = None
self.manager = None
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2010-07-26 15:19:11 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2010-07-31 00:52:46 +0000
@@ -79,7 +79,6 @@
'Select Presentation(s)')
self.Automatic = translate('PresentationPlugin.MediaItem',
'Automatic')
- self.buildFileMaskString()
def buildFileMaskString(self):
"""
@@ -92,7 +91,7 @@
self.controllers[controller].alsosupports
for type in types:
if fileType.find(type) == -1:
- fileType += u'*%s ' % type
+ fileType += u'*.%s ' % type
self.parent.serviceManager.supportedSuffixes(type)
self.OnNewFileMasks = translate('PresentationPlugin.MediaItem',
'Presentations (%s)' % fileType)
@@ -288,7 +287,7 @@
"supports" the extension. If none found, then look for a controller
which "alsosupports" it instead.
"""
- filetype = os.path.splitext(filename)[1]
+ filetype = filename.split(u'.')[1]
if not filetype:
return None
for controller in self.controllers:
=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2010-07-31 00:52:46 +0000
@@ -54,7 +54,7 @@
"""
log.debug(u'Initialising')
PresentationController.__init__(self, plugin, u'Powerpoint')
- self.supports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
+ self.supports = [u'ppt', u'pps', u'pptx', u'ppsx']
self.process = None
def check_available(self):
=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py 2010-07-26 15:19:11 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2010-07-31 00:52:46 +0000
@@ -50,7 +50,7 @@
log.debug(u'Initialising')
self.process = None
PresentationController.__init__(self, plugin, u'Powerpoint Viewer')
- self.supports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
+ self.supports = [u'ppt', u'pps', u'pptx', u'ppsx']
def check_available(self):
"""
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2010-07-31 00:52:46 +0000
@@ -30,7 +30,7 @@
import os
import logging
-from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
+from openlp.core.lib import Plugin, build_icon, translate
from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab
@@ -55,7 +55,6 @@
self.weight = -8
self.icon_path = u':/plugins/plugin_presentations.png'
self.icon = build_icon(self.icon_path)
- self.status = PluginStatus.Active
def getSettingsTab(self):
"""
@@ -74,6 +73,7 @@
for controller in self.controllers:
if self.controllers[controller].enabled():
self.controllers[controller].start_process()
+ self.mediaItem.buildFileMaskString()
def finalise(self):
"""
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/songs/songsplugin.py 2010-07-31 00:52:46 +0000
@@ -28,8 +28,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \
- translate
+from openlp.core.lib import Plugin, build_icon, Receiver, translate
from openlp.core.lib.db import Manager
from openlp.plugins.songs.lib import OpenLPSongImport, SongMediaItem, SongsTab
from openlp.plugins.songs.lib.db import init_schema, Song
@@ -63,7 +62,6 @@
self.manager = Manager(u'songs', init_schema)
self.icon_path = u':/plugins/plugin_songs.png'
self.icon = build_icon(self.icon_path)
- self.status = PluginStatus.Active
def getSettingsTab(self):
return SongsTab(self.name)
=== modified file 'openlp/plugins/songusage/forms/songusagedeleteform.py'
--- openlp/plugins/songusage/forms/songusagedeleteform.py 2010-07-27 11:21:11 +0000
+++ openlp/plugins/songusage/forms/songusagedeleteform.py 2010-07-31 00:52:46 +0000
@@ -34,7 +34,7 @@
"""
Class documentation goes here.
"""
- def __init__(self, songusagemanager, parent=None):
+ def __init__(self, songusagemanager, parent):
"""
Constructor
"""
=== modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
--- openlp/plugins/songusage/forms/songusagedetailform.py 2010-07-27 11:21:11 +0000
+++ openlp/plugins/songusage/forms/songusagedetailform.py 2010-07-31 00:52:46 +0000
@@ -42,12 +42,12 @@
"""
log.info(u'SongUsage Detail Form Loaded')
- def __init__(self, parent=None):
+ def __init__(self, plugin, parent):
"""
Initialise the form
"""
- QtGui.QDialog.__init__(self, None)
- self.parent = parent
+ QtGui.QDialog.__init__(self, parent)
+ self.plugin = plugin
self.setupUi(self)
def initialise(self):
@@ -59,16 +59,16 @@
self.fromDate.setSelectedDate(fromDate)
self.toDate.setSelectedDate(toDate)
self.fileLineEdit.setText(
- SettingsManager.get_last_dir(self.parent.settingsSection, 1))
+ SettingsManager.get_last_dir(self.plugin.settingsSection, 1))
def defineOutputLocation(self):
path = QtGui.QFileDialog.getExistingDirectory(self,
translate('SongUsagePlugin.SongUsageDetailForm',
'Output File Location'),
- SettingsManager.get_last_dir(self.parent.settingsSection, 1))
+ SettingsManager.get_last_dir(self.plugin.settingsSection, 1))
path = unicode(path)
if path != u'':
- SettingsManager.set_last_dir(self.parent.settingsSection, path, 1)
+ SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1)
self.fileLineEdit.setText(path)
def accept(self):
@@ -76,7 +76,7 @@
filename = u'usage_detail_%s_%s.txt' % (
self.fromDate.selectedDate().toString(u'ddMMyyyy'),
self.toDate.selectedDate().toString(u'ddMMyyyy'))
- usage = self.parent.songusagemanager.get_all_objects(
+ usage = self.plugin.songusagemanager.get_all_objects(
SongUsageItem, and_(
SongUsageItem.usagedate >= self.fromDate.selectedDate().toPyDate(),
SongUsageItem.usagedate < self.toDate.selectedDate().toPyDate()),
@@ -95,3 +95,4 @@
finally:
if file:
file.close()
+ self.close()
=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py 2010-07-27 09:32:52 +0000
+++ openlp/plugins/songusage/songusageplugin.py 2010-07-31 00:52:46 +0000
@@ -117,8 +117,9 @@
self.SongUsageStatus.setChecked(self.SongUsageActive)
if self.songusagemanager is None:
self.songusagemanager = Manager(u'songusage', init_schema)
- self.SongUsagedeleteform = SongUsageDeleteForm(self.songusagemanager)
- self.SongUsagedetailform = SongUsageDetailForm(self)
+ self.SongUsagedeleteform = SongUsageDeleteForm(self.songusagemanager,
+ self.formparent)
+ self.SongUsagedetailform = SongUsageDetailForm(self, self.formparent)
self.SongUsageMenu.menuAction().setVisible(True)
def finalise(self):
Follow ups