forked from openlp/openlp
progressbar
This commit is contained in:
commit
ea2419924c
@ -233,7 +233,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
def getListOfFiles(self, listbox):
|
||||
files = []
|
||||
for row in range(0, listbox.count()):
|
||||
files.append(unicode(listbox.item(row)))
|
||||
files.append(unicode(listbox.item(row).text()))
|
||||
return files
|
||||
|
||||
def removeSelectedItems(self, listbox):
|
||||
@ -338,7 +338,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
log.debug(u'IncrementBar %s', status_text)
|
||||
self.importProgressLabel.setText(status_text)
|
||||
self.importProgressBar.setValue(self.importProgressBar.value() + 1)
|
||||
Receiver.send_message(u'process_events')
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def preImport(self):
|
||||
self.finishButton.setVisible(False)
|
||||
@ -347,7 +347,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
self.importProgressBar.setValue(0)
|
||||
self.importProgressLabel.setText(
|
||||
translate('SongsPlugin.ImportWizardForm', 'Starting import...'))
|
||||
Receiver.send_message(u'process_events')
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def performImport(self):
|
||||
"""
|
||||
@ -411,4 +411,4 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
self.importProgressBar.setValue(self.importProgressBar.maximum())
|
||||
self.finishButton.setVisible(True)
|
||||
self.cancelButton.setVisible(False)
|
||||
Receiver.send_message(u'process_events')
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
@ -59,6 +59,7 @@ class OooImport(SongImport):
|
||||
self.document = None
|
||||
self.process_started = False
|
||||
self.filenames = kwargs[u'filenames']
|
||||
self.import_wizard.importProgressBar.setMaximum(0)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'openlp_stop_song_import'), self.stop_import)
|
||||
|
||||
@ -67,7 +68,7 @@ class OooImport(SongImport):
|
||||
self.start_ooo()
|
||||
for filename in self.filenames:
|
||||
if self.abort:
|
||||
self.wizard.incrementProgressBar(u'Import cancelled')
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled')
|
||||
return
|
||||
filename = unicode(filename)
|
||||
if os.path.isfile(filename):
|
||||
@ -148,7 +149,7 @@ class OooImport(SongImport):
|
||||
self.document.supportsService("com.sun.star.text.TextDocument"):
|
||||
self.close_ooo_file()
|
||||
else:
|
||||
self.wizard.incrementProgressBar(u'Processing file ' + filepath)
|
||||
self.import_wizard.incrementProgressBar(u'Processing file ' + filepath)
|
||||
except:
|
||||
pass
|
||||
return
|
||||
@ -176,7 +177,7 @@ class OooImport(SongImport):
|
||||
text = u''
|
||||
for slide_no in range(slides.getCount()):
|
||||
if self.abort:
|
||||
self.wizard.incrementProgressBar(u'Import cancelled')
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled')
|
||||
return
|
||||
slide = slides.getByIndex(slide_no)
|
||||
slidetext = u''
|
||||
|
@ -80,7 +80,7 @@ class SofImport(OooImport):
|
||||
self.start_ooo()
|
||||
for filename in self.filenames:
|
||||
if self.abort:
|
||||
self.wizard.incrementProgressBar(u'Import cancelled')
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled')
|
||||
return
|
||||
filename = unicode(filename)
|
||||
if os.path.isfile(filename):
|
||||
@ -99,7 +99,7 @@ class SofImport(OooImport):
|
||||
paragraphs = self.document.getText().createEnumeration()
|
||||
while paragraphs.hasMoreElements():
|
||||
if self.abort:
|
||||
self.wizard.incrementProgressBar(u'Import cancelled')
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled')
|
||||
return
|
||||
paragraph = paragraphs.nextElement()
|
||||
if paragraph.supportsService("com.sun.star.text.Paragraph"):
|
||||
@ -255,7 +255,7 @@ class SofImport(OooImport):
|
||||
if title.endswith(u','):
|
||||
title = title[:-1]
|
||||
self.song.title = title
|
||||
self.wizard.incrementProgressBar(u'Processing song ' + title)
|
||||
self.import_wizard.incrementProgressBar(u'Processing song ' + title)
|
||||
|
||||
def add_author(self, text):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user