forked from openlp/openlp
More cleanups, Bibles and media done
This commit is contained in:
parent
85a0c245ea
commit
5d32ce5e66
@ -30,14 +30,11 @@ class MediaDockManager(object):
|
||||
|
||||
def __init__(self, mediaDock):
|
||||
self.mediaDock = mediaDock
|
||||
self.docks = {}
|
||||
|
||||
def addDock(self, name, media_item, icon):
|
||||
log.info(u'Adding %s dock' % name)
|
||||
id = self.mediaDock.addItem(
|
||||
media_item, icon, media_item.title)
|
||||
self.docks[name] = (\
|
||||
{u'data':media_item, u'icon':icon, u'id': id, u'active':True})
|
||||
|
||||
def insertDock(self, name):
|
||||
log.debug(u'Inserting %s dock' % name)
|
||||
@ -49,6 +46,6 @@ class MediaDockManager(object):
|
||||
def removeDock(self, name):
|
||||
log.debug(u'remove %s dock' % name)
|
||||
for tab_index in range(0, self.mediaDock.count()):
|
||||
#print self.mediaDock.widget(tab_index).ConfigSection, name
|
||||
#print "rd", self.mediaDock.widget(tab_index).ConfigSection, name
|
||||
if self.mediaDock.widget(tab_index).ConfigSection == name.lower():
|
||||
self.mediaDock.setItemEnabled(tab_index, False)
|
||||
|
@ -35,7 +35,6 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||
|
||||
def __init__(self, screen_list, mainWindow, parent=None):
|
||||
QtGui.QDialog.__init__(self, None)
|
||||
self.tabs = {}
|
||||
self.setupUi(self)
|
||||
# General tab
|
||||
self.GeneralTab = GeneralTab(screen_list)
|
||||
@ -50,7 +49,6 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||
def addTab(self, name, tab):
|
||||
log.info(u'Adding %s tab' % tab.title())
|
||||
id = self.SettingsTabWidget.addTab(tab, tab.title())
|
||||
self.tabs[name] = ({u'data': tab, u'id': id, u'active':True})
|
||||
|
||||
def insertTab(self, name):
|
||||
log.debug(u'Inserting %s tab' % name)
|
||||
@ -67,7 +65,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||
log.debug(u'remove %s tab' % name)
|
||||
#print ">>>>>>>>>>> remove settings"
|
||||
for tab_index in range(0, self.SettingsTabWidget.count()):
|
||||
#print self.SettingsTabWidget.widget(tab_index).title(), name
|
||||
#print "rt", self.SettingsTabWidget.widget(tab_index).title(), name
|
||||
if self.SettingsTabWidget.widget(tab_index).title() == name:
|
||||
#print "remove match"
|
||||
#print self.SettingsTabWidget.widget(tab_index).isVisible()
|
||||
|
@ -41,7 +41,26 @@ class BiblePlugin(Plugin):
|
||||
# Create the plugin icon
|
||||
self.icon = buildIcon(u':/media/media_bible.png')
|
||||
#Register the bible Manager
|
||||
self.biblemanager = BibleManager(self.config)
|
||||
self.biblemanager = None
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'bibles Initialising')
|
||||
if self.biblemanager is None:
|
||||
self.biblemanager = BibleManager(self.config)
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
self.ImportBibleItem.setVisible(True)
|
||||
self.ExportBibleItem.setVisible(True)
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
Plugin.finalise(self)
|
||||
self.remove_toolbox_item()
|
||||
self.ImportBibleItem.setVisible(False)
|
||||
self.ExportBibleItem.setVisible(False)
|
||||
|
||||
def get_settings_tab(self):
|
||||
return BiblesTab()
|
||||
@ -58,15 +77,18 @@ class BiblePlugin(Plugin):
|
||||
# Signals and slots
|
||||
QtCore.QObject.connect(self.ImportBibleItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onBibleNewClick)
|
||||
self.ImportBibleItem.setVisible(False)
|
||||
|
||||
def add_export_menu_item(self, export_menu):
|
||||
self.ExportBibleItem = QtGui.QAction(export_menu)
|
||||
self.ExportBibleItem.setObjectName(u'ExportBibleItem')
|
||||
export_menu.addAction(self.ExportBibleItem)
|
||||
self.ExportBibleItem.setText(translate(u'BiblePlugin', u'&Bible'))
|
||||
self.ExportBibleItem.setVisible(False)
|
||||
|
||||
def onBibleNewClick(self):
|
||||
self.media_item.onBibleNewClick()
|
||||
if self.media_item is not None:
|
||||
self.media_item.onNewClick()
|
||||
|
||||
def about(self):
|
||||
return u'<b>Bible Plugin</b> <br>This plugin allows bible verse from different sources to be displayed on the screen during the service.<br><br>This is a core plugin and cannot be made inactive</b>'
|
||||
|
@ -226,9 +226,10 @@ class BibleMediaItem(MediaManagerItem):
|
||||
translate(u'BibleMediaItem', u'Keep'))
|
||||
|
||||
def initialise(self):
|
||||
log.debug(u'initialise')
|
||||
log.debug(u'bible manager initialise')
|
||||
self.loadBibles()
|
||||
self.parent.biblemanager.set_media_manager(self)
|
||||
log.debug(u'bible manager initialise complete')
|
||||
|
||||
def setQuickMessage(self, text):
|
||||
self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text)))
|
||||
|
@ -22,10 +22,15 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import logging
|
||||
|
||||
from openlp.core.lib import Plugin, buildIcon
|
||||
from openlp.plugins.media.lib import MediaTab, MediaMediaItem
|
||||
|
||||
class MediaPlugin(Plugin):
|
||||
global log
|
||||
log = logging.getLogger(u'MediaPlugin')
|
||||
log.info(u'Media Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
# Call the parent constructor
|
||||
@ -39,6 +44,18 @@ class MediaPlugin(Plugin):
|
||||
def get_settings_tab(self):
|
||||
return MediaTab()
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
self.remove_toolbox_item()
|
||||
|
||||
def get_media_manager_item(self):
|
||||
# Create the MediaManagerItem object
|
||||
return MediaMediaItem(self, self.icon, u'Media')
|
||||
|
Loading…
Reference in New Issue
Block a user