forked from openlp/openlp
dded autocompletion to the authors, topics, songbooks and themes.
bzr-revno: 795
This commit is contained in:
commit
7a6c8c54f6
@ -135,7 +135,7 @@ class Ui_EditSongDialog(object):
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.AuthorsSelectionComboItem.sizePolicy().hasHeightForWidth())
|
||||
self.AuthorsSelectionComboItem.setSizePolicy(sizePolicy)
|
||||
self.AuthorsSelectionComboItem.setEditable(False)
|
||||
self.AuthorsSelectionComboItem.setEditable(True)
|
||||
self.AuthorsSelectionComboItem.setInsertPolicy(
|
||||
QtGui.QComboBox.InsertAlphabetically)
|
||||
self.AuthorsSelectionComboItem.setSizeAdjustPolicy(
|
||||
@ -212,6 +212,7 @@ class Ui_EditSongDialog(object):
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.SongTopicCombo.sizePolicy().hasHeightForWidth())
|
||||
self.SongTopicCombo.setEditable(True)
|
||||
self.SongTopicCombo.setSizePolicy(sizePolicy)
|
||||
self.SongTopicCombo.setObjectName(u'SongTopicCombo')
|
||||
self.TopicAddLayout.addWidget(self.SongTopicCombo)
|
||||
@ -256,6 +257,7 @@ class Ui_EditSongDialog(object):
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.SongbookCombo.sizePolicy().hasHeightForWidth())
|
||||
self.SongbookCombo.setEditable(True)
|
||||
self.SongbookCombo.setSizePolicy(sizePolicy)
|
||||
self.SongbookCombo.setObjectName(u'SongbookCombo')
|
||||
self.SongbookLayout.addWidget(self.SongbookCombo, 0, 0, 1, 1)
|
||||
@ -293,6 +295,7 @@ class Ui_EditSongDialog(object):
|
||||
self.ThemeLayout.setMargin(8)
|
||||
self.ThemeLayout.setObjectName(u'ThemeLayout')
|
||||
self.ThemeSelectionComboItem = QtGui.QComboBox(self.ThemeGroupBox)
|
||||
self.ThemeSelectionComboItem.setEditable(True)
|
||||
self.ThemeSelectionComboItem.setObjectName(u'ThemeSelectionComboItem')
|
||||
self.ThemeLayout.addWidget(self.ThemeSelectionComboItem)
|
||||
self.ThemeAddButton = QtGui.QPushButton(self.ThemeGroupBox)
|
||||
|
@ -122,6 +122,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
|
||||
def loadAuthors(self):
|
||||
authors = self.songmanager.get_authors()
|
||||
authorsCompleter = QtGui.QCompleter(
|
||||
[author.display_name for author in authors],
|
||||
self.AuthorsSelectionComboItem)
|
||||
authorsCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
||||
self.AuthorsSelectionComboItem.setCompleter(authorsCompleter);
|
||||
self.AuthorsSelectionComboItem.clear()
|
||||
for author in authors:
|
||||
row = self.AuthorsSelectionComboItem.count()
|
||||
@ -131,6 +136,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
|
||||
def loadTopics(self):
|
||||
topics = self.songmanager.get_topics()
|
||||
topicsCompleter = QtGui.QCompleter(
|
||||
[topic.name for topic in topics],
|
||||
self.SongTopicCombo)
|
||||
topicsCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
||||
self.SongTopicCombo.setCompleter(topicsCompleter);
|
||||
self.SongTopicCombo.clear()
|
||||
for topic in topics:
|
||||
row = self.SongTopicCombo.count()
|
||||
@ -139,6 +149,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
|
||||
def loadBooks(self):
|
||||
books = self.songmanager.get_books()
|
||||
booksCompleter = QtGui.QCompleter(
|
||||
[book.name for book in books],
|
||||
self.SongbookCombo)
|
||||
booksCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
||||
self.SongbookCombo.setCompleter(booksCompleter);
|
||||
self.SongbookCombo.clear()
|
||||
self.SongbookCombo.addItem(u' ')
|
||||
for book in books:
|
||||
@ -147,6 +162,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.SongbookCombo.setItemData(row, QtCore.QVariant(book.id))
|
||||
|
||||
def loadThemes(self, theme_list):
|
||||
themesCompleter = QtGui.QCompleter(
|
||||
[theme for theme in theme_list],
|
||||
self.ThemeSelectionComboItem)
|
||||
themesCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
||||
self.ThemeSelectionComboItem.setCompleter(themesCompleter);
|
||||
self.ThemeSelectionComboItem.clear()
|
||||
self.ThemeSelectionComboItem.addItem(u' ')
|
||||
for theme in theme_list:
|
||||
|
Loading…
Reference in New Issue
Block a user