forked from openlp/openlp
More naming cleanup
This commit is contained in:
parent
3b5c29dc07
commit
2bd442ff4f
@ -112,60 +112,60 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.serviceNoteForm = ServiceNoteForm(self.parent)
|
self.serviceNoteForm = ServiceNoteForm(self.parent)
|
||||||
self.serviceItemEditForm = ServiceItemEditForm(self.parent)
|
self.serviceItemEditForm = ServiceItemEditForm(self.parent)
|
||||||
#start with the layout
|
#start with the layout
|
||||||
self.Layout = QtGui.QVBoxLayout(self)
|
self.layout = QtGui.QVBoxLayout(self)
|
||||||
self.Layout.setSpacing(0)
|
self.layout.setSpacing(0)
|
||||||
self.Layout.setMargin(0)
|
self.layout.setMargin(0)
|
||||||
# Create the top toolbar
|
# Create the top toolbar
|
||||||
self.Toolbar = OpenLPToolbar(self)
|
self.toolbar = OpenLPToolbar(self)
|
||||||
self.Toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'New Service'),
|
translate('OpenLP.ServiceManager', 'New Service'),
|
||||||
u':/general/general_new.png',
|
u':/general/general_new.png',
|
||||||
translate('OpenLP.ServiceManager', 'Create a new service'),
|
translate('OpenLP.ServiceManager', 'Create a new service'),
|
||||||
self.onNewService)
|
self.onNewService)
|
||||||
self.Toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'Open Service'),
|
translate('OpenLP.ServiceManager', 'Open Service'),
|
||||||
u':/general/general_open.png',
|
u':/general/general_open.png',
|
||||||
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
||||||
self.onLoadService)
|
self.onLoadService)
|
||||||
self.Toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'Save Service'),
|
translate('OpenLP.ServiceManager', 'Save Service'),
|
||||||
u':/general/general_save.png',
|
u':/general/general_save.png',
|
||||||
translate('OpenLP.ServiceManager', 'Save this service'),
|
translate('OpenLP.ServiceManager', 'Save this service'),
|
||||||
self.onQuickSaveService)
|
self.onQuickSaveService)
|
||||||
self.Toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
self.ThemeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager',
|
self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager',
|
||||||
'Theme:'), self)
|
'Theme:'), self)
|
||||||
self.ThemeLabel.setMargin(3)
|
self.themeLabel.setMargin(3)
|
||||||
self.Toolbar.addToolbarWidget(u'ThemeLabel', self.ThemeLabel)
|
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
|
||||||
self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
|
self.themeComboBox = QtGui.QComboBox(self.toolbar)
|
||||||
self.ThemeComboBox.setToolTip(translate('OpenLP.ServiceManager',
|
self.themeComboBox.setToolTip(translate('OpenLP.ServiceManager',
|
||||||
'Select a theme for the service'))
|
'Select a theme for the service'))
|
||||||
self.ThemeComboBox.setSizeAdjustPolicy(
|
self.themeComboBox.setSizeAdjustPolicy(
|
||||||
QtGui.QComboBox.AdjustToContents)
|
QtGui.QComboBox.AdjustToContents)
|
||||||
self.Toolbar.addToolbarWidget(u'ThemeWidget', self.ThemeComboBox)
|
self.toolbar.addToolbarWidget(u'ThemeWidget', self.themeComboBox)
|
||||||
self.Layout.addWidget(self.Toolbar)
|
self.layout.addWidget(self.toolbar)
|
||||||
# Create the service manager list
|
# Create the service manager list
|
||||||
self.ServiceManagerList = ServiceManagerList(self)
|
self.serviceManagerList = ServiceManagerList(self)
|
||||||
self.ServiceManagerList.setEditTriggers(
|
self.serviceManagerList.setEditTriggers(
|
||||||
QtGui.QAbstractItemView.CurrentChanged |
|
QtGui.QAbstractItemView.CurrentChanged |
|
||||||
QtGui.QAbstractItemView.DoubleClicked |
|
QtGui.QAbstractItemView.DoubleClicked |
|
||||||
QtGui.QAbstractItemView.EditKeyPressed)
|
QtGui.QAbstractItemView.EditKeyPressed)
|
||||||
self.ServiceManagerList.setDragDropMode(
|
self.serviceManagerList.setDragDropMode(
|
||||||
QtGui.QAbstractItemView.DragDrop)
|
QtGui.QAbstractItemView.DragDrop)
|
||||||
self.ServiceManagerList.setAlternatingRowColors(True)
|
self.serviceManagerList.setAlternatingRowColors(True)
|
||||||
self.ServiceManagerList.setHeaderHidden(True)
|
self.serviceManagerList.setHeaderHidden(True)
|
||||||
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
self.serviceManagerList.setExpandsOnDoubleClick(False)
|
||||||
self.ServiceManagerList.setContextMenuPolicy(
|
self.serviceManagerList.setContextMenuPolicy(
|
||||||
QtCore.Qt.CustomContextMenu)
|
QtCore.Qt.CustomContextMenu)
|
||||||
QtCore.QObject.connect(self.ServiceManagerList,
|
QtCore.QObject.connect(self.serviceManagerList,
|
||||||
QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
|
QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
|
||||||
self.contextMenu)
|
self.contextMenu)
|
||||||
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
self.serviceManagerList.setObjectName(u'serviceManagerList')
|
||||||
# enable drop
|
# enable drop
|
||||||
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
self.serviceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
||||||
self.ServiceManagerList.__class__.dragMoveEvent = self.dragEnterEvent
|
self.serviceManagerList.__class__.dragMoveEvent = self.dragEnterEvent
|
||||||
self.ServiceManagerList.__class__.dropEvent = self.dropEvent
|
self.serviceManagerList.__class__.dropEvent = self.dropEvent
|
||||||
self.Layout.addWidget(self.ServiceManagerList)
|
self.layout.addWidget(self.serviceManagerList)
|
||||||
# Add the bottom toolbar
|
# Add the bottom toolbar
|
||||||
self.OrderToolbar = OpenLPToolbar(self)
|
self.OrderToolbar = OpenLPToolbar(self)
|
||||||
self.OrderToolbar.addToolbarButton(
|
self.OrderToolbar.addToolbarButton(
|
||||||
@ -199,15 +199,15 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
translate('OpenLP.ServiceManager',
|
translate('OpenLP.ServiceManager',
|
||||||
'Delete the selected item from the service.'),
|
'Delete the selected item from the service.'),
|
||||||
self.onDeleteFromService)
|
self.onDeleteFromService)
|
||||||
self.Layout.addWidget(self.OrderToolbar)
|
self.layout.addWidget(self.OrderToolbar)
|
||||||
# Connect up our signals and slots
|
# Connect up our signals and slots
|
||||||
QtCore.QObject.connect(self.ThemeComboBox,
|
QtCore.QObject.connect(self.themeComboBox,
|
||||||
QtCore.SIGNAL(u'activated(int)'), self.onThemeComboBoxSelected)
|
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.SIGNAL(u'doubleClicked(QModelIndex)'), self.makeLive)
|
||||||
QtCore.QObject.connect(self.ServiceManagerList,
|
QtCore.QObject.connect(self.serviceManagerList,
|
||||||
QtCore.SIGNAL(u'itemCollapsed(QTreeWidgetItem*)'), self.collapsed)
|
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.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
||||||
@ -268,7 +268,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.suffixes.append(suffix)
|
self.suffixes.append(suffix)
|
||||||
|
|
||||||
def contextMenu(self, point):
|
def contextMenu(self, point):
|
||||||
item = self.ServiceManagerList.itemAt(point)
|
item = self.serviceManagerList.itemAt(point)
|
||||||
if item is None:
|
if item is None:
|
||||||
return
|
return
|
||||||
if item.parent() is None:
|
if item.parent() is None:
|
||||||
@ -289,7 +289,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.themeMenu.menuAction().setVisible(False)
|
self.themeMenu.menuAction().setVisible(False)
|
||||||
if serviceItem[u'service_item'].is_text():
|
if serviceItem[u'service_item'].is_text():
|
||||||
self.themeMenu.menuAction().setVisible(True)
|
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:
|
if action == self.editAction:
|
||||||
self.remoteEdit()
|
self.remoteEdit()
|
||||||
if action == self.maintainAction:
|
if action == self.maintainAction:
|
||||||
@ -326,14 +326,14 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Called by the SlideController to select the
|
Called by the SlideController to select the
|
||||||
next service item
|
next service item
|
||||||
"""
|
"""
|
||||||
if len(self.ServiceManagerList.selectedItems()) == 0:
|
if len(self.serviceManagerList.selectedItems()) == 0:
|
||||||
return
|
return
|
||||||
selected = self.ServiceManagerList.selectedItems()[0]
|
selected = self.serviceManagerList.selectedItems()[0]
|
||||||
lookFor = 0
|
lookFor = 0
|
||||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList)
|
serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList)
|
||||||
while serviceIterator.value():
|
while serviceIterator.value():
|
||||||
if lookFor == 1 and serviceIterator.value().parent() is None:
|
if lookFor == 1 and serviceIterator.value().parent() is None:
|
||||||
self.ServiceManagerList.setCurrentItem(serviceIterator.value())
|
self.serviceManagerList.setCurrentItem(serviceIterator.value())
|
||||||
self.makeLive()
|
self.makeLive()
|
||||||
return
|
return
|
||||||
if serviceIterator.value() == selected:
|
if serviceIterator.value() == selected:
|
||||||
@ -345,15 +345,15 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Called by the SlideController to select the
|
Called by the SlideController to select the
|
||||||
previous service item
|
previous service item
|
||||||
"""
|
"""
|
||||||
if len(self.ServiceManagerList.selectedItems()) == 0:
|
if len(self.serviceManagerList.selectedItems()) == 0:
|
||||||
return
|
return
|
||||||
selected = self.ServiceManagerList.selectedItems()[0]
|
selected = self.serviceManagerList.selectedItems()[0]
|
||||||
prevItem = None
|
prevItem = None
|
||||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList)
|
serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList)
|
||||||
while serviceIterator.value():
|
while serviceIterator.value():
|
||||||
if serviceIterator.value() == selected:
|
if serviceIterator.value() == selected:
|
||||||
if prevItem:
|
if prevItem:
|
||||||
self.ServiceManagerList.setCurrentItem(prevItem)
|
self.serviceManagerList.setCurrentItem(prevItem)
|
||||||
self.makeLive()
|
self.makeLive()
|
||||||
return
|
return
|
||||||
if serviceIterator.value().parent() is None:
|
if serviceIterator.value().parent() is None:
|
||||||
@ -370,9 +370,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Makes a specific item in the service live
|
Makes a specific item in the service live
|
||||||
"""
|
"""
|
||||||
if index >= 0 and index < self.ServiceManagerList.topLevelItemCount:
|
if index >= 0 and index < self.serviceManagerList.topLevelItemCount:
|
||||||
item = self.ServiceManagerList.topLevelItem(index)
|
item = self.serviceManagerList.topLevelItem(index)
|
||||||
self.ServiceManagerList.setCurrentItem(item)
|
self.serviceManagerList.setCurrentItem(item)
|
||||||
self.makeLive()
|
self.makeLive()
|
||||||
|
|
||||||
def onMoveSelectionUp(self):
|
def onMoveSelectionUp(self):
|
||||||
@ -380,7 +380,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Moves the selection up the window
|
Moves the selection up the window
|
||||||
Called by the up arrow
|
Called by the up arrow
|
||||||
"""
|
"""
|
||||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList)
|
serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList)
|
||||||
tempItem = None
|
tempItem = None
|
||||||
setLastItem = False
|
setLastItem = False
|
||||||
while serviceIterator:
|
while serviceIterator:
|
||||||
@ -405,7 +405,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Moves the selection down the window
|
Moves the selection down the window
|
||||||
Called by the down arrow
|
Called by the down arrow
|
||||||
"""
|
"""
|
||||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.ServiceManagerList)
|
serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList)
|
||||||
firstItem = serviceIterator
|
firstItem = serviceIterator
|
||||||
setSelected = False
|
setSelected = False
|
||||||
while serviceIterator:
|
while serviceIterator:
|
||||||
@ -503,7 +503,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
QtGui.QMessageBox.Save)
|
QtGui.QMessageBox.Save)
|
||||||
if ret == QtGui.QMessageBox.Save:
|
if ret == QtGui.QMessageBox.Save:
|
||||||
self.onSaveService()
|
self.onSaveService()
|
||||||
self.ServiceManagerList.clear()
|
self.serviceManagerList.clear()
|
||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.serviceName = u''
|
self.serviceName = u''
|
||||||
self.isNew = True
|
self.isNew = True
|
||||||
@ -531,10 +531,10 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
item[u'order'] = count
|
item[u'order'] = count
|
||||||
count += 1
|
count += 1
|
||||||
#Repaint the screen
|
#Repaint the screen
|
||||||
self.ServiceManagerList.clear()
|
self.serviceManagerList.clear()
|
||||||
for itemcount, item in enumerate(self.serviceItems):
|
for itemcount, item in enumerate(self.serviceItems):
|
||||||
serviceitem = item[u'service_item']
|
serviceitem = item[u'service_item']
|
||||||
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
|
treewidgetitem = QtGui.QTreeWidgetItem(self.serviceManagerList)
|
||||||
if serviceitem.is_valid:
|
if serviceitem.is_valid:
|
||||||
if serviceitem.notes:
|
if serviceitem.notes:
|
||||||
icon = QtGui.QImage(serviceitem.icon)
|
icon = QtGui.QImage(serviceitem.icon)
|
||||||
@ -565,7 +565,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
if serviceItem == itemcount and serviceItemCount == count:
|
if serviceItem == itemcount and serviceItemCount == count:
|
||||||
#preserve expanding status as setCurrentItem sets it to True
|
#preserve expanding status as setCurrentItem sets it to True
|
||||||
temp = item[u'expanded']
|
temp = item[u'expanded']
|
||||||
self.ServiceManagerList.setCurrentItem(treewidgetitem1)
|
self.serviceManagerList.setCurrentItem(treewidgetitem1)
|
||||||
item[u'expanded'] = temp
|
item[u'expanded'] = temp
|
||||||
treewidgetitem.setExpanded(item[u'expanded'])
|
treewidgetitem.setExpanded(item[u'expanded'])
|
||||||
|
|
||||||
@ -758,7 +758,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Set the theme for the current service
|
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)
|
self.parent.RenderManager.set_service_theme(self.service_theme)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.serviceSettingsSection + u'/service theme',
|
self.parent.serviceSettingsSection + u'/service theme',
|
||||||
@ -771,11 +771,11 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
sure the theme combo box is in the correct state.
|
sure the theme combo box is in the correct state.
|
||||||
"""
|
"""
|
||||||
if self.parent.RenderManager.theme_level == ThemeLevel.Global:
|
if self.parent.RenderManager.theme_level == ThemeLevel.Global:
|
||||||
self.Toolbar.actions[u'ThemeLabel'].setVisible(False)
|
self.toolbar.actions[u'ThemeLabel'].setVisible(False)
|
||||||
self.Toolbar.actions[u'ThemeWidget'].setVisible(False)
|
self.toolbar.actions[u'ThemeWidget'].setVisible(False)
|
||||||
else:
|
else:
|
||||||
self.Toolbar.actions[u'ThemeLabel'].setVisible(True)
|
self.toolbar.actions[u'ThemeLabel'].setVisible(True)
|
||||||
self.Toolbar.actions[u'ThemeWidget'].setVisible(True)
|
self.toolbar.actions[u'ThemeWidget'].setVisible(True)
|
||||||
|
|
||||||
def regenerateServiceItems(self):
|
def regenerateServiceItems(self):
|
||||||
"""
|
"""
|
||||||
@ -786,7 +786,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.parent.RenderManager.themedata = None
|
self.parent.RenderManager.themedata = None
|
||||||
if self.serviceItems:
|
if self.serviceItems:
|
||||||
tempServiceItems = self.serviceItems
|
tempServiceItems = self.serviceItems
|
||||||
self.ServiceManagerList.clear()
|
self.serviceManagerList.clear()
|
||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.isNew = True
|
self.isNew = True
|
||||||
for item in tempServiceItems:
|
for item in tempServiceItems:
|
||||||
@ -903,7 +903,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Finds a ServiceItem in the list
|
Finds a ServiceItem in the list
|
||||||
"""
|
"""
|
||||||
items = self.ServiceManagerList.selectedItems()
|
items = self.serviceManagerList.selectedItems()
|
||||||
pos = 0
|
pos = 0
|
||||||
count = 0
|
count = 0
|
||||||
for item in items:
|
for item in items:
|
||||||
@ -923,7 +923,6 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
``event``
|
``event``
|
||||||
Handle of the event pint passed
|
Handle of the event pint passed
|
||||||
|
|
||||||
"""
|
"""
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
@ -939,7 +938,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
link = event.mimeData()
|
link = event.mimeData()
|
||||||
if link.hasText():
|
if link.hasText():
|
||||||
plugin = event.mimeData().text()
|
plugin = event.mimeData().text()
|
||||||
item = self.ServiceManagerList.itemAt(event.pos())
|
item = self.serviceManagerList.itemAt(event.pos())
|
||||||
#ServiceManager started the drag and drop
|
#ServiceManager started the drag and drop
|
||||||
if plugin == u'ServiceManager':
|
if plugin == u'ServiceManager':
|
||||||
startpos, startCount = self.findServiceItem()
|
startpos, startCount = self.findServiceItem()
|
||||||
@ -983,23 +982,21 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
``theme_list``
|
``theme_list``
|
||||||
A list of current themes to be displayed
|
A list of current themes to be displayed
|
||||||
"""
|
"""
|
||||||
self.ThemeComboBox.clear()
|
self.themeComboBox.clear()
|
||||||
self.themeMenu.clear()
|
self.themeMenu.clear()
|
||||||
self.ThemeComboBox.addItem(u'')
|
self.themeComboBox.addItem(u'')
|
||||||
for theme in theme_list:
|
for theme in theme_list:
|
||||||
self.ThemeComboBox.addItem(theme)
|
self.themeComboBox.addItem(theme)
|
||||||
action = context_menu_action(
|
action = context_menu_action(self.serviceManagerList, None, theme,
|
||||||
self.ServiceManagerList,
|
self.onThemeChangeAction)
|
||||||
None,
|
|
||||||
theme , self.onThemeChangeAction)
|
|
||||||
self.themeMenu.addAction(action)
|
self.themeMenu.addAction(action)
|
||||||
id = self.ThemeComboBox.findText(self.service_theme,
|
index = self.themeComboBox.findText(self.service_theme,
|
||||||
QtCore.Qt.MatchExactly)
|
QtCore.Qt.MatchExactly)
|
||||||
# Not Found
|
# Not Found
|
||||||
if id == -1:
|
if index == -1:
|
||||||
id = 0
|
index = 0
|
||||||
self.service_theme = u''
|
self.service_theme = u''
|
||||||
self.ThemeComboBox.setCurrentIndex(id)
|
self.themeComboBox.setCurrentIndex(index)
|
||||||
self.parent.RenderManager.set_service_theme(self.service_theme)
|
self.parent.RenderManager.set_service_theme(self.service_theme)
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ class LanguageManager(object):
|
|||||||
"""
|
"""
|
||||||
if LanguageManager.AutoLanguage:
|
if LanguageManager.AutoLanguage:
|
||||||
language = QtCore.QLocale.system().name()
|
language = QtCore.QLocale.system().name()
|
||||||
lang_Path = AppLocation.get_directory(AppLocation.AppDir)
|
lang_path = AppLocation.get_directory(AppLocation.AppDir)
|
||||||
lang_Path = os.path.join(lang_Path, u'resources', u'i18n')
|
lang_path = os.path.join(lang_path, u'resources', u'i18n')
|
||||||
app_translator = QtCore.QTranslator()
|
app_translator = QtCore.QTranslator()
|
||||||
if app_translator.load("openlp_" + language, lang_Path):
|
if app_translator.load("openlp_" + language, lang_path):
|
||||||
return app_translator
|
return app_translator
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -66,11 +66,9 @@ class AlertsPlugin(Plugin):
|
|||||||
"""
|
"""
|
||||||
log.info(u'add tools menu')
|
log.info(u'add tools menu')
|
||||||
self.toolsAlertItem = QtGui.QAction(tools_menu)
|
self.toolsAlertItem = QtGui.QAction(tools_menu)
|
||||||
AlertIcon = build_icon(u':/plugins/plugin_alerts.png')
|
self.toolsAlertItem.setIcon(build_icon(u':/plugins/plugin_alerts.png'))
|
||||||
self.toolsAlertItem.setIcon(AlertIcon)
|
|
||||||
self.toolsAlertItem.setObjectName(u'toolsAlertItem')
|
self.toolsAlertItem.setObjectName(u'toolsAlertItem')
|
||||||
self.toolsAlertItem.setText(
|
self.toolsAlertItem.setText(translate('AlertsPlugin', '&Alert'))
|
||||||
translate('AlertsPlugin', '&Alert'))
|
|
||||||
self.toolsAlertItem.setStatusTip(
|
self.toolsAlertItem.setStatusTip(
|
||||||
translate('AlertsPlugin', 'Show an alert message.'))
|
translate('AlertsPlugin', 'Show an alert message.'))
|
||||||
self.toolsAlertItem.setShortcut(u'F7')
|
self.toolsAlertItem.setShortcut(u'F7')
|
||||||
|
@ -50,14 +50,14 @@ class BiblePlugin(Plugin):
|
|||||||
if self.manager is None:
|
if self.manager is None:
|
||||||
self.manager = BibleManager(self)
|
self.manager = BibleManager(self)
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
self.ImportBibleItem.setVisible(True)
|
self.importBibleItem.setVisible(True)
|
||||||
self.ExportBibleItem.setVisible(True)
|
self.exportBibleItem.setVisible(True)
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
log.info(u'Plugin Finalise')
|
log.info(u'Plugin Finalise')
|
||||||
Plugin.finalise(self)
|
Plugin.finalise(self)
|
||||||
self.ImportBibleItem.setVisible(False)
|
self.importBibleItem.setVisible(False)
|
||||||
self.ExportBibleItem.setVisible(False)
|
self.exportBibleItem.setVisible(False)
|
||||||
|
|
||||||
def getSettingsTab(self):
|
def getSettingsTab(self):
|
||||||
return BiblesTab(self.name)
|
return BiblesTab(self.name)
|
||||||
@ -67,23 +67,23 @@ class BiblePlugin(Plugin):
|
|||||||
return BibleMediaItem(self, self.icon, self.name)
|
return BibleMediaItem(self, self.icon, self.name)
|
||||||
|
|
||||||
def addImportMenuItem(self, import_menu):
|
def addImportMenuItem(self, import_menu):
|
||||||
self.ImportBibleItem = QtGui.QAction(import_menu)
|
self.importBibleItem = QtGui.QAction(import_menu)
|
||||||
self.ImportBibleItem.setObjectName(u'ImportBibleItem')
|
self.importBibleItem.setObjectName(u'importBibleItem')
|
||||||
import_menu.addAction(self.ImportBibleItem)
|
import_menu.addAction(self.importBibleItem)
|
||||||
self.ImportBibleItem.setText(
|
self.importBibleItem.setText(
|
||||||
translate('BiblesPlugin', '&Bible'))
|
translate('BiblesPlugin', '&Bible'))
|
||||||
# signals and slots
|
# signals and slots
|
||||||
QtCore.QObject.connect(self.ImportBibleItem,
|
QtCore.QObject.connect(self.importBibleItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
|
QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
|
||||||
self.ImportBibleItem.setVisible(False)
|
self.importBibleItem.setVisible(False)
|
||||||
|
|
||||||
def addExportMenuItem(self, export_menu):
|
def addExportMenuItem(self, export_menu):
|
||||||
self.ExportBibleItem = QtGui.QAction(export_menu)
|
self.exportBibleItem = QtGui.QAction(export_menu)
|
||||||
self.ExportBibleItem.setObjectName(u'ExportBibleItem')
|
self.exportBibleItem.setObjectName(u'exportBibleItem')
|
||||||
export_menu.addAction(self.ExportBibleItem)
|
export_menu.addAction(self.exportBibleItem)
|
||||||
self.ExportBibleItem.setText(translate(
|
self.exportBibleItem.setText(translate(
|
||||||
'BiblesPlugin', '&Bible'))
|
'BiblesPlugin', '&Bible'))
|
||||||
self.ExportBibleItem.setVisible(False)
|
self.exportBibleItem.setVisible(False)
|
||||||
|
|
||||||
def onBibleImportClick(self):
|
def onBibleImportClick(self):
|
||||||
if self.mediaItem:
|
if self.mediaItem:
|
||||||
|
@ -50,8 +50,8 @@ class WebDownload(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_name(cls, id):
|
def get_name(cls, name):
|
||||||
return cls.Names[id]
|
return cls.Names[name]
|
||||||
|
|
||||||
|
|
||||||
class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
||||||
@ -260,8 +260,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
if self.currentId() == 3:
|
if self.currentId() == 3:
|
||||||
Receiver.send_message(u'bibles_stop_import')
|
Receiver.send_message(u'bibles_stop_import')
|
||||||
|
|
||||||
def onCurrentIdChanged(self, id):
|
def onCurrentIdChanged(self, pageId):
|
||||||
if id == 3:
|
if pageId == 3:
|
||||||
self.preImport()
|
self.preImport()
|
||||||
self.performImport()
|
self.performImport()
|
||||||
self.postImport()
|
self.postImport()
|
||||||
|
@ -241,10 +241,10 @@ class BiblesTab(SettingsTab):
|
|||||||
self.BibleThemeComboBox.addItem(u'')
|
self.BibleThemeComboBox.addItem(u'')
|
||||||
for theme in theme_list:
|
for theme in theme_list:
|
||||||
self.BibleThemeComboBox.addItem(theme)
|
self.BibleThemeComboBox.addItem(theme)
|
||||||
id = self.BibleThemeComboBox.findText(
|
index = self.BibleThemeComboBox.findText(
|
||||||
unicode(self.bible_theme), QtCore.Qt.MatchExactly)
|
unicode(self.bible_theme), QtCore.Qt.MatchExactly)
|
||||||
if id == -1:
|
if index == -1:
|
||||||
# Not Found
|
# Not Found
|
||||||
id = 0
|
index = 0
|
||||||
self.bible_theme = u''
|
self.bible_theme = u''
|
||||||
self.BibleThemeComboBox.setCurrentIndex(id)
|
self.BibleThemeComboBox.setCurrentIndex(index)
|
||||||
|
@ -63,20 +63,20 @@ class BibleFormat(object):
|
|||||||
WebDownload = 3
|
WebDownload = 3
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_class(id):
|
def get_class(format):
|
||||||
"""
|
"""
|
||||||
Return the appropriate imeplementation class.
|
Return the appropriate imeplementation class.
|
||||||
|
|
||||||
``id``
|
``format``
|
||||||
The Bible format.
|
The Bible format.
|
||||||
"""
|
"""
|
||||||
if id == BibleFormat.OSIS:
|
if format == BibleFormat.OSIS:
|
||||||
return OSISBible
|
return OSISBible
|
||||||
elif id == BibleFormat.CSV:
|
elif format == BibleFormat.CSV:
|
||||||
return CSVBible
|
return CSVBible
|
||||||
elif id == BibleFormat.OpenSong:
|
elif format == BibleFormat.OpenSong:
|
||||||
return OpenSongBible
|
return OpenSongBible
|
||||||
elif id == BibleFormat.WebDownload:
|
elif format == BibleFormat.WebDownload:
|
||||||
return HTTPBible
|
return HTTPBible
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user