forked from openlp/openlp
Various fixes:
Allow ServiceManager to use Cursor keys correctly and and Expand/Collapse to get at leaves. Add "Display if Single " Fix. Block Start / End time for files over 50 Meg. Hide unfinished menu items bzr-revno: 1392 Fixes: https://launchpad.net/bugs/707725, https://launchpad.net/bugs/730160, https://launchpad.net/bugs/730474
This commit is contained in:
commit
520d8c8ac3
@ -62,7 +62,7 @@ class ItemCapabilities(object):
|
||||
AddIfNewItem = 9
|
||||
ProvidesOwnDisplay = 10
|
||||
AllowsDetailedTitleDisplay = 11
|
||||
AllowsVarableStartTime = 12
|
||||
AllowsVariableStartTime = 12
|
||||
|
||||
|
||||
class ServiceItem(object):
|
||||
|
@ -237,6 +237,12 @@ class GeneralTab(SettingsTab):
|
||||
# Reload the tab, as the screen resolution/count may have changed.
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_screen_changed'), self.load)
|
||||
# Remove for now
|
||||
self.usernameLabel.setVisible(False)
|
||||
self.usernameEdit.setVisible(False)
|
||||
self.passwordLabel.setVisible(False)
|
||||
self.passwordEdit.setVisible(False)
|
||||
|
||||
|
||||
def retranslateUi(self):
|
||||
"""
|
||||
|
@ -434,7 +434,14 @@ class MainDisplay(DisplayWidget):
|
||||
if self.hideMode:
|
||||
self.hideDisplay(self.hideMode)
|
||||
else:
|
||||
self.setVisible(True)
|
||||
# Single screen active
|
||||
if self.screens.monitor_number == 0:
|
||||
# Only make visible if setting enabled
|
||||
if QtCore.QSettings().value(u'general/display on monitor',
|
||||
QtCore.QVariant(True)).toBool():
|
||||
self.setVisible(True)
|
||||
else:
|
||||
self.setVisible(True)
|
||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height(),
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
|
@ -217,8 +217,6 @@ class Ui_MainWindow(object):
|
||||
self.ModeDefaultItem.setChecked(True)
|
||||
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
||||
u':/tools/tools_add.png')
|
||||
# Hide the entry, as it does not have any functionality yet.
|
||||
self.ToolsAddToolItem.setVisible(False)
|
||||
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
||||
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
||||
@ -300,6 +298,13 @@ class Ui_MainWindow(object):
|
||||
QtCore.QObject.connect(self.FileExitItem,
|
||||
QtCore.SIGNAL(u'triggered()'), mainWindow.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(mainWindow)
|
||||
# Hide the entry, as it does not have any functionality yet.
|
||||
self.ToolsAddToolItem.setVisible(False)
|
||||
self.ImportLanguageItem.setVisible(False)
|
||||
self.ExportLanguageItem.setVisible(False)
|
||||
self.SettingsShortcutsItem.setVisible(False)
|
||||
self.HelpDocumentationItem.setVisible(False)
|
||||
self.HelpOnlineHelpItem.setVisible(False)
|
||||
|
||||
def retranslateUi(self, mainWindow):
|
||||
"""
|
||||
|
@ -49,6 +49,19 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
QtGui.QTreeWidget.__init__(self, parent)
|
||||
self.mainwindow = mainwindow
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if isinstance(event, QtGui.QKeyEvent):
|
||||
# here accept the event and do something
|
||||
if event.key() == QtCore.Qt.Key_Up:
|
||||
self.mainwindow.onMoveSelectionUp()
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Down:
|
||||
self.mainwindow.onMoveSelectionDown()
|
||||
event.accept()
|
||||
event.ignore()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
"""
|
||||
Drag and drop event does not care what data is selected
|
||||
@ -197,13 +210,13 @@ class ServiceManager(QtGui.QWidget):
|
||||
u':/services/service_expand_all.png',
|
||||
translate('OpenLP.ServiceManager',
|
||||
'Expand all the service items.'),
|
||||
self.onExpandAll)
|
||||
self.onExpandAll, shortcut=QtCore.Qt.Key_Plus)
|
||||
self.serviceManagerList.collapse = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', '&Collapse all'),
|
||||
u':/services/service_collapse_all.png',
|
||||
translate('OpenLP.ServiceManager',
|
||||
'Collapse all the service items.'),
|
||||
self.onCollapseAll)
|
||||
self.onCollapseAll, shortcut=QtCore.Qt.Key_Minus)
|
||||
self.orderToolbar.addSeparator()
|
||||
self.serviceManagerList.makeLive = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Go Live'),
|
||||
@ -293,7 +306,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.serviceManagerList.moveTop,
|
||||
self.serviceManagerList.moveBottom,
|
||||
self.serviceManagerList.up,
|
||||
self.serviceManagerList.down
|
||||
self.serviceManagerList.down,
|
||||
self.serviceManagerList.expand,
|
||||
self.serviceManagerList.collapse
|
||||
])
|
||||
self.configUpdated()
|
||||
|
||||
@ -306,6 +321,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
actionList.add_action(self.serviceManagerList.makeLive, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.up, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.down, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.expand, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.collapse, u'Service')
|
||||
|
||||
|
||||
def setModified(self, modified=True):
|
||||
"""
|
||||
@ -600,7 +618,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
if item.parent() is None:
|
||||
self.notesAction.setVisible(True)
|
||||
if serviceItem[u'service_item']\
|
||||
.is_capable(ItemCapabilities.AllowsVarableStartTime):
|
||||
.is_capable(ItemCapabilities.AllowsVariableStartTime):
|
||||
self.timeAction.setVisible(True)
|
||||
self.themeMenu.menuAction().setVisible(False)
|
||||
if serviceItem[u'service_item'].is_text():
|
||||
@ -887,7 +905,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
child.setText(0, text[:40])
|
||||
child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
|
||||
if item[u'service_item'] \
|
||||
.is_capable(ItemCapabilities.AllowsVarableStartTime):
|
||||
.is_capable(ItemCapabilities.AllowsVariableStartTime):
|
||||
tip = item[u'service_item'].get_media_time()
|
||||
if tip:
|
||||
child.setToolTip(0, tip)
|
||||
|
@ -50,7 +50,8 @@ class BiblePlugin(Plugin):
|
||||
self.manager = BibleManager(self)
|
||||
Plugin.initialise(self)
|
||||
self.importBibleItem.setVisible(True)
|
||||
self.exportBibleItem.setVisible(True)
|
||||
# Set to invisible until we can export bibles
|
||||
self.exportBibleItem.setVisible(False)
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
@ -132,14 +132,18 @@ class MediaMediaItem(MediaManagerItem):
|
||||
self.mediaObject.play()
|
||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||
service_item.add_capability(ItemCapabilities.AllowsVarableStartTime)
|
||||
# force a nonexistent theme
|
||||
service_item.theme = -1
|
||||
frame = u':/media/image_clapperboard.png'
|
||||
(path, name) = os.path.split(filename)
|
||||
while not self.mediaState:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
service_item.media_length = self.mediaLength
|
||||
file_size = os.path.getsize(filename)
|
||||
# File too big for processing
|
||||
if file_size <= 52428800: # 50MiB
|
||||
while not self.mediaState:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
service_item.media_length = self.mediaLength
|
||||
service_item.add_capability(
|
||||
ItemCapabilities.AllowsVariableStartTime)
|
||||
service_item.add_from_command(path, name, frame)
|
||||
return True
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user