fixed bug #738706; make sure that the wizard does not run again, when it shouldn't

bzr-revno: 1411
Fixes: https://launchpad.net/bugs/738706
This commit is contained in:
Andreas Preikschat 2011-03-20 18:58:15 +01:00
commit 5293683325
2 changed files with 7 additions and 8 deletions

View File

@ -173,7 +173,9 @@ class OpenLP(QtGui.QApplication):
has_run_wizard = QtCore.QSettings().value( has_run_wizard = QtCore.QSettings().value(
u'general/has run wizard', QtCore.QVariant(False)).toBool() u'general/has run wizard', QtCore.QVariant(False)).toBool()
if not has_run_wizard: if not has_run_wizard:
FirstTimeForm(screens).exec_() if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
QtCore.QSettings().setValue(u'general/has run wizard',
QtCore.QVariant(True))
if os.name == u'nt': if os.name == u'nt':
self.setStyleSheet(application_stylesheet) self.setStyleSheet(application_stylesheet)
show_splash = QtCore.QSettings().value( show_splash = QtCore.QSettings().value(

View File

@ -33,7 +33,8 @@ from ConfigParser import SafeConfigParser
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \
check_directory_exists
from openlp.core.utils import get_web_page, AppLocation from openlp.core.utils import get_web_page, AppLocation
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
@ -60,8 +61,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.downloading = unicode(translate('OpenLP.FirstTimeWizard', self.downloading = unicode(translate('OpenLP.FirstTimeWizard',
'Downloading %s...')) 'Downloading %s...'))
QtCore.QObject.connect(self, QtCore.QObject.connect(self,
QtCore.SIGNAL(u'currentIdChanged(int)'), QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
self.onCurrentIdChanged)
def exec_(self, edit=False): def exec_(self, edit=False):
""" """
@ -75,6 +75,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
Set up display at start of theme edit. Set up display at start of theme edit.
""" """
self.restart() self.restart()
check_directory_exists(os.path.join(gettempdir(), u'openlp'))
# Sort out internet access for downloads # Sort out internet access for downloads
if self.webAccess: if self.webAccess:
songs = self.config.get(u'songs', u'languages') songs = self.config.get(u'songs', u'languages')
@ -111,8 +112,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.biblesTreeWidget.expandAll() self.biblesTreeWidget.expandAll()
themes = self.config.get(u'themes', u'files') themes = self.config.get(u'themes', u'files')
themes = themes.split(u',') themes = themes.split(u',')
if not os.path.exists(os.path.join(gettempdir(), u'openlp')):
os.makedirs(os.path.join(gettempdir(), u'openlp'))
for theme in themes: for theme in themes:
title = self.config.get(u'theme_%s' % theme, u'title') title = self.config.get(u'theme_%s' % theme, u'title')
filename = self.config.get(u'theme_%s' % theme, u'filename') filename = self.config.get(u'theme_%s' % theme, u'filename')
@ -294,8 +293,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
if self.themeComboBox.currentIndex() != -1: if self.themeComboBox.currentIndex() != -1:
QtCore.QSettings().setValue(u'themes/global theme', QtCore.QSettings().setValue(u'themes/global theme',
QtCore.QVariant(self.themeComboBox.currentText())) QtCore.QVariant(self.themeComboBox.currentText()))
QtCore.QSettings().setValue(u'general/has run wizard',
QtCore.QVariant(True))
def _setPluginStatus(self, field, tag): def _setPluginStatus(self, field, tag):
status = PluginStatus.Active if field.checkState() \ status = PluginStatus.Active if field.checkState() \