forked from openlp/openlp
Replace disablable with can_disable. Change obj_prefix default
This commit is contained in:
parent
29cfa96ce8
commit
e99ebe64c7
@ -98,7 +98,7 @@ class Ui_SongImportWizard(object):
|
|||||||
# OpenLP 2.0
|
# OpenLP 2.0
|
||||||
self.addSingleFileSelectItem(u'openLP2')
|
self.addSingleFileSelectItem(u'openLP2')
|
||||||
# openlp.org 1.x
|
# openlp.org 1.x
|
||||||
self.addSingleFileSelectItem(u'openLP1', u'', True)
|
self.addSingleFileSelectItem(u'openLP1', None, True)
|
||||||
# OpenLyrics
|
# OpenLyrics
|
||||||
self.addMultiFileSelectItem(u'openLyrics', u'OpenLyrics', True)
|
self.addMultiFileSelectItem(u'openLyrics', u'OpenLyrics', True)
|
||||||
# set OpenLyrics to disabled by default
|
# set OpenLyrics to disabled by default
|
||||||
@ -111,9 +111,9 @@ class Ui_SongImportWizard(object):
|
|||||||
# CCLI File import
|
# CCLI File import
|
||||||
self.addMultiFileSelectItem(u'ccli')
|
self.addMultiFileSelectItem(u'ccli')
|
||||||
# Songs of Fellowship
|
# Songs of Fellowship
|
||||||
self.addMultiFileSelectItem(u'songsOfFellowship', u'', True)
|
self.addMultiFileSelectItem(u'songsOfFellowship', None, True)
|
||||||
# Generic Document/Presentation import
|
# Generic Document/Presentation import
|
||||||
self.addMultiFileSelectItem(u'generic', u'', True)
|
self.addMultiFileSelectItem(u'generic', None, True)
|
||||||
# EasyWorship
|
# EasyWorship
|
||||||
self.addSingleFileSelectItem(u'ew')
|
self.addSingleFileSelectItem(u'ew')
|
||||||
# Commented out for future use.
|
# Commented out for future use.
|
||||||
@ -250,19 +250,20 @@ class Ui_SongImportWizard(object):
|
|||||||
self.importProgressBar.setFormat(
|
self.importProgressBar.setFormat(
|
||||||
translate('SongsPlugin.ImportWizardForm', '%p%'))
|
translate('SongsPlugin.ImportWizardForm', '%p%'))
|
||||||
|
|
||||||
def addSingleFileSelectItem(self, prefix, obj_prefix=u'', disablable=False):
|
def addSingleFileSelectItem(self, prefix, obj_prefix=None,
|
||||||
if obj_prefix == u'':
|
can_disable=False):
|
||||||
|
if not obj_prefix:
|
||||||
obj_prefix = prefix
|
obj_prefix = prefix
|
||||||
page = QtGui.QWidget()
|
page = QtGui.QWidget()
|
||||||
page.setObjectName(obj_prefix + u'Page')
|
page.setObjectName(obj_prefix + u'Page')
|
||||||
if disablable:
|
if can_disable:
|
||||||
importWidget = self.disablableWidget(page, prefix, obj_prefix)
|
importWidget = self.disablableWidget(page, prefix, obj_prefix)
|
||||||
else:
|
else:
|
||||||
importWidget = page
|
importWidget = page
|
||||||
importLayout = QtGui.QFormLayout(importWidget)
|
importLayout = QtGui.QFormLayout(importWidget)
|
||||||
importLayout.setMargin(0)
|
importLayout.setMargin(0)
|
||||||
importLayout.setSpacing(8)
|
importLayout.setSpacing(8)
|
||||||
if disablable:
|
if can_disable:
|
||||||
importLayout.setObjectName(obj_prefix + u'ImportLayout')
|
importLayout.setObjectName(obj_prefix + u'ImportLayout')
|
||||||
else:
|
else:
|
||||||
importLayout.setObjectName(obj_prefix + u'Layout')
|
importLayout.setObjectName(obj_prefix + u'Layout')
|
||||||
@ -286,25 +287,26 @@ class Ui_SongImportWizard(object):
|
|||||||
setattr(self, prefix + u'FileLayout', fileLayout)
|
setattr(self, prefix + u'FileLayout', fileLayout)
|
||||||
setattr(self, prefix + u'FilenameEdit', filenameEdit)
|
setattr(self, prefix + u'FilenameEdit', filenameEdit)
|
||||||
setattr(self, prefix + u'BrowseButton', browseButton)
|
setattr(self, prefix + u'BrowseButton', browseButton)
|
||||||
if disablable:
|
if can_disable:
|
||||||
setattr(self, prefix + u'ImportLayout', importLayout)
|
setattr(self, prefix + u'ImportLayout', importLayout)
|
||||||
else:
|
else:
|
||||||
setattr(self, prefix + u'Layout', importLayout)
|
setattr(self, prefix + u'Layout', importLayout)
|
||||||
self.formatComboBox.addItem(u'')
|
self.formatComboBox.addItem(u'')
|
||||||
|
|
||||||
def addMultiFileSelectItem(self, prefix, obj_prefix=u'', disablable=False):
|
def addMultiFileSelectItem(self, prefix, obj_prefix=None,
|
||||||
if obj_prefix == u'':
|
can_disable=False):
|
||||||
|
if not obj_prefix:
|
||||||
obj_prefix = prefix
|
obj_prefix = prefix
|
||||||
page = QtGui.QWidget()
|
page = QtGui.QWidget()
|
||||||
page.setObjectName(obj_prefix + u'Page')
|
page.setObjectName(obj_prefix + u'Page')
|
||||||
if disablable:
|
if can_disable:
|
||||||
importWidget = self.disablableWidget(page, prefix, obj_prefix)
|
importWidget = self.disablableWidget(page, prefix, obj_prefix)
|
||||||
else:
|
else:
|
||||||
importWidget = page
|
importWidget = page
|
||||||
importLayout = QtGui.QVBoxLayout(importWidget)
|
importLayout = QtGui.QVBoxLayout(importWidget)
|
||||||
importLayout.setMargin(0)
|
importLayout.setMargin(0)
|
||||||
importLayout.setSpacing(8)
|
importLayout.setSpacing(8)
|
||||||
if disablable:
|
if can_disable:
|
||||||
importLayout.setObjectName(obj_prefix + u'ImportLayout')
|
importLayout.setObjectName(obj_prefix + u'ImportLayout')
|
||||||
else:
|
else:
|
||||||
importLayout.setObjectName(obj_prefix + u'Layout')
|
importLayout.setObjectName(obj_prefix + u'Layout')
|
||||||
@ -335,7 +337,7 @@ class Ui_SongImportWizard(object):
|
|||||||
setattr(self, prefix + u'ButtonSpacer', buttonSpacer)
|
setattr(self, prefix + u'ButtonSpacer', buttonSpacer)
|
||||||
setattr(self, prefix + u'AddButton', addButton)
|
setattr(self, prefix + u'AddButton', addButton)
|
||||||
setattr(self, prefix + u'RemoveButton', removeButton)
|
setattr(self, prefix + u'RemoveButton', removeButton)
|
||||||
if disablable:
|
if can_disable:
|
||||||
setattr(self, prefix + u'ImportLayout', importLayout)
|
setattr(self, prefix + u'ImportLayout', importLayout)
|
||||||
else:
|
else:
|
||||||
setattr(self, prefix + u'Layout', importLayout)
|
setattr(self, prefix + u'Layout', importLayout)
|
||||||
|
Loading…
Reference in New Issue
Block a user