mirror of https://gitlab.com/openlp/openlp.git
r1830 + resolved conflict
This commit is contained in:
commit
f1485aba47
|
@ -191,10 +191,10 @@ def validate_thumb(file_path, thumb_path):
|
|||
``thumb_path``
|
||||
The path to the thumb.
|
||||
"""
|
||||
if not os.path.exists(unicode(thumb_path)):
|
||||
if not os.path.exists(thumb_path):
|
||||
return False
|
||||
image_date = os.stat(unicode(file_path)).st_mtime
|
||||
thumb_date = os.stat(unicode(thumb_path)).st_mtime
|
||||
image_date = os.stat(file_path).st_mtime
|
||||
thumb_date = os.stat(thumb_path).st_mtime
|
||||
return image_date <= thumb_date
|
||||
|
||||
def resize_image(image_path, width, height, background=u'#000000'):
|
||||
|
|
|
@ -113,10 +113,10 @@ sup {
|
|||
document.getElementById('lyricsmain').style.visibility = lyrics;
|
||||
document.getElementById('image').style.visibility = lyrics;
|
||||
outline = document.getElementById('lyricsoutline')
|
||||
if(outline!=null)
|
||||
if(outline != null)
|
||||
outline.style.visibility = lyrics;
|
||||
shadow = document.getElementById('lyricsshadow')
|
||||
if(shadow!=null)
|
||||
if(shadow != null)
|
||||
shadow.style.visibility = lyrics;
|
||||
document.getElementById('footer').style.visibility = lyrics;
|
||||
}
|
||||
|
@ -129,10 +129,28 @@ sup {
|
|||
var match = /-webkit-text-fill-color:[^;\"]+/gi;
|
||||
if(timer != null)
|
||||
clearTimeout(timer);
|
||||
/*
|
||||
QtWebkit bug with outlines and justify causing outline alignment
|
||||
problems. (Bug 859950) Surround each word with a <span> to workaround,
|
||||
but only in this scenario.
|
||||
*/
|
||||
var txt = document.getElementById('lyricsmain');
|
||||
if(window.getComputedStyle(txt).textAlign == 'justify'){
|
||||
var outline = document.getElementById('lyricsoutline');
|
||||
if(outline != null)
|
||||
txt = outline;
|
||||
if(window.getComputedStyle(txt).webkitTextStrokeWidth != '0px'){
|
||||
newtext = newtext.replace(/(\s| )+(?![^<]*>)/g,
|
||||
function(match) {
|
||||
return '</span>' + match + '<span>';
|
||||
});
|
||||
newtext = '<span>' + newtext + '</span>';
|
||||
}
|
||||
}
|
||||
text_fade('lyricsmain', newtext);
|
||||
text_fade('lyricsoutline', newtext);
|
||||
text_fade('lyricsshadow', newtext.replace(match, ""));
|
||||
if(text_opacity()==1) return;
|
||||
text_fade('lyricsshadow', newtext.replace(match, ''));
|
||||
if(text_opacity() == 1) return;
|
||||
timer = setTimeout(function(){
|
||||
show_text(newtext);
|
||||
}, 100);
|
||||
|
@ -149,18 +167,18 @@ sup {
|
|||
slides) still looks pretty and is zippy.
|
||||
*/
|
||||
var text = document.getElementById(id);
|
||||
if(text==null) return;
|
||||
if(text == null) return;
|
||||
if(!transition){
|
||||
text.innerHTML = newtext;
|
||||
return;
|
||||
}
|
||||
if(newtext==text.innerHTML){
|
||||
if(newtext == text.innerHTML){
|
||||
text.style.opacity = parseFloat(text.style.opacity) + 0.3;
|
||||
if(text.style.opacity>0.7)
|
||||
if(text.style.opacity > 0.7)
|
||||
text.style.opacity = 1;
|
||||
} else {
|
||||
text.style.opacity = parseFloat(text.style.opacity) - 0.3;
|
||||
if(text.style.opacity<=0.1){
|
||||
if(text.style.opacity <= 0.1){
|
||||
text.innerHTML = newtext;
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +190,7 @@ sup {
|
|||
}
|
||||
|
||||
function show_text_complete(){
|
||||
return (text_opacity()==1);
|
||||
return (text_opacity() == 1);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -157,10 +157,10 @@ class Plugin(QtCore.QObject):
|
|||
self.icon = None
|
||||
self.media_item_class = media_item_class
|
||||
self.settings_tab_class = settings_tab_class
|
||||
self.settings_tab = None
|
||||
self.mediaItem = None
|
||||
self.weight = 0
|
||||
self.status = PluginStatus.Inactive
|
||||
# Set up logging
|
||||
self.log = logging.getLogger(self.name)
|
||||
self.previewController = plugin_helpers[u'preview']
|
||||
self.liveController = plugin_helpers[u'live']
|
||||
self.renderer = plugin_helpers[u'renderer']
|
||||
|
@ -217,9 +217,8 @@ class Plugin(QtCore.QObject):
|
|||
you need, and return it for integration into OpenLP.
|
||||
"""
|
||||
if self.media_item_class:
|
||||
return self.media_item_class(self.mediadock.media_dock, self,
|
||||
self.icon)
|
||||
return None
|
||||
self.mediaItem = self.media_item_class(self.mediadock.media_dock,
|
||||
self, self.icon)
|
||||
|
||||
def addImportMenuItem(self, importMenu):
|
||||
"""
|
||||
|
@ -254,10 +253,9 @@ class Plugin(QtCore.QObject):
|
|||
for this plugin to the user.
|
||||
"""
|
||||
if self.settings_tab_class:
|
||||
return self.settings_tab_class(parent, self.name,
|
||||
self.settings_tab = self.settings_tab_class(parent, self.name,
|
||||
self.getString(StringContent.VisibleName)[u'title'],
|
||||
self.icon_path)
|
||||
return None
|
||||
|
||||
def addToMenu(self, menubar):
|
||||
"""
|
||||
|
|
|
@ -90,7 +90,7 @@ class PluginManager(object):
|
|||
thisdepth = len(path.split(os.sep))
|
||||
if thisdepth - startdepth > 2:
|
||||
# skip anything lower down
|
||||
continue
|
||||
break
|
||||
modulename = os.path.splitext(path)[0]
|
||||
prefix = os.path.commonprefix([self.basepath, path])
|
||||
# hack off the plugin base path
|
||||
|
@ -128,7 +128,7 @@ class PluginManager(object):
|
|||
"""
|
||||
for plugin in self.plugins:
|
||||
if plugin.status is not PluginStatus.Disabled:
|
||||
plugin.mediaItem = plugin.createMediaManagerItem()
|
||||
plugin.createMediaManagerItem()
|
||||
|
||||
def hook_settings_tabs(self, settings_form=None):
|
||||
"""
|
||||
|
@ -141,7 +141,7 @@ class PluginManager(object):
|
|||
"""
|
||||
for plugin in self.plugins:
|
||||
if plugin.status is not PluginStatus.Disabled:
|
||||
plugin.settings_tab = plugin.createSettingsTab(settings_form)
|
||||
plugin.createSettingsTab(settings_form)
|
||||
settings_form.plugins = self.plugins
|
||||
|
||||
def hook_import_menu(self, import_menu):
|
||||
|
@ -207,7 +207,7 @@ class PluginManager(object):
|
|||
|
||||
def get_plugin_by_name(self, name):
|
||||
"""
|
||||
Return the plugin which has a name with value ``name``
|
||||
Return the plugin which has a name with value ``name``.
|
||||
"""
|
||||
for plugin in self.plugins:
|
||||
if plugin.name == name:
|
||||
|
|
|
@ -176,92 +176,100 @@ class Ui_MainWindow(object):
|
|||
self.themeManagerDock)
|
||||
# Create the menu items
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_category(UiStrings().File, CategoryOrder.standardMenu)
|
||||
action_list.add_category(unicode(UiStrings().File),
|
||||
CategoryOrder.standardMenu)
|
||||
self.fileNewItem = shortcut_action(mainWindow, u'fileNewItem',
|
||||
[QtGui.QKeySequence(u'Ctrl+N')],
|
||||
self.serviceManagerContents.onNewServiceClicked,
|
||||
u':/general/general_new.png', category=UiStrings().File)
|
||||
u':/general/general_new.png', category=unicode(UiStrings().File))
|
||||
self.fileOpenItem = shortcut_action(mainWindow, u'fileOpenItem',
|
||||
[QtGui.QKeySequence(u'Ctrl+O')],
|
||||
self.serviceManagerContents.onLoadServiceClicked,
|
||||
u':/general/general_open.png', category=UiStrings().File)
|
||||
u':/general/general_open.png', category=unicode(UiStrings().File))
|
||||
self.fileSaveItem = shortcut_action(mainWindow, u'fileSaveItem',
|
||||
[QtGui.QKeySequence(u'Ctrl+S')],
|
||||
self.serviceManagerContents.saveFile,
|
||||
u':/general/general_save.png', category=UiStrings().File)
|
||||
u':/general/general_save.png', category=unicode(UiStrings().File))
|
||||
self.fileSaveAsItem = shortcut_action(mainWindow, u'fileSaveAsItem',
|
||||
[QtGui.QKeySequence(u'Ctrl+Shift+S')],
|
||||
self.serviceManagerContents.saveFileAs, category=UiStrings().File)
|
||||
self.serviceManagerContents.saveFileAs,
|
||||
category=unicode(UiStrings().File))
|
||||
self.printServiceOrderItem = shortcut_action(mainWindow,
|
||||
u'printServiceItem', [QtGui.QKeySequence(u'Ctrl+P')],
|
||||
self.serviceManagerContents.printServiceOrder,
|
||||
category=UiStrings().File)
|
||||
category=unicode(UiStrings().File))
|
||||
self.fileExitItem = shortcut_action(mainWindow, u'fileExitItem',
|
||||
[QtGui.QKeySequence(u'Alt+F4')], mainWindow.close,
|
||||
u':/system/system_exit.png', category=UiStrings().File)
|
||||
action_list.add_category(UiStrings().Import, CategoryOrder.standardMenu)
|
||||
u':/system/system_exit.png', category=unicode(UiStrings().File))
|
||||
action_list.add_category(unicode(UiStrings().Import),
|
||||
CategoryOrder.standardMenu)
|
||||
self.importThemeItem = base_action(
|
||||
mainWindow, u'importThemeItem', UiStrings().Import)
|
||||
mainWindow, u'importThemeItem', unicode(UiStrings().Import))
|
||||
self.importLanguageItem = base_action(
|
||||
mainWindow, u'importLanguageItem')#, UiStrings().Import)
|
||||
action_list.add_category(UiStrings().Export, CategoryOrder.standardMenu)
|
||||
mainWindow, u'importLanguageItem')#, unicode(UiStrings().Import))
|
||||
action_list.add_category(unicode(UiStrings().Export),
|
||||
CategoryOrder.standardMenu)
|
||||
self.exportThemeItem = base_action(
|
||||
mainWindow, u'exportThemeItem', UiStrings().Export)
|
||||
mainWindow, u'exportThemeItem', unicode(UiStrings().Export))
|
||||
self.exportLanguageItem = base_action(
|
||||
mainWindow, u'exportLanguageItem')#, UiStrings().Export)
|
||||
action_list.add_category(UiStrings().View, CategoryOrder.standardMenu)
|
||||
mainWindow, u'exportLanguageItem')#, unicode(UiStrings().Export))
|
||||
action_list.add_category(unicode(UiStrings().View),
|
||||
CategoryOrder.standardMenu)
|
||||
self.viewMediaManagerItem = shortcut_action(mainWindow,
|
||||
u'viewMediaManagerItem', [QtGui.QKeySequence(u'F8')],
|
||||
self.toggleMediaManager, u':/system/system_mediamanager.png',
|
||||
self.mediaManagerDock.isVisible(), UiStrings().View)
|
||||
self.mediaManagerDock.isVisible(), unicode(UiStrings().View))
|
||||
self.viewThemeManagerItem = shortcut_action(mainWindow,
|
||||
u'viewThemeManagerItem', [QtGui.QKeySequence(u'F10')],
|
||||
self.toggleThemeManager, u':/system/system_thememanager.png',
|
||||
self.themeManagerDock.isVisible(), UiStrings().View)
|
||||
self.themeManagerDock.isVisible(), unicode(UiStrings().View))
|
||||
self.viewServiceManagerItem = shortcut_action(mainWindow,
|
||||
u'viewServiceManagerItem', [QtGui.QKeySequence(u'F9')],
|
||||
self.toggleServiceManager, u':/system/system_servicemanager.png',
|
||||
self.serviceManagerDock.isVisible(), UiStrings().View)
|
||||
self.serviceManagerDock.isVisible(), unicode(UiStrings().View))
|
||||
self.viewPreviewPanel = shortcut_action(mainWindow,
|
||||
u'viewPreviewPanel', [QtGui.QKeySequence(u'F11')],
|
||||
self.setPreviewPanelVisibility, checked=previewVisible,
|
||||
category=UiStrings().View)
|
||||
category=unicode(UiStrings().View))
|
||||
self.viewLivePanel = shortcut_action(mainWindow, u'viewLivePanel',
|
||||
[QtGui.QKeySequence(u'F12')], self.setLivePanelVisibility,
|
||||
checked=liveVisible, category=UiStrings().View)
|
||||
checked=liveVisible, category=unicode(UiStrings().View))
|
||||
self.lockPanel = shortcut_action(mainWindow, u'lockPanel',
|
||||
None, self.setLockPanel,
|
||||
checked=panelLocked, category=None)
|
||||
action_list.add_category(UiStrings().ViewMode,
|
||||
action_list.add_category(unicode(UiStrings().ViewMode),
|
||||
CategoryOrder.standardMenu)
|
||||
self.modeDefaultItem = checkable_action(
|
||||
mainWindow, u'modeDefaultItem', category=UiStrings().ViewMode)
|
||||
mainWindow, u'modeDefaultItem',
|
||||
category=unicode(UiStrings().ViewMode))
|
||||
self.modeSetupItem = checkable_action(
|
||||
mainWindow, u'modeSetupItem', category=UiStrings().ViewMode)
|
||||
mainWindow, u'modeSetupItem',
|
||||
category=unicode(UiStrings().ViewMode))
|
||||
self.modeLiveItem = checkable_action(
|
||||
mainWindow, u'modeLiveItem', True, UiStrings().ViewMode)
|
||||
mainWindow, u'modeLiveItem', True, unicode(UiStrings().ViewMode))
|
||||
self.modeGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.modeGroup.addAction(self.modeDefaultItem)
|
||||
self.modeGroup.addAction(self.modeSetupItem)
|
||||
self.modeGroup.addAction(self.modeLiveItem)
|
||||
self.modeDefaultItem.setChecked(True)
|
||||
action_list.add_category(UiStrings().Tools, CategoryOrder.standardMenu)
|
||||
action_list.add_category(unicode(UiStrings().Tools),
|
||||
CategoryOrder.standardMenu)
|
||||
self.toolsAddToolItem = icon_action(mainWindow, u'toolsAddToolItem',
|
||||
u':/tools/tools_add.png', category=UiStrings().Tools)
|
||||
u':/tools/tools_add.png', category=unicode(UiStrings().Tools))
|
||||
self.toolsOpenDataFolder = icon_action(mainWindow,
|
||||
u'toolsOpenDataFolder', u':/general/general_open.png',
|
||||
category=UiStrings().Tools)
|
||||
category=unicode(UiStrings().Tools))
|
||||
self.toolsFirstTimeWizard = icon_action(mainWindow,
|
||||
u'toolsFirstTimeWizard', u':/general/general_revert.png',
|
||||
category=UiStrings().Tools)
|
||||
category=unicode(UiStrings().Tools))
|
||||
self.updateThemeImages = base_action(mainWindow,
|
||||
u'updateThemeImages', category=UiStrings().Tools)
|
||||
action_list.add_category(UiStrings().Settings,
|
||||
u'updateThemeImages', category=unicode(UiStrings().Tools))
|
||||
action_list.add_category(unicode(UiStrings().Settings),
|
||||
CategoryOrder.standardMenu)
|
||||
self.settingsPluginListItem = shortcut_action(mainWindow,
|
||||
u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
|
||||
self.onPluginItemClicked, u':/system/settings_plugin_list.png',
|
||||
category=UiStrings().Settings)
|
||||
category=unicode(UiStrings().Settings))
|
||||
# i18n Language Items
|
||||
self.autoLanguageItem = checkable_action(mainWindow,
|
||||
u'autoLanguageItem', LanguageManager.auto_language)
|
||||
|
@ -278,35 +286,38 @@ class Ui_MainWindow(object):
|
|||
self.settingsShortcutsItem = icon_action(mainWindow,
|
||||
u'settingsShortcutsItem',
|
||||
u':/system/system_configure_shortcuts.png',
|
||||
category=UiStrings().Settings)
|
||||
category=unicode(UiStrings().Settings))
|
||||
# Formatting Tags were also known as display tags.
|
||||
self.formattingTagItem = icon_action(mainWindow,
|
||||
u'displayTagItem', u':/system/tag_editor.png',
|
||||
category=UiStrings().Settings)
|
||||
category=unicode(UiStrings().Settings))
|
||||
self.settingsConfigureItem = icon_action(mainWindow,
|
||||
u'settingsConfigureItem', u':/system/system_settings.png',
|
||||
category=UiStrings().Settings)
|
||||
category=unicode(UiStrings().Settings))
|
||||
self.settingsImportItem = base_action(mainWindow,
|
||||
u'settingsImportItem', category=UiStrings().Settings)
|
||||
u'settingsImportItem', category=unicode(UiStrings().Settings))
|
||||
self.settingsExportItem = base_action(mainWindow,
|
||||
u'settingsExportItem', category=UiStrings().Settings)
|
||||
action_list.add_category(UiStrings().Help, CategoryOrder.standardMenu)
|
||||
u'settingsExportItem', category=unicode(UiStrings().Settings))
|
||||
action_list.add_category(unicode(UiStrings().Help),
|
||||
CategoryOrder.standardMenu)
|
||||
self.aboutItem = shortcut_action(mainWindow, u'aboutItem',
|
||||
[QtGui.QKeySequence(u'Ctrl+F1')], self.onAboutItemClicked,
|
||||
u':/system/system_about.png', category=UiStrings().Help)
|
||||
u':/system/system_about.png', category=unicode(UiStrings().Help))
|
||||
if os.name == u'nt':
|
||||
self.localHelpFile = os.path.join(
|
||||
AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
|
||||
self.offlineHelpItem = shortcut_action(
|
||||
mainWindow, u'offlineHelpItem', [QtGui.QKeySequence(u'F1')],
|
||||
self.onOfflineHelpClicked,
|
||||
u':/system/system_help_contents.png', category=UiStrings().Help)
|
||||
u':/system/system_help_contents.png',
|
||||
category=unicode(UiStrings().Help))
|
||||
self.onlineHelpItem = shortcut_action(
|
||||
mainWindow, u'onlineHelpItem',
|
||||
[QtGui.QKeySequence(u'Alt+F1')], self.onOnlineHelpClicked,
|
||||
u':/system/system_online_help.png', category=UiStrings().Help)
|
||||
u':/system/system_online_help.png',
|
||||
category=unicode(UiStrings().Help))
|
||||
self.webSiteItem = base_action(
|
||||
mainWindow, u'webSiteItem', category=UiStrings().Help)
|
||||
mainWindow, u'webSiteItem', category=unicode(UiStrings().Help))
|
||||
add_actions(self.fileImportMenu, (self.settingsImportItem, None,
|
||||
self.importThemeItem, self.importLanguageItem))
|
||||
add_actions(self.fileExportMenu, (self.settingsExportItem, None,
|
||||
|
@ -720,7 +731,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
args = []
|
||||
for a in self.arguments:
|
||||
args.extend([a])
|
||||
self.serviceManagerContents.loadFile(unicode(args[0]))
|
||||
filename = args[0]
|
||||
if not isinstance(filename, unicode):
|
||||
filename = unicode(filename, sys.getfilesystemencoding())
|
||||
self.serviceManagerContents.loadFile(filename)
|
||||
elif QtCore.QSettings().value(
|
||||
self.generalSettingsSection + u'/auto open',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
|
@ -1312,7 +1326,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
settings.value(u'preview splitter geometry').toByteArray())
|
||||
self.controlSplitter.restoreState(
|
||||
settings.value(u'mainwindow splitter geometry').toByteArray())
|
||||
|
||||
settings.endGroup()
|
||||
|
||||
def saveSettings(self):
|
||||
|
@ -1388,6 +1401,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
maxRecentFiles = QtCore.QSettings().value(u'advanced/max recent files',
|
||||
QtCore.QVariant(20)).toInt()[0]
|
||||
if filename:
|
||||
# Add some cleanup to reduce duplication in the recent file list
|
||||
filename = os.path.abspath(filename)
|
||||
# abspath() only capitalises the drive letter if it wasn't provided
|
||||
# in the given filename which then causes duplication.
|
||||
if filename[1:3] == ':\\':
|
||||
filename = filename[0].upper() + filename[1:]
|
||||
position = self.recentFiles.indexOf(filename)
|
||||
if position != -1:
|
||||
self.recentFiles.removeAt(position)
|
||||
|
|
|
@ -206,15 +206,15 @@ class MediaController(object):
|
|||
controller.mediabar = OpenLPToolbar(controller)
|
||||
controller.mediabar.addToolbarButton(
|
||||
u'media_playback_play', u':/slides/media_playback_start.png',
|
||||
translate('OpenLP.SlideController', 'Start playing media'),
|
||||
translate('OpenLP.SlideController', 'Start playing media.'),
|
||||
controller.sendToPlugins)
|
||||
controller.mediabar.addToolbarButton(
|
||||
u'media_playback_pause', u':/slides/media_playback_pause.png',
|
||||
translate('OpenLP.SlideController', 'Pause playing media'),
|
||||
translate('OpenLP.SlideController', 'Pause playing media.'),
|
||||
controller.sendToPlugins)
|
||||
controller.mediabar.addToolbarButton(
|
||||
u'media_playback_stop', u':/slides/media_playback_stop.png',
|
||||
translate('OpenLP.SlideController', 'Stop playing media'),
|
||||
translate('OpenLP.SlideController', 'Stop playing media.'),
|
||||
controller.sendToPlugins)
|
||||
# Build the seekSlider.
|
||||
controller.seekSlider = QtGui.QSlider(QtCore.Qt.Horizontal)
|
||||
|
@ -223,7 +223,7 @@ class MediaController(object):
|
|||
'OpenLP.SlideController', 'Video position.'))
|
||||
controller.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
controller.seekSlider.setObjectName(u'seek_slider')
|
||||
controller.mediabar.addToolbarWidget(u'Seek Slider',
|
||||
controller.mediabar.addToolbarWidget(u'Seek Slider',
|
||||
controller.seekSlider)
|
||||
# Build the volumeSlider.
|
||||
controller.volumeSlider = QtGui.QSlider(QtCore.Qt.Horizontal)
|
||||
|
@ -236,7 +236,7 @@ class MediaController(object):
|
|||
controller.volumeSlider.setValue(controller.media_info.volume)
|
||||
controller.volumeSlider.setGeometry(QtCore.QRect(90, 160, 221, 24))
|
||||
controller.volumeSlider.setObjectName(u'volume_slider')
|
||||
controller.mediabar.addToolbarWidget(u'Audio Volume',
|
||||
controller.mediabar.addToolbarWidget(u'Audio Volume',
|
||||
controller.volumeSlider)
|
||||
control_panel.addWidget(controller.mediabar)
|
||||
controller.mediabar.setVisible(False)
|
||||
|
@ -255,7 +255,7 @@ class MediaController(object):
|
|||
|
||||
def setup_display(self, display):
|
||||
"""
|
||||
After a new display is configured, all media related widget will be
|
||||
After a new display is configured, all media related widget will be
|
||||
created too
|
||||
"""
|
||||
# clean up possible running old media files
|
||||
|
@ -276,13 +276,13 @@ class MediaController(object):
|
|||
def set_controls_visible(self, controller, value):
|
||||
# Generic controls
|
||||
controller.mediabar.setVisible(value)
|
||||
# Special controls: Here media type specific Controls will be enabled
|
||||
# Special controls: Here media type specific Controls will be enabled
|
||||
# (e.g. for DVD control, ...)
|
||||
# TODO
|
||||
|
||||
def resize(self, controller, display, player):
|
||||
"""
|
||||
After Mainwindow changes or Splitter moved all related media widgets
|
||||
After Mainwindow changes or Splitter moved all related media widgets
|
||||
have to be resized
|
||||
"""
|
||||
player.resize(display)
|
||||
|
@ -311,8 +311,13 @@ class MediaController(object):
|
|||
isValid = self.check_file_type(controller, display)
|
||||
display.override[u'theme'] = u''
|
||||
display.override[u'video'] = True
|
||||
controller.media_info.start_time = display.serviceItem.start_time
|
||||
controller.media_info.end_time = display.serviceItem.end_time
|
||||
if controller.media_info.is_background:
|
||||
# ignore start/end time
|
||||
controller.media_info.start_time = 0
|
||||
controller.media_info.end_time = 0
|
||||
else:
|
||||
controller.media_info.start_time = display.serviceItem.start_time
|
||||
controller.media_info.end_time = display.serviceItem.end_time
|
||||
elif controller.previewDisplay:
|
||||
display = controller.previewDisplay
|
||||
isValid = self.check_file_type(controller, display)
|
||||
|
@ -389,7 +394,7 @@ class MediaController(object):
|
|||
def video_play(self, msg, status=True):
|
||||
"""
|
||||
Responds to the request to play a loaded video
|
||||
|
||||
|
||||
``msg``
|
||||
First element is the controller which should be used
|
||||
"""
|
||||
|
|
|
@ -402,6 +402,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
|||
settings.endGroup()
|
||||
|
||||
def update_song_usage(self):
|
||||
# Only continue when we include the song's text.
|
||||
if not self.slideTextCheckBox.isChecked():
|
||||
return
|
||||
for index, item in enumerate(self.serviceManager.serviceItems):
|
||||
# Trigger Audit requests
|
||||
Receiver.send_message(u'print_service_started',
|
||||
|
|
|
@ -177,9 +177,9 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.serviceManagerList.moveTop.setObjectName(u'moveTop')
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_category(
|
||||
UiStrings().Service, CategoryOrder.standardToolbar)
|
||||
unicode(UiStrings().Service), CategoryOrder.standardToolbar)
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.moveTop, UiStrings().Service)
|
||||
self.serviceManagerList.moveTop, unicode(UiStrings().Service))
|
||||
self.serviceManagerList.moveUp = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Move &up'),
|
||||
u':/services/service_up.png',
|
||||
|
@ -188,7 +188,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.onServiceUp, shortcuts=[QtCore.Qt.Key_PageUp])
|
||||
self.serviceManagerList.moveUp.setObjectName(u'moveUp')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.moveUp, UiStrings().Service)
|
||||
self.serviceManagerList.moveUp, unicode(UiStrings().Service))
|
||||
self.serviceManagerList.moveDown = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Move &down'),
|
||||
u':/services/service_down.png',
|
||||
|
@ -197,7 +197,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.onServiceDown, shortcuts=[QtCore.Qt.Key_PageDown])
|
||||
self.serviceManagerList.moveDown.setObjectName(u'moveDown')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.moveDown, UiStrings().Service)
|
||||
self.serviceManagerList.moveDown, unicode(UiStrings().Service))
|
||||
self.serviceManagerList.moveBottom = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Move to &bottom'),
|
||||
u':/services/service_bottom.png',
|
||||
|
@ -206,7 +206,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.onServiceEnd, shortcuts=[QtCore.Qt.Key_End])
|
||||
self.serviceManagerList.moveBottom.setObjectName(u'moveBottom')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.moveBottom, UiStrings().Service)
|
||||
self.serviceManagerList.moveBottom, unicode(UiStrings().Service))
|
||||
self.serviceManagerList.down = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Move &down'),
|
||||
None,
|
||||
|
@ -241,7 +241,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.onExpandAll, shortcuts=[QtCore.Qt.Key_Plus])
|
||||
self.serviceManagerList.expand.setObjectName(u'expand')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.expand, UiStrings().Service)
|
||||
self.serviceManagerList.expand, unicode(UiStrings().Service))
|
||||
self.serviceManagerList.collapse = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', '&Collapse all'),
|
||||
u':/services/service_collapse_all.png',
|
||||
|
@ -250,7 +250,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
self.onCollapseAll, shortcuts=[QtCore.Qt.Key_Minus])
|
||||
self.serviceManagerList.collapse.setObjectName(u'collapse')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.collapse, UiStrings().Service)
|
||||
self.serviceManagerList.collapse, unicode(UiStrings().Service))
|
||||
self.orderToolbar.addSeparator()
|
||||
self.serviceManagerList.makeLive = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Go Live'),
|
||||
|
@ -260,7 +260,7 @@ class ServiceManager(QtGui.QWidget):
|
|||
shortcuts=[QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return])
|
||||
self.serviceManagerList.makeLive.setObjectName(u'orderToolbar')
|
||||
action_list.add_action(
|
||||
self.serviceManagerList.makeLive, UiStrings().Service)
|
||||
self.serviceManagerList.makeLive, unicode(UiStrings().Service))
|
||||
self.layout.addWidget(self.orderToolbar)
|
||||
# Connect up our signals and slots
|
||||
QtCore.QObject.connect(self.themeComboBox,
|
||||
|
|
|
@ -187,18 +187,20 @@ class SlideController(Controller):
|
|||
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
|
||||
self.blankScreen = shortcut_action(self.hideMenu, u'blankScreen',
|
||||
[QtCore.Qt.Key_Period], self.onBlankDisplay,
|
||||
u':/slides/slide_blank.png', False, UiStrings().LiveToolbar)
|
||||
u':/slides/slide_blank.png', False,
|
||||
unicode(UiStrings().LiveToolbar))
|
||||
self.blankScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Blank Screen'))
|
||||
self.themeScreen = shortcut_action(self.hideMenu, u'themeScreen',
|
||||
[QtGui.QKeySequence(u'T')], self.onThemeDisplay,
|
||||
u':/slides/slide_theme.png', False, UiStrings().LiveToolbar)
|
||||
u':/slides/slide_theme.png', False,
|
||||
unicode(UiStrings().LiveToolbar))
|
||||
self.themeScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Blank to Theme'))
|
||||
self.desktopScreen = shortcut_action(self.hideMenu,
|
||||
u'desktopScreen', [QtGui.QKeySequence(u'D')],
|
||||
self.onHideDisplay, u':/slides/slide_desktop.png', False,
|
||||
UiStrings().LiveToolbar)
|
||||
unicode(UiStrings().LiveToolbar))
|
||||
self.desktopScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Show Desktop'))
|
||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||
|
@ -218,11 +220,13 @@ class SlideController(Controller):
|
|||
self.toolbar))
|
||||
self.playSlidesLoop = shortcut_action(self.playSlidesMenu,
|
||||
u'playSlidesLoop', [], self.onPlaySlidesLoop,
|
||||
u':/media/media_time.png', False, UiStrings().LiveToolbar)
|
||||
u':/media/media_time.png', False,
|
||||
unicode(UiStrings().LiveToolbar))
|
||||
self.playSlidesLoop.setText(UiStrings().PlaySlidesInLoop)
|
||||
self.playSlidesOnce = shortcut_action(self.playSlidesMenu,
|
||||
u'playSlidesOnce', [], self.onPlaySlidesOnce,
|
||||
u':/media/media_time.png', False, UiStrings().LiveToolbar)
|
||||
u':/media/media_time.png', False,
|
||||
unicode(UiStrings().LiveToolbar))
|
||||
self.playSlidesOnce.setText(UiStrings().PlaySlidesToEnd)
|
||||
if QtCore.QSettings().value(self.parent().generalSettingsSection +
|
||||
u'/enable slide loop', QtCore.QVariant(True)).toBool():
|
||||
|
@ -320,7 +324,7 @@ class SlideController(Controller):
|
|||
self.shortcutTimer.setSingleShot(True)
|
||||
self.verseShortcut = shortcut_action(self, u'verseShortcut',
|
||||
[QtGui.QKeySequence(u'V')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.verseShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Verse"'))
|
||||
|
@ -356,37 +360,37 @@ class SlideController(Controller):
|
|||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.chorusShortcut = shortcut_action(self, u'chorusShortcut',
|
||||
[QtGui.QKeySequence(u'C')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.chorusShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Chorus"'))
|
||||
self.bridgeShortcut = shortcut_action(self, u'bridgeShortcut',
|
||||
[QtGui.QKeySequence(u'B')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.bridgeShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Bridge"'))
|
||||
self.preChorusShortcut = shortcut_action(self, u'preChorusShortcut',
|
||||
[QtGui.QKeySequence(u'P')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.preChorusShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Pre-Chorus"'))
|
||||
self.introShortcut = shortcut_action(self, u'introShortcut',
|
||||
[QtGui.QKeySequence(u'I')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.introShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Intro"'))
|
||||
self.endingShortcut = shortcut_action(self, u'endingShortcut',
|
||||
[QtGui.QKeySequence(u'E')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.endingShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Ending"'))
|
||||
self.otherShortcut = shortcut_action(self, u'otherShortcut',
|
||||
[QtGui.QKeySequence(u'O')], self.slideShortcutActivated,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.otherShortcut.setText(translate(
|
||||
'OpenLP.SlideController', 'Go to "Other"'))
|
||||
|
@ -540,24 +544,24 @@ class SlideController(Controller):
|
|||
self.nextItem.setObjectName(u'nextItemLive')
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_category(
|
||||
UiStrings().LiveToolbar, CategoryOrder.standardToolbar)
|
||||
unicode(UiStrings().LiveToolbar), CategoryOrder.standardToolbar)
|
||||
action_list.add_action(self.previousItem)
|
||||
action_list.add_action(self.nextItem)
|
||||
self.previousService = shortcut_action(parent, u'previousService',
|
||||
[QtCore.Qt.Key_Left], self.servicePrevious,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.previousService.setText(
|
||||
translate('OpenLP.SlideController', 'Previous Service'))
|
||||
self.nextService = shortcut_action(parent, 'nextService',
|
||||
[QtCore.Qt.Key_Right], self.serviceNext,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.nextService.setText(
|
||||
translate('OpenLP.SlideController', 'Next Service'))
|
||||
self.escapeItem = shortcut_action(parent, 'escapeItem',
|
||||
[QtCore.Qt.Key_Escape], self.liveEscape,
|
||||
category=UiStrings().LiveToolbar,
|
||||
category=unicode(UiStrings().LiveToolbar),
|
||||
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||
self.escapeItem.setText(
|
||||
translate('OpenLP.SlideController', 'Escape Item'))
|
||||
|
|
|
@ -218,8 +218,6 @@ class ActionList(object):
|
|||
The weight specifies how important a category is. However, this only
|
||||
has an impact on the order the categories are displayed.
|
||||
"""
|
||||
if category is not None:
|
||||
category = unicode(category)
|
||||
if category not in self.categories:
|
||||
self.categories.append(category)
|
||||
action.defaultShortcuts = action.shortcuts()
|
||||
|
@ -275,8 +273,6 @@ class ActionList(object):
|
|||
The name (unicode string) of the category, which contains the
|
||||
action. Defaults to None.
|
||||
"""
|
||||
if category is not None:
|
||||
category = unicode(category)
|
||||
if category not in self.categories:
|
||||
return
|
||||
self.categories[category].actions.remove(action)
|
||||
|
|
|
@ -149,7 +149,7 @@ class AlertsPlugin(Plugin):
|
|||
Plugin.initialise(self)
|
||||
self.toolsAlertItem.setVisible(True)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(self.toolsAlertItem, UiStrings().Tools)
|
||||
action_list.add_action(self.toolsAlertItem, unicode(UiStrings().Tools))
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
|
|
@ -55,9 +55,11 @@ class BiblePlugin(Plugin):
|
|||
Plugin.initialise(self)
|
||||
self.importBibleItem.setVisible(True)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(self.importBibleItem, UiStrings().Import)
|
||||
action_list.add_action(self.importBibleItem,
|
||||
unicode(UiStrings().Import))
|
||||
# Do not add the action to the list yet.
|
||||
#action_list.add_action(self.exportBibleItem, UiStrings().Export)
|
||||
#action_list.add_action(self.exportBibleItem,
|
||||
# unicode(UiStrings().Export))
|
||||
# Set to invisible until we can export bibles
|
||||
self.exportBibleItem.setVisible(False)
|
||||
if len(self.manager.old_bible_databases):
|
||||
|
@ -71,7 +73,8 @@ class BiblePlugin(Plugin):
|
|||
self.manager.finalise()
|
||||
Plugin.finalise(self)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.remove_action(self.importBibleItem, UiStrings().Import)
|
||||
action_list.remove_action(self.importBibleItem,
|
||||
unicode(UiStrings().Import))
|
||||
self.importBibleItem.setVisible(False)
|
||||
#action_list.remove_action(self.exportBibleItem, UiStrings().Export)
|
||||
self.exportBibleItem.setVisible(False)
|
||||
|
|
|
@ -127,13 +127,13 @@ class ImageMediaItem(MediaManagerItem):
|
|||
self.plugin.formparent.incrementProgressBar()
|
||||
filename = os.path.split(unicode(imageFile))[1]
|
||||
thumb = os.path.join(self.servicePath, filename)
|
||||
if not os.path.exists(imageFile):
|
||||
if not os.path.exists(unicode(imageFile)):
|
||||
icon = build_icon(u':/general/general_delete.png')
|
||||
else:
|
||||
if validate_thumb(imageFile, thumb):
|
||||
if validate_thumb(unicode(imageFile), thumb):
|
||||
icon = build_icon(thumb)
|
||||
else:
|
||||
icon = create_thumb(imageFile, thumb)
|
||||
icon = create_thumb(unicode(imageFile), thumb)
|
||||
item_name = QtGui.QListWidgetItem(filename)
|
||||
item_name.setIcon(icon)
|
||||
item_name.setToolTip(imageFile)
|
||||
|
|
|
@ -57,7 +57,7 @@ class MediaPlugin(Plugin):
|
|||
Create the settings Tab
|
||||
"""
|
||||
visible_name = self.getString(StringContent.VisibleName)
|
||||
return MediaTab(parent, self.name, visible_name[u'title'],
|
||||
self.settings_tab = MediaTab(parent, self.name, visible_name[u'title'],
|
||||
self.mediaController.mediaPlayers, self.icon_path)
|
||||
|
||||
def about(self):
|
||||
|
|
|
@ -62,8 +62,8 @@ class PresentationPlugin(Plugin):
|
|||
Create the settings Tab
|
||||
"""
|
||||
visible_name = self.getString(StringContent.VisibleName)
|
||||
return PresentationTab(parent, self.name, visible_name[u'title'],
|
||||
self.controllers, self.icon_path)
|
||||
self.settings_tab = PresentationTab(parent, self.name,
|
||||
visible_name[u'title'], self.controllers, self.icon_path)
|
||||
|
||||
def initialise(self):
|
||||
"""
|
||||
|
@ -98,7 +98,7 @@ class PresentationPlugin(Plugin):
|
|||
"""
|
||||
Create the Media Manager List
|
||||
"""
|
||||
return PresentationMediaItem(
|
||||
self.mediaItem = PresentationMediaItem(
|
||||
self.mediadock.media_dock, self, self.icon, self.controllers)
|
||||
|
||||
def registerControllers(self, controller):
|
||||
|
|
|
@ -30,7 +30,7 @@ song databases into the current installation database.
|
|||
"""
|
||||
import logging
|
||||
|
||||
from sqlalchemy import create_engine, MetaData
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy.orm import class_mapper, mapper, relation, scoped_session, \
|
||||
sessionmaker
|
||||
from sqlalchemy.orm.exc import UnmappedClassError
|
||||
|
@ -39,46 +39,11 @@ from openlp.core.lib import translate
|
|||
from openlp.core.lib.db import BaseModel
|
||||
from openlp.core.ui.wizard import WizardStrings
|
||||
from openlp.plugins.songs.lib import clean_song
|
||||
from openlp.plugins.songs.lib.db import Author, Book, MediaFile, Song, Topic
|
||||
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic, MediaFile
|
||||
from songimport import SongImport
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class OldAuthor(BaseModel):
|
||||
"""
|
||||
Author model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldBook(BaseModel):
|
||||
"""
|
||||
Book model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldMediaFile(BaseModel):
|
||||
"""
|
||||
MediaFile model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldSong(BaseModel):
|
||||
"""
|
||||
Song model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldTopic(BaseModel):
|
||||
"""
|
||||
Topic model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OpenLPSongImport(SongImport):
|
||||
"""
|
||||
The :class:`OpenLPSongImport` class provides OpenLP with the ability to
|
||||
|
@ -101,6 +66,41 @@ class OpenLPSongImport(SongImport):
|
|||
"""
|
||||
Run the import for an OpenLP version 2 song database.
|
||||
"""
|
||||
class OldAuthor(BaseModel):
|
||||
"""
|
||||
Author model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldBook(BaseModel):
|
||||
"""
|
||||
Book model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldMediaFile(BaseModel):
|
||||
"""
|
||||
MediaFile model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldSong(BaseModel):
|
||||
"""
|
||||
Song model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class OldTopic(BaseModel):
|
||||
"""
|
||||
Topic model
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if not self.importSource.endswith(u'.sqlite'):
|
||||
self.logError(self.importSource,
|
||||
translate('SongsPlugin.OpenLPSongImport',
|
||||
|
@ -121,6 +121,7 @@ class OpenLPSongImport(SongImport):
|
|||
source_topics_table = source_meta.tables[u'topics']
|
||||
source_authors_songs_table = source_meta.tables[u'authors_songs']
|
||||
source_songs_topics_table = source_meta.tables[u'songs_topics']
|
||||
source_media_files_songs_table = None
|
||||
if has_media_files:
|
||||
source_media_files_table = source_meta.tables[u'media_files']
|
||||
source_media_files_songs_table = \
|
||||
|
@ -137,13 +138,16 @@ class OpenLPSongImport(SongImport):
|
|||
secondary=source_songs_topics_table)
|
||||
}
|
||||
if has_media_files:
|
||||
if source_media_files_songs_table:
|
||||
if isinstance(source_media_files_songs_table, Table):
|
||||
song_props['media_files'] = relation(OldMediaFile,
|
||||
backref='songs',
|
||||
secondary=source_media_files_songs_table)
|
||||
else:
|
||||
song_props['media_files'] = relation(OldMediaFile,
|
||||
backref='songs')
|
||||
backref='songs',
|
||||
foreign_keys=[source_media_files_table.c.song_id],
|
||||
primaryjoin=source_songs_table.c.id == \
|
||||
source_media_files_table.c.song_id)
|
||||
try:
|
||||
class_mapper(OldAuthor)
|
||||
except UnmappedClassError:
|
||||
|
|
|
@ -127,7 +127,7 @@ class SofImport(OooImport):
|
|||
self.processParagraphText(text)
|
||||
self.newSong()
|
||||
text = u''
|
||||
text += self.process_textportion(textportion)
|
||||
text += self.processTextPortion(textportion)
|
||||
if textportion.BreakType in (PAGE_AFTER, PAGE_BOTH):
|
||||
self.processParagraphText(text)
|
||||
self.newSong()
|
||||
|
@ -202,8 +202,8 @@ class SofImport(OooImport):
|
|||
if boldtext.isdigit() and self.songNumber == '':
|
||||
self.addSongNumber(boldtext)
|
||||
return u''
|
||||
text = self.uncapText(text)
|
||||
if self.title == u'':
|
||||
text = self.uncap_text(text)
|
||||
self.addTitle(text)
|
||||
return text
|
||||
if text.strip().startswith(u'('):
|
||||
|
@ -242,8 +242,12 @@ class SofImport(OooImport):
|
|||
self.songBook = u'Songs of Fellowship 2'
|
||||
elif int(song_no) <= 1690:
|
||||
self.songBook = u'Songs of Fellowship 3'
|
||||
else:
|
||||
elif int(song_no) <= 2200:
|
||||
self.songBook = u'Songs of Fellowship 4'
|
||||
elif int(song_no) <= 2710:
|
||||
self.songBook = u'Songs of Fellowship 5'
|
||||
else:
|
||||
self.songBook = u'Songs of Fellowship Other'
|
||||
|
||||
def addTitle(self, text):
|
||||
"""
|
||||
|
|
|
@ -74,9 +74,10 @@ class SongsPlugin(Plugin):
|
|||
self.songExportItem.setVisible(True)
|
||||
self.toolsReindexItem.setVisible(True)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(self.songImportItem, UiStrings().Import)
|
||||
action_list.add_action(self.songExportItem, UiStrings().Export)
|
||||
action_list.add_action(self.toolsReindexItem, UiStrings().Tools)
|
||||
action_list.add_action(self.songImportItem, unicode(UiStrings().Import))
|
||||
action_list.add_action(self.songExportItem, unicode(UiStrings().Export))
|
||||
action_list.add_action(self.toolsReindexItem,
|
||||
unicode(UiStrings().Tools))
|
||||
|
||||
def addImportMenuItem(self, import_menu):
|
||||
"""
|
||||
|
@ -269,7 +270,10 @@ class SongsPlugin(Plugin):
|
|||
self.songExportItem.setVisible(False)
|
||||
self.toolsReindexItem.setVisible(False)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.remove_action(self.songImportItem, UiStrings().Import)
|
||||
action_list.remove_action(self.songExportItem, UiStrings().Export)
|
||||
action_list.remove_action(self.toolsReindexItem, UiStrings().Tools)
|
||||
action_list.remove_action(self.songImportItem,
|
||||
unicode(UiStrings().Import))
|
||||
action_list.remove_action(self.songExportItem,
|
||||
unicode(UiStrings().Export))
|
||||
action_list.remove_action(self.toolsReindexItem,
|
||||
unicode(UiStrings().Tools))
|
||||
Plugin.finalise(self)
|
||||
|
|
|
@ -136,11 +136,11 @@ class SongUsagePlugin(Plugin):
|
|||
self.setButtonState()
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(self.songUsageStatus,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
action_list.add_action(self.songUsageDelete,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
action_list.add_action(self.songUsageReport,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
self.songUsageDeleteForm = SongUsageDeleteForm(self.manager,
|
||||
self.formparent)
|
||||
self.songUsageDetailForm = SongUsageDetailForm(self, self.formparent)
|
||||
|
@ -157,11 +157,11 @@ class SongUsagePlugin(Plugin):
|
|||
self.songUsageMenu.menuAction().setVisible(False)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.remove_action(self.songUsageStatus,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
action_list.remove_action(self.songUsageDelete,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
action_list.remove_action(self.songUsageReport,
|
||||
translate('SongUsagePlugin', 'Song Usage'))
|
||||
unicode(translate('SongUsagePlugin', 'Song Usage')))
|
||||
self.songUsageActiveButton.hide()
|
||||
# stop any events being processed
|
||||
self.songUsageActive = False
|
||||
|
|
Loading…
Reference in New Issue