Attempt to fix a bug where the song list is never updated.

This commit is contained in:
Raoul Snyman 2009-09-08 17:21:30 +02:00
parent 3c4e9a957f
commit 4cfd7dfbaa
4 changed files with 73 additions and 54 deletions

View File

@ -1,19 +1,23 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################

View File

@ -1,25 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
import sys
import logging, logging.handlers

View File

@ -29,8 +29,8 @@ class BaseListWithDnD(QtGui.QListWidget):
Please put a short description of what this class does in here.
"""
def __init__(self,parent = None):
QtGui.QListWidget.__init__(self,parent)
def __init__(self, parent=None):
QtGui.QListWidget.__init__(self, parent)
# this must be set by the class which is inheriting
assert(self.PluginName)

View File

@ -73,8 +73,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'activated(int)'), self.onThemeComboChanged)
QtCore.QObject.connect(self.MaintenanceButton,
QtCore.SIGNAL(u'clicked()'), self.onMaintenanceButtonClicked)
QtCore.QObject.connect(self.TitleEditItem,
QtCore.SIGNAL(u'lostFocus()'), self.onTitleEditItemLostFocus)
QtCore.QObject.connect(self.CCLNumberEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onCCLNumberEditLostFocus)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.loadThemes)
QtCore.QObject.connect(self.CommentsEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
QtCore.QObject.connect(self.VerseOrderEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
# Create other objects and forms
self.songmanager = songmanager
self.parent = parent
@ -322,35 +330,41 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
message = u''
if len(self.TitleEditItem.displayText()) == 0:
valid = False
self.TitleEditItem.setStyleSheet(u'background-color: red; color: white')
message = translate(u'SongFormDialog', u'You need to enter a song title \n')
else:
self.TitleEditItem.setStyleSheet(u'')
##self.TitleEditItem.setStyleSheet(u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(0)
self.TitleEditItem.setFocus()
return False, translate(u'SongFormDialog', u'You need to enter a song title.')
#else:
#self.TitleEditItem.setStyleSheet(u'')
if self.VerseListWidget.count() == 0:
valid = False
self.VerseListWidget.setStyleSheet(u'background-color: red; color: white')
message = message + translate(u'SongFormDialog', u'You need to enter some verse text \n')
else:
self.VerseListWidget.setStyleSheet(u'')
#self.VerseListWidget.setStyleSheet(u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(0)
self.VerseListWidget.setFocus()
return False, translate(u'SongFormDialog', u'You need to enter some verses.')
#else:
#self.VerseListWidget.setStyleSheet(u'')
if self.AuthorsListView.count() == 0:
valid = False
self.AuthorsListView.setStyleSheet(u'background-color: red; color: white')
message = message + translate(u'SongFormDialog', u'You need to provide an author')
else:
self.AuthorsListView.setStyleSheet(u'')
return valid, message
#self.AuthorsListView.setStyleSheet(u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(2)
self.AuthorsListView.setFocus()
return False, translate(u'SongFormDialog', u'You need to provide at least one author.')
#else:
#self.AuthorsListView.setStyleSheet(u'')
return valid, message
def on_TitleEditItem_lostFocus(self):
def onTitleEditItemLostFocus(self):
self.song.title = self.TitleEditItem.text()
self.title_change = True
def on_VerseOrderEdit_lostFocus(self):
def onVerseOrderEditLostFocus(self):
self.song.verse_order = self.VerseOrderEdit.text()
def on_CommentsEdit_lostFocus(self):
def onCommentsEditLostFocus(self):
self.song.comments = self.CommentsEdit.text()
def on_CCLNumberEdit_lostFocus(self):
def onCCLNumberEditLostFocus(self):
self.song.ccli_number = self.CCLNumberEdit.text()
def onCopyrightInsertButtonTriggered(self):