openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #10915
[Merge] lp:~smpettit/openlp/ftw into lp:openlp
Stevan Pettit has proposed merging lp:~smpettit/openlp/ftw into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~smpettit/openlp/ftw/+merge/68849
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
--
https://code.launchpad.net/~smpettit/openlp/ftw/+merge/68849
Your team OpenLP Core is requested to review the proposed merge of lp:~smpettit/openlp/ftw into lp:openlp.
=== 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-22 14:17:05 +0000
@@ -244,6 +244,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 +326,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 +473,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 +552,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 +722,20 @@
delete_file(os.path.join(temp_dir, filename))
os.removedirs(temp_dir)
+ def onFirstTimeWizardClicked(self):
+ ret = QtGui.QMessageBox.information(self,
+ translate('OpenLP.MainWindow', 'Restart OpenLP'),
+ translate('OpenLP.MainWindow',
+ 'OpenLP will now restart. The First Time Wizard will run when ' +
+ 'OpenLP is restarted'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
+ QtGui.QMessageBox.Ok)
+ QtCore.QSettings().setValue(u'general/has run wizard',
+ QtCore.QVariant(False))
+ self.close()
+ OpenLP_exe = sys.executable
+ os.execl(OpenLP_exe, OpenLP_exe, * sys.argv)
+
def blankCheck(self):
"""
Check and display message if screen blank on setup.
Follow ups