forked from openlp/openlp
Head
This commit is contained in:
commit
3d316a802b
@ -51,7 +51,7 @@ class MainDisplay(QtGui.QGraphicsView):
|
||||
def __init__(self, parent, imageManager, live):
|
||||
if live:
|
||||
QtGui.QGraphicsView.__init__(self)
|
||||
# Do not overwrite the parent() method.
|
||||
# Overwrite the parent() method.
|
||||
self.parent = lambda: parent
|
||||
else:
|
||||
QtGui.QGraphicsView.__init__(self, parent)
|
||||
|
@ -71,11 +71,24 @@ JAVASCRIPT = """
|
||||
|
||||
function update_css(align, font, size, color, bgcolor){
|
||||
var text = document.getElementById('alert');
|
||||
text.style.verticalAlign = align;
|
||||
text.style.fontSize = size + "pt";
|
||||
text.style.fontFamily = font;
|
||||
text.style.color = color;
|
||||
text.style.backgroundColor = bgcolor;
|
||||
switch(align)
|
||||
{
|
||||
case 'top':
|
||||
text.style.top = '0px';
|
||||
break;
|
||||
case 'middle':
|
||||
text.style.top = ((window.innerHeight - text.clientHeight) / 2)
|
||||
+ 'px';
|
||||
break;
|
||||
case 'bottom':
|
||||
text.style.top = (window.innerHeight - text.clientHeight)
|
||||
+ 'px';
|
||||
break;
|
||||
}
|
||||
}
|
||||
"""
|
||||
CSS = """
|
||||
|
@ -419,8 +419,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
old_song = self.plugin.manager.get_object(Song, item_id)
|
||||
song_xml = self.openLyrics.song_to_xml(old_song)
|
||||
new_song_id = self.openLyrics.xml_to_song(song_xml)
|
||||
new_song = self.plugin.manager.get_object(Song, new_song_id)
|
||||
new_song = self.openLyrics.xml_to_song(song_xml)
|
||||
new_song.title = u'%s <%s>' % (new_song.title,
|
||||
translate('SongsPlugin.MediaItem', 'copy',
|
||||
'For song cloning'))
|
||||
|
@ -78,30 +78,35 @@ class OpenLP1SongImport(SongImport):
|
||||
connection = sqlite.connect(self.importSource, mode=0444,
|
||||
encoding=(encoding, 'replace'))
|
||||
cursor = connection.cursor()
|
||||
# Determine if we're using a new or an old DB.
|
||||
# Determine if the db supports linking audio to songs.
|
||||
cursor.execute(u'SELECT name FROM sqlite_master '
|
||||
u'WHERE type = \'table\' AND name = \'tracks\'')
|
||||
new_db = len(cursor.fetchall()) > 0
|
||||
db_has_tracks = len(cursor.fetchall()) > 0
|
||||
# Determine if the db contains theme information.
|
||||
cursor.execute(u'SELECT name FROM sqlite_master '
|
||||
u'WHERE type = \'table\' AND name = \'settings\'')
|
||||
db_has_themes = len(cursor.fetchall()) > 0
|
||||
# "cache" our list of authors.
|
||||
cursor.execute(u'-- types int, unicode')
|
||||
cursor.execute(u'SELECT authorid, authorname FROM authors')
|
||||
authors = cursor.fetchall()
|
||||
if new_db:
|
||||
if db_has_tracks:
|
||||
# "cache" our list of tracks.
|
||||
cursor.execute(u'-- types int, unicode')
|
||||
cursor.execute(u'SELECT trackid, fulltrackname FROM tracks')
|
||||
tracks = cursor.fetchall()
|
||||
# "cache" our list of themes.
|
||||
cursor.execute(u'-- types int, unicode')
|
||||
cursor.execute(u'SELECT settingsid, settingsname FROM settings')
|
||||
themes = {}
|
||||
for theme_id, theme_name in cursor.fetchall():
|
||||
if theme_name in self.availableThemes:
|
||||
themes[theme_id] = theme_name
|
||||
if db_has_themes:
|
||||
# "cache" our list of themes.
|
||||
themes = {}
|
||||
cursor.execute(u'-- types int, unicode')
|
||||
cursor.execute(u'SELECT settingsid, settingsname FROM settings')
|
||||
for theme_id, theme_name in cursor.fetchall():
|
||||
if theme_name in self.availableThemes:
|
||||
themes[theme_id] = theme_name
|
||||
# Import the songs.
|
||||
cursor.execute(u'-- types int, unicode, unicode, unicode, int')
|
||||
cursor.execute(u'SELECT songid, songtitle, lyrics || \'\' AS lyrics, '
|
||||
u'copyrightinfo, settingsid FROM songs')
|
||||
cursor.execute(u'-- types int, unicode, unicode, unicode')
|
||||
cursor.execute(u'SELECT songid, songtitle, lyrics || \'\' AS ' \
|
||||
u'lyrics, copyrightinfo FROM songs')
|
||||
songs = cursor.fetchall()
|
||||
self.importWizard.progressBar.setMaximum(len(songs))
|
||||
for song in songs:
|
||||
@ -112,8 +117,13 @@ class OpenLP1SongImport(SongImport):
|
||||
self.title = song[1]
|
||||
lyrics = song[2].replace(u'\r\n', u'\n')
|
||||
self.addCopyright(song[3])
|
||||
if themes.has_key(song[4]):
|
||||
self.themeName = themes[song[4]]
|
||||
if db_has_themes:
|
||||
cursor.execute(u'-- types int')
|
||||
cursor.execute(
|
||||
u'SELECT settingsid FROM songs WHERE songid = %s' % song_id)
|
||||
theme_id = cursor.fetchone()[0]
|
||||
if themes.has_key(theme_id):
|
||||
self.themeName = themes[theme_id]
|
||||
verses = lyrics.split(u'\n\n')
|
||||
for verse in verses:
|
||||
if verse.strip():
|
||||
@ -131,7 +141,7 @@ class OpenLP1SongImport(SongImport):
|
||||
break
|
||||
if self.stopImportFlag:
|
||||
break
|
||||
if new_db:
|
||||
if db_has_tracks:
|
||||
cursor.execute(u'-- types int, int')
|
||||
cursor.execute(u'SELECT trackid, listindex '
|
||||
u'FROM songtracks '
|
||||
|
@ -65,7 +65,7 @@ class OooImport(SongImport):
|
||||
if not isinstance(self.importSource, list):
|
||||
return
|
||||
try:
|
||||
self.start_ooo()
|
||||
self.startOoo()
|
||||
except NoConnectException as exc:
|
||||
self.logError(
|
||||
self.importSource[0],
|
||||
@ -145,7 +145,7 @@ class OooImport(SongImport):
|
||||
process.waitForStarted()
|
||||
self.processStarted = True
|
||||
except:
|
||||
log.exception("start_ooo_process failed")
|
||||
log.exception("startOooProcess failed")
|
||||
|
||||
def openOooFile(self, filepath):
|
||||
"""
|
||||
@ -171,7 +171,7 @@ class OooImport(SongImport):
|
||||
self.importWizard.incrementProgressBar(
|
||||
u'Processing file ' + filepath, 0)
|
||||
except AttributeError:
|
||||
log.exception("open_ooo_file failed: %s", url)
|
||||
log.exception("openOooFile failed: %s", url)
|
||||
return
|
||||
|
||||
def closeOooFile(self):
|
||||
|
@ -67,7 +67,7 @@ Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription
|
||||
Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; DLL used to check if the target program is running at install time
|
||||
Source: psvince.dll; flags: dontcopy
|
||||
; psvince is installed in {app} folder, so it will be loaded at
|
||||
; psvince is installed in {app} folder, so it will be loaded at
|
||||
; uninstall time to check if the target program is running
|
||||
Source: psvince.dll; DestDir: {app}
|
||||
|
||||
@ -84,10 +84,16 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filenam
|
||||
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Registry]
|
||||
Root: HKCR; Subkey: ".osz"; ValueType: string; ValueName: ""; ValueData: "OpenLP"; Flags: uninsdeletevalue
|
||||
Root: HKCR; Subkey: "OpenLP"; ValueType: string; ValueName: ""; ValueData: "OpenLP Service"; Flags: uninsdeletekey
|
||||
Root: HKCR; Subkey: "OpenLP\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\OpenLP.exe,0"
|
||||
Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1"""
|
||||
Root: HKCR; Subkey: .osz; ValueType: string; ValueName: ; ValueData: OpenLP; Flags: uninsdeletevalue
|
||||
Root: HKCR; Subkey: OpenLP; ValueType: string; ValueName: ; ValueData: OpenLP Service; Flags: uninsdeletekey
|
||||
Root: HKCR; Subkey: OpenLP\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\OpenLP.exe,0
|
||||
Root: HKCR; Subkey: OpenLP\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\OpenLP.exe"" ""%1"""
|
||||
|
||||
[UninstallDelete]
|
||||
; Remove support directory created when program is run:
|
||||
Type: filesandordirs; Name: {app}\support
|
||||
; Remove program directory if empty:
|
||||
Name: {app}; Type: dirifempty
|
||||
|
||||
[Code]
|
||||
// Function to call psvince.dll at install time
|
||||
@ -173,4 +179,6 @@ begin
|
||||
Result := false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// Unload psvince.dll, otherwise it is not deleted
|
||||
UnloadDLL(ExpandConstant('{app}\psvince.dll'));
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user