diff --git a/openlp.org 2.0.e4p b/openlp.org 2.0.e4p index 54ab8cd13..671a9f399 100644 --- a/openlp.org 2.0.e4p +++ b/openlp.org 2.0.e4p @@ -1,315 +1,313 @@ - - - - - - - en - Python - Qt4 - - 1.9.0 - Raoul Snyman - raoulsnyman@openlp.org - - openlp.pyw - openlp/controls/__init__.py - openlp/core/test/test_render_theme.py - openlp/core/test/test_render.py - openlp/core/interpolate.py - openlp/core/__init__.py - openlp/core/render.py - openlp/__init__.py - demo.py - openlp/core/settingsmanager.py - openlp/plugins/__init__.py - openlp/core/pluginmanager.py - openlp/core/ui/__init__.py - openlp/core/ui/mainwindow.py - openlp/core/ui/splashscreen.py - openlp/core/ui/alertform.py - openlp/core/ui/about.py - openlp/plugins/songs/songsplugin.py - openlp/plugins/songs/__init__.py - openlp/plugins/songs/forms/__init__.py - openlp/plugins/songs/forms/openlpimportform.py - openlp/plugins/songs/forms/editsongform.py - openlp/plugins/songs/forms/opensongexportform.py - openlp/plugins/songs/forms/openlpexportform.py - openlp/plugins/songs/forms/opensongimportform.py - openlp/core/utils/__init__.py - openlp/core/theme/__init__.py - openlp/core/theme/theme.py - openlp/plugins/songs/test/test_song_opensong.py - openlp/plugins/songs/test/test_song_basic.py - openlp/plugins/songs/test/test_song_verse.py - openlp/plugins/songs/test/test_song_text.py - openlp/core/theme/test/test_theme.py - openlp/core/resources.py - openlp/core/lib/__init__.py - openlp/core/lib/xmlrootclass.py - openlp/core/lib/plugin.py - openlp/core/lib/mediamanageritem.py - openlp/core/lib/event.py - openlp/core/utils/confighelper.py - openlp/core/utils/winregistry.py - openlp/core/utils/registry.py - openlp/core/utils/linregistry.py - setup.py - openlp/core/lib/pluginconfig.py - openlp/core/test/test_plugin_manager.py - openlp/core/test/test_mediamanageritem.py - openlp/core/test/testplugins/testplugin1.py - openlp/core/test/testplugins/testplugin2/__init__.py - openlp/core/test/testplugins/testplugin2/testplugin2.py - openlp/plugins/bibles/bibleplugin.py - openlp/plugins/bibles/forms/bibleimportdialog.py - openlp/plugins/bibles/forms/bibleimportform.py - openlp/plugins/bibles/lib/bibleDBimpl.py - openlp/plugins/bibles/lib/bibleOSISimpl.py - openlp/plugins/bibles/lib/bibleHTTPimpl.py - openlp/plugins/bibles/lib/bibleCSVimpl.py - openlp/plugins/bibles/__init__.py - openlp/plugins/bibles/lib/__init__.py - openlp/plugins/bibles/forms/__init__.py - openlp/plugins/songs/lib/__init__.py - openlp/plugins/songs/lib/songxml.py - openlp/plugins/songs/lib/models.py - openlp/plugins/bibles/test/__init__.py - openlp/plugins/bibles/test/test_bibleManagerAPI.py - openlp/plugins/bibles/test/test_bibleManager.py - openlp/plugins/bibles/test/test_bibleManagerOSIS.py - openlp/plugins/bibles/test/test_bibleManagerCSV.py - openlp/plugins/presentations/lib/pptview.py - openlp/plugins/presentations/lib/impresscom.py - openlp/plugins/presentations/lib/powerpoint.py - openlp/plugins/presentations/lib/pptviewlib/ppttest.py - openlp/plugins/presentations/__init__.py - openlp/plugins/presentations/presentationplugin.py - openlp/plugins/videos/__init__.py - openlp/plugins/videos/videoplugin.py - openlp/plugins/images/__init__.py - openlp/plugins/images/imageplugin.py - openlp/plugins/songs/forms/editsongdialog.py - openlp/core/lib/pluginutils.py - openlpcnv.pyw - openlp/plugins/songs/forms/songbookdialog.py - openlp/plugins/songs/forms/topicsdialog.py - openlp/plugins/songs/forms/authorsdialog.py - openlp/plugins/songs/forms/topicsform.py - openlp/plugins/songs/forms/authorsform.py - openlp/plugins/songs/forms/songbookform.py - openlp/migration/__init__.py - openlp/migration/migratefiles.py - openlp/migration/migratesongs.py - openlp/migration/display.py - openlp/migration/migratebibles.py - openlp/plugins/songs/lib/tables.py - openlp/plugins/songs/lib/classes.py - openlp/plugins/songs/lib/manager.py - openlp/plugins/bibles/lib/classes.py - openlp/plugins/bibles/lib/tables.py - openlp/plugins/bibles/lib/manager.py - openlp/plugins/bibles/lib/common.py - openlp/plugins/songs/lib/meta.py - openlp/core/test/testplugins/deeper/__init__.py - openlp/core/test/testplugins/deeper/toodeep/__init__.py - openlp/core/test/testplugins/deeper/toodeep/plugin3toodeep.py - openlp/core/lib/serviceitem.py - openlp/core/ui/slidecontroller.py - openlp/core/lib/eventreceiver.py - resources/forms/Ui_editsongdialog.py - openlp/core/ui/servicemanager.py - openlp/core/lib/toolbar.py - openlp/core/ui/settingsform.py - openlp/core/ui/generaltab.py - openlp/core/ui/themestab.py - openlp/core/ui/alertstab.py - resources/forms/Ui_settings.py - openlp/core/ui/settingsdialog.py - openlp/core/lib/settingstab.py - openlp/plugins/bibles/lib/biblestab.py - openlp/plugins/songs/lib/songstab.py - openlp/plugins/videos/lib/__init__.py - openlp/plugins/videos/lib/videotab.py - openlp/plugins/bibles/lib/biblemediaitem.py - openlp/core/ui/test/test_service_manager.py - openlp/plugins/images/lib/__init__.py - openlp/plugins/images/lib/imageserviceitem.py - openlp/plugins/images/lib/listwithpreviews.py - resources/forms/Ui_editversedialog.py - openlp/plugins/songs/forms/editverseform.py - openlp/plugins/songs/forms/editversedialog.py - openlp/plugins/custom/__init__.py - openlp/plugins/custom/customplugin.py - openlp/plugins/custom/forms/__init__.py - openlp/plugins/custom/forms/editcustomform.py - openlp/plugins/custom/forms/editcustomdialog.py - openlp/plugins/custom/lib/__init__.py - openlp/plugins/custom/lib/customtab.py - openlp/plugins/custom/lib/classes.py - openlp/plugins/custom/lib/tables.py - openlp/plugins/custom/lib/custommediaitem.py - openlp/plugins/custom/lib/meta.py - openlp/plugins/custom/lib/models.py - openlp/plugins/custom/lib/manager.py - - -
resources/forms/openlpexportform.ui
-
resources/forms/opensongexportform.ui
-
resources/forms/about.ui
-
resources/forms/settings.ui
-
resources/forms/themewizard.ui
-
resources/forms/opensongimportform.ui
-
resources/forms/alertform.ui
-
resources/forms/mainwindow.ui
-
resources/forms/songexport.ui
-
resources/forms/openlpimportform.ui
-
resources/forms/splashscreen.ui
-
resources/forms/authorsdialog.ui
-
resources/forms/bibleimportdialog.ui
-
resources/forms/songbookdialog.ui
-
resources/forms/topicsdialog.ui
-
resources/forms/editsongdialog.ui
-
resources/forms/editversedialog.ui
-
resources/forms/editcustomdialog.ui
-
- - - - resources/images/openlp-2.qrc - - - - - copyright.txt - documentation/SongFormat.txt - documentation/pyqt-sql-py2exe.txt - documentation/PluginDevelopersGuide.txt - - openlp.pyw - - Subversion - - - - add - - - - - - - - checkout - - - - - - - - commit - - - - - - - - diff - - - - - - - - export - - - - - - - - global - - - - - - - - history - - - - - - - - log - - - - - - - - remove - - - - - - - - status - - - - - - - - tag - - - - - - - - update - - - - - - - - - - - - standardLayout - - - True - - - - - - - - - - - - - - - + + + + + + + en + Python + Qt4 + + 1.9.0 + Raoul Snyman + raoulsnyman@openlp.org + + openlp.pyw + openlp/controls/__init__.py + openlp/core/test/test_render_theme.py + openlp/core/test/test_render.py + openlp/core/interpolate.py + openlp/core/__init__.py + openlp/core/render.py + openlp/__init__.py + demo.py + openlp/core/settingsmanager.py + openlp/plugins/__init__.py + openlp/core/pluginmanager.py + openlp/core/ui/__init__.py + openlp/core/ui/mainwindow.py + openlp/core/ui/splashscreen.py + openlp/core/ui/alertform.py + openlp/core/ui/about.py + openlp/plugins/songs/songsplugin.py + openlp/plugins/songs/__init__.py + openlp/plugins/songs/forms/__init__.py + openlp/plugins/songs/forms/openlpimportform.py + openlp/plugins/songs/forms/editsongform.py + openlp/plugins/songs/forms/opensongexportform.py + openlp/plugins/songs/forms/openlpexportform.py + openlp/plugins/songs/forms/opensongimportform.py + openlp/core/utils/__init__.py + openlp/core/theme/__init__.py + openlp/core/theme/theme.py + openlp/plugins/songs/test/test_song_opensong.py + openlp/plugins/songs/test/test_song_basic.py + openlp/plugins/songs/test/test_song_verse.py + openlp/plugins/songs/test/test_song_text.py + openlp/core/theme/test/test_theme.py + openlp/core/resources.py + openlp/core/lib/__init__.py + openlp/core/lib/xmlrootclass.py + openlp/core/lib/plugin.py + openlp/core/lib/mediamanageritem.py + openlp/core/lib/event.py + openlp/core/utils/confighelper.py + openlp/core/utils/winregistry.py + openlp/core/utils/registry.py + openlp/core/utils/linregistry.py + setup.py + openlp/core/lib/pluginconfig.py + openlp/core/test/test_plugin_manager.py + openlp/core/test/test_mediamanageritem.py + openlp/core/test/testplugins/testplugin1.py + openlp/core/test/testplugins/testplugin2/__init__.py + openlp/core/test/testplugins/testplugin2/testplugin2.py + openlp/plugins/bibles/bibleplugin.py + openlp/plugins/bibles/forms/bibleimportdialog.py + openlp/plugins/bibles/forms/bibleimportform.py + openlp/plugins/bibles/lib/bibleDBimpl.py + openlp/plugins/bibles/lib/bibleOSISimpl.py + openlp/plugins/bibles/lib/bibleHTTPimpl.py + openlp/plugins/bibles/lib/bibleCSVimpl.py + openlp/plugins/bibles/__init__.py + openlp/plugins/bibles/lib/__init__.py + openlp/plugins/bibles/forms/__init__.py + openlp/plugins/songs/lib/__init__.py + openlp/plugins/songs/lib/songxml.py + openlp/plugins/songs/lib/models.py + openlp/plugins/bibles/test/__init__.py + openlp/plugins/bibles/test/test_bibleManagerAPI.py + openlp/plugins/bibles/test/test_bibleManager.py + openlp/plugins/bibles/test/test_bibleManagerOSIS.py + openlp/plugins/bibles/test/test_bibleManagerCSV.py + openlp/plugins/presentations/lib/pptview.py + openlp/plugins/presentations/lib/impresscom.py + openlp/plugins/presentations/lib/powerpoint.py + openlp/plugins/presentations/lib/pptviewlib/ppttest.py + openlp/plugins/presentations/__init__.py + openlp/plugins/presentations/presentationplugin.py + openlp/plugins/videos/__init__.py + openlp/plugins/videos/videoplugin.py + openlp/plugins/images/__init__.py + openlp/plugins/images/imageplugin.py + openlp/plugins/songs/forms/editsongdialog.py + openlp/core/lib/pluginutils.py + openlpcnv.pyw + openlp/plugins/songs/forms/songbookdialog.py + openlp/plugins/songs/forms/topicsdialog.py + openlp/plugins/songs/forms/authorsdialog.py + openlp/plugins/songs/forms/topicsform.py + openlp/plugins/songs/forms/authorsform.py + openlp/plugins/songs/forms/songbookform.py + openlp/migration/__init__.py + openlp/migration/migratefiles.py + openlp/migration/migratesongs.py + openlp/migration/display.py + openlp/migration/migratebibles.py + openlp/plugins/songs/lib/tables.py + openlp/plugins/songs/lib/classes.py + openlp/plugins/songs/lib/manager.py + openlp/plugins/bibles/lib/classes.py + openlp/plugins/bibles/lib/tables.py + openlp/plugins/bibles/lib/manager.py + openlp/plugins/bibles/lib/common.py + openlp/plugins/songs/lib/meta.py + openlp/core/test/testplugins/deeper/__init__.py + openlp/core/test/testplugins/deeper/toodeep/__init__.py + openlp/core/test/testplugins/deeper/toodeep/plugin3toodeep.py + openlp/core/lib/serviceitem.py + openlp/core/ui/slidecontroller.py + openlp/core/lib/eventreceiver.py + openlp/core/ui/servicemanager.py + openlp/core/lib/toolbar.py + openlp/core/ui/settingsform.py + openlp/core/ui/generaltab.py + openlp/core/ui/themestab.py + openlp/core/ui/alertstab.py + openlp/core/ui/settingsdialog.py + openlp/core/lib/settingstab.py + openlp/plugins/bibles/lib/biblestab.py + openlp/plugins/songs/lib/songstab.py + openlp/plugins/videos/lib/__init__.py + openlp/plugins/videos/lib/videotab.py + openlp/plugins/bibles/lib/biblemediaitem.py + openlp/core/ui/test/test_service_manager.py + openlp/plugins/images/lib/__init__.py + openlp/plugins/images/lib/imageserviceitem.py + openlp/plugins/images/lib/listwithpreviews.py + openlp/plugins/songs/forms/editverseform.py + openlp/plugins/songs/forms/editversedialog.py + openlp/plugins/custom/__init__.py + openlp/plugins/custom/customplugin.py + openlp/plugins/custom/forms/__init__.py + openlp/plugins/custom/forms/editcustomform.py + openlp/plugins/custom/forms/editcustomdialog.py + openlp/plugins/custom/lib/__init__.py + openlp/plugins/custom/lib/customtab.py + openlp/plugins/custom/lib/classes.py + openlp/plugins/custom/lib/tables.py + openlp/plugins/custom/lib/custommediaitem.py + openlp/plugins/custom/lib/meta.py + openlp/plugins/custom/lib/models.py + openlp/plugins/custom/lib/manager.py + openlp/plugins/images/lib/mediaitem.py + + +
resources/forms/openlpexportform.ui
+
resources/forms/opensongexportform.ui
+
resources/forms/about.ui
+
resources/forms/settings.ui
+
resources/forms/themewizard.ui
+
resources/forms/opensongimportform.ui
+
resources/forms/alertform.ui
+
resources/forms/mainwindow.ui
+
resources/forms/songexport.ui
+
resources/forms/openlpimportform.ui
+
resources/forms/splashscreen.ui
+
resources/forms/authorsdialog.ui
+
resources/forms/bibleimportdialog.ui
+
resources/forms/songbookdialog.ui
+
resources/forms/topicsdialog.ui
+
resources/forms/editsongdialog.ui
+
resources/forms/editversedialog.ui
+
resources/forms/editcustomdialog.ui
+
+ + + + resources/images/openlp-2.qrc + + + + + copyright.txt + documentation/SongFormat.txt + documentation/pyqt-sql-py2exe.txt + documentation/PluginDevelopersGuide.txt + + openlp.pyw + + None + + + + add + + + + + + + + checkout + + + + + + + + commit + + + + + + + + diff + + + + + + + + export + + + + + + + + global + + + + + + + + history + + + + + + + + log + + + + + + + + remove + + + + + + + + status + + + + + + + + tag + + + + + + + + update + + + + + + + + + + + + standardLayout + + + True + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/openlp/core/lib/pluginconfig.py b/openlp/core/lib/pluginconfig.py index 916272fc7..f9afb24db 100644 --- a/openlp/core/lib/pluginconfig.py +++ b/openlp/core/lib/pluginconfig.py @@ -83,3 +83,56 @@ class PluginConfig(object): return returnfiles else: return files # no filtering required + + def load_list(self, name): + """ + Load a list from the config file + """ + list_count = self.get_config('%s count' % name) + if list_count is not None: + list_count = int(list_count) + else: + list_count = 0 + list = [] + if list_count > 0: + for counter in range(0 , list_count): + item = str(self.get_config('%s %d' % (name, counter))) + list.append(item) + return list + + def set_list(self, name, list): + """ + Save a list to the config file + """ + old_count = int(self.get_config('%s count' % name)) + new_count = len(list) + self.set_config('%s count' % new_count) + for counter in range (0, new_count): + self.set_config('%s %d' % (name, counter), list[counter]) + if old_count > new_count: + # Tidy up any old list itrms if list is smaller now + for counter in range(new_count, old_count): + self.delete_config('%s %d' % (name, counter)) + + def get_last_dir(self, num=None): + """ + Read the last directory used for plugin + """ + if num is not None: + name = 'last directory %d' % num + else: + name = 'last directory' + last_dir = self.get_config(name) + if last_dir is None: + last_dir = '' + return last_dir + + def set_last_dir(self, directory, num=None): + """ + Save the last directory used for plugin + """ + if num is not None: + name = 'last directory %d' % num + else: + name = 'last directory' + self.config.set_config(name, directory) diff --git a/openlp/plugins/bibles/lib/biblemediaitem.py b/openlp/plugins/bibles/lib/biblemediaitem.py index 6653bea58..e3e2acc61 100644 --- a/openlp/plugins/bibles/lib/biblemediaitem.py +++ b/openlp/plugins/bibles/lib/biblemediaitem.py @@ -106,7 +106,8 @@ class BibleMediaItem(MediaManagerItem): self.ClearQuickSearchComboBox.setObjectName('ClearQuickSearchComboBox') self.QuickLayout.addWidget(self.ClearQuickSearchComboBox, 3, 1, 1, 1) self.SearchTabWidget.addTab(self.QuickTab, 'Quick') - QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Expanding) self.QuickLayout.addItem(QuickSpacerItem, 4, 2, 1, 1) # Add the Advanced Search tab diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 8cffafc6b..a0225b0cd 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -71,7 +71,6 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.VerseListView.setCurrentRow(selectedRow - 1) def onDownButtonPressed(self): - print "Down" selectedRow = self.VerseListView.currentRow() if self.selectedRow != self.VerseListView.count() - 1: # zero base arrays qw = self.VerseListView.takeItem(selectedRow) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 6ee63683c..5853a12e4 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -17,17 +17,14 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -import os -import os.path +import logging from PyQt4 import QtCore, QtGui + +from openlp.core.lib import Plugin, PluginUtils from openlp.core.resources import * -from openlp.core.lib import Plugin, PluginUtils, MediaManagerItem -import logging -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from openlp.plugins.images.lib import ListWithPreviews -from openlp.plugins.images.lib import ImageServiceItem + +from openlp.plugins.images.lib import ImageMediaItem, ImageServiceItem class ImagePlugin(Plugin, PluginUtils): global log @@ -43,99 +40,16 @@ class ImagePlugin(Plugin, PluginUtils): self.icon.addPixmap(QtGui.QPixmap(':/media/media_image.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.preview_service_item=ImageServiceItem(preview_controller) - self.live_service_item=ImageServiceItem(live_controller) + self.preview_service_item = ImageServiceItem(preview_controller) + self.live_service_item = ImageServiceItem(live_controller) def get_media_manager_item(self): # Create the MediaManagerItem object - self.MediaManagerItem = MediaManagerItem(self, self.icon, 'Images') - # Add a toolbar - self.MediaManagerItem.addToolbar() - # Create buttons for the toolbar - ## New Song Button ## - self.MediaManagerItem.addToolbarButton('Load Image', 'Load images into openlp.org', - ':/images/image_load.png', self.onImagesNewClick, 'ImageNewItem') - ## Delete Song Button ## - self.MediaManagerItem.addToolbarButton('Delete Image', 'Delete the selected image', - ':/images/image_delete.png', self.onImageDeleteClick, 'ImageDeleteItem') - ## Separator Line ## - self.MediaManagerItem.addToolbarSeparator() - ## Preview Song Button ## - self.MediaManagerItem.addToolbarButton('Preview Song', 'Preview the selected image', - ':/system/system_preview.png', self.onImagePreviewClick, 'ImagePreviewItem') - ## Live Song Button ## - self.MediaManagerItem.addToolbarButton('Go Live', 'Send the selected image live', - ':/system/system_live.png', self.onImageLiveClick, 'ImageLiveItem') - ## Add Song Button ## - self.MediaManagerItem.addToolbarButton('Add Image To Service', - 'Add the selected image(s) to the service', ':/system/system_add.png', - self.onImageAddClick, 'ImageAddItem') - ## Add the songlist widget ## - self.ImageListView=QtGui.QListView() - self.ImageListView.uniformItemSizes=True - self.ImageListData=ListWithPreviews() - self.ImageListView.setModel(self.ImageListData) - - self.ImageListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) - self.ImageListView.setObjectName("ImageListView") - self.MediaManagerItem.PageLayout.addWidget(self.ImageListView) - - #define and add the context menu - self.ImageListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - - self.ImageListView.addAction(self.add_to_context_menu(self.ImageListView, ':/system/system_preview.png', "&Preview Image", self.onImagePreviewClick)) - self.ImageListView.addAction(self.add_to_context_menu(self.ImageListView, ':/system/system_live.png', "&Show Live", self.onImageLiveClick)) - self.ImageListView.addAction(self.add_to_context_menu(self.ImageListView, ':/system/system_add.png', "&Add to Service", self.onImageAddClick)) - - self.ImageListPreview = QtGui.QWidget() - self.MediaManagerItem.PageLayout.addWidget(self.ImageListPreview) - self.ImageListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) - self.ImageListView.setSpacing(1) - self.ImageListView.setAlternatingRowColors(True) + self.MediaManagerItem = ImageMediaItem(self, self.icon, 'Images') return self.MediaManagerItem def initialise(self): log.info("Plugin Initialising") - list = self._load_display_list() - self._load_image_list(list) log.info("Done") - def onImagesNewClick(self): - files = QtGui.QFileDialog.getOpenFileNames(None, "Select Image(s)", self._get_last_dir(), "Images (*.jpg *.gif *.png *.bmp)") - log.info("New image(s)", str(files)) - if len(files) > 0: - self._load_image_list(files) - self._save_last_directory(files[0]) - self._save_display_list(self.ImageListData.get_file_list()) - - def _load_image_list(self, list): - for f in list: - self.ImageListData.addRow(f) - - def onImageDeleteClick(self): - indexes=self.ImageListView.selectedIndexes() - for i in indexes: - cr = i.row() - self.ImageListData.removeRow(int(cr)) - - self._save_display_list(self.ImageListData.get_file_list()) - - def onImageClick(self, where): - indexes=self.ImageListView.selectedIndexes() - for i in indexes: - filename = self.ImageListData.get_filename(i) - log.info("Click %s:%s"%(str(where), filename)) - where.add(filename) - - where.render() - - def onImagePreviewClick(self): - self.onImageClick(self.preview_service_item) - - def onImageLiveClick(self): - self.onImageClick(self.live_service_item) - - def onImageAddClick(self): - """Add this item to the OOS""" - pass diff --git a/openlp/plugins/images/lib/__init__.py b/openlp/plugins/images/lib/__init__.py index 1d71312ce..34111461b 100644 --- a/openlp/plugins/images/lib/__init__.py +++ b/openlp/plugins/images/lib/__init__.py @@ -19,3 +19,4 @@ Place, Suite 330, Boston, MA 02111-1307 USA """ from imageserviceitem import ImageServiceItem from listwithpreviews import ListWithPreviews +from mediaitem import ImageMediaItem diff --git a/openlp/plugins/images/lib/listwithpreviews.py b/openlp/plugins/images/lib/listwithpreviews.py index f1a5a34e3..6a16636e7 100644 --- a/openlp/plugins/images/lib/listwithpreviews.py +++ b/openlp/plugins/images/lib/listwithpreviews.py @@ -9,13 +9,16 @@ class ListWithPreviews(QAbstractListModel): global log log=logging.getLogger("ListWithPreviews") log.info("started") + def __init__(self): QAbstractListModel.__init__(self) self.items=[] # will be a list of (full filename, QPixmap, shortname) tuples self.rowheight=50 self.maximagewidth=self.rowheight*16/9.0; + def rowCount(self, parent): return len(self.items) + def insertRow(self, row, filename): self.beginInsertRows(QModelIndex(),row,row) log.info("insert row %d:%s"%(row,filename)) @@ -40,18 +43,19 @@ class ListWithPreviews(QAbstractListModel): # finally create the row self.items.insert(row, (filename, p, shortfilename)) self.endInsertRows() + def removeRow(self, row): self.beginRemoveRows(QModelIndex(), row,row) self.items.pop(row) self.endRemoveRows() + def addRow(self, filename): self.insertRow(len(self.items), filename) - + def data(self, index, role): row=index.row() if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! return QVariant() - if role==Qt.DisplayRole: retval= self.items[row][2] elif role == Qt.DecorationRole: @@ -60,16 +64,16 @@ class ListWithPreviews(QAbstractListModel): retval= self.items[row][0] else: retval= QVariant() - # log.info("Returning"+ str(retval)) if type(retval) is not type(QVariant): return QVariant(retval) else: return retval - def get_file_list(self): - filelist=[i[0] for i in self.items]; + + def getFileList(self): + filelist = [item[0] for item in self.items]; return filelist - def get_filename(self, index): - row=index.row() + def getFilename(self, index): + row = index.row() return self.items[row][0]