Added confirmation message prior to re-start of FTW

This commit is contained in:
Stevan Pettit 2011-07-23 14:09:13 -04:00
parent f7a222da6c
commit 8800b41749

View File

@ -725,20 +725,36 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
os.removedirs(temp_dir) os.removedirs(temp_dir)
def onFirstTimeWizardClicked(self): def onFirstTimeWizardClicked(self):
Receiver.send_message(u'cursor_busy') ret = QtGui.QMessageBox.warning(self,
screens = ScreenList.get_instance() translate('OpenLP.MainWindow', 'Re-Run First Time Wizard?'),
FirstTimeForm(screens).exec_() translate('OpenLP.MainWindow',
self.firstTime() 'Are you sure you want to run the First Time Wizard?\n\n' + \
for plugin in self.pluginManager.plugins: 'Re-running this wizard will make changes to your current ' + \
self.activePlugin = plugin 'OpenLP configuration, possibly add songs to your ' + \
oldStatus = self.activePlugin.status 'existing Songs list and change your Default Theme'),
self.activePlugin.setStatus() QtGui.QMessageBox.StandardButtons(
if oldStatus != self.activePlugin.status: QtGui.QMessageBox.Yes |
if self.activePlugin.status == PluginStatus.Active: QtGui.QMessageBox.No),
self.activePlugin.toggleStatus(PluginStatus.Active) QtGui.QMessageBox.Yes)
self.activePlugin.appStartup() if ret == QtGui.QMessageBox.Yes:
else: Receiver.send_message(u'cursor_busy')
self.activePlugin.toggleStatus(PluginStatus.Inactive) screens = ScreenList.get_instance()
if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
self.firstTime()
for plugin in self.pluginManager.plugins:
self.activePlugin = plugin
oldStatus = self.activePlugin.status
self.activePlugin.setStatus()
if oldStatus != self.activePlugin.status:
if self.activePlugin.status == PluginStatus.Active:
self.activePlugin.toggleStatus(PluginStatus.Active)
self.activePlugin.appStartup()
else:
self.activePlugin.toggleStatus(PluginStatus.Inactive)
self.themeManagerContents.configUpdated()
self.themeManagerContents.loadThemes(True)
Receiver.send_message(u'theme_update_global',
self.themeManagerContents.global_theme)
def blankCheck(self): def blankCheck(self):
""" """