← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~smpettit/openlp/ftw into lp:openlp

 

Stevan Pettit has proposed merging lp:~smpettit/openlp/ftw into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
  Jonathan Corwin (j-corwin)

For more details, see:
https://code.launchpad.net/~smpettit/openlp/ftw/+merge/68968

Bug #801325

Modified mainwindow.py:

Add "Run First Time Wizard" to the "Tools" menu
Added code to reset the "has run wizard" indicator
Added code to close and restart OpenLP so the FTW will run

Modified code to run first time wizard "inline".  After the wizard exits, any items downloaded are imported and the pluginmanager is set to reflect plugins selected.

Due to the delay between selecting the menu item and the display of the FTW screen, the cursor is set to "busy"

Added code for FTW re-run confirmation with warnings informing what re-running the wizard will do.
Added code to check for FTW "Cancel"
Added code to update thememanager and a new default theme
-- 
https://code.launchpad.net/~smpettit/openlp/ftw/+merge/68968
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py	2011-06-12 16:02:52 +0000
+++ openlp/core/ui/firsttimeform.py	2011-07-23 19:29:24 +0000
@@ -129,6 +129,7 @@
                     os.path.join(gettempdir(), u'openlp', screenshot)))
                 item.setCheckState(QtCore.Qt.Unchecked)
                 item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
+        Receiver.send_message(u'cursor_normal')
 
     def nextId(self):
         """

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2011-07-12 19:06:37 +0000
+++ openlp/core/ui/mainwindow.py	2011-07-23 19:29:24 +0000
@@ -33,7 +33,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, \
-    PluginManager, Receiver, translate, ImageManager
+    PluginManager, Receiver, translate, ImageManager,  PluginStatus
 from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
     icon_action, shortcut_action
 from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
@@ -42,6 +42,8 @@
 from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
     get_application_version, delete_file
 from openlp.core.utils.actions import ActionList, CategoryOrder
+from openlp.core.ui.firsttimeform import FirstTimeForm
+from openlp.core.ui import ScreenList
 
 log = logging.getLogger(__name__)
 
@@ -244,6 +246,9 @@
         self.toolsOpenDataFolder = icon_action(mainWindow,
             u'toolsOpenDataFolder', u':/general/general_open.png',
             category=UiStrings().Tools)
+        self.toolsFirstTimeWizard = icon_action(mainWindow,
+            u'toolsFirstTimeWizard', u':/general/general_revert.png',
+            category=UiStrings().Tools)
         self.updateThemeImages = base_action(mainWindow,
             u'updateThemeImages', category=UiStrings().Tools)
         action_list.add_category(UiStrings().Settings,
@@ -323,6 +328,7 @@
                 self.settingsConfigureItem))
         add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
         add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
+        add_actions(self.toolsMenu, (self.toolsFirstTimeWizard, None))
         add_actions(self.toolsMenu, [self.updateThemeImages])
         if os.name == u'nt':
             add_actions(self.helpMenu, (self.offlineHelpItem,
@@ -469,6 +475,8 @@
             'Add an application to the list of tools.'))
         self.toolsOpenDataFolder.setText(
             translate('OpenLP.MainWindow', 'Open &Data Folder...'))
+        self.toolsFirstTimeWizard.setText(
+            translate('OpenLP.MainWindow', 'Run First Time Wizard'))
         self.toolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
             'Open the folder where songs, bibles and other data resides.'))
         self.updateThemeImages.setText(
@@ -546,6 +554,8 @@
             QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
         QtCore.QObject.connect(self.toolsOpenDataFolder,
             QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
+        QtCore.QObject.connect(self.toolsFirstTimeWizard,
+            QtCore.SIGNAL(u'triggered()'), self.onFirstTimeWizardClicked)
         QtCore.QObject.connect(self.updateThemeImages,
             QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
         QtCore.QObject.connect(self.displayTagItem,
@@ -714,6 +724,38 @@
             delete_file(os.path.join(temp_dir, filename))
         os.removedirs(temp_dir)
 
+    def onFirstTimeWizardClicked(self):
+        ret = QtGui.QMessageBox.warning(self,
+            translate('OpenLP.MainWindow', 'Re-Run First Time Wizard?'),
+            translate('OpenLP.MainWindow',
+            'Are you sure you want to run the First Time Wizard?\n\n' + \
+            'Re-running this wizard will make changes to your current ' + \
+            'OpenLP configuration, possibly add songs to your ' + \
+            'existing Songs list and change your Default Theme'),
+            QtGui.QMessageBox.StandardButtons(
+            QtGui.QMessageBox.Yes |
+            QtGui.QMessageBox.No),
+            QtGui.QMessageBox.Yes)
+        if ret == QtGui.QMessageBox.Yes:
+            Receiver.send_message(u'cursor_busy')
+            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):
         """
         Check and display message if screen blank on setup.


Follow ups