forked from openlp/openlp
Cleanup superfluous functions and import halting
This commit is contained in:
parent
51812f21de
commit
934d26bd0a
@ -68,9 +68,6 @@ class CustomMediaItem(MediaManagerItem):
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick)
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
||||
def initialise(self):
|
||||
self.loadCustomListView(self.manager.get_all_objects(
|
||||
CustomSlide, order_by_ref=CustomSlide.title))
|
||||
|
@ -220,6 +220,3 @@ class ImageMediaItem(MediaManagerItem):
|
||||
unicode(translate('ImagePlugin.MediaItem',
|
||||
'There was a problem replacing your background, '
|
||||
'the image file "%s" no longer exists.')) % filename)
|
||||
|
||||
def onPreviewClick(self):
|
||||
MediaManagerItem.onPreviewClick(self)
|
||||
|
@ -68,9 +68,6 @@ class SongMediaItem(MediaManagerItem):
|
||||
self.editItem = None
|
||||
self.whitespace = re.compile(r'\W+', re.UNICODE)
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
||||
def addEndHeaderBar(self):
|
||||
self.addToolbarSeparator()
|
||||
## Song Maintenance Button ##
|
||||
|
@ -66,11 +66,11 @@ class OooImport(SongImport):
|
||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
||||
|
||||
def do_import(self):
|
||||
self.abort = False
|
||||
self.stop_import_flag = False
|
||||
self.import_wizard.progressBar.setMaximum(0)
|
||||
self.start_ooo()
|
||||
for filename in self.filenames:
|
||||
if self.abort:
|
||||
if self.stop_import_flag:
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||
return
|
||||
filename = unicode(filename)
|
||||
@ -89,9 +89,6 @@ class OooImport(SongImport):
|
||||
self.import_wizard.incrementProgressBar(u'', 1)
|
||||
return True
|
||||
|
||||
def stop_import(self):
|
||||
self.abort = True
|
||||
|
||||
def start_ooo(self):
|
||||
"""
|
||||
Start OpenOffice.org process
|
||||
@ -180,7 +177,7 @@ class OooImport(SongImport):
|
||||
slides = doc.getDrawPages()
|
||||
text = u''
|
||||
for slide_no in range(slides.getCount()):
|
||||
if self.abort:
|
||||
if self.stop_import_flag:
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||
return
|
||||
slide = slides.getByIndex(slide_no)
|
||||
|
@ -76,10 +76,10 @@ class SofImport(OooImport):
|
||||
OooImport.__init__(self, master_manager, **kwargs)
|
||||
|
||||
def do_import(self):
|
||||
self.abort = False
|
||||
self.stop_import_flag = False
|
||||
self.start_ooo()
|
||||
for filename in self.filenames:
|
||||
if self.abort:
|
||||
if self.stop_import_flag:
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||
return
|
||||
filename = unicode(filename)
|
||||
@ -101,7 +101,7 @@ class SofImport(OooImport):
|
||||
self.new_song()
|
||||
paragraphs = self.document.getText().createEnumeration()
|
||||
while paragraphs.hasMoreElements():
|
||||
if self.abort:
|
||||
if self.stop_import_flag:
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||
return
|
||||
paragraph = paragraphs.nextElement()
|
||||
|
Loading…
Reference in New Issue
Block a user