forked from openlp/openlp
use the awesome mainwindow progress bar
This commit is contained in:
parent
304f4ff732
commit
383670e446
@ -664,25 +664,12 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Called to update the themes' preview images.
|
Called to update the themes' preview images.
|
||||||
"""
|
"""
|
||||||
progressDialog = QtGui.QProgressDialog(self.mainwindow)
|
self.mainwindow.displayProgressBar(len(self.themelist))
|
||||||
progressDialog.setWindowModality(QtCore.Qt.WindowModal)
|
for theme in self.themelist:
|
||||||
progressDialog.setLabelText(
|
self.mainwindow.incrementProgressBar()
|
||||||
translate('OpenLP.ThemeManager', 'Starting update...',
|
|
||||||
'Shown when you update the theme images.'))
|
|
||||||
progressDialog.setCancelButton(None)
|
|
||||||
progressDialog.setRange(0, len(self.themelist))
|
|
||||||
progressDialog.setMinimumDuration(0)
|
|
||||||
progressDialog.forceShow()
|
|
||||||
Receiver.send_message(u'openlp_process_events')
|
|
||||||
for index, theme in enumerate(self.themelist):
|
|
||||||
progressDialog.setValue(index)
|
|
||||||
progressDialog.setLabelText(unicode(translate('OpenLP.ThemeManager',
|
|
||||||
'Updating %s...',
|
|
||||||
'Shown when you update the theme images.')) % theme)
|
|
||||||
Receiver.send_message(u'openlp_process_events')
|
|
||||||
self.generateAndSaveImage(
|
self.generateAndSaveImage(
|
||||||
self.path, theme, self.getThemeData(theme))
|
self.path, theme, self.getThemeData(theme))
|
||||||
progressDialog.setValue(len(self.themelist))
|
self.mainwindow.finishedProgressBar()
|
||||||
self.loadThemes()
|
self.loadThemes()
|
||||||
|
|
||||||
def generateImage(self, themeData, forcePage=False):
|
def generateImage(self, themeData, forcePage=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user