use the awesome mainwindow progress bar

This commit is contained in:
Andreas Preikschat 2011-05-20 17:00:27 +02:00
parent 304f4ff732
commit 383670e446
1 changed files with 4 additions and 17 deletions

View File

@ -664,25 +664,12 @@ class ThemeManager(QtGui.QWidget):
"""
Called to update the themes' preview images.
"""
progressDialog = QtGui.QProgressDialog(self.mainwindow)
progressDialog.setWindowModality(QtCore.Qt.WindowModal)
progressDialog.setLabelText(
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.mainwindow.displayProgressBar(len(self.themelist))
for theme in self.themelist:
self.mainwindow.incrementProgressBar()
self.generateAndSaveImage(
self.path, theme, self.getThemeData(theme))
progressDialog.setValue(len(self.themelist))
self.mainwindow.finishedProgressBar()
self.loadThemes()
def generateImage(self, themeData, forcePage=False):