Fix bug #1194622: skip the Bibles page if the Bibles plugin is not enabled.

bzr-revno: 2155
This commit is contained in:
Raoul Snyman 2013-08-20 18:41:51 +01:00 committed by Tim Bentley
commit 24a94c0478
2 changed files with 17 additions and 2 deletions

View File

@ -26,7 +26,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The First Time Wizard
"""
import io
import logging
import os
@ -48,6 +50,7 @@ from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
log = logging.getLogger(__name__)
class ThemeScreenshotThread(QtCore.QThread):
"""
This thread downloads the theme screenshots.
@ -56,6 +59,9 @@ class ThemeScreenshotThread(QtCore.QThread):
QtCore.QThread.__init__(self, parent)
def run(self):
"""
Run the thread.
"""
themes = self.parent().config.get(u'themes', u'files')
themes = themes.split(u',')
themes_dir = self.parent().config.get(u'themes', u'directory')
@ -189,6 +195,11 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
return -1
elif self.currentId() == FirstTimePage.NoInternet:
return FirstTimePage.Progress
elif self.currentId() == FirstTimePage.Songs:
if self.bibleCheckBox.isChecked():
return FirstTimePage.Bibles
else:
return FirstTimePage.Themes
elif self.currentId() == FirstTimePage.Themes:
Receiver.send_message(u'cursor_busy')
Receiver.send_message(u'openlp_process_events')
@ -395,7 +406,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.max_progress += size
if self.max_progress:
# Add on 2 for plugins status setting plus a "finished" point.
self.max_progress = self.max_progress + 2
self.max_progress += 2
self.progressBar.setValue(0)
self.progressBar.setMinimum(0)
self.progressBar.setMaximum(self.max_progress)

View File

@ -34,7 +34,11 @@ import sys
from openlp.core.lib import translate
from openlp.core.lib.ui import add_welcome_page
class FirstTimePage(object):
"""
An enumeration object to make it easy for a developer to determine which page is which by index
"""
Welcome = 0
Plugins = 1
NoInternet = 2