From db87a9e7dd1b363fa1eed226ebac99b57360f4f0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 27 Jul 2010 16:07:00 +0100 Subject: [PATCH 1/5] Exception handling fixes in bible import --- openlp/plugins/bibles/forms/importwizardform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index ba48ed5fb..371dcfa56 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -327,6 +327,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): #Load and store Crosswalk Bibles filepath = AppLocation.get_directory(AppLocation.PluginsDir) filepath = os.path.join(filepath, u'bibles', u'resources') + books_file = None try: self.web_bible_list[WebDownload.Crosswalk] = {} books_file = open( @@ -348,6 +349,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if books_file: books_file.close() #Load and store BibleGateway Bibles + books_file = None try: self.web_bible_list[WebDownload.BibleGateway] = {} books_file = open(os.path.join(filepath, u'biblegateway.csv'), 'r') From 3b5c29dc073bb893ef8d76fc78a304f4a613cafd Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Jul 2010 13:44:33 +0100 Subject: [PATCH 2/5] Missing space --- openlp/core/ui/generaltab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index ce33c65f0..ec0d10743 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -120,7 +120,7 @@ class GeneralTab(SettingsTab): self.settingsLayout.addWidget(self.timeoutLabel, 2, 0, 1, 1) self.timeoutSpinBox = QtGui.QSpinBox(self.settingsGroupBox) self.timeoutSpinBox.setObjectName("timeoutSpinBox") - self.settingsLayout.addWidget(self.timeoutSpinBox, 2,1, 1, 1) + self.settingsLayout.addWidget(self.timeoutSpinBox, 2, 1, 1, 1) self.generalLeftLayout.addWidget(self.settingsGroupBox) self.generalLeftSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) From 2bd442ff4fd120afbbb24a729a4e415ac7e6d87d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Jul 2010 14:15:39 +0100 Subject: [PATCH 3/5] More naming cleanup --- openlp/core/ui/servicemanager.py | 143 +++++++++--------- openlp/core/utils/languagemanager.py | 6 +- openlp/plugins/alerts/alertsplugin.py | 6 +- openlp/plugins/bibles/bibleplugin.py | 30 ++-- .../plugins/bibles/forms/importwizardform.py | 8 +- openlp/plugins/bibles/lib/biblestab.py | 8 +- openlp/plugins/bibles/lib/manager.py | 12 +- 7 files changed, 104 insertions(+), 109 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index a9f7af20c..b1ccce77e 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -112,60 +112,60 @@ class ServiceManager(QtGui.QWidget): self.serviceNoteForm = ServiceNoteForm(self.parent) self.serviceItemEditForm = ServiceItemEditForm(self.parent) #start with the layout - self.Layout = QtGui.QVBoxLayout(self) - self.Layout.setSpacing(0) - self.Layout.setMargin(0) + self.layout = QtGui.QVBoxLayout(self) + self.layout.setSpacing(0) + self.layout.setMargin(0) # Create the top toolbar - self.Toolbar = OpenLPToolbar(self) - self.Toolbar.addToolbarButton( + self.toolbar = OpenLPToolbar(self) + self.toolbar.addToolbarButton( translate('OpenLP.ServiceManager', 'New Service'), u':/general/general_new.png', translate('OpenLP.ServiceManager', 'Create a new service'), self.onNewService) - self.Toolbar.addToolbarButton( + self.toolbar.addToolbarButton( translate('OpenLP.ServiceManager', 'Open Service'), u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), self.onLoadService) - self.Toolbar.addToolbarButton( + self.toolbar.addToolbarButton( translate('OpenLP.ServiceManager', 'Save Service'), u':/general/general_save.png', translate('OpenLP.ServiceManager', 'Save this service'), self.onQuickSaveService) - self.Toolbar.addSeparator() - self.ThemeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager', + self.toolbar.addSeparator() + self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager', 'Theme:'), self) - self.ThemeLabel.setMargin(3) - self.Toolbar.addToolbarWidget(u'ThemeLabel', self.ThemeLabel) - self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) - self.ThemeComboBox.setToolTip(translate('OpenLP.ServiceManager', + self.themeLabel.setMargin(3) + self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel) + self.themeComboBox = QtGui.QComboBox(self.toolbar) + self.themeComboBox.setToolTip(translate('OpenLP.ServiceManager', 'Select a theme for the service')) - self.ThemeComboBox.setSizeAdjustPolicy( + self.themeComboBox.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToContents) - self.Toolbar.addToolbarWidget(u'ThemeWidget', self.ThemeComboBox) - self.Layout.addWidget(self.Toolbar) + self.toolbar.addToolbarWidget(u'ThemeWidget', self.themeComboBox) + self.layout.addWidget(self.toolbar) # Create the service manager list - self.ServiceManagerList = ServiceManagerList(self) - self.ServiceManagerList.setEditTriggers( + self.serviceManagerList = ServiceManagerList(self) + self.serviceManagerList.setEditTriggers( QtGui.QAbstractItemView.CurrentChanged | QtGui.QAbstractItemView.DoubleClicked | QtGui.QAbstractItemView.EditKeyPressed) - self.ServiceManagerList.setDragDropMode( + self.serviceManagerList.setDragDropMode( QtGui.QAbstractItemView.DragDrop) - self.ServiceManagerList.setAlternatingRowColors(True) - self.ServiceManagerList.setHeaderHidden(True) - self.ServiceManagerList.setExpandsOnDoubleClick(False) - self.ServiceManagerList.setContextMenuPolicy( + self.serviceManagerList.setAlternatingRowColors(True) + self.serviceManagerList.setHeaderHidden(True) + self.serviceManagerList.setExpandsOnDoubleClick(False) + self.serviceManagerList.setContextMenuPolicy( QtCore.Qt.CustomContextMenu) - QtCore.QObject.connect(self.ServiceManagerList, + QtCore.QObject.connect(self.serviceManagerList, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.contextMenu) - self.ServiceManagerList.setObjectName(u'ServiceManagerList') + self.serviceManagerList.setObjectName(u'serviceManagerList') # enable drop - self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent - self.ServiceManagerList.__class__.dragMoveEvent = self.dragEnterEvent - self.ServiceManagerList.__class__.dropEvent = self.dropEvent - self.Layout.addWidget(self.ServiceManagerList) + self.serviceManagerList.__class__.dragEnterEvent = self.dragEnterEvent + self.serviceManagerList.__class__.dragMoveEvent = self.dragEnterEvent + self.serviceManagerList.__class__.dropEvent = self.dropEvent + self.layout.addWidget(self.serviceManagerList) # Add the bottom toolbar self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar.addToolbarButton( @@ -199,15 +199,15 @@ class ServiceManager(QtGui.QWidget): translate('OpenLP.ServiceManager', 'Delete the selected item from the service.'), self.onDeleteFromService) - self.Layout.addWidget(self.OrderToolbar) + self.layout.addWidget(self.OrderToolbar) # Connect up our signals and slots - QtCore.QObject.connect(self.ThemeComboBox, + QtCore.QObject.connect(self.themeComboBox, QtCore.SIGNAL(u'activated(int)'), self.onThemeComboBoxSelected) - QtCore.QObject.connect(self.ServiceManagerList, + QtCore.QObject.connect(self.serviceManagerList, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.makeLive) - QtCore.QObject.connect(self.ServiceManagerList, + QtCore.QObject.connect(self.serviceManagerList, QtCore.SIGNAL(u'itemCollapsed(QTreeWidgetItem*)'), self.collapsed) - QtCore.QObject.connect(self.ServiceManagerList, + QtCore.QObject.connect(self.serviceManagerList, QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) @@ -268,7 +268,7 @@ class ServiceManager(QtGui.QWidget): self.suffixes.append(suffix) def contextMenu(self, point): - item = self.ServiceManagerList.itemAt(point) + item = self.serviceManagerList.itemAt(point) if item is None: return if item.parent() is None: @@ -289,7 +289,7 @@ class ServiceManager(QtGui.QWidget): self.themeMenu.menuAction().setVisible(False) if serviceItem[u'service_item'].is_text(): self.themeMenu.menuAction().setVisible(True) - action = self.menu.exec_(self.ServiceManagerList.mapToGlobal(point)) + action = self.menu.exec_(self.serviceManagerList.mapToGlobal(point)) if action == self.editAction: self.remoteEdit() if action == self.maintainAction: @@ -326,14 +326,14 @@ class ServiceManager(QtGui.QWidget): Called by the SlideController to select the next service item """ - if len(self.ServiceManagerList.selectedItems()) == 0: + if len(self.serviceManagerList.selectedItems()) == 0: return - selected = self.ServiceManagerList.selectedItems()[0] + selected = self.serviceManagerList.selectedItems()[0] lookFor = 0 - serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) while serviceIterator.value(): if lookFor == 1 and serviceIterator.value().parent() is None: - self.ServiceManagerList.setCurrentItem(serviceIterator.value()) + self.serviceManagerList.setCurrentItem(serviceIterator.value()) self.makeLive() return if serviceIterator.value() == selected: @@ -345,15 +345,15 @@ class ServiceManager(QtGui.QWidget): Called by the SlideController to select the previous service item """ - if len(self.ServiceManagerList.selectedItems()) == 0: + if len(self.serviceManagerList.selectedItems()) == 0: return - selected = self.ServiceManagerList.selectedItems()[0] + selected = self.serviceManagerList.selectedItems()[0] prevItem = None - serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) while serviceIterator.value(): if serviceIterator.value() == selected: if prevItem: - self.ServiceManagerList.setCurrentItem(prevItem) + self.serviceManagerList.setCurrentItem(prevItem) self.makeLive() return if serviceIterator.value().parent() is None: @@ -370,9 +370,9 @@ class ServiceManager(QtGui.QWidget): """ Makes a specific item in the service live """ - if index >= 0 and index < self.ServiceManagerList.topLevelItemCount: - item = self.ServiceManagerList.topLevelItem(index) - self.ServiceManagerList.setCurrentItem(item) + if index >= 0 and index < self.serviceManagerList.topLevelItemCount: + item = self.serviceManagerList.topLevelItem(index) + self.serviceManagerList.setCurrentItem(item) self.makeLive() def onMoveSelectionUp(self): @@ -380,7 +380,7 @@ class ServiceManager(QtGui.QWidget): Moves the selection up the window Called by the up arrow """ - serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) tempItem = None setLastItem = False while serviceIterator: @@ -405,7 +405,7 @@ class ServiceManager(QtGui.QWidget): Moves the selection down the window Called by the down arrow """ - serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList) + serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) firstItem = serviceIterator setSelected = False while serviceIterator: @@ -503,7 +503,7 @@ class ServiceManager(QtGui.QWidget): QtGui.QMessageBox.Save) if ret == QtGui.QMessageBox.Save: self.onSaveService() - self.ServiceManagerList.clear() + self.serviceManagerList.clear() self.serviceItems = [] self.serviceName = u'' self.isNew = True @@ -531,10 +531,10 @@ class ServiceManager(QtGui.QWidget): item[u'order'] = count count += 1 #Repaint the screen - self.ServiceManagerList.clear() + self.serviceManagerList.clear() for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] - treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) + treewidgetitem = QtGui.QTreeWidgetItem(self.serviceManagerList) if serviceitem.is_valid: if serviceitem.notes: icon = QtGui.QImage(serviceitem.icon) @@ -565,7 +565,7 @@ class ServiceManager(QtGui.QWidget): if serviceItem == itemcount and serviceItemCount == count: #preserve expanding status as setCurrentItem sets it to True temp = item[u'expanded'] - self.ServiceManagerList.setCurrentItem(treewidgetitem1) + self.serviceManagerList.setCurrentItem(treewidgetitem1) item[u'expanded'] = temp treewidgetitem.setExpanded(item[u'expanded']) @@ -758,7 +758,7 @@ class ServiceManager(QtGui.QWidget): """ Set the theme for the current service """ - self.service_theme = unicode(self.ThemeComboBox.currentText()) + self.service_theme = unicode(self.themeComboBox.currentText()) self.parent.RenderManager.set_service_theme(self.service_theme) QtCore.QSettings().setValue( self.parent.serviceSettingsSection + u'/service theme', @@ -771,11 +771,11 @@ class ServiceManager(QtGui.QWidget): sure the theme combo box is in the correct state. """ if self.parent.RenderManager.theme_level == ThemeLevel.Global: - self.Toolbar.actions[u'ThemeLabel'].setVisible(False) - self.Toolbar.actions[u'ThemeWidget'].setVisible(False) + self.toolbar.actions[u'ThemeLabel'].setVisible(False) + self.toolbar.actions[u'ThemeWidget'].setVisible(False) else: - self.Toolbar.actions[u'ThemeLabel'].setVisible(True) - self.Toolbar.actions[u'ThemeWidget'].setVisible(True) + self.toolbar.actions[u'ThemeLabel'].setVisible(True) + self.toolbar.actions[u'ThemeWidget'].setVisible(True) def regenerateServiceItems(self): """ @@ -786,7 +786,7 @@ class ServiceManager(QtGui.QWidget): self.parent.RenderManager.themedata = None if self.serviceItems: tempServiceItems = self.serviceItems - self.ServiceManagerList.clear() + self.serviceManagerList.clear() self.serviceItems = [] self.isNew = True for item in tempServiceItems: @@ -903,7 +903,7 @@ class ServiceManager(QtGui.QWidget): """ Finds a ServiceItem in the list """ - items = self.ServiceManagerList.selectedItems() + items = self.serviceManagerList.selectedItems() pos = 0 count = 0 for item in items: @@ -923,7 +923,6 @@ class ServiceManager(QtGui.QWidget): ``event`` Handle of the event pint passed - """ event.accept() @@ -939,7 +938,7 @@ class ServiceManager(QtGui.QWidget): link = event.mimeData() if link.hasText(): plugin = event.mimeData().text() - item = self.ServiceManagerList.itemAt(event.pos()) + item = self.serviceManagerList.itemAt(event.pos()) #ServiceManager started the drag and drop if plugin == u'ServiceManager': startpos, startCount = self.findServiceItem() @@ -983,23 +982,21 @@ class ServiceManager(QtGui.QWidget): ``theme_list`` A list of current themes to be displayed """ - self.ThemeComboBox.clear() + self.themeComboBox.clear() self.themeMenu.clear() - self.ThemeComboBox.addItem(u'') + self.themeComboBox.addItem(u'') for theme in theme_list: - self.ThemeComboBox.addItem(theme) - action = context_menu_action( - self.ServiceManagerList, - None, - theme , self.onThemeChangeAction) + self.themeComboBox.addItem(theme) + action = context_menu_action(self.serviceManagerList, None, theme, + self.onThemeChangeAction) self.themeMenu.addAction(action) - id = self.ThemeComboBox.findText(self.service_theme, + index = self.themeComboBox.findText(self.service_theme, QtCore.Qt.MatchExactly) # Not Found - if id == -1: - id = 0 + if index == -1: + index = 0 self.service_theme = u'' - self.ThemeComboBox.setCurrentIndex(id) + self.themeComboBox.setCurrentIndex(index) self.parent.RenderManager.set_service_theme(self.service_theme) self.regenerateServiceItems() diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 6b939d9b2..275d6985b 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -54,10 +54,10 @@ class LanguageManager(object): """ if LanguageManager.AutoLanguage: language = QtCore.QLocale.system().name() - lang_Path = AppLocation.get_directory(AppLocation.AppDir) - lang_Path = os.path.join(lang_Path, u'resources', u'i18n') + lang_path = AppLocation.get_directory(AppLocation.AppDir) + lang_path = os.path.join(lang_path, u'resources', u'i18n') app_translator = QtCore.QTranslator() - if app_translator.load("openlp_" + language, lang_Path): + if app_translator.load("openlp_" + language, lang_path): return app_translator @staticmethod diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index c62f088a6..c4e1f50ea 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -66,11 +66,9 @@ class AlertsPlugin(Plugin): """ log.info(u'add tools menu') self.toolsAlertItem = QtGui.QAction(tools_menu) - AlertIcon = build_icon(u':/plugins/plugin_alerts.png') - self.toolsAlertItem.setIcon(AlertIcon) + self.toolsAlertItem.setIcon(build_icon(u':/plugins/plugin_alerts.png')) self.toolsAlertItem.setObjectName(u'toolsAlertItem') - self.toolsAlertItem.setText( - translate('AlertsPlugin', '&Alert')) + self.toolsAlertItem.setText(translate('AlertsPlugin', '&Alert')) self.toolsAlertItem.setStatusTip( translate('AlertsPlugin', 'Show an alert message.')) self.toolsAlertItem.setShortcut(u'F7') diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index d81aed399..5550dd90e 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -50,14 +50,14 @@ class BiblePlugin(Plugin): if self.manager is None: self.manager = BibleManager(self) Plugin.initialise(self) - self.ImportBibleItem.setVisible(True) - self.ExportBibleItem.setVisible(True) + self.importBibleItem.setVisible(True) + self.exportBibleItem.setVisible(True) def finalise(self): log.info(u'Plugin Finalise') Plugin.finalise(self) - self.ImportBibleItem.setVisible(False) - self.ExportBibleItem.setVisible(False) + self.importBibleItem.setVisible(False) + self.exportBibleItem.setVisible(False) def getSettingsTab(self): return BiblesTab(self.name) @@ -67,23 +67,23 @@ class BiblePlugin(Plugin): return BibleMediaItem(self, self.icon, self.name) def addImportMenuItem(self, import_menu): - self.ImportBibleItem = QtGui.QAction(import_menu) - self.ImportBibleItem.setObjectName(u'ImportBibleItem') - import_menu.addAction(self.ImportBibleItem) - self.ImportBibleItem.setText( + self.importBibleItem = QtGui.QAction(import_menu) + self.importBibleItem.setObjectName(u'importBibleItem') + import_menu.addAction(self.importBibleItem) + self.importBibleItem.setText( translate('BiblesPlugin', '&Bible')) # signals and slots - QtCore.QObject.connect(self.ImportBibleItem, + QtCore.QObject.connect(self.importBibleItem, QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick) - self.ImportBibleItem.setVisible(False) + self.importBibleItem.setVisible(False) def addExportMenuItem(self, export_menu): - self.ExportBibleItem = QtGui.QAction(export_menu) - self.ExportBibleItem.setObjectName(u'ExportBibleItem') - export_menu.addAction(self.ExportBibleItem) - self.ExportBibleItem.setText(translate( + self.exportBibleItem = QtGui.QAction(export_menu) + self.exportBibleItem.setObjectName(u'exportBibleItem') + export_menu.addAction(self.exportBibleItem) + self.exportBibleItem.setText(translate( 'BiblesPlugin', '&Bible')) - self.ExportBibleItem.setVisible(False) + self.exportBibleItem.setVisible(False) def onBibleImportClick(self): if self.mediaItem: diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 371dcfa56..c955847c6 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -50,8 +50,8 @@ class WebDownload(object): } @classmethod - def get_name(cls, id): - return cls.Names[id] + def get_name(cls, name): + return cls.Names[name] class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): @@ -260,8 +260,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if self.currentId() == 3: Receiver.send_message(u'bibles_stop_import') - def onCurrentIdChanged(self, id): - if id == 3: + def onCurrentIdChanged(self, pageId): + if pageId == 3: self.preImport() self.performImport() self.postImport() diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 162ab13d2..8399ee1d4 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -241,10 +241,10 @@ class BiblesTab(SettingsTab): self.BibleThemeComboBox.addItem(u'') for theme in theme_list: self.BibleThemeComboBox.addItem(theme) - id = self.BibleThemeComboBox.findText( + index = self.BibleThemeComboBox.findText( unicode(self.bible_theme), QtCore.Qt.MatchExactly) - if id == -1: + if index == -1: # Not Found - id = 0 + index = 0 self.bible_theme = u'' - self.BibleThemeComboBox.setCurrentIndex(id) + self.BibleThemeComboBox.setCurrentIndex(index) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 0f06764ad..5c2767d0e 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -63,20 +63,20 @@ class BibleFormat(object): WebDownload = 3 @staticmethod - def get_class(id): + def get_class(format): """ Return the appropriate imeplementation class. - ``id`` + ``format`` The Bible format. """ - if id == BibleFormat.OSIS: + if format == BibleFormat.OSIS: return OSISBible - elif id == BibleFormat.CSV: + elif format == BibleFormat.CSV: return CSVBible - elif id == BibleFormat.OpenSong: + elif format == BibleFormat.OpenSong: return OpenSongBible - elif id == BibleFormat.WebDownload: + elif format == BibleFormat.WebDownload: return HTTPBible else: return None From c099e6f8083bad8fdbaa4aca0abbd41788175b55 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Jul 2010 14:32:12 +0100 Subject: [PATCH 4/5] Naming cleanup --- openlp/plugins/custom/lib/customtab.py | 38 +++++++++++++------------- openlp/plugins/songs/lib/__init__.py | 12 ++++---- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 0081524b6..77ef0f3f6 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -38,29 +38,29 @@ class CustomTab(SettingsTab): def setupUi(self): self.setObjectName(u'CustomTab') self.tabTitleVisible = translate('CustomPlugin.CustomTab', 'Custom') - self.CustomLayout = QtGui.QFormLayout(self) - self.CustomLayout.setSpacing(8) - self.CustomLayout.setMargin(8) - self.CustomLayout.setObjectName(u'CustomLayout') - self.CustomModeGroupBox = QtGui.QGroupBox(self) - self.CustomModeGroupBox.setObjectName(u'CustomModeGroupBox') - self.CustomModeLayout = QtGui.QVBoxLayout(self.CustomModeGroupBox) - self.CustomModeLayout.setSpacing(8) - self.CustomModeLayout.setMargin(8) - self.CustomModeLayout.setObjectName(u'CustomModeLayout') - self.DisplayFooterCheckBox = QtGui.QCheckBox(self.CustomModeGroupBox) - self.DisplayFooterCheckBox.setObjectName(u'DisplayFooterCheckBox') - self.CustomModeLayout.addWidget(self.DisplayFooterCheckBox) - self.CustomLayout.setWidget( - 0, QtGui.QFormLayout.LabelRole, self.CustomModeGroupBox) - QtCore.QObject.connect(self.DisplayFooterCheckBox, + self.customLayout = QtGui.QFormLayout(self) + self.customLayout.setSpacing(8) + self.customLayout.setMargin(8) + self.customLayout.setObjectName(u'customLayout') + self.customModeGroupBox = QtGui.QGroupBox(self) + self.customModeGroupBox.setObjectName(u'customModeGroupBox') + self.customModeLayout = QtGui.QVBoxLayout(self.customModeGroupBox) + self.customModeLayout.setSpacing(8) + self.customModeLayout.setMargin(8) + self.customModeLayout.setObjectName(u'customModeLayout') + self.displayFooterCheckBox = QtGui.QCheckBox(self.customModeGroupBox) + self.displayFooterCheckBox.setObjectName(u'displayFooterCheckBox') + self.customModeLayout.addWidget(self.displayFooterCheckBox) + self.customLayout.setWidget( + 0, QtGui.QFormLayout.LabelRole, self.customModeGroupBox) + QtCore.QObject.connect(self.displayFooterCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onDisplayFooterCheckBoxChanged) def retranslateUi(self): - self.CustomModeGroupBox.setTitle(translate('CustomPlugin.CustomTab', + self.customModeGroupBox.setTitle(translate('CustomPlugin.CustomTab', 'Custom Display')) - self.DisplayFooterCheckBox.setText( + self.displayFooterCheckBox.setText( translate('CustomPlugin.CustomTab', 'Display footer')) def onDisplayFooterCheckBoxChanged(self, check_state): @@ -73,7 +73,7 @@ class CustomTab(SettingsTab): self.displayFooter = QtCore.QSettings().value( self.settingsSection + u'/display footer', QtCore.QVariant(True)).toBool() - self.DisplayFooterCheckBox.setChecked(self.displayFooter) + self.displayFooterCheckBox.setChecked(self.displayFooter) def save(self): QtCore.QSettings().setValue(self.settingsSection + u'/display footer', diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 23bbc2a52..b8f4d9a05 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -42,20 +42,20 @@ class SongFormat(object): CSV = 3 @staticmethod - def get_class(id): + def get_class(format): """ Return the appropriate imeplementation class. - ``id`` + ``format`` The song format. """ -# if id == SongFormat.OpenLyrics: +# if format == SongFormat.OpenLyrics: # return OpenLyricsSong -# elif id == SongFormat.OpenSong: +# elif format == SongFormat.OpenSong: # return OpenSongSong -# elif id == SongFormat.CCLI: +# elif format == SongFormat.CCLI: # return CCLISong -# elif id == SongFormat.CSV: +# elif format == SongFormat.CSV: # return CSVSong # else: return None From 8838e9563eab69ac44925f9b5aad69f03ba8757c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Jul 2010 14:36:29 +0100 Subject: [PATCH 5/5] Naming cleanup fixes --- openlp/core/ui/mainwindow.py | 6 +++--- openlp/core/ui/thememanager.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index cbbe7f5bd..1730e02d8 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -220,17 +220,17 @@ class Ui_MainWindow(object): # Create the menu items self.FileNewItem = QtGui.QAction(MainWindow) self.FileNewItem.setIcon( - self.ServiceManagerContents.Toolbar.getIconFromTitle( + self.ServiceManagerContents.toolbar.getIconFromTitle( u'New Service')) self.FileNewItem.setObjectName(u'FileNewItem') self.FileOpenItem = QtGui.QAction(MainWindow) self.FileOpenItem.setIcon( - self.ServiceManagerContents.Toolbar.getIconFromTitle( + self.ServiceManagerContents.toolbar.getIconFromTitle( u'Open Service')) self.FileOpenItem.setObjectName(u'FileOpenItem') self.FileSaveItem = QtGui.QAction(MainWindow) self.FileSaveItem.setIcon( - self.ServiceManagerContents.Toolbar.getIconFromTitle( + self.ServiceManagerContents.toolbar.getIconFromTitle( u'Save Service')) self.FileSaveItem.setObjectName(u'FileSaveItem') self.FileSaveAsItem = QtGui.QAction(MainWindow) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 5198c0ea4..760d8b059 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -49,7 +49,7 @@ class ThemeManager(QtGui.QWidget): QtGui.QWidget.__init__(self, parent) self.parent = parent self.settingsSection = u'themes' - self.serviceComboBox = self.parent.ServiceManagerContents.ThemeComboBox + self.serviceComboBox = self.parent.ServiceManagerContents.themeComboBox self.layout = QtGui.QVBoxLayout(self) self.layout.setSpacing(0) self.layout.setMargin(0)