Update local branch from trunk

This commit is contained in:
Stevan Pettit 2011-05-31 08:17:23 -04:00
commit b52d00a623
6 changed files with 66 additions and 48 deletions

View File

@ -42,42 +42,44 @@ http://doc.trolltech.com/4.7/richtext-html-subset.html#css-properties
*/
.serviceTitle {
font-weight:600;
font-size:x-large;
color:black;
font-weight: 600;
font-size: x-large;
color: black;
}
.item {
color:black;
color: black;
}
.itemTitle {
font-weight:600;
font-size:large;
font-weight: 600;
font-size: large;
}
.itemText {}
.itemText {
margin-top: 10px;
}
.itemFooter {
font-size:8px;
font-size: 8px;
}
.itemNotes {}
.itemNotesTitle {
font-weight:bold;
font-size:12px;
font-weight: bold;
font-size: 12px;
}
.itemNotesText {
font-size:11px;
font-size: 11px;
}
.media {}
.mediaTitle {
font-weight:bold;
font-size:11px;
font-weight: bold;
font-size: 11px;
}
.mediaText {}
@ -89,16 +91,16 @@ http://doc.trolltech.com/4.7/richtext-html-subset.html#css-properties
}
.customNotesTitle {
font-weight:bold;
font-size:11px;
font-weight: bold;
font-size: 11px;
}
.customNotesText {
font-size:11px;
font-size: 11px;
}
.newPage {
page-break-before:always;
page-break-before: always;
}
"""
@ -212,11 +214,11 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
verse_def = None
for slide in item.get_frames():
if not verse_def or verse_def != slide[u'verseTag']:
p = self._addElement(u'div', parent=div,
text_div = self._addElement(u'div', parent=div,
classId=u'itemText')
else:
self._addElement(u'br', parent=p)
self._addElement(u'p', slide[u'html'], p)
self._addElement(u'br', parent=text_div)
self._addElement(u'span', slide[u'html'], text_div)
verse_def = slide[u'verseTag']
# Break the page before the div element.
if index != 0 and self.pageBreakAfterText.isChecked():

View File

@ -219,9 +219,9 @@ class BibleManager(object):
log.debug(u'BibleManager.get_books("%s")', bible)
return [
{
u'name': book.name,
u'chapters': self.db_cache[bible].get_chapter_count(
book)
u'name': book.name,
u'book_reference_id': book.book_reference_id,
u'chapters': self.db_cache[bible].get_chapter_count(book)
}
for book in self.db_cache[bible].get_books()
]

View File

@ -239,8 +239,14 @@ class BibleMediaItem(MediaManagerItem):
self.advancedLayout.addWidget(self.advancedToVerse, 4, 2)
self.addSearchFields(u'advanced', UiStrings().Advanced)
# Combo Boxes
QtCore.QObject.connect(self.quickVersionComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onQuickVersionComboBox)
QtCore.QObject.connect(self.quickSecondComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onQuickSecondComboBox)
QtCore.QObject.connect(self.advancedVersionComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox)
QtCore.QObject.connect(self.advancedSecondComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onAdvancedSecondComboBox)
QtCore.QObject.connect(self.advancedBookComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onAdvancedBookComboBox)
QtCore.QObject.connect(self.advancedFromChapter,
@ -401,6 +407,16 @@ class BibleMediaItem(MediaManagerItem):
"""
log.debug(u'initialiseAdvancedBible %s', bible)
book_data = self.plugin.manager.get_books(bible)
secondbible = unicode(self.advancedSecondComboBox.currentText())
if secondbible != u'':
secondbook_data = self.plugin.manager.get_books(secondbible)
book_data_temp = []
for book in book_data:
for secondbook in secondbook_data:
if book['book_reference_id'] == \
secondbook['book_reference_id']:
book_data_temp.append(book)
book_data = book_data_temp
self.advancedBookComboBox.clear()
first = True
for book in book_data:
@ -449,10 +465,26 @@ class BibleMediaItem(MediaManagerItem):
bible = unicode(self.quickVersionComboBox.currentText())
if bible:
book_data = bibles[bible].get_books()
secondbible = unicode(self.quickSecondComboBox.currentText())
if secondbible != u'':
secondbook_data = bibles[secondbible].get_books()
book_data_temp = []
for book in book_data:
for secondbook in secondbook_data:
if book.book_reference_id == \
secondbook.book_reference_id:
book_data_temp.append(book)
book_data = book_data_temp
books = [book.name + u' ' for book in book_data]
books.sort(cmp=locale.strcoll)
add_widget_completer(books, self.quickSearchEdit)
def onQuickVersionComboBox(self):
self.updateAutoCompleter()
def onQuickSecondComboBox(self):
self.updateAutoCompleter()
def onImportClick(self):
if not hasattr(self, u'import_wizard'):
self.import_wizard = BibleImportForm(self, self.plugin.manager,
@ -501,6 +533,10 @@ class BibleMediaItem(MediaManagerItem):
self.initialiseAdvancedBible(
unicode(self.advancedVersionComboBox.currentText()))
def onAdvancedSecondComboBox(self):
self.initialiseAdvancedBible(
unicode(self.advancedVersionComboBox.currentText()))
def onAdvancedBookComboBox(self):
item = int(self.advancedBookComboBox.currentIndex())
self.initialiseChapterVerse(

View File

@ -165,7 +165,7 @@ def init_schema(url):
Column(u'id', types.Integer, primary_key=True),
Column(u'first_name', types.Unicode(128)),
Column(u'last_name', types.Unicode(128)),
Column(u'display_name', types.Unicode(255), nullable=False)
Column(u'display_name', types.Unicode(255), index=True, nullable=False)
)
# Definition of the "media_files" table
@ -186,7 +186,7 @@ def init_schema(url):
songs_table = Table(u'songs', metadata,
Column(u'id', types.Integer, primary_key=True),
Column(u'song_book_id', types.Integer,
ForeignKey(u'song_books.id'), default=0),
ForeignKey(u'song_books.id'), default=None),
Column(u'title', types.Unicode(255), nullable=False),
Column(u'alternate_title', types.Unicode(255)),
Column(u'lyrics', types.UnicodeText, nullable=False),
@ -203,7 +203,7 @@ def init_schema(url):
# Definition of the "topics" table
topics_table = Table(u'topics', metadata,
Column(u'id', types.Integer, primary_key=True),
Column(u'name', types.Unicode(128), nullable=False)
Column(u'name', types.Unicode(128), index=True, nullable=False)
)
# Definition of the "authors_songs" table
@ -230,27 +230,6 @@ def init_schema(url):
ForeignKey(u'topics.id'), primary_key=True)
)
# Define table indexes
Index(u'authors_id', authors_table.c.id)
Index(u'authors_display_name_id', authors_table.c.display_name,
authors_table.c.id)
Index(u'media_files_id', media_files_table.c.id)
Index(u'song_books_id', song_books_table.c.id)
Index(u'songs_id', songs_table.c.id)
Index(u'topics_id', topics_table.c.id)
Index(u'authors_songs_author', authors_songs_table.c.author_id,
authors_songs_table.c.song_id)
Index(u'authors_songs_song', authors_songs_table.c.song_id,
authors_songs_table.c.author_id)
Index(u'media_files_songs_file', media_files_songs_table.c.media_file_id,
media_files_songs_table.c.song_id)
Index(u'media_files_songs_song', media_files_songs_table.c.song_id,
media_files_songs_table.c.media_file_id)
Index(u'topics_song_topic', songs_topics_table.c.topic_id,
songs_topics_table.c.song_id)
Index(u'topics_song_song', songs_topics_table.c.song_id,
songs_topics_table.c.topic_id)
mapper(Author, authors_table)
mapper(Book, song_books_table)
mapper(MediaFile, media_files_table)

View File

@ -27,6 +27,7 @@
import logging
import locale
import re
from PyQt4 import QtCore, QtGui
from sqlalchemy.sql import or_

View File

@ -514,7 +514,7 @@ class OpenLyrics(object):
``song``
The song object.
"""
song.song_book_id = 0
song.song_book_id = None
song.song_number = u''
if hasattr(properties, u'songbooks'):
for songbook in properties.songbooks.songbook: