forked from openlp/openlp
- fixed missing plugin in kwargs
bzr-revno: 1991
This commit is contained in:
commit
fbe982f862
@ -515,6 +515,7 @@ class SongImportForm(OpenLPWizard):
|
|||||||
self.formatWidgets[format][u'importWidget'] = importWidget
|
self.formatWidgets[format][u'importWidget'] = importWidget
|
||||||
return importWidget
|
return importWidget
|
||||||
|
|
||||||
|
|
||||||
class SongImportSourcePage(QtGui.QWizardPage):
|
class SongImportSourcePage(QtGui.QWizardPage):
|
||||||
"""
|
"""
|
||||||
Subclass of QtGui.QWizardPage to override isComplete() for Source Page.
|
Subclass of QtGui.QWizardPage to override isComplete() for Source Page.
|
||||||
|
@ -66,6 +66,7 @@ except ImportError:
|
|||||||
log.exception('Error importing %s', 'OooImport')
|
log.exception('Error importing %s', 'OooImport')
|
||||||
HAS_OOO = False
|
HAS_OOO = False
|
||||||
|
|
||||||
|
|
||||||
class SongFormatSelect(object):
|
class SongFormatSelect(object):
|
||||||
"""
|
"""
|
||||||
This is a special enumeration class listing available file selection modes.
|
This is a special enumeration class listing available file selection modes.
|
||||||
@ -74,6 +75,7 @@ class SongFormatSelect(object):
|
|||||||
MultipleFiles = 1
|
MultipleFiles = 1
|
||||||
SingleFolder = 2
|
SingleFolder = 2
|
||||||
|
|
||||||
|
|
||||||
class SongFormat(object):
|
class SongFormat(object):
|
||||||
"""
|
"""
|
||||||
This is a special static class that holds an enumeration of the various
|
This is a special static class that holds an enumeration of the various
|
||||||
@ -84,8 +86,10 @@ class SongFormat(object):
|
|||||||
|
|
||||||
``u'class'``
|
``u'class'``
|
||||||
Import class, e.g. ``OpenLyricsImport``
|
Import class, e.g. ``OpenLyricsImport``
|
||||||
|
|
||||||
``u'name'``
|
``u'name'``
|
||||||
Name of the format, e.g. ``u'OpenLyrics'``
|
Name of the format, e.g. ``u'OpenLyrics'``
|
||||||
|
|
||||||
``u'prefix'``
|
``u'prefix'``
|
||||||
Prefix for Qt objects. Use mixedCase, e.g. ``u'openLyrics'``
|
Prefix for Qt objects. Use mixedCase, e.g. ``u'openLyrics'``
|
||||||
See ``SongImportForm.addFileSelectItem()``
|
See ``SongImportForm.addFileSelectItem()``
|
||||||
@ -94,11 +98,14 @@ class SongFormat(object):
|
|||||||
|
|
||||||
``u'canDisable'``
|
``u'canDisable'``
|
||||||
Whether song format importer is disablable.
|
Whether song format importer is disablable.
|
||||||
|
|
||||||
``u'availability'``
|
``u'availability'``
|
||||||
Whether song format importer is available.
|
Whether song format importer is available.
|
||||||
|
|
||||||
``u'selectMode'``
|
``u'selectMode'``
|
||||||
Whether format accepts single file, multiple files, or single folder
|
Whether format accepts single file, multiple files, or single folder
|
||||||
(as per ``SongFormatSelect`` options).
|
(as per ``SongFormatSelect`` options).
|
||||||
|
|
||||||
``u'filter'``
|
``u'filter'``
|
||||||
File extension filter for ``QFileDialog``.
|
File extension filter for ``QFileDialog``.
|
||||||
|
|
||||||
@ -106,14 +113,19 @@ class SongFormat(object):
|
|||||||
|
|
||||||
``u'comboBoxText'``
|
``u'comboBoxText'``
|
||||||
Combo box selector (default value is the format's ``u'name'``).
|
Combo box selector (default value is the format's ``u'name'``).
|
||||||
|
|
||||||
``u'disabledLabelText'``
|
``u'disabledLabelText'``
|
||||||
Required for disablable song formats.
|
Required for disablable song formats.
|
||||||
|
|
||||||
``u'getFilesTitle'``
|
``u'getFilesTitle'``
|
||||||
Title for ``QFileDialog`` (default includes the format's ``u'name'``).
|
Title for ``QFileDialog`` (default includes the format's ``u'name'``).
|
||||||
|
|
||||||
``u'invalidSourceMsg'``
|
``u'invalidSourceMsg'``
|
||||||
Message displayed if ``isValidSource()`` returns ``False``.
|
Message displayed if ``isValidSource()`` returns ``False``.
|
||||||
|
|
||||||
``u'descriptionText'``
|
``u'descriptionText'``
|
||||||
Short description (1-2 lines) about the song format.
|
Short description (1-2 lines) about the song format.
|
||||||
|
Message displayed if ``isValidSource()`` returns ``False``.
|
||||||
"""
|
"""
|
||||||
# Song formats (ordered alphabetically after Generic)
|
# Song formats (ordered alphabetically after Generic)
|
||||||
# * Numerical order of song formats is significant as it determines the
|
# * Numerical order of song formats is significant as it determines the
|
||||||
@ -313,7 +325,7 @@ class SongFormat(object):
|
|||||||
SongFormat.WordsOfWorship,
|
SongFormat.WordsOfWorship,
|
||||||
SongFormat.ZionWorx
|
SongFormat.ZionWorx
|
||||||
]
|
]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get(format, *attributes):
|
def get(format, *attributes):
|
||||||
"""
|
"""
|
||||||
@ -326,6 +338,7 @@ class SongFormat(object):
|
|||||||
Zero or more song format attributes from SongFormat.
|
Zero or more song format attributes from SongFormat.
|
||||||
|
|
||||||
Return type depends on number of supplied attributes:
|
Return type depends on number of supplied attributes:
|
||||||
|
|
||||||
:0: Return dict containing all defined attributes for the format.
|
:0: Return dict containing all defined attributes for the format.
|
||||||
:1: Return the attribute value.
|
:1: Return the attribute value.
|
||||||
:>1: Return tuple of requested attribute values.
|
:>1: Return tuple of requested attribute values.
|
||||||
|
@ -195,6 +195,7 @@ class SongsPlugin(Plugin):
|
|||||||
|
|
||||||
def importSongs(self, format, **kwargs):
|
def importSongs(self, format, **kwargs):
|
||||||
class_ = SongFormat.get(format, u'class')
|
class_ = SongFormat.get(format, u'class')
|
||||||
|
kwargs[u'plugin'] = self
|
||||||
importer = class_(self.manager, **kwargs)
|
importer = class_(self.manager, **kwargs)
|
||||||
importer.register(self.mediaItem.importWizard)
|
importer.register(self.mediaItem.importWizard)
|
||||||
return importer
|
return importer
|
||||||
|
Loading…
Reference in New Issue
Block a user