From f37dd74b4e0916d0e8a342375fdf739f7ee2e525 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 22 Nov 2008 15:16:02 +0000 Subject: [PATCH] Moved MediaManagerItem to core. bzr-revno: 111 --- .eric4project/openlp.org 2.0.e4q | 2 +- .eric4project/openlp.org 2.0.e4t | 2 +- openlp.org 2.0.e4p | 6 ++--- openlp/core/__init__.py | 2 +- openlp/core/mediamanageritem.py | 41 ++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 openlp/core/mediamanageritem.py diff --git a/.eric4project/openlp.org 2.0.e4q b/.eric4project/openlp.org 2.0.e4q index 7a8a7d042..84e7cb899 100644 --- a/.eric4project/openlp.org 2.0.e4q +++ b/.eric4project/openlp.org 2.0.e4q @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/.eric4project/openlp.org 2.0.e4t b/.eric4project/openlp.org 2.0.e4t index a9ddac42a..b49f3dcb4 100644 --- a/.eric4project/openlp.org 2.0.e4t +++ b/.eric4project/openlp.org 2.0.e4t @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/openlp.org 2.0.e4p b/openlp.org 2.0.e4p index 8aaae61e5..6391f573d 100644 --- a/openlp.org 2.0.e4p +++ b/openlp.org 2.0.e4p @@ -1,7 +1,7 @@ - + Python @@ -48,8 +48,6 @@ openlp/song/test/test_song_verse.py openlp/plugins/__init__.py openlp/plugins/testplugin1.py - openlp/plugins/plugin.py - openlp/plugins/plugin_manager.py openlp/plugins/testplugin2/__init__.py openlp/plugins/testplugin2/testplugin2.py openlp/plugins/test/test_plugin_manager.py @@ -70,6 +68,8 @@ openlp/plugins/test/test_mediamanageritem.py openlp/plugins/biblemanager/BibleOSISImpl.py openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py + openlp/core/pluginmanager.py + openlp/core/mediamanageritem.py
openlp/resources/forms/mainwindow.ui
diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 25bc9d548..c860a9519 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -21,4 +21,4 @@ from openlp.core.settingsmanager import SettingsManager from openlp.core.plugin import Plugin from openlp.core.pluginmanager import PluginManager -__all__ = ['Renderer', 'SettingsManager', 'Plugin'] +__all__ = ['Renderer', 'SettingsManager', 'Plugin', 'PluginManager'] diff --git a/openlp/core/mediamanageritem.py b/openlp/core/mediamanageritem.py new file mode 100644 index 000000000..354b62afa --- /dev/null +++ b/openlp/core/mediamanageritem.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 +""" +OpenLP - Open Source Lyrics Projection +Copyright (c) 2008 Raoul Snyman +Portions copyright (c) 2008 Martin Thompson, Tim Bentley + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +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 +""" + +from PyQt4 import QtCore, QtGui +from openlp.resources import * + +class MediaManagerItem(QtGui.QWidget): + """ + MediaManagerItem is a helper widget for plugins. + """ + def __init__(self, icon=None, title=None): + """ + Constructor to create the media manager item. + """ + QtGui.QWidget.__init__(self) + self.Icon = QtGui.QIcon() + if icon is not None: + self.Icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off) + else: + self.Icon = None + if title is not None: + self.Title = title + else: + self.Title = ''