← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugs into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugs into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  #693150 Custom Slide Display footer option
  https://bugs.launchpad.net/bugs/693150
  #693202 delete theme
  https://bugs.launchpad.net/bugs/693202

For more details, see:
https://code.launchpad.net/~trb143/openlp/bugs/+merge/45908

Final Theme cleanup for now.
-- 
https://code.launchpad.net/~trb143/openlp/bugs/+merge/45908
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bugs into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2011-01-08 02:44:12 +0000
+++ openlp/core/lib/mediamanageritem.py	2011-01-11 20:44:11 +0000
@@ -266,7 +266,7 @@
         """
         Creates the main widget for listing items the media item is tracking
         """
-        #Add the List widget
+        # Add the List widget
         self.listView = self.ListViewWithDnD_class(self)
         self.listView.uniformItemSizes = True
         self.listView.setSpacing(1)
@@ -275,9 +275,9 @@
         self.listView.setAlternatingRowColors(True)
         self.listView.setDragEnabled(True)
         self.listView.setObjectName(u'%sListView' % self.plugin.name)
-        #Add to pageLayout
+        # Add to pageLayout
         self.pageLayout.addWidget(self.listView)
-        #define and add the context menu
+        # define and add the context menu
         self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
         name_string = self.plugin.getString(StringContent.Name)
         if self.hasEditIcon:

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2011-01-10 19:13:40 +0000
+++ openlp/core/ui/thememanager.py	2011-01-11 20:44:11 +0000
@@ -69,7 +69,7 @@
             u':/themes/theme_edit.png',
             translate('OpenLP.ThemeManager', 'Edit a theme.'),
             self.onEditTheme)
-        self.toolbar.addToolbarButton(
+        self.deleteToolbarAction = self.toolbar.addToolbarButton(
             translate('OpenLP.ThemeManager', 'Delete Theme'),
             u':/general/general_delete.png',
             translate('OpenLP.ThemeManager', 'Delete a theme.'),
@@ -124,6 +124,9 @@
         QtCore.QObject.connect(self.themeListWidget,
             QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
             self.changeGlobalFromScreen)
+        QtCore.QObject.connect(self.themeListWidget,
+            QtCore.SIGNAL(u'itemClicked(QListWidgetItem *)'),
+            self.checkListState)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -147,6 +150,18 @@
             self.settingsSection + u'/global theme',
             QtCore.QVariant(u'')).toString())
 
+    def checkListState(self, item):
+        """
+        If Default theme selected remove delete button.
+        """
+        realThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
+        themeName = unicode(item.text())
+        # If default theme restrict actions
+        if realThemeName == themeName:
+            self.deleteToolbarAction.setVisible(True)
+        else:
+            self.deleteToolbarAction.setVisible(False)
+
     def contextMenu(self, point):
         """
         Build the Right Click Context menu and set state depending on

=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py	2011-01-10 01:46:47 +0000
+++ openlp/core/utils/__init__.py	2011-01-11 20:44:11 +0000
@@ -207,7 +207,7 @@
         The current version of OpenLP.
     """
     version_string = current_version[u'full']
-    #set to prod in the distribution config file.
+    # set to prod in the distribution config file.
     settings = QtCore.QSettings()
     settings.beginGroup(u'general')
     last_test = unicode(settings.value(u'last version test',


Follow ups