From b09b36da8ee67e004057256599feb53934e31d70 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Mar 2011 21:47:55 +0000 Subject: [PATCH] Move theme to default selection --- openlp/core/ui/firsttimeform.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index b4921bdc9..baf4624d6 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -91,10 +91,26 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): if file: child = QtGui.QTreeWidgetItem(tree) child.setText(0, self.config.get(u'%s_%s' %(root, file), u'title')) + child.setData(0, QtCore.Qt.UserRole, + QtCore.QVariant(self.config.get(u'%s_%s' %(root, file), u'filename'))) child.setCheckState(0, QtCore.Qt.Unchecked) child.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + def initializePage(self, id): + """ + Set up the pages for Initial run through dialog + """ + wizardPage = self.page(id) + if wizardPage == self.DefaultsPage: + listIterator = QtGui.QTreeWidgetItemIterator(self.selectionTreeWidget) + while listIterator.value(): + parent = listIterator.value().parent() + if parent and listIterator.value().checkState(0) == QtCore.Qt.Checked: + if unicode(parent.text(0)) == u'Themes': + self.themeSelectionComboBox.addItem(listIterator.value().text(0)) + listIterator += 1 + def accept(self): self.__pluginStatus(self.songsCheckBox, u'songs/status') self.__pluginStatus(self.bibleCheckBox, u'bibles/status') @@ -105,6 +121,17 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self.__pluginStatus(self.customCheckBox, u'custom/status') self.__pluginStatus(self.songUsageCheckBox, u'songusage/status') self.__pluginStatus(self.alertCheckBox, u'alerts/status') + + listIterator = QtGui.QTreeWidgetItemIterator(self.selectionTreeWidget) + while listIterator.value(): + type = listIterator.value().parent() + if listIterator.value().parent(): + if listIterator.value().checkState(0) == QtCore.Qt.Checked: + # Install + print type, listIterator.value().data(0, QtCore.Qt.UserRole).toString() + #if type == u'Themes': + #self.themeSelectionComboBox.addItem(listIterator.value().text()) + listIterator += 1 return QtGui.QWizard.accept(self) def __pluginStatus(self, field, tag):