forked from openlp/openlp
UI library - media_item_combo_box
This commit is contained in:
parent
e9ea8fd8cc
commit
750a232311
@ -98,3 +98,13 @@ def critical_error_message_box(title=None, message=None, parent=None,
|
|||||||
data = {u'message': message}
|
data = {u'message': message}
|
||||||
data[u'title'] = title if title else error
|
data[u'title'] = title if title else error
|
||||||
return Receiver.send_message(u'openlp_error_message', data)
|
return Receiver.send_message(u'openlp_error_message', data)
|
||||||
|
|
||||||
|
def media_item_combo_box(parent, name):
|
||||||
|
"""
|
||||||
|
Provide a standard combo box for media items.
|
||||||
|
"""
|
||||||
|
combo = QtGui.QComboBox(parent)
|
||||||
|
combo.setObjectName(name)
|
||||||
|
combo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
|
||||||
|
combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
||||||
|
return combo
|
||||||
|
@ -30,7 +30,7 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
|
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
|
||||||
ItemCapabilities, translate
|
ItemCapabilities, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box, media_item_combo_box
|
||||||
from openlp.plugins.bibles.forms import BibleImportForm
|
from openlp.plugins.bibles.forms import BibleImportForm
|
||||||
from openlp.plugins.bibles.lib import get_reference_match
|
from openlp.plugins.bibles.lib import get_reference_match
|
||||||
|
|
||||||
@ -81,33 +81,21 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.quickLayout.setObjectName(u'quickLayout')
|
self.quickLayout.setObjectName(u'quickLayout')
|
||||||
self.quickVersionLabel = QtGui.QLabel(self.quickTab)
|
self.quickVersionLabel = QtGui.QLabel(self.quickTab)
|
||||||
self.quickVersionLabel.setObjectName(u'quickVersionLabel')
|
self.quickVersionLabel.setObjectName(u'quickVersionLabel')
|
||||||
self.quickVersionComboBox = QtGui.QComboBox(self.quickTab)
|
self.quickVersionComboBox = media_item_combo_box(self.quickTab,
|
||||||
self.quickVersionComboBox.setSizeAdjustPolicy(
|
u'quickVersionComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.quickVersionComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.quickVersionComboBox.setObjectName(u'quickVersionComboBox')
|
|
||||||
self.quickVersionLabel.setBuddy(self.quickVersionComboBox)
|
self.quickVersionLabel.setBuddy(self.quickVersionComboBox)
|
||||||
self.quickLayout.addRow(self.quickVersionLabel,
|
self.quickLayout.addRow(self.quickVersionLabel,
|
||||||
self.quickVersionComboBox)
|
self.quickVersionComboBox)
|
||||||
self.quickSecondLabel = QtGui.QLabel(self.quickTab)
|
self.quickSecondLabel = QtGui.QLabel(self.quickTab)
|
||||||
self.quickSecondLabel.setObjectName(u'quickSecondLabel')
|
self.quickSecondLabel.setObjectName(u'quickSecondLabel')
|
||||||
self.quickSecondComboBox = QtGui.QComboBox(self.quickTab)
|
self.quickSecondComboBox = media_item_combo_box(self.quickTab,
|
||||||
self.quickSecondComboBox.setSizeAdjustPolicy(
|
u'quickSecondComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.quickSecondComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.quickSecondComboBox.setObjectName(u'quickSecondComboBox')
|
|
||||||
self.quickSecondLabel.setBuddy(self.quickSecondComboBox)
|
self.quickSecondLabel.setBuddy(self.quickSecondComboBox)
|
||||||
self.quickLayout.addRow(self.quickSecondLabel, self.quickSecondComboBox)
|
self.quickLayout.addRow(self.quickSecondLabel, self.quickSecondComboBox)
|
||||||
self.quickSearchTypeLabel = QtGui.QLabel(self.quickTab)
|
self.quickSearchTypeLabel = QtGui.QLabel(self.quickTab)
|
||||||
self.quickSearchTypeLabel.setObjectName(u'quickSearchTypeLabel')
|
self.quickSearchTypeLabel.setObjectName(u'quickSearchTypeLabel')
|
||||||
self.quickSearchComboBox = QtGui.QComboBox(self.quickTab)
|
self.quickSearchComboBox = media_item_combo_box(self.quickTab,
|
||||||
self.quickSearchComboBox.setSizeAdjustPolicy(
|
u'quickSearchComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.quickSearchComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.quickSearchComboBox.setObjectName(u'quickSearchComboBox')
|
|
||||||
self.quickSearchTypeLabel.setBuddy(self.quickSearchComboBox)
|
self.quickSearchTypeLabel.setBuddy(self.quickSearchComboBox)
|
||||||
self.quickLayout.addRow(self.quickSearchTypeLabel,
|
self.quickLayout.addRow(self.quickSearchTypeLabel,
|
||||||
self.quickSearchComboBox)
|
self.quickSearchComboBox)
|
||||||
@ -119,12 +107,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit)
|
self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit)
|
||||||
self.quickClearLabel = QtGui.QLabel(self.quickTab)
|
self.quickClearLabel = QtGui.QLabel(self.quickTab)
|
||||||
self.quickClearLabel.setObjectName(u'quickClearLabel')
|
self.quickClearLabel.setObjectName(u'quickClearLabel')
|
||||||
self.quickClearComboBox = QtGui.QComboBox(self.quickTab)
|
self.quickClearComboBox = media_item_combo_box(self.quickTab,
|
||||||
self.quickClearComboBox.setSizeAdjustPolicy(
|
u'quickClearComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.quickClearComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.quickClearComboBox.setObjectName(u'quickClearComboBox')
|
|
||||||
self.quickLayout.addRow(self.quickClearLabel, self.quickClearComboBox)
|
self.quickLayout.addRow(self.quickClearLabel, self.quickClearComboBox)
|
||||||
self.quickSearchButtonLayout = QtGui.QHBoxLayout()
|
self.quickSearchButtonLayout = QtGui.QHBoxLayout()
|
||||||
self.quickSearchButtonLayout.setObjectName(u'quickSearchButtonLayout')
|
self.quickSearchButtonLayout.setObjectName(u'quickSearchButtonLayout')
|
||||||
@ -144,36 +128,24 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.advancedVersionLabel.setObjectName(u'advancedVersionLabel')
|
self.advancedVersionLabel.setObjectName(u'advancedVersionLabel')
|
||||||
self.advancedLayout.addWidget(self.advancedVersionLabel, 0, 0,
|
self.advancedLayout.addWidget(self.advancedVersionLabel, 0, 0,
|
||||||
QtCore.Qt.AlignRight)
|
QtCore.Qt.AlignRight)
|
||||||
self.advancedVersionComboBox = QtGui.QComboBox(self.advancedTab)
|
self.advancedVersionComboBox = media_item_combo_box(self.advancedTab,
|
||||||
self.advancedVersionComboBox.setSizeAdjustPolicy(
|
u'advancedVersionComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.advancedVersionComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.advancedVersionComboBox.setObjectName(u'advancedVersionComboBox')
|
|
||||||
self.advancedVersionLabel.setBuddy(self.advancedVersionComboBox)
|
self.advancedVersionLabel.setBuddy(self.advancedVersionComboBox)
|
||||||
self.advancedLayout.addWidget(self.advancedVersionComboBox, 0, 1, 1, 2)
|
self.advancedLayout.addWidget(self.advancedVersionComboBox, 0, 1, 1, 2)
|
||||||
self.advancedSecondLabel = QtGui.QLabel(self.advancedTab)
|
self.advancedSecondLabel = QtGui.QLabel(self.advancedTab)
|
||||||
self.advancedSecondLabel.setObjectName(u'advancedSecondLabel')
|
self.advancedSecondLabel.setObjectName(u'advancedSecondLabel')
|
||||||
self.advancedLayout.addWidget(self.advancedSecondLabel, 1, 0,
|
self.advancedLayout.addWidget(self.advancedSecondLabel, 1, 0,
|
||||||
QtCore.Qt.AlignRight)
|
QtCore.Qt.AlignRight)
|
||||||
self.advancedSecondComboBox = QtGui.QComboBox(self.advancedTab)
|
self.advancedSecondComboBox = media_item_combo_box(self.advancedTab,
|
||||||
self.advancedSecondComboBox.setSizeAdjustPolicy(
|
u'advancedSecondComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.advancedSecondComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.advancedSecondComboBox.setObjectName(u'advancedSecondComboBox')
|
|
||||||
self.advancedSecondLabel.setBuddy(self.advancedSecondComboBox)
|
self.advancedSecondLabel.setBuddy(self.advancedSecondComboBox)
|
||||||
self.advancedLayout.addWidget(self.advancedSecondComboBox, 1, 1, 1, 2)
|
self.advancedLayout.addWidget(self.advancedSecondComboBox, 1, 1, 1, 2)
|
||||||
self.advancedBookLabel = QtGui.QLabel(self.advancedTab)
|
self.advancedBookLabel = QtGui.QLabel(self.advancedTab)
|
||||||
self.advancedBookLabel.setObjectName(u'advancedBookLabel')
|
self.advancedBookLabel.setObjectName(u'advancedBookLabel')
|
||||||
self.advancedLayout.addWidget(self.advancedBookLabel, 2, 0,
|
self.advancedLayout.addWidget(self.advancedBookLabel, 2, 0,
|
||||||
QtCore.Qt.AlignRight)
|
QtCore.Qt.AlignRight)
|
||||||
self.advancedBookComboBox = QtGui.QComboBox(self.advancedTab)
|
self.advancedBookComboBox = media_item_combo_box(self.advancedTab,
|
||||||
self.advancedBookComboBox.setSizeAdjustPolicy(
|
u'advancedBookComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.advancedBookComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.advancedBookComboBox.setObjectName(u'advancedBookComboBox')
|
|
||||||
self.advancedBookLabel.setBuddy(self.advancedBookComboBox)
|
self.advancedBookLabel.setBuddy(self.advancedBookComboBox)
|
||||||
self.advancedLayout.addWidget(self.advancedBookComboBox, 2, 1, 1, 2)
|
self.advancedLayout.addWidget(self.advancedBookComboBox, 2, 1, 1, 2)
|
||||||
self.advancedChapterLabel = QtGui.QLabel(self.advancedTab)
|
self.advancedChapterLabel = QtGui.QLabel(self.advancedTab)
|
||||||
@ -202,17 +174,12 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.advancedToVerse = QtGui.QComboBox(self.advancedTab)
|
self.advancedToVerse = QtGui.QComboBox(self.advancedTab)
|
||||||
self.advancedToVerse.setObjectName(u'advancedToVerse')
|
self.advancedToVerse.setObjectName(u'advancedToVerse')
|
||||||
self.advancedLayout.addWidget(self.advancedToVerse, 5, 2)
|
self.advancedLayout.addWidget(self.advancedToVerse, 5, 2)
|
||||||
|
|
||||||
self.advancedClearLabel = QtGui.QLabel(self.quickTab)
|
self.advancedClearLabel = QtGui.QLabel(self.quickTab)
|
||||||
self.advancedClearLabel.setObjectName(u'advancedClearLabel')
|
self.advancedClearLabel.setObjectName(u'advancedClearLabel')
|
||||||
self.advancedLayout.addWidget(self.advancedClearLabel, 6, 0,
|
self.advancedLayout.addWidget(self.advancedClearLabel, 6, 0,
|
||||||
QtCore.Qt.AlignRight)
|
QtCore.Qt.AlignRight)
|
||||||
self.advancedClearComboBox = QtGui.QComboBox(self.quickTab)
|
self.advancedClearComboBox = media_item_combo_box(self.quickTab,
|
||||||
self.advancedClearComboBox.setSizeAdjustPolicy(
|
u'advancedClearComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.advancedClearComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.advancedClearComboBox.setObjectName(u'advancedClearComboBox')
|
|
||||||
self.advancedClearLabel.setBuddy(self.advancedClearComboBox)
|
self.advancedClearLabel.setBuddy(self.advancedClearComboBox)
|
||||||
self.advancedLayout.addWidget(self.advancedClearComboBox, 6, 1, 1, 2)
|
self.advancedLayout.addWidget(self.advancedClearComboBox, 6, 1, 1, 2)
|
||||||
self.advancedSearchButtonLayout = QtGui.QHBoxLayout()
|
self.advancedSearchButtonLayout = QtGui.QHBoxLayout()
|
||||||
|
@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
||||||
SettingsManager, translate, check_item_selected, Receiver, ItemCapabilities
|
SettingsManager, translate, check_item_selected, Receiver, ItemCapabilities
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box, media_item_combo_box
|
||||||
from openlp.plugins.presentations.lib import MessageListener
|
from openlp.plugins.presentations.lib import MessageListener
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -116,12 +116,8 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
self.displayLayout.setObjectName(u'displayLayout')
|
self.displayLayout.setObjectName(u'displayLayout')
|
||||||
self.displayTypeLabel = QtGui.QLabel(self.presentationWidget)
|
self.displayTypeLabel = QtGui.QLabel(self.presentationWidget)
|
||||||
self.displayTypeLabel.setObjectName(u'displayTypeLabel')
|
self.displayTypeLabel.setObjectName(u'displayTypeLabel')
|
||||||
self.displayTypeComboBox = QtGui.QComboBox(self.presentationWidget)
|
self.displayTypeComboBox = media_item_combo_box(
|
||||||
self.displayTypeComboBox.setSizeAdjustPolicy(
|
self.presentationWidget, u'displayTypeComboBox')
|
||||||
QtGui.QComboBox.AdjustToMinimumContentsLength)
|
|
||||||
self.displayTypeComboBox.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
|
|
||||||
self.displayTypeComboBox.setObjectName(u'displayTypeComboBox')
|
|
||||||
self.displayTypeLabel.setBuddy(self.displayTypeComboBox)
|
self.displayTypeLabel.setBuddy(self.displayTypeComboBox)
|
||||||
self.displayLayout.addRow(self.displayTypeLabel,
|
self.displayLayout.addRow(self.displayTypeLabel,
|
||||||
self.displayTypeComboBox)
|
self.displayTypeComboBox)
|
||||||
|
Loading…
Reference in New Issue
Block a user