From d6128a4f0694d176e6279150c1d268dcf70aa2ac Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 9 Feb 2013 15:13:38 +0100 Subject: [PATCH 1/3] fixed first time wizard --- openlp/core/ui/firsttimeform.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index daedbb94e..efeac2d25 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -61,7 +61,7 @@ class ThemeScreenshotThread(QtCore.QThread): config = self.parent().config for theme in themes: # Stop if the wizard has been cancelled. - if self.parent().downloadCancelled: + if self.parent().was_download_cancelled: return title = config.get(u'theme_%s' % theme, u'title') filename = config.get(u'theme_%s' % theme, u'filename') @@ -91,9 +91,9 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): # check to see if we have web access self.web = u'http://openlp.org/files/frw/' self.config = SafeConfigParser() - self.webAccess = get_web_page(u'%s%s' % (self.web, u'download.cfg')) - if self.webAccess: - files = self.webAccess.read() + self.web_access = get_web_page(u'%s%s' % (self.web, u'download.cfg')) + if self.web_access: + files = self.web_access.read() self.config.readfp(io.BytesIO(files)) self.updateScreenListCombo() self.was_download_cancelled = False @@ -118,13 +118,12 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): Set up display at start of theme edit. """ self.restart() - check_directory_exists(os.path.join( - unicode(gettempdir(), get_filesystem_encoding()), u'openlp')) + check_directory_exists(os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp')) self.noInternetFinishButton.setVisible(False) # Check if this is a re-run of the wizard. self.hasRunWizard = Settings().value(u'general/has run wizard') # Sort out internet access for downloads - if self.webAccess: + if self.web_access: songs = self.config.get(u'songs', u'languages') songs = songs.split(u',') for song in songs: @@ -160,7 +159,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): """ self.application.process_events() if self.currentId() == FirstTimePage.Plugins: - if not self.webAccess: + if not self.web_access: return FirstTimePage.NoInternet else: return FirstTimePage.Songs @@ -169,6 +168,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): elif self.currentId() == FirstTimePage.NoInternet: return FirstTimePage.Progress elif self.currentId() == FirstTimePage.Themes: + self.application.process_events() self.application.set_busy_cursor() while not self.themeScreenshotThread.isFinished(): time.sleep(0.1) @@ -241,8 +241,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): """ Process the triggering of the cancel button. """ - if self.lastId == FirstTimePage.NoInternet or \ - (self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard): + if self.lastId == FirstTimePage.NoInternet or (self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard): QtCore.QCoreApplication.exit() sys.exit() self.was_download_cancelled = True @@ -428,7 +427,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self._setPluginStatus(self.customCheckBox, u'custom/status') self._setPluginStatus(self.songUsageCheckBox, u'songusage/status') self._setPluginStatus(self.alertCheckBox, u'alerts/status') - if self.webAccess: + if self.web_access: # Build directories for downloads songs_destination = os.path.join( unicode(gettempdir(), get_filesystem_encoding()), u'openlp') From b0065d808cc113132f42bc237baf9f9300cb7f54 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 9 Feb 2013 15:45:07 +0100 Subject: [PATCH 2/3] removed not needed call --- openlp/core/ui/firsttimeform.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index efeac2d25..16f39b85e 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -168,7 +168,6 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): elif self.currentId() == FirstTimePage.NoInternet: return FirstTimePage.Progress elif self.currentId() == FirstTimePage.Themes: - self.application.process_events() self.application.set_busy_cursor() while not self.themeScreenshotThread.isFinished(): time.sleep(0.1) From 5739536d8cd469ef383533af450ca4547734d067 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 9 Feb 2013 16:27:35 +0100 Subject: [PATCH 3/3] fixed more regression --- openlp/core/ui/mainwindow.py | 2 +- openlp/core/ui/thememanager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 5e21a6c28..cb94a0914 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -699,7 +699,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.activePlugin.app_startup() else: self.activePlugin.toggleStatus(PluginStatus.Inactive) - self.themeManagerContents.configUpdated() + self.themeManagerContents.config_updated() self.themeManagerContents.load_themes(True) Receiver.send_message(u'theme_update_global', self.themeManagerContents.global_theme) # Check if any Bibles downloaded. If there are, they will be diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 08746b884..a60244257 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -157,7 +157,7 @@ class ThemeManager(QtGui.QWidget): files = SettingsManager.get_files(self.settingsSection, u'.otz') for theme_file in files: theme_file = os.path.join(self.path, theme_file) - self.unzipTheme(theme_file, self.path) + self.unzip_theme(theme_file, self.path) delete_file(theme_file) self.application.set_normal_cursor()