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