forked from openlp/openlp
Fix merge problem.
Song search works again Bible import fixes bzr-revno: 297
This commit is contained in:
parent
3f0ba7a3ba
commit
11e3d43caf
@ -91,6 +91,4 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
return QtGui.QFileDialog.getOpenFileNames(self, dialogname,
|
||||
dialoglocation, dialogfilter)
|
||||
|
||||
def refresh(self):
|
||||
self.update()
|
||||
|
||||
|
@ -88,6 +88,7 @@ class Plugin(object):
|
||||
self.weight = 0
|
||||
# Set up logging
|
||||
self.log = logging.getLogger(self.name)
|
||||
self.repaint_main_window = None
|
||||
|
||||
def check_pre_conditions(self):
|
||||
"""
|
||||
@ -115,6 +116,12 @@ class Plugin(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def add_repaint_main_window(self, repaint_main_window):
|
||||
"""
|
||||
Create ability to repaint main window.
|
||||
"""
|
||||
self.repaint_main_window = repaint_main_window
|
||||
|
||||
def get_settings_tab(self):
|
||||
"""
|
||||
Create a menu item and add it to the "Import" menu.
|
||||
|
@ -114,3 +114,8 @@ class PluginManager(object):
|
||||
|
||||
def hook_handle_event(self, event):
|
||||
pass
|
||||
|
||||
def hook_repaint_main_window(self, repaint_main_window):
|
||||
for plugin in self.plugins:
|
||||
plugin.add_repaint_main_window(repaint_main_window)
|
||||
|
||||
|
@ -38,6 +38,9 @@ class MainWindow(object):
|
||||
self.plugin_manager = PluginManager(pluginpath)
|
||||
self.setupUi()
|
||||
|
||||
def repaint_window(self):
|
||||
self.main_window.update()
|
||||
|
||||
def setupUi(self):
|
||||
self.main_window.setObjectName("main_window")
|
||||
self.main_window.resize(1087, 847)
|
||||
@ -119,6 +122,8 @@ class MainWindow(object):
|
||||
self.FileExportMenu.setObjectName("FileExportMenu")
|
||||
# Call the hook method to pull in export menus.
|
||||
self.plugin_manager.hook_import_menu(self.FileExportMenu)
|
||||
# Call the hook method to export refresh.
|
||||
self.plugin_manager.hook_repaint_main_window(self.repaint_window)
|
||||
#
|
||||
self.OptionsMenu = QtGui.QMenu(self.MenuBar)
|
||||
self.OptionsMenu.setObjectName("OptionsMenu")
|
||||
|
@ -252,7 +252,7 @@ class BiblePlugin(Plugin, PluginUtils):
|
||||
pass
|
||||
|
||||
def refresh(self):
|
||||
self.MediaManagerItem.refresh()
|
||||
self.repaint_main_window()
|
||||
|
||||
def reload_bibles(self):
|
||||
self.biblemanager.reload_bibles()
|
||||
@ -372,7 +372,7 @@ class BiblePlugin(Plugin, PluginUtils):
|
||||
|
||||
|
||||
def _initialise_bible_quick(self, bible): # not sure if needed yet!
|
||||
a=1
|
||||
pass
|
||||
|
||||
def translate(self, bible, search):
|
||||
book = ""
|
||||
|
@ -127,7 +127,6 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils):
|
||||
self._import_bible()
|
||||
self.MessageLabel.setText("Import Complete")
|
||||
self.ProgressBar.setValue(self.barmax)
|
||||
self.update()
|
||||
self.bibleplugin.reload_bibles() # Update form as we have a new bible
|
||||
elif button.text() == "Cancel":
|
||||
self.close()
|
||||
@ -137,13 +136,14 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils):
|
||||
self.ProgressBar.setMaximum(max)
|
||||
|
||||
def incrementBar(self, text = None):
|
||||
print self.progress, text, self.barmax
|
||||
if text != None:
|
||||
self.MessageLabel.setText("Import progressing with " + text)
|
||||
self.MessageLabel.setText("Import processed " + text)
|
||||
else:
|
||||
self.MessageLabel.setText("Import progressing")
|
||||
self.progress +=1
|
||||
self.ProgressBar.setValue(self.progress)
|
||||
self.update()
|
||||
#self.update()
|
||||
self.bibleplugin.refresh()
|
||||
|
||||
def _import_bible(self):
|
||||
|
@ -204,10 +204,10 @@ class SongsPlugin(Plugin, PluginUtils):
|
||||
self.SearchTextEdit.clear()
|
||||
|
||||
def onSearchTextEditChanged(self, text):
|
||||
#sl = 3
|
||||
#if self.SearchTypeComboBox.currentText() == u'Lyrics':
|
||||
# sl = 7
|
||||
#if len(text) > sl: # only search if > 3 characters
|
||||
sl = 3
|
||||
if self.SearchTypeComboBox.currentText() == u'Lyrics':
|
||||
sl = 7
|
||||
if len(text) > sl: # only search if > 3 characters
|
||||
self.onSearchTextButtonClick()
|
||||
|
||||
def onSearchTextButtonClick(self):
|
||||
@ -267,7 +267,7 @@ class SongsPlugin(Plugin, PluginUtils):
|
||||
self.SongListView.setHorizontalHeaderLabels(QtCore.QStringList(["","Song Name","Author"]))
|
||||
self.SongListView.setVerticalHeaderLabels(QtCore.QStringList([""]))
|
||||
self.SongListView.setRowCount(0)
|
||||
log.debug("Records returned from search %s", len(searchresults))
|
||||
#log.debug("Records returned from search %s", len(searchresults))
|
||||
for song in searchresults:
|
||||
for author in song.authors:
|
||||
c = self.SongListView.rowCount()
|
||||
|
Loading…
Reference in New Issue
Block a user