forked from openlp/openlp
Modified firsttimeform to include existing themes in the set default theme list, if the wizard is being re-run.
bzr-revno: 1700
This commit is contained in:
commit
5e6c60da88
@ -157,10 +157,27 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
|||||||
item = self.themesListWidget.item(iter)
|
item = self.themesListWidget.item(iter)
|
||||||
if item.checkState() == QtCore.Qt.Checked:
|
if item.checkState() == QtCore.Qt.Checked:
|
||||||
self.themeComboBox.addItem(item.text())
|
self.themeComboBox.addItem(item.text())
|
||||||
|
# Check if this is a re-run of the wizard.
|
||||||
|
self.has_run_wizard = QtCore.QSettings().value(
|
||||||
|
u'general/has run wizard', QtCore.QVariant(False)).toBool()
|
||||||
|
if self.has_run_wizard:
|
||||||
|
# Add any existing themes to list.
|
||||||
|
for theme in self.parent().themeManagerContents.getThemes():
|
||||||
|
index = self.themeComboBox.findText(theme)
|
||||||
|
if index == -1:
|
||||||
|
self.themeComboBox.addItem(theme)
|
||||||
|
default_theme = unicode(QtCore.QSettings().value(
|
||||||
|
u'themes/global theme',
|
||||||
|
QtCore.QVariant(u'')).toString())
|
||||||
|
# Pre-select the current default theme.
|
||||||
|
index = self.themeComboBox.findText(default_theme)
|
||||||
|
self.themeComboBox.setCurrentIndex(index)
|
||||||
elif pageId == FirstTimePage.Progress:
|
elif pageId == FirstTimePage.Progress:
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
self._preWizard()
|
self._preWizard()
|
||||||
self._performWizard()
|
self._performWizard()
|
||||||
self._postWizard()
|
self._postWizard()
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
|
||||||
def updateScreenListCombo(self):
|
def updateScreenListCombo(self):
|
||||||
"""
|
"""
|
||||||
@ -249,11 +266,21 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
|||||||
"""
|
"""
|
||||||
if self.max_progress:
|
if self.max_progress:
|
||||||
self.progressBar.setValue(self.progressBar.maximum())
|
self.progressBar.setValue(self.progressBar.maximum())
|
||||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
if self.has_run_wizard:
|
||||||
'Download complete. Click the finish button to start OpenLP.'))
|
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Download complete.'
|
||||||
|
' Click the finish button to return to OpenLP.'))
|
||||||
|
else:
|
||||||
|
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Download complete.'
|
||||||
|
' Click the finish button to start OpenLP.'))
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
if self.has_run_wizard:
|
||||||
'Click the finish button to start OpenLP.'))
|
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Click the finish button to return to OpenLP.'))
|
||||||
|
else:
|
||||||
|
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Click the finish button to start OpenLP.'))
|
||||||
self.finishButton.setVisible(True)
|
self.finishButton.setVisible(True)
|
||||||
self.finishButton.setEnabled(True)
|
self.finishButton.setEnabled(True)
|
||||||
self.cancelButton.setVisible(False)
|
self.cancelButton.setVisible(False)
|
||||||
|
@ -749,7 +749,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
return
|
return
|
||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
screens = ScreenList.get_instance()
|
screens = ScreenList.get_instance()
|
||||||
if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
|
if FirstTimeForm(screens, self).exec_() == QtGui.QDialog.Accepted:
|
||||||
self.firstTime()
|
self.firstTime()
|
||||||
for plugin in self.pluginManager.plugins:
|
for plugin in self.pluginManager.plugins:
|
||||||
self.activePlugin = plugin
|
self.activePlugin = plugin
|
||||||
|
Loading…
Reference in New Issue
Block a user