← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/trivial into lp:openlp

 

googol has proposed merging lp:~googol-hush/openlp/trivial into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Improved button behaviour. E.g.: When no topic is in the database, then the edit and delete buttons for topics will be disabled.
-- 
https://code.launchpad.net/~googol-hush/openlp/trivial/+merge/31452
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/trivial into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py	2010-07-27 09:32:52 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py	2010-07-31 11:56:43 +0000
@@ -113,6 +113,12 @@
                     u'%s %s' % (author.first_name, author.last_name))
             author_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id))
             self.AuthorsListWidget.addItem(author_name)
+        if self.AuthorsListWidget.count() == 0:
+            self.AuthorDeleteButton.setEnabled(False)
+            self.AuthorEditButton.setEnabled(False)
+        else:
+            self.AuthorDeleteButton.setEnabled(True)
+            self.AuthorEditButton.setEnabled(True)
 
     def resetTopics(self):
         """
@@ -125,6 +131,12 @@
             topic_name = QtGui.QListWidgetItem(topic.name)
             topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id))
             self.TopicsListWidget.addItem(topic_name)
+        if self.TopicsListWidget.count() == 0:
+            self.TopicDeleteButton.setEnabled(False)
+            self.TopicEditButton.setEnabled(False)
+        else:
+            self.TopicDeleteButton.setEnabled(True)
+            self.TopicEditButton.setEnabled(True)
 
     def resetBooks(self):
         """
@@ -137,6 +149,12 @@
                 book.publisher))
             book_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(book.id))
             self.BooksListWidget.addItem(book_name)
+        if self.BooksListWidget.count() == 0:
+            self.BookDeleteButton.setEnabled(False)
+            self.BookEditButton.setEnabled(False)
+        else:
+            self.BookDeleteButton.setEnabled(True)
+            self.BookEditButton.setEnabled(True)
 
     def checkAuthor(self, new_author, edit=False):
         """


Follow ups