Minor changes and clean ups

This commit is contained in:
Tim Bentley 2009-09-23 19:49:26 +01:00
parent 39f4cdfcc9
commit 44ecfe6dd3
2 changed files with 5 additions and 22 deletions

View File

@ -405,11 +405,11 @@ class Ui_MainWindow(object):
self.action_Preview_Panel.setStatusTip(translate(u'mainWindow', self.action_Preview_Panel.setStatusTip(translate(u'mainWindow',
u'Toggle the visibility of the Preview Panel')) u'Toggle the visibility of the Preview Panel'))
self.action_Preview_Panel.setShortcut(translate(u'mainWindow', u'F11')) self.action_Preview_Panel.setShortcut(translate(u'mainWindow', u'F11'))
self.ToolsAlertItem.setText(translate(u'mainWindow', u'Trigger &Alert')) self.ToolsAlertItem.setText(translate(u'mainWindow', u'Nursery &Alert'))
self.ToolsAlertItem.setStatusTip( self.ToolsAlertItem.setStatusTip(
translate(u'mainWindow', u'Show an alert message')) translate(u'mainWindow', u'Show an alert message'))
self.ToolsAlertItem.setShortcut(translate(u'mainWindow', u'F7')) self.ToolsAlertItem.setShortcut(translate(u'mainWindow', u'F7'))
self.PluginItem.setText(translate(u'mainWindow', u'List &Plugins')) self.PluginItem.setText(translate(u'mainWindow', u'&Plugin List'))
self.PluginItem.setStatusTip( self.PluginItem.setStatusTip(
translate(u'mainWindow', u'List the Plugins')) translate(u'mainWindow', u'List the Plugins'))
self.PluginItem.setShortcut(translate(u'mainWindow', u'Alt+F7')) self.PluginItem.setShortcut(translate(u'mainWindow', u'Alt+F7'))

View File

@ -327,7 +327,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
for row in range(0, self.VerseListWidget.count()): for row in range(0, self.VerseListWidget.count()):
item = self.VerseListWidget.item(row) item = self.VerseListWidget.item(row)
verse_list += item.text() verse_list += item.text()
verse_list += u'\n\n' verse_list += u'\n---\n'
self.verse_form.setVerse(verse_list) self.verse_form.setVerse(verse_list)
else: else:
self.verse_form.setVerse(u'') self.verse_form.setVerse(u'')
@ -335,7 +335,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
verse_list = self.verse_form.getVerse() verse_list = self.verse_form.getVerse()
verse_list = verse_list.replace(u'\r\n', u'\n') verse_list = verse_list.replace(u'\r\n', u'\n')
self.VerseListWidget.clear() self.VerseListWidget.clear()
for row in verse_list.split(u'\n\n'): for row in verse_list.split(u'---'):
self.VerseListWidget.addItem(row) self.VerseListWidget.addItem(row)
self.VerseListWidget.repaint() self.VerseListWidget.repaint()
@ -352,39 +352,22 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
""" """
log.debug(u'Validate Song') log.debug(u'Validate Song')
# Lets be nice and assume the data is correct. # Lets be nice and assume the data is correct.
valid = True
message = u''
if len(self.TitleEditItem.displayText()) == 0: if len(self.TitleEditItem.displayText()) == 0:
valid = False
#self.TitleEditItem.setStyleSheet(
# u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.TitleEditItem.setFocus() self.TitleEditItem.setFocus()
return False, translate( return False, translate(
u'SongFormDialog', u'You need to enter a song title.') u'SongFormDialog', u'You need to enter a song title.')
#else:
#self.TitleEditItem.setStyleSheet(u'')
if self.VerseListWidget.count() == 0: if self.VerseListWidget.count() == 0:
valid = False
#self.VerseListWidget.setStyleSheet(
# u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.VerseListWidget.setFocus() self.VerseListWidget.setFocus()
return False, translate( return False, translate(
u'SongFormDialog', u'You need to enter some verses.') u'SongFormDialog', u'You need to enter some verses.')
#else:
#self.VerseListWidget.setStyleSheet(u'')
if self.AuthorsListView.count() == 0: if self.AuthorsListView.count() == 0:
valid = False
#self.AuthorsListView.setStyleSheet(
# u'background-color: red; color: white')
self.SongTabWidget.setCurrentIndex(2) self.SongTabWidget.setCurrentIndex(2)
self.AuthorsListView.setFocus() self.AuthorsListView.setFocus()
return False, translate( return False, translate(
u'SongFormDialog', u'You need to provide at least one author.') u'SongFormDialog', u'You need to provide at least one author.')
#else: return True, u''
#self.AuthorsListView.setStyleSheet(u'')
return valid, message
def onTitleEditItemLostFocus(self): def onTitleEditItemLostFocus(self):
self.song.title = self.TitleEditItem.text() self.song.title = self.TitleEditItem.text()