Lists from the web now

This commit is contained in:
Tim Bentley 2011-02-27 15:33:08 +00:00
parent b4156c809b
commit 0e773c7a1b
2 changed files with 53 additions and 28 deletions

View File

@ -44,8 +44,14 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
def __init__(self, parent=None):
# check to see if we have web access
self.webAccess = get_web_page(u'http://openlp.org1')
self.webAccess = get_web_page(u'http://openlp.org/files/frw/themes.lst')
print self.webAccess
if self.webAccess:
self.themes = self.webAccess.read()
songs = get_web_page(u'http://openlp.org/files/frw/songs.lst')
self.songs = songs.read()
bibles = get_web_page(u'http://openlp.org/files/frw/bibles.lst')
self.bibles = bibles.read()
QtGui.QWizard.__init__(self, parent)
self.setupUi(self)
QtCore.QObject.connect(self.autoLanguageCheckBox,
@ -78,6 +84,26 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.qmList = LanguageManager.get_qm_list()
for key in sorted(self.qmList.keys()):
self.LanguageComboBox.addItem(key)
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
treewidgetitem.setText(0, u'Songs')
self.__loadChild(treewidgetitem, self.songs)
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
treewidgetitem.setText(0, u'Bibles')
self.__loadChild(treewidgetitem, self.bibles)
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
treewidgetitem.setText(0, u'Themes')
self.__loadChild(treewidgetitem, self.themes)
def __loadChild(self, tree, list):
list = list.split(u'\n')
for item in list:
if item:
child = QtGui.QTreeWidgetItem(tree)
child.setText(0, item)
child.setCheckState(0, QtCore.Qt.Unchecked)
child.setFlags(QtCore.Qt.ItemIsUserCheckable |
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
#self.themeSelectionComboBox.addItem(theme)
def accept(self):
self.__pluginStatus(self.songsCheckBox, u'songs/status')

View File

@ -250,10 +250,10 @@ p, li { white-space: pre-wrap; }
<widget class="QGroupBox" name="internetGroupBox">
<property name="geometry">
<rect>
<x>30</x>
<y>50</y>
<width>441</width>
<height>191</height>
<x>20</x>
<y>0</y>
<width>501</width>
<height>281</height>
</rect>
</property>
<property name="title">
@ -261,29 +261,28 @@ p, li { white-space: pre-wrap; }
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="downLoadSongsCheckBox">
<property name="text">
<string>Sample Songs </string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="downLoadBibleCheckBox">
<property name="text">
<string>Bible XXX (Repeat per bible)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="downLoadThemeCheckBox">
<property name="text">
<string>Theme XXX (Repeat per theme)</string>
</property>
</widget>
</item>
</layout>
<widget class="QTreeWidget" name="selectionTreeWidget">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>