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

Fixes: https://launchpad.net/bugs/1194622
This commit is contained in:
Raoul Snyman 2013-08-19 23:09:52 +02:00
parent bb5aacfb6a
commit c620a303e2
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