forked from openlp/openlp
More hiding changes
This commit is contained in:
parent
444e1796cf
commit
4f1241e60f
@ -35,17 +35,35 @@ class MediaDockManager(object):
|
|||||||
log.info(u'Adding %s dock' % media_item.title)
|
log.info(u'Adding %s dock' % media_item.title)
|
||||||
id = self.mediaDock.addItem(
|
id = self.mediaDock.addItem(
|
||||||
media_item, icon, media_item.title)
|
media_item, icon, media_item.title)
|
||||||
print "add", media_item.title, id, weight
|
print "add", media_item.title, id, weight, media_item
|
||||||
|
|
||||||
def insertDock(self, media_item, icon, weight):
|
def insertDock(self, media_item, icon, weight):
|
||||||
|
"""
|
||||||
|
This should insert a dock item at a given location
|
||||||
|
This does not work as it gives a Segmentation error.
|
||||||
|
For now add at end of stack if not present
|
||||||
|
"""
|
||||||
log.debug(u'Inserting %s dock' % media_item.title)
|
log.debug(u'Inserting %s dock' % media_item.title)
|
||||||
if self.mediaDock.widget(weight + 10) is None:
|
for dock_index in range(0, self.mediaDock.count()):
|
||||||
self.mediaDock.insertItem(weight + 10, media_item, icon, media_item.title)
|
print "dock list", dock_index, self.mediaDock.widget(dock_index)
|
||||||
print "insert", media_item.title, weight
|
#self.mediaDock.insertItem(weight + 10, media_item, icon, media_item.title)
|
||||||
|
match = False
|
||||||
|
for dock_index in range(0, self.mediaDock.count()):
|
||||||
|
print self.mediaDock.widget(dock_index).ConfigSection , media_item.title.lower()
|
||||||
|
if self.mediaDock.widget(dock_index).ConfigSection == media_item.title.lower():
|
||||||
|
print "match found ", dock_index
|
||||||
|
match = True
|
||||||
|
break
|
||||||
|
if not match:
|
||||||
|
self.mediaDock.addItem(media_item, icon, media_item.title)
|
||||||
|
|
||||||
|
|
||||||
def removeDock(self, name):
|
def removeDock(self, name):
|
||||||
log.debug(u'remove %s dock' % name)
|
log.debug(u'remove %s dock' % name)
|
||||||
|
print "remove dock ", name
|
||||||
for dock_index in range(0, self.mediaDock.count()):
|
for dock_index in range(0, self.mediaDock.count()):
|
||||||
if self.mediaDock.widget(dock_index) is not None:
|
if self.mediaDock.widget(dock_index) is not None:
|
||||||
if self.mediaDock.widget(dock_index).ConfigSection == name.lower():
|
if self.mediaDock.widget(dock_index).ConfigSection == name.lower():
|
||||||
|
print "remove ", dock_index
|
||||||
|
self.mediaDock.widget(dock_index).hide()
|
||||||
self.mediaDock.removeItem(dock_index)
|
self.mediaDock.removeItem(dock_index)
|
||||||
|
@ -56,5 +56,17 @@ class CustomPlugin(Plugin):
|
|||||||
# Create the CustomManagerItem object
|
# Create the CustomManagerItem object
|
||||||
return CustomMediaItem(self, self.icon, u'Custom Slides')
|
return CustomMediaItem(self, self.icon, u'Custom Slides')
|
||||||
|
|
||||||
|
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 about(self):
|
def about(self):
|
||||||
return u'<b>Custom Plugin</b> <br>This plugin allows slides to be displayed on the screen in the same way songs are. The difference between this plugin and songs is this plugin provides greater freedom.<br><br>This is a core plugin and cannot be made inactive</b>'
|
return u'<b>Custom Plugin</b> <br>This plugin allows slides to be displayed on the screen in the same way songs are. The difference between this plugin and songs is this plugin provides greater freedom.<br><br>This is a core plugin and cannot be made inactive</b>'
|
||||||
|
Loading…
Reference in New Issue
Block a user