Rewrote Plugin methods to match Python standards, fixed a few other things here and there.

bzr-revno: 219
This commit is contained in:
Raoul Snyman 2008-12-14 15:49:54 +00:00
parent 40e52dd4ff
commit 508a542d6f
22 changed files with 1554 additions and 1375 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
<!-- eric4 user project file for project openlp.org 2.0 -->
<!-- Saved: 2008-12-07, 01:02:37 -->
<!-- Saved: 2008-12-14, 17:46:43 -->
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
<UserProject version="4.0">
</UserProject>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
<!-- eric4 tasks file for project openlp.org 2.0 -->
<!-- Saved: 2008-12-07, 01:02:37 -->
<!-- Saved: 2008-12-14, 17:46:43 -->
<Tasks version="4.2">
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
@ -21,4 +21,94 @@
<Linenumber>523</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Logging - not all, but enough</Summary>
<Description></Description>
<Created>2008-12-07, 10:06:59</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>39</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Handle OpenLP2 format</Summary>
<Description></Description>
<Created>2008-12-07, 10:06:59</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>40</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Import OpenLP1</Summary>
<Description></Description>
<Created>2008-12-07, 10:06:59</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>41</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Export OpenLP1</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>42</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Export Song to CCLI</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>43</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Export Song to OpenSong</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>44</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Import ChangingSong</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>45</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Song: Export ChangingSong</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>46</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>149</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: check font formatting</Summary>
<Description></Description>
<Created>2008-12-07, 10:07:00</Created>
<Resource>
<Filename>openlp/plugins/songs/songxml.py</Filename>
<Linenumber>534</Linenumber>
</Resource>
</Task>
</Tasks>

View File

@ -62,7 +62,7 @@ The "songs" table has the following columns:
* comments
* ccli_number
* song_number
* theme
* theme_name
* search_title
* search_lyrics

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-4.4.dtd">
<!-- eric4 project file for project openlp.org 2.0 -->
<!-- Saved: 2008-12-07, 01:02:26 -->
<!-- Saved: 2008-12-13, 19:19:42 -->
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
<Project version="4.4">
<ProgLanguage mixed="0">Python</ProgLanguage>
@ -21,14 +21,7 @@
<Source>openlp/__init__.py</Source>
<Source>demo.py</Source>
<Source>openlp/core/settingsmanager.py</Source>
<Source>openlp/plugins/biblemanager/test/__init__.py</Source>
<Source>openlp/plugins/biblemanager/test/test_bibleManager.py</Source>
<Source>openlp/plugins/__init__.py</Source>
<Source>openlp/libraries/pptviewlib/ppttest.py</Source>
<Source>openlp/plugins/biblemanager/test/test_bibleManagerAPI.py</Source>
<Source>openlp/plugins/biblemanager/test/test_bibleManagerCSV.py</Source>
<Source>openlp/plugins/mediamanageritem.py</Source>
<Source>openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py</Source>
<Source>openlp/core/pluginmanager.py</Source>
<Source>openlp/core/ui/__init__.py</Source>
<Source>openlp/core/ui/mainwindow.py</Source>
@ -39,7 +32,6 @@
<Source>openlp/plugins/songs/songsplugin.py</Source>
<Source>openlp/plugins/songs/__init__.py</Source>
<Source>openlp/plugins/songs/forms/__init__.py</Source>
<Source>openlp/plugins/songs/songxml.py</Source>
<Source>openlp/plugins/songs/forms/openlpimportform.py</Source>
<Source>openlp/plugins/songs/forms/editsongform.py</Source>
<Source>openlp/plugins/songs/forms/opensongexportform.py</Source>
@ -85,6 +77,20 @@
<Source>openlp/plugins/bibles/lib/__init__.py</Source>
<Source>openlp/plugins/bibles/forms/__init__.py</Source>
<Source>openlp/plugins/bibles/lib/biblecommon.py</Source>
<Source>openlp/plugins/songs/lib/__init__.py</Source>
<Source>openlp/plugins/songs/lib/songxml.py</Source>
<Source>openlp/plugins/songs/lib/models.py</Source>
<Source>openlp/plugins/bibles/test/__init__.py</Source>
<Source>openlp/plugins/bibles/test/test_bibleManagerAPI.py</Source>
<Source>openlp/plugins/bibles/test/test_bibleManager.py</Source>
<Source>openlp/plugins/bibles/test/test_bibleManagerOSIS.py</Source>
<Source>openlp/plugins/bibles/test/test_bibleManagerCSV.py</Source>
<Source>openlp/plugins/presentations/lib/pptview.py</Source>
<Source>openlp/plugins/presentations/lib/impresscom.py</Source>
<Source>openlp/plugins/presentations/lib/powerpoint.py</Source>
<Source>openlp/plugins/presentations/lib/pptviewlib/ppttest.py</Source>
<Source>openlp/plugins/presentations/__init__.py</Source>
<Source>openlp/plugins/presentations/presentationplugin.py</Source>
</Sources>
<Forms>
<Form>resources/forms/bibleimport.ui</Form>

View File

@ -20,9 +20,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
import sys
import logging
from PyQt4 import QtCore, QtGui
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',

View File

@ -32,14 +32,14 @@ class MediaManagerItem(QtGui.QWidget):
"""
QtGui.QWidget.__init__(self)
if type(icon) is QtGui.QIcon:
self.Icon = icon
self.icon = icon
elif type(icon) is types.StringType:
self.Icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
self.icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
else:
self.Icon = None
self.icon = None
if title is not None:
self.Title = title
self.title = title
self.Toolbar = None
#self.ToolbarButtons = []

View File

@ -17,30 +17,43 @@ 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 openlp.core.lib import PluginConfig
__version__ = "$Revision: $"
# $Source$
import logging
from openlp.core.lib import PluginConfig
class Plugin(object):
"""
Base class for openlp plugins to inherit from.
Basic attributes are:
* Name
* name
The name that should appear in the plugins list.
* Version
* version
The version number of this iteration of the plugin.
* MediaManagerItem
An instance of the MediaManagerItem class, used in the Media Manager.
* SettingsTab
An instance of the SettingsTab class, used in the Settings dialog.
* ImportMenuItem
A menu item to be placed in the Import menu.
* ExportMenuItem
A menu item to be placed in the Export menu.
* icon
An instance of QIcon, which holds an icon for this plugin.
* config
An instance of PluginConfig, which allows plugins to read and write to
openlp.org's configuration. This is pre-instantiated.
* log
A log object used to log debugging messages. This is pre-instantiated.
Hook functions:
* get_media_manager_item()
Returns an instance of MediaManagerItem to be used in the Media Manager.
* get_import_menu_item()
Returns an item for the Import menu.
* get_export_menu_item()
Returns an item for the Export menu.
* get_settings_tab()
Returns an instance of SettingsTab to be used in the Settings dialog.
* add_to_menu(menubar)
A method to add a menu item to anywhere in the menu, given the menu bar.
* handle_event(event)
A method use to handle events, given an Event object.
* about()
Used in the plugin manager, when a person clicks on the 'About' button.
* save(data)
@ -52,12 +65,8 @@ class Plugin(object):
* render(theme, screen_number)
A method used to render something to the screen, given the current theme
and screen number.
* addToMenu(menubar)
A method to add a menu item to anywhere in the menu, given the menu bar.
* handleEvent(event)
A method use to handle events, given an Event object.
"""
global log
def __init__(self, name=None, version=None):
"""
This is the constructor for the plugin object. This provides an easy
@ -69,17 +78,53 @@ class Plugin(object):
...
"""
if name is not None:
self.Name = name
self.name = name
else:
self.Name = 'Plugin'
self.name = 'Plugin'
if version is not None:
self.Version = version
self.config = PluginConfig(self.Name)
#self.MediaManagerItem = None
self.SettingsTab = None
self.ImportMenuItem = None
self.ExportMenuItem = None
self.Weight = 0
self.version = version
self.icon = None
self.config = PluginConfig(self.name)
self.weight = 0
# Set up logging
self.log = logging.getLogger(self.name)
def get_media_manager_item(self):
"""
Construct a MediaManagerItem object with all the buttons and things you
need, and return it for integration into openlp.org.
"""
pass
def get_import_menu_item(self):
"""
Create a menu item and add it to the "Import" menu.
"""
pass
def get_export_menu_item(self):
"""
Create a menu item and add it to the "Export" menu.
"""
pass
def get_settings_tab(self):
"""
Create a menu item and add it to the "Import" menu.
"""
pass
def add_to_menu(self, menubar):
"""
Add menu items to the menu, given the menubar.
"""
pass
def handle_event(self, event):
"""
Handle the event contained in the event object.
"""
pass
def about(self):
"""
@ -108,30 +153,8 @@ class Plugin(object):
"""
pass
def getMediaManagerItem(self):
def initalise(self):
"""
Construct a MediaManagerItem object with all the buttons and things you
need, and return it for integration into openlp.org.
Called by the plugin Manager to initialise anything it needs.
"""
pass
def addToMenu(self, menubar):
"""
Add menu items to the menu, given the menubar.
"""
pass
def handleEvent(self, event):
"""
Handle the event contained in the event object.
"""
pass
def getName(self):
return self.Name
def initalise_ui(self):
"""
Called by the plugin Manager to setup any UI features on creation after the UI has been created,
"""
pass

View File

@ -73,22 +73,22 @@ class PluginManager(object):
for p in self.plugin_classes:
plugin = p()
plugin_objects.append(plugin)
self.plugins = sorted(plugin_objects, self.orderByWeight)
self.plugins = sorted(plugin_objects, self.order_by_weight)
def orderByWeight(self, x, y):
return cmp(x.Weight, y.Weight)
def order_by_weight(self, x, y):
return cmp(x.weight, y.weight)
def hookMediaManager(self, mediatoolbox):
def hook_media_manager(self, mediatoolbox):
"""
Loop through all the plugins. If a plugin has a valid media manager item,
add it to the media manager.
"""
for plugin in self.plugins:
media_manager_item = plugin.getMediaManagerItem()
media_manager_item = plugin.get_media_manager_item()
if media_manager_item is not None:
log.debug('Inserting media manager item from %s' % plugin.Name)
mediatoolbox.addItem(media_manager_item, plugin.Icon, media_manager_item.Title)
plugin.initalise_ui()
log.debug('Inserting media manager item from %s' % plugin.name)
mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
plugin.initalise()
def hookHandleEvent(self, event):
def hook_handle_event(self, event):
pass

View File

@ -161,7 +161,7 @@ class MainWindow(object):
self.MediaToolBox.setObjectName("MediaToolBox")
# This is where we will eventually get the Plugin Manager to pull in
# the media manager items.
self.plugin_manager.hookMediaManager(self.MediaToolBox)
self.plugin_manager.hook_media_manager(self.MediaToolBox)
# End adding media manager items.
self.MediaManagerLayout.addWidget(self.MediaToolBox)
self.MediaManagerDock.setWidget(self.MediaManagerContents)

View File

@ -18,40 +18,40 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.resources import *
from openlp.core.lib import Plugin, MediaManagerItem
from openlp.plugins.bibles.lib.biblemanager import BibleManager
from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm
import logging
from openlp.plugins.bibles.lib import BibleManager
from openlp.plugins.bibles.forms import BibleImportForm
class BiblePlugin(Plugin):
global log
log=logging.getLogger("BiblePlugin")
log.info("Bible Plugin loaded")
log.info("Bible Plugin loaded")
def __init__(self):
# Call the parent constructor
Plugin.__init__(self, 'Bible', '1.9.0')
self.Weight = -9
self.weight = -9
# Create the plugin icon
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(':/media/media_verse.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
#Register the bible Manager
self.biblemanager = BibleManager(self.config)
self.searchresults = {} # place to store the search results
def getMediaManagerItem(self):
# Create the plugin icon
self.Icon = QtGui.QIcon()
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_verse.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_media_manager_item(self):
# Create the MediaManagerItem object
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Bible Verses')
self.MediaManagerItem = MediaManagerItem(self.icon, 'Bible Verses')
# Add a toolbar
self.MediaManagerItem.addToolbar()
# Create buttons for the toolbar
## New Bible Button ##
self.MediaManagerItem.addToolbarButton('New Bible', 'Register a new Bible',
':/bibles/bible_new.png', self.onBibleNewClick, 'BibleNewItem')
':/themes/theme_import.png', self.onBibleNewClick, 'BibleNewItem')
## Separator Line ##
self.MediaManagerItem.addToolbarSeparator()
## Preview Bible Button ##
@ -87,15 +87,15 @@ class BiblePlugin(Plugin):
self.QuickVersionLabel = QtGui.QLabel(self.QuickTab)
self.QuickVersionLabel.setObjectName('QuickVersionLabel')
self.QuickVersionLabel.setText('Version:')
self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1)
self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1)
self.QuickSearchComboBox = QtGui.QComboBox(self.QuickTab)
self.QuickSearchComboBox.setObjectName('SearchComboBox')
self.QuickLayout.addWidget(self.QuickSearchComboBox, 1, 1, 1, 2)
self.QuickSearchLabel = QtGui.QLabel(self.QuickTab)
self.QuickSearchLabel .setObjectName('QuickSearchLabel')
self.QuickSearchLabel .setText('Search Type:')
self.QuickLayout.addWidget(self.QuickSearchLabel, 1, 0, 1, 1)
self.QuickLayout.addWidget(self.QuickSearchLabel, 1, 0, 1, 1)
self.QuickSearchLabel = QtGui.QLabel(self.QuickTab)
self.QuickSearchLabel.setObjectName('QuickSearchLabel')
@ -146,21 +146,21 @@ class BiblePlugin(Plugin):
self.AdvancedToLabel.setObjectName('AdvancedToLabel')
self.AdvancedToLabel.setText('To:')
self.AdvancedLayout.addWidget(self.AdvancedToLabel, 4, 0, 1, 1)
self.AdvancedFromChapter = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedFromChapter.setObjectName('AdvancedFromChapter')
self.AdvancedLayout.addWidget(self.AdvancedFromChapter, 3, 2, 1, 1)
self.AdvancedFromVerse = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedFromVerse.setObjectName('AdvancedFromVerse')
self.AdvancedLayout.addWidget(self.AdvancedFromVerse, 3, 3, 1, 1)
self.AdvancedToChapter = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedToChapter.setObjectName('AdvancedToChapter')
self.AdvancedLayout.addWidget(self.AdvancedToChapter, 4, 2, 1, 1)
self.AdvancedToVerse = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedToVerse.setObjectName('AdvancedToVerse')
self.AdvancedLayout.addWidget(self.AdvancedToVerse, 4, 3, 1, 1)
self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)
self.AdvancedSearchButton.setObjectName('AdvancedSearchButton')
self.AdvancedSearchButton.setText('Search')
@ -174,20 +174,22 @@ class BiblePlugin(Plugin):
self.listView.setGeometry(QtCore.QRect(10, 200, 256, 391))
self.listView.setObjectName("listView")
self.MediaManagerItem.PageLayout.addWidget(self.listView)
#QtCore.QObject.connect(self.QuickTab, QtCore.SIGNAL("triggered()"), self.onQuickTabClick)
QtCore.QObject.connect( self.SearchTabWidget, QtCore.SIGNAL("currentChanged ( QWidget * )" ), self.onQuickTabClick)
QtCore.QObject.connect(self.AdvancedVersionComboBox, QtCore.SIGNAL("activated(int)"), self.onAdvancedVersionComboBox)
QtCore.QObject.connect(self.AdvancedBookComboBox, QtCore.SIGNAL("activated(int)"), self.onAdvancedBookComboBox)
QtCore.QObject.connect(self.AdvancedBookComboBox, QtCore.SIGNAL("activated(int)"), self.onAdvancedBookComboBox)
QtCore.QObject.connect(self.AdvancedFromChapter, QtCore.SIGNAL("activated(int)"), self.onAdvancedFromChapter)
QtCore.QObject.connect(self.AdvancedFromVerse, QtCore.SIGNAL("activated(int)"), self.onAdvancedFromVerse)
QtCore.QObject.connect(self.AdvancedToChapter, QtCore.SIGNAL("activated(int)"), self.onAdvancedToChapter)
self._initialiseForm()
QtCore.QObject.connect(self.AdvancedSearchButton, QtCore.SIGNAL("pressed()"), self.onAdvancedSearchButton)
QtCore.QObject.connect(self.QuickSearchButton, QtCore.SIGNAL("pressed()"), self.onQuickSearchButton)
QtCore.QObject.connect(self.QuickSearchButton, QtCore.SIGNAL("pressed()"), self.onQuickSearchButton)
return self.MediaManagerItem
def initalise_ui(self):
def initalise(self):
self._initialiseForm()
def onAdvancedVersionComboBox(self):
@ -196,7 +198,7 @@ class BiblePlugin(Plugin):
def onAdvancedBookComboBox(self):
print self.AdvancedVersionComboBox.currentText()
self._initialiseBibleAdvanced(str(self.AdvancedVersionComboBox.currentText())) # restet the bible info
def onQuickTabClick(self):
print "onQuickTabClick"
print self.SearchTabWidget.currentIndex()
@ -221,18 +223,17 @@ class BiblePlugin(Plugin):
def _initialiseForm(self):
bibles = self.biblemanager.getBibles()
self.QuickSearchComboBox.addItem("Text Search")
self.QuickSearchComboBox.addItem("Verse Search")
self.QuickSearchComboBox.addItem("Verse Search")
first = True
for b in bibles: # load bibles into the combo boxes
self.QuickVersionComboBox.addItem(b)
self.AdvancedVersionComboBox.addItem(b)
self.AdvancedVersionComboBox.addItem(b)
if first:
first = False
self._initialiseBible(b) # use the fist bible as the trigger
def _initialiseBible(self, bible):
log.debug("_initialiseBible %s ", bible)
log.debug("_initialiseBible %s ", bible)
self._initialiseBibleQuick(bible)
self._initialiseBibleAdvanced(bible)
@ -242,11 +243,11 @@ class BiblePlugin(Plugin):
cf = self.biblemanager.getBookChapterCount(bible, currentBook)[0]
log.debug("Book change bible %s book %s ChapterCount %s", bible, currentBook, cf)
if cf == None: # Only change the search details if the book is missing from the new bible
books = self.biblemanager.getBibleBooks(str(self.AdvancedVersionComboBox.currentText()))
books = self.biblemanager.getBibleBooks(str(self.AdvancedVersionComboBox.currentText()))
self.AdvancedBookComboBox.clear()
first = True
for b in books:
self.AdvancedBookComboBox.addItem(b[0])
self.AdvancedBookComboBox.addItem(b[0])
if first:
book = b
first = False
@ -257,68 +258,68 @@ class BiblePlugin(Plugin):
self.chaptersfrom = self.biblemanager.getBookChapterCount(bible, book)[0]
self.verses = self.biblemanager.getBookVerseCount(bible, book, 1)[0]
self._adjustComboBox(1, self.chaptersfrom, self.AdvancedFromChapter)
self._adjustComboBox(1, self.chaptersfrom, self.AdvancedToChapter)
self._adjustComboBox(1, self.chaptersfrom, self.AdvancedToChapter)
self._adjustComboBox(1, self.verses, self.AdvancedFromVerse)
self._adjustComboBox(1, self.verses, self.AdvancedToVerse)
self._adjustComboBox(1, self.verses, self.AdvancedToVerse)
def onAdvancedFromChapter(self):
bible = str(self.AdvancedVersionComboBox.currentText())
book = str(self.AdvancedBookComboBox.currentText())
cf = self.AdvancedFromChapter.currentText()
self._adjustComboBox(cf, self.chaptersfrom, self.AdvancedToChapter)
vse = self.biblemanager.getBookVerseCount(bible, book, int(cf))[0] # get the verse count for new chapter
self._adjustComboBox(1, vse, self.AdvancedFromVerse)
self._adjustComboBox(1, vse, self.AdvancedToVerse)
self._adjustComboBox(1, vse, self.AdvancedFromVerse)
self._adjustComboBox(1, vse, self.AdvancedToVerse)
def _adjustComboBox(self, frm, to , combo):
log.debug("_adjustComboBox %s , %s , %s", combo, frm, to)
log.debug("_adjustComboBox %s , %s , %s", combo, frm, to)
combo.clear()
for i in range(int(frm), int(to) + 1):
for i in range(int(frm), int(to) + 1):
combo.addItem(str(i))
def onAdvancedFromVerse(self):
frm = self.AdvancedFromVerse.currentText()
self._adjustComboBox(frm, self.verses, self.AdvancedToVerse)
def onAdvancedToChapter(self):
t1 = self.AdvancedFromChapter.currentText()
def onAdvancedToChapter(self):
t1 = self.AdvancedFromChapter.currentText()
t2 = self.AdvancedToChapter.currentText()
if t1 != t2:
bible = str(self.AdvancedVersionComboBox.currentText())
book = str(self.AdvancedBookComboBox.currentText())
book = str(self.AdvancedBookComboBox.currentText())
vse = self.biblemanager.getBookVerseCount(bible, book, int(t2))[0] # get the verse count for new chapter
self._adjustComboBox(1, vse, self.AdvancedToVerse)
self._adjustComboBox(1, vse, self.AdvancedToVerse)
def onAdvancedSearchButton(self):
bible = str(self.AdvancedVersionComboBox.currentText())
book = str(self.AdvancedBookComboBox.currentText())
book = str(self.AdvancedBookComboBox.currentText())
chapfrom = int(self.AdvancedFromChapter.currentText())
chapto = int(self.AdvancedToChapter.currentText())
versefrom = int(self.AdvancedFromVerse.currentText())
verseto = int(self.AdvancedToVerse.currentText())
self.searchresults = self.biblemanager.getVerseText(bible, book, chapfrom, versefrom, verseto)
self.searchresults = self.biblemanager.getVerseText(bible, book, chapfrom, versefrom, verseto)
self._displayResults()
def onQuickSearchButton(self):
bible = str(self.QuickVersionComboBox.currentText())
text = str(self.QuickSearchEdit.displayText())
if self.QuickSearchComboBox.currentText() == "Text Search":
self._searchText(bible, text)
else:
self._verseSearch()
def _searchText(self, bible, text):
self.searchresults = self.biblemanager.getVersesFromText(bible,text)
self._displayResults()
self.searchresults = self.biblemanager.getVersesFromText(bible,text)
self._displayResults()
def _verseSearch(self):
self._displayResults()
self._displayResults()
def _displayResults(self):
self.listView.clear() # clear the results
for book, chap, vse , txt in self.searchresults:
self.listView.addItem(book + " " +str(chap) + ":"+ str(vse))
def _initialiseBibleQuick(self, bible): # not sure if needed yet!
a=1

View File

@ -17,3 +17,7 @@ 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 bibleimportform import BibleImportForm
__all__ = ['BibleImportForm']

View File

@ -17,3 +17,8 @@ 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 biblecommon import BibleCommon
from biblemanager import BibleManager
__all__ = ['BibleCommon', 'BibleManager']

View File

@ -16,7 +16,8 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
import os, os.path
import os
import os.path
import sys
import urllib2
@ -26,17 +27,17 @@ logging.basicConfig(level=logging.DEBUG,
datefmt='%m-%d %H:%M',
filename='plugins.log',
filemode='w')
class BibleCommon:
global log
global log
log=logging.getLogger("BibleCommon")
log.info("BibleCommon")
log.info("BibleCommon")
def __init__(self):
"""
"""
def _getWebText(self, urlstring, proxyurl):
log.debug( "getWebText %s %s", proxyurl, urlstring)
if proxyurl != "" or len(proxyurl) > 0 :
print "ProxyUrl " , proxyurl + " " + str(len(proxyurl))
proxy_support = urllib2.ProxyHandler({'http': self.proxyurl})
@ -55,24 +56,24 @@ class BibleCommon:
log.error( 'Reason : ')
log.error( e.reason)
return xml_string
def _cleanText(self, text):
"""
Clean up text and remove extra characters
after been downloaded from web
"""
#return text.rstrip()
#return text.rstrip()
# Remove Headings from the Text
i = text.find("<h")
while i > -1:
j=text.find("</h", i)
j=text.find("</h", i)
text = text[ : (i - 1)]+text[(j+4)]
i = text.find("<h")
# Remove Support References from the Text
x = text.find("<sup>")
while x > -1:
y = text.find("</sup>")
y = text.find("</sup>")
text= text[:x] + text[y + 6:len(text)]
x = text.find("<sup>")
@ -82,23 +83,23 @@ class BibleCommon:
text= text.replace('&nbsp;', '')
text= text.replace('<P>', '')
text= text.replace('<I>', '')
text= text.replace('</I>', '')
text= text.replace('</I>', '')
text= text.replace('<P />', '')
text= text.replace('<p />', '')
text= text.replace('<p />', '')
text= text.replace('</P>', '')
text= text.replace('<BR>', '')
text= text.replace('<BR />', '')
text= text.replace('<BR>', '')
text= text.replace('<BR />', '')
text= text.replace(chr(189), '1/2')
text= text.replace("&quot;", '"')
text= text.replace("&apos;", "'")
i = text.find("<")
while i > -1 :
j = text.find(">", i)
text= text[:i] + text[j+1:]
text= text[:i] + text[j+1:]
i = text.find("<")
text= text.replace('>', '')
return text.rstrip()

View File

@ -19,24 +19,24 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
from PyQt4 import QtCore, QtGui
from openlp.core.resources import *
from openlp.core.lib import Plugin, MediaManagerItem
#from forms import EditSongForm
class PresentationPlugin(Plugin):
def __init__(self):
# Call the parent constructor
Plugin.__init__(self, 'Presentations', '1.9.0')
self.Weight = -8
def getMediaManagerItem(self):
self.weight = -8
# Create the plugin icon
self.Icon = QtGui.QIcon()
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_media_manager_item(self):
# Create the MediaManagerItem object
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Presentations')
self.MediaManagerItem = MediaManagerItem(self.icon, 'Presentations')
# Add a toolbar
self.MediaManagerItem.addToolbar()
# Create buttons for the toolbar
@ -66,11 +66,11 @@ class PresentationPlugin(Plugin):
self.listView = QtGui.QListWidget()
self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591))
self.listView.setObjectName("listView")
self.MediaManagerItem.PageLayout.addWidget(self.listView)
self.MediaManagerItem.PageLayout.addWidget(self.listView)
return self.MediaManagerItem
def initalise_ui(self):
def initalise(self):
self.onPresentationNewClick()
def onPresentationNewClick(self):

View File

@ -19,4 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
from editsongform import EditSongForm
from openlpexportform import OpenLPExportForm
from openlpimportform import OpenLPImportForm
from opensongexportform import OpenSongExportForm
from opensongimportform import OpenSongImportForm

View File

@ -1,299 +1,310 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\openlpexportform.ui'
#
# Created: Wed Nov 05 20:55:51 2008
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from openlp.resources import *
class OpenLPExportForm(object):
def __init__(self):
self.OpenLPExportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenLPExportForm.setObjectName("OpenLPExportForm")
self.OpenLPExportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPExportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ExportFileWidget = QtGui.QWidget(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
self.ExportFileWidget.setObjectName("ExportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
self.ExportFileLabel.setObjectName("ExportFileLabel")
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
self.ExportListLabel.setObjectName("ExportListLabel")
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
self.ExportListTable.setObjectName("ExportListTable")
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ExportSelectAllWidget)
self.exportFilterWidget = QtGui.QWidget(self.ExportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.exportFilterWidget.setObjectName("exportFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPExportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ExportPushButton.setObjectName("ExportPushButton")
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPExportForm.close)
QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPExportForm)
def retranslateUi(self):
self.OpenLPExportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPExportForm", "openlp.org Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select openlp.org export filename:", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
self.ExportPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenLPExportForm.show()
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
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.core.resources import *
class OpenLPExportForm(object):
def __init__(self):
self.OpenLPExportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenLPExportForm.setObjectName("OpenLPExportForm")
self.OpenLPExportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPExportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ExportFileWidget = QtGui.QWidget(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
self.ExportFileWidget.setObjectName("ExportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
self.ExportFileLabel.setObjectName("ExportFileLabel")
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
self.ExportListLabel.setObjectName("ExportListLabel")
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
self.ExportListTable.setObjectName("ExportListTable")
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ExportSelectAllWidget)
self.exportFilterWidget = QtGui.QWidget(self.ExportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.exportFilterWidget.setObjectName("exportFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenLPExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPExportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ExportPushButton.setObjectName("ExportPushButton")
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPExportForm.close)
QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPExportForm)
def retranslateUi(self):
self.OpenLPExportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPExportForm", "openlp.org Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select openlp.org export filename:", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
self.ExportPushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenLPExportForm.show()

View File

@ -1,299 +1,310 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\openlpimportform.ui'
#
# Created: Wed Nov 05 20:56:08 2008
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from openlp.resources import *
class OpenLPImportForm(object):
def __init__(self):
self.OpenLPImportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenLPImportForm.setObjectName("OpenLPImportForm")
self.OpenLPImportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPImportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPImportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ImportFileWidget = QtGui.QWidget(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
self.ImportFileWidget.setObjectName("ImportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
self.ImportFileLabel.setObjectName("ImportFileLabel")
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ImportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ImportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ImportFileSongListWidget.setSizePolicy(sizePolicy)
self.ImportFileSongListWidget.setObjectName("ImportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ImportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ImportListLabel = QtGui.QLabel(self.ImportFileSongListWidget)
self.ImportListLabel.setObjectName("ImportListLabel")
self.verticalLayout.addWidget(self.ImportListLabel)
self.ImportListTable = QtGui.QTableWidget(self.ImportFileSongListWidget)
self.ImportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ImportListTable.setShowGrid(False)
self.ImportListTable.setWordWrap(False)
self.ImportListTable.setCornerButtonEnabled(False)
self.ImportListTable.setObjectName("ImportListTable")
self.ImportListTable.setColumnCount(2)
self.ImportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ImportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ImportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ImportListTable)
self.ImportSelectAllWidget = QtGui.QWidget(self.ImportFileSongListWidget)
self.ImportSelectAllWidget.setObjectName("ImportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ImportSelectAllPushButton = QtGui.QPushButton(self.ImportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ImportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ImportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/imports/import_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportSelectAllPushButton.setIcon(icon2)
self.ImportSelectAllPushButton.setObjectName("ImportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ImportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ImportSelectAllWidget)
self.importFilterWidget = QtGui.QWidget(self.ImportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.importFilterWidget.sizePolicy().hasHeightForWidth())
self.importFilterWidget.setSizePolicy(sizePolicy)
self.importFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.importFilterWidget.setObjectName("importFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.importFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ImportFilterComboBox = QtGui.QComboBox(self.importFilterWidget)
self.ImportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ImportFilterComboBox.setObjectName("ImportFilterComboBox")
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ImportFilterComboBox)
self.importFilterLineEdit = QtGui.QLineEdit(self.importFilterWidget)
self.importFilterLineEdit.setObjectName("importFilterLineEdit")
self.horizontalLayout_3.addWidget(self.importFilterLineEdit)
self.verticalLayout.addWidget(self.importFilterWidget)
self.horizontalLayout_6.addWidget(self.ImportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/imports/import_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/imports/import_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(0))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPImportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ImportPushButton.setObjectName("ImportPushButton")
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPImportForm.close)
QtCore.QObject.connect(self.ImportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ImportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPImportForm)
def retranslateUi(self):
self.OpenLPImportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPImportForm", "openlp.org Song Importer", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select openlp.org songfile to import:", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import File Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ImportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPImportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPImportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Import List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
self.ImportPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenLPImportForm.show()
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
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.core.resources import *
class OpenLPImportForm(object):
def __init__(self):
self.OpenLPImportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenLPImportForm.setObjectName("OpenLPImportForm")
self.OpenLPImportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPImportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPImportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ImportFileWidget = QtGui.QWidget(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
self.ImportFileWidget.setObjectName("ImportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
self.ImportFileLabel.setObjectName("ImportFileLabel")
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ImportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ImportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ImportFileSongListWidget.setSizePolicy(sizePolicy)
self.ImportFileSongListWidget.setObjectName("ImportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ImportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ImportListLabel = QtGui.QLabel(self.ImportFileSongListWidget)
self.ImportListLabel.setObjectName("ImportListLabel")
self.verticalLayout.addWidget(self.ImportListLabel)
self.ImportListTable = QtGui.QTableWidget(self.ImportFileSongListWidget)
self.ImportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ImportListTable.setShowGrid(False)
self.ImportListTable.setWordWrap(False)
self.ImportListTable.setCornerButtonEnabled(False)
self.ImportListTable.setObjectName("ImportListTable")
self.ImportListTable.setColumnCount(2)
self.ImportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ImportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ImportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ImportListTable)
self.ImportSelectAllWidget = QtGui.QWidget(self.ImportFileSongListWidget)
self.ImportSelectAllWidget.setObjectName("ImportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ImportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ImportSelectAllPushButton = QtGui.QPushButton(self.ImportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ImportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ImportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/imports/import_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportSelectAllPushButton.setIcon(icon2)
self.ImportSelectAllPushButton.setObjectName("ImportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ImportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ImportSelectAllWidget)
self.importFilterWidget = QtGui.QWidget(self.ImportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.importFilterWidget.sizePolicy().hasHeightForWidth())
self.importFilterWidget.setSizePolicy(sizePolicy)
self.importFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.importFilterWidget.setObjectName("importFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.importFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ImportFilterComboBox = QtGui.QComboBox(self.importFilterWidget)
self.ImportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ImportFilterComboBox.setObjectName("ImportFilterComboBox")
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.ImportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ImportFilterComboBox)
self.importFilterLineEdit = QtGui.QLineEdit(self.importFilterWidget)
self.importFilterLineEdit.setObjectName("importFilterLineEdit")
self.horizontalLayout_3.addWidget(self.importFilterLineEdit)
self.verticalLayout.addWidget(self.importFilterWidget)
self.horizontalLayout_6.addWidget(self.ImportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/imports/import_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/imports/import_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenLPImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(0))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenLPImportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ImportPushButton.setObjectName("ImportPushButton")
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenLPImportForm.close)
QtCore.QObject.connect(self.ImportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ImportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenLPImportForm)
def retranslateUi(self):
self.OpenLPImportForm.setWindowTitle(QtGui.QApplication.translate("OpenLPImportForm", "openlp.org Song Importer", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select openlp.org songfile to import:", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import File Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ImportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ImportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenLPImportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenLPImportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Import List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenLPImportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenLPImportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenLPImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenLPImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
self.ImportPushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenLPImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenLPImportForm.show()

View File

@ -1,299 +1,310 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\opensongexportform.ui'
#
# Created: Wed Nov 05 20:56:41 2008
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from openlp.resources import *
class OpenSongExportForm(object):
def __init__(self):
self.OpenSongExportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenSongExportForm.setObjectName("OpenSongExportForm")
self.OpenSongExportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenSongExportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ExportFileWidget = QtGui.QWidget(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
self.ExportFileWidget.setObjectName("ExportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
self.ExportFileLabel.setObjectName("ExportFileLabel")
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
self.ExportListLabel.setObjectName("ExportListLabel")
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
self.ExportListTable.setObjectName("ExportListTable")
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ExportSelectAllWidget)
self.exportFilterWidget = QtGui.QWidget(self.ExportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.exportFilterWidget.setObjectName("exportFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongExportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ExportPushButton.setObjectName("ExportPushButton")
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongExportForm.close)
QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongExportForm)
def retranslateUi(self):
self.OpenSongExportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongExportForm", "OpenSong Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select OpenSong song folder:", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenSongExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenSongExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
self.ExportPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenSongExportForm.show()
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
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.core.resources import *
class OpenSongExportForm(object):
def __init__(self):
self.OpenSongExportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenSongExportForm.setObjectName("OpenSongExportForm")
self.OpenSongExportForm.resize(473, 459)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenSongExportForm)
self.verticalLayout_5.setMargin(8)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.ExportFileWidget = QtGui.QWidget(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileWidget.sizePolicy().hasHeightForWidth())
self.ExportFileWidget.setSizePolicy(sizePolicy)
self.ExportFileWidget.setObjectName("ExportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ExportFileWidget)
self.horizontalLayout.setSpacing(3)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ExportFileLabel = QtGui.QLabel(self.ExportFileWidget)
self.ExportFileLabel.setObjectName("ExportFileLabel")
self.horizontalLayout.addWidget(self.ExportFileLabel)
self.ExportFileLineEdit = QtGui.QLineEdit(self.ExportFileWidget)
self.ExportFileLineEdit.setObjectName("ExportFileLineEdit")
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportFileSelectPushButton.setIcon(icon1)
self.ExportFileSelectPushButton.setObjectName("ExportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
self.verticalLayout_5.addWidget(self.ExportFileWidget)
self.SongListFrame = QtGui.QFrame(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongListFrame.sizePolicy().hasHeightForWidth())
self.SongListFrame.setSizePolicy(sizePolicy)
self.SongListFrame.setFrameShape(QtGui.QFrame.Box)
self.SongListFrame.setFrameShadow(QtGui.QFrame.Raised)
self.SongListFrame.setObjectName("SongListFrame")
self.horizontalLayout_6 = QtGui.QHBoxLayout(self.SongListFrame)
self.horizontalLayout_6.setSpacing(8)
self.horizontalLayout_6.setMargin(8)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.ExportFileSongListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportFileSongListWidget.sizePolicy().hasHeightForWidth())
self.ExportFileSongListWidget.setSizePolicy(sizePolicy)
self.ExportFileSongListWidget.setObjectName("ExportFileSongListWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.ExportFileSongListWidget)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.ExportListLabel = QtGui.QLabel(self.ExportFileSongListWidget)
self.ExportListLabel.setObjectName("ExportListLabel")
self.verticalLayout.addWidget(self.ExportListLabel)
self.ExportListTable = QtGui.QTableWidget(self.ExportFileSongListWidget)
self.ExportListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.ExportListTable.setShowGrid(False)
self.ExportListTable.setWordWrap(False)
self.ExportListTable.setCornerButtonEnabled(False)
self.ExportListTable.setObjectName("ExportListTable")
self.ExportListTable.setColumnCount(2)
self.ExportListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.ExportListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout.addWidget(self.ExportListTable)
self.ExportSelectAllWidget = QtGui.QWidget(self.ExportFileSongListWidget)
self.ExportSelectAllWidget.setObjectName("ExportSelectAllWidget")
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.ExportSelectAllWidget)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setMargin(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.ExportSelectAllPushButton = QtGui.QPushButton(self.ExportSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ExportSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.ExportSelectAllPushButton.setSizePolicy(sizePolicy)
self.ExportSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/exports/export_selectall.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ExportSelectAllPushButton.setIcon(icon2)
self.ExportSelectAllPushButton.setObjectName("ExportSelectAllPushButton")
self.horizontalLayout_2.addWidget(self.ExportSelectAllPushButton)
spacerItem = QtGui.QSpacerItem(89, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addWidget(self.ExportSelectAllWidget)
self.exportFilterWidget = QtGui.QWidget(self.ExportFileSongListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exportFilterWidget.sizePolicy().hasHeightForWidth())
self.exportFilterWidget.setSizePolicy(sizePolicy)
self.exportFilterWidget.setMinimumSize(QtCore.QSize(0, 0))
self.exportFilterWidget.setObjectName("exportFilterWidget")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.exportFilterWidget)
self.horizontalLayout_3.setMargin(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.ExportFilterComboBox = QtGui.QComboBox(self.exportFilterWidget)
self.ExportFilterComboBox.setMinimumSize(QtCore.QSize(70, 0))
self.ExportFilterComboBox.setObjectName("ExportFilterComboBox")
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.ExportFilterComboBox.addItem(QtCore.QString())
self.horizontalLayout_3.addWidget(self.ExportFilterComboBox)
self.ExportFilterLineEdit = QtGui.QLineEdit(self.exportFilterWidget)
self.ExportFilterLineEdit.setObjectName("ExportFilterLineEdit")
self.horizontalLayout_3.addWidget(self.ExportFilterLineEdit)
self.verticalLayout.addWidget(self.exportFilterWidget)
self.horizontalLayout_6.addWidget(self.ExportFileSongListWidget)
self.AddSelectedWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedWidget.sizePolicy().hasHeightForWidth())
self.AddSelectedWidget.setSizePolicy(sizePolicy)
self.AddSelectedWidget.setObjectName("AddSelectedWidget")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.AddSelectedWidget)
self.verticalLayout_3.setMargin(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem1)
self.AddSelectedPushButton = QtGui.QPushButton(self.AddSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AddSelectedPushButton.sizePolicy().hasHeightForWidth())
self.AddSelectedPushButton.setSizePolicy(sizePolicy)
self.AddSelectedPushButton.setMinimumSize(QtCore.QSize(25, 25))
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddSelectedPushButton.setIcon(icon3)
self.AddSelectedPushButton.setObjectName("AddSelectedPushButton")
self.verticalLayout_3.addWidget(self.AddSelectedPushButton)
spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem2)
self.horizontalLayout_6.addWidget(self.AddSelectedWidget)
self.SelectedFileListWidget = QtGui.QWidget(self.SongListFrame)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedFileListWidget.sizePolicy().hasHeightForWidth())
self.SelectedFileListWidget.setSizePolicy(sizePolicy)
self.SelectedFileListWidget.setObjectName("SelectedFileListWidget")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.SelectedFileListWidget)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.SelectedListLabel = QtGui.QLabel(self.SelectedFileListWidget)
self.SelectedListLabel.setObjectName("SelectedListLabel")
self.verticalLayout_2.addWidget(self.SelectedListLabel)
self.SelectedListTable = QtGui.QTableWidget(self.SelectedFileListWidget)
self.SelectedListTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.SelectedListTable.setShowGrid(False)
self.SelectedListTable.setWordWrap(False)
self.SelectedListTable.setCornerButtonEnabled(False)
self.SelectedListTable.setObjectName("SelectedListTable")
self.SelectedListTable.setColumnCount(2)
self.SelectedListTable.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.SelectedListTable.setHorizontalHeaderItem(1, item)
self.verticalLayout_2.addWidget(self.SelectedListTable)
self.SelectedSelectAllWidget = QtGui.QWidget(self.SelectedFileListWidget)
self.SelectedSelectAllWidget.setObjectName("SelectedSelectAllWidget")
self.horizontalLayout_4 = QtGui.QHBoxLayout(self.SelectedSelectAllWidget)
self.horizontalLayout_4.setSpacing(6)
self.horizontalLayout_4.setMargin(0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.SelectedSelectAllPushButton = QtGui.QPushButton(self.SelectedSelectAllWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedSelectAllPushButton.sizePolicy().hasHeightForWidth())
self.SelectedSelectAllPushButton.setSizePolicy(sizePolicy)
self.SelectedSelectAllPushButton.setMinimumSize(QtCore.QSize(100, 0))
self.SelectedSelectAllPushButton.setIcon(icon2)
self.SelectedSelectAllPushButton.setObjectName("SelectedSelectAllPushButton")
self.horizontalLayout_4.addWidget(self.SelectedSelectAllPushButton)
spacerItem3 = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem3)
self.verticalLayout_2.addWidget(self.SelectedSelectAllWidget)
self.SelectedRemoveSelectedWidget = QtGui.QWidget(self.SelectedFileListWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedWidget.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedWidget.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedWidget.setObjectName("SelectedRemoveSelectedWidget")
self.horizontalLayout_5 = QtGui.QHBoxLayout(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_5.setMargin(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.SelectedRemoveSelectedButton = QtGui.QPushButton(self.SelectedRemoveSelectedWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SelectedRemoveSelectedButton.sizePolicy().hasHeightForWidth())
self.SelectedRemoveSelectedButton.setSizePolicy(sizePolicy)
self.SelectedRemoveSelectedButton.setMinimumSize(QtCore.QSize(140, 0))
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/exports/export_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SelectedRemoveSelectedButton.setIcon(icon4)
self.SelectedRemoveSelectedButton.setObjectName("SelectedRemoveSelectedButton")
self.horizontalLayout_5.addWidget(self.SelectedRemoveSelectedButton)
spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem4)
self.verticalLayout_2.addWidget(self.SelectedRemoveSelectedWidget)
self.horizontalLayout_6.addWidget(self.SelectedFileListWidget)
self.verticalLayout_5.addWidget(self.SongListFrame)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenSongExportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setContentsMargins(8, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout_5.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongExportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem5 = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem5)
self.ExportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ExportPushButton.setObjectName("ExportPushButton")
self.horizontalLayout_7.addWidget(self.ExportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout_5.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongExportForm.close)
QtCore.QObject.connect(self.ExportSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.ExportListTable.selectAll)
QtCore.QObject.connect(self.SelectedSelectAllPushButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.selectAll)
QtCore.QObject.connect(self.SelectedRemoveSelectedButton, QtCore.SIGNAL("clicked()"), self.SelectedListTable.clear)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongExportForm)
def retranslateUi(self):
self.OpenSongExportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongExportForm", "OpenSong Song Exporter", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFileLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select OpenSong song folder:", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Full Song List", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.ExportSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(0, QtGui.QApplication.translate("OpenSongExportForm", "Lyrics", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(1, QtGui.QApplication.translate("OpenSongExportForm", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.ExportFilterComboBox.setItemText(2, QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Export List", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("OpenSongExportForm", "Song Title", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedListTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("OpenSongExportForm", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedSelectAllPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Select All", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedRemoveSelectedButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Remove Selected", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongExportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongExportForm", "Ready to export", None, QtGui.QApplication.UnicodeUTF8))
self.ExportPushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Export", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongExportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenSongExportForm.show()

View File

@ -1,102 +1,113 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\opensongimportform.ui'
#
# Created: Wed Nov 05 20:56:54 2008
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from openlp.resources import *
class OpenSongImportForm(object):
def __init__(self):
self.OpenSongImportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenSongImportForm.setObjectName("OpenSongImportForm")
self.OpenSongImportForm.resize(481, 153)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongImportForm.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(self.OpenSongImportForm)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(8)
self.verticalLayout.setObjectName("verticalLayout")
self.ImportFileWidget = QtGui.QWidget(self.OpenSongImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
self.ImportFileWidget.setObjectName("ImportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
self.ImportFileLabel.setObjectName("ImportFileLabel")
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout.addWidget(self.ImportFileWidget)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenSongImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(6)
self.verticalLayout_4.setContentsMargins(6, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongImportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ImportPushButton.setObjectName("ImportPushButton")
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongImportForm.close)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongImportForm)
def retranslateUi(self):
self.OpenSongImportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Song Importer", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Folder:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
self.ImportPushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenSongImportForm.show()
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
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.core.resources import *
class OpenSongImportForm(object):
def __init__(self):
self.OpenSongImportForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.OpenSongImportForm.setObjectName("OpenSongImportForm")
self.OpenSongImportForm.resize(481, 153)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongImportForm.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(self.OpenSongImportForm)
self.verticalLayout.setSpacing(6)
self.verticalLayout.setMargin(8)
self.verticalLayout.setObjectName("verticalLayout")
self.ImportFileWidget = QtGui.QWidget(self.OpenSongImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ImportFileWidget.sizePolicy().hasHeightForWidth())
self.ImportFileWidget.setSizePolicy(sizePolicy)
self.ImportFileWidget.setObjectName("ImportFileWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.ImportFileWidget)
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setMargin(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.ImportFileLabel = QtGui.QLabel(self.ImportFileWidget)
self.ImportFileLabel.setObjectName("ImportFileLabel")
self.horizontalLayout.addWidget(self.ImportFileLabel)
self.ImportFileLineEdit = QtGui.QLineEdit(self.ImportFileWidget)
self.ImportFileLineEdit.setObjectName("ImportFileLineEdit")
self.horizontalLayout.addWidget(self.ImportFileLineEdit)
self.ImportFileSelectPushButton = QtGui.QPushButton(self.ImportFileWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/imports/import_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ImportFileSelectPushButton.setIcon(icon1)
self.ImportFileSelectPushButton.setObjectName("ImportFileSelectPushButton")
self.horizontalLayout.addWidget(self.ImportFileSelectPushButton)
self.verticalLayout.addWidget(self.ImportFileWidget)
self.ProgressGroupBox = QtGui.QGroupBox(self.OpenSongImportForm)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ProgressGroupBox.sizePolicy().hasHeightForWidth())
self.ProgressGroupBox.setSizePolicy(sizePolicy)
self.ProgressGroupBox.setObjectName("ProgressGroupBox")
self.verticalLayout_4 = QtGui.QVBoxLayout(self.ProgressGroupBox)
self.verticalLayout_4.setSpacing(6)
self.verticalLayout_4.setContentsMargins(6, 0, 8, 8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.ProgressLabel = QtGui.QLabel(self.ProgressGroupBox)
self.ProgressLabel.setObjectName("ProgressLabel")
self.verticalLayout_4.addWidget(self.ProgressLabel)
self.ProgressBar = QtGui.QProgressBar(self.ProgressGroupBox)
self.ProgressBar.setProperty("value", QtCore.QVariant(24))
self.ProgressBar.setObjectName("ProgressBar")
self.verticalLayout_4.addWidget(self.ProgressBar)
self.verticalLayout.addWidget(self.ProgressGroupBox)
self.ButtonBarWidget = QtGui.QWidget(self.OpenSongImportForm)
self.ButtonBarWidget.setObjectName("ButtonBarWidget")
self.horizontalLayout_7 = QtGui.QHBoxLayout(self.ButtonBarWidget)
self.horizontalLayout_7.setSpacing(8)
self.horizontalLayout_7.setMargin(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
spacerItem = QtGui.QSpacerItem(288, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem)
self.ImportPushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ImportPushButton.setObjectName("ImportPushButton")
self.horizontalLayout_7.addWidget(self.ImportPushButton)
self.ClosePushButton = QtGui.QPushButton(self.ButtonBarWidget)
self.ClosePushButton.setObjectName("ClosePushButton")
self.horizontalLayout_7.addWidget(self.ClosePushButton)
self.verticalLayout.addWidget(self.ButtonBarWidget)
self.retranslateUi()
QtCore.QObject.connect(self.ClosePushButton, QtCore.SIGNAL("clicked()"), self.OpenSongImportForm.close)
QtCore.QMetaObject.connectSlotsByName(self.OpenSongImportForm)
def retranslateUi(self):
self.OpenSongImportForm.setWindowTitle(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Song Importer", None, QtGui.QApplication.UnicodeUTF8))
self.ImportFileLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "OpenSong Folder:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressGroupBox.setTitle(QtGui.QApplication.translate("OpenSongImportForm", "Progress:", None, QtGui.QApplication.UnicodeUTF8))
self.ProgressLabel.setText(QtGui.QApplication.translate("OpenSongImportForm", "Ready to import", None, QtGui.QApplication.UnicodeUTF8))
self.ImportPushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Import", None, QtGui.QApplication.UnicodeUTF8))
self.ClosePushButton.setText(QtGui.QApplication.translate("OpenSongImportForm", "Close", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.OpenSongImportForm.show()

View File

@ -19,6 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
from PyQt4 import QtCore, QtGui
from openlp.core.resources import *
from openlp.core.lib import Plugin, MediaManagerItem
from forms import EditSongForm
@ -27,16 +28,16 @@ class SongsPlugin(Plugin):
def __init__(self):
# Call the parent constructor
Plugin.__init__(self, 'Songs', '1.9.0')
self.Weight = -10
self.weight = -10
self.edit_song_form = EditSongForm()
def getMediaManagerItem(self):
# Create the plugin icon
self.Icon = QtGui.QIcon()
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_media_manager_item(self):
# Create the MediaManagerItem object
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Songs')
self.MediaManagerItem = MediaManagerItem(self.icon, 'Songs')
# Add a toolbar
self.MediaManagerItem.addToolbar()
# Create buttons for the toolbar
@ -62,55 +63,52 @@ class SongsPlugin(Plugin):
'Add the selected song(s) to the service', ':/system/system_add.png',
self.onSongAddClick, 'SongAddItem')
## Add the songlist widget ##
# Create the tab widget
self.SongGroupBox = QtGui.QGroupBox(self.MediaManagerItem)
self.SongWidget = QtGui.QWidget(self.MediaManagerItem)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongGroupBox.sizePolicy().hasHeightForWidth())
self.SongGroupBox.setSizePolicy(sizePolicy)
self.SongGroupBox.setObjectName('SearchTabWidget')
sizePolicy.setHeightForWidth(self.SongWidget.sizePolicy().hasHeightForWidth())
self.SongWidget.setSizePolicy(sizePolicy)
self.SongWidget.setObjectName('SongWidget')
self.QuickLayout = QtGui.QGridLayout(self.SongGroupBox)
self.QuickLayout.setObjectName('QuickLayout')
self.SearchTypeComboBox = QtGui.QComboBox(self.SongGroupBox)
self.SearchTypeComboBox.setObjectName('VersionComboBox')
self.QuickLayout.addWidget(self.SearchTypeComboBox, 0, 1, 1, 2)
self.SearchTypeLabel = QtGui.QLabel(self.SongGroupBox)
self.SearchLayout = QtGui.QGridLayout(self.SongWidget)
self.SearchLayout.setObjectName('SearchLayout')
self.SearchTypeComboBox = QtGui.QComboBox(self.SongWidget)
self.SearchTypeComboBox.setObjectName('SearchTypeComboBox')
self.SearchLayout.addWidget(self.SearchTypeComboBox, 0, 1, 1, 2)
self.SearchTypeLabel = QtGui.QLabel(self.SongWidget)
self.SearchTypeLabel.setObjectName('SearchTypeLabel')
self.SearchTypeLabel.setText('Search Type:')
self.QuickLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
self.SearchLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
self.SearchTextLabel = QtGui.QLabel(self.SongGroupBox)
self.SearchTextLabel = QtGui.QLabel(self.SongWidget)
self.SearchTextLabel.setObjectName('SearchTextLabel')
self.SearchTextLabel.setText('Search Text:')
self.QuickLayout.addWidget(self.SearchTextLabel, 2, 0, 1, 1)
self.SearchTextEdit = QtGui.QLineEdit(self.SongGroupBox)
self.SearchLayout.addWidget(self.SearchTextLabel, 2, 0, 1, 1)
self.SearchTextEdit = QtGui.QLineEdit(self.SongWidget)
self.SearchTextEdit.setObjectName('SearchTextEdit')
self.QuickLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
self.SearchTextButton = QtGui.QPushButton(self.SongGroupBox)
self.SearchLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
self.SearchTextButton = QtGui.QPushButton(self.SongWidget)
self.SearchTextButton.setObjectName('SearchTextButton')
self.SearchTextButton.setText('Search')
self.QuickLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.QuickLayout.addItem(QuickSpacerItem, 4, 2, 1, 1)
self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
# Add the search tab widget to the page layout
self.MediaManagerItem.PageLayout.addWidget(self.SongGroupBox)
# Add the song widget to the page layout
self.MediaManagerItem.PageLayout.addWidget(self.SongWidget)
self.listView = QtGui.QListWidget()
self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591))
self.listView.setObjectName("listView")
self.MediaManagerItem.PageLayout.addWidget(self.listView)
self.MediaManagerItem.PageLayout.addWidget(self.listView)
return self.MediaManagerItem
def initalise_ui(self):
def initalise(self):
self.SearchTypeComboBox.addItem("Lyrics")
self.SearchTypeComboBox.addItem("Titles")
self.SearchTypeComboBox.addItem("Authors")
self.SearchTypeComboBox.addItem("Authors")
def onSongNewClick(self):
pass

View File

@ -1,181 +1,184 @@
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Carsten Tinggaard
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
"""
import py.test
import os
import sys
sys.path.append(os.path.abspath("./../../../.."))
from openlp.plugins.songs.songxml import *
class Test_Basic(object):
"""Class for first initialization check
set-get functions
"""
def test_Creation(self):
"""Init: Create as empty"""
s = Song()
assert(True)
def test_str(self):
"""Init: Empty, use __str__ to count public attributes & methods"""
s = Song()
r = s.__str__()
l = r.split("\n")
assert(len(l) == 55)
def test_asString(self):
"""Init: Empty asString - initial values"""
s = Song()
r = s._get_as_string()
#print r
flag = r.endswith("__None__None__None__None__None__None__1__1__1__1__[]__None__None__None__None__BlankSong__None_")
assert(flag)
def test_Title1(self):
"""Set an empty title - raises an exception"""
s = Song()
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
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
"""
import py.test
import os
import sys
sys.path.append(os.path.abspath("./../../../.."))
from openlp.plugins.songs.songxml import *
class Test_Basic(object):
"""Class for first initialization check
set-get functions
"""
def test_Creation(self):
"""Init: Create as empty"""
s = Song()
assert(True)
def test_str(self):
"""Init: Empty, use __str__ to count public attributes & methods"""
s = Song()
r = s.__str__()
l = r.split("\n")
assert(len(l) == 55)
def test_asString(self):
"""Init: Empty asString - initial values"""
s = Song()
r = s._get_as_string()
#print r
flag = r.endswith("__None__None__None__None__None__None__1__1__1__1__[]__None__None__None__None__BlankSong__None_")
assert(flag)
def test_Title1(self):
"""Set an empty title - raises an exception"""
s = Song()
py.test.raises(SongTitleError, s.SetTitle, "")
def test_Title2(self):
"""Set a normal title"""
s = Song()
t = "A normal title"
s.SetTitle(t)
assert(s.GetTitle() == t)
assert(s.GetSearchableTitle() == t)
def test_Title3(self):
"""Set a titel with punctuation 1"""
s = Song()
t1 = "Hey! Come on, ya programmers*"
t2 = "Hey Come on ya programmers"
s.SetTitle(t1)
assert(s.GetTitle() == t1)
assert(s.GetSearchableTitle() == t2)
def test_Title4(self):
"""Set a titel with punctuation 2"""
s = Song()
t1 = "??#Hey! Come on, ya programmers*"
t2 = "Hey Come on ya programmers"
s.SetTitle(t1)
assert(s.GetTitle() == t1)
assert(s.GetSearchableTitle() == t2)
def test_Title5(self):
"""Set a title, where searchable title becomes empty - raises an exception"""
s = Song()
def test_Title2(self):
"""Set a normal title"""
s = Song()
t = "A normal title"
s.SetTitle(t)
assert(s.GetTitle() == t)
assert(s.GetSearchableTitle() == t)
def test_Title3(self):
"""Set a titel with punctuation 1"""
s = Song()
t1 = "Hey! Come on, ya programmers*"
t2 = "Hey Come on ya programmers"
s.SetTitle(t1)
assert(s.GetTitle() == t1)
assert(s.GetSearchableTitle() == t2)
def test_Title4(self):
"""Set a titel with punctuation 2"""
s = Song()
t1 = "??#Hey! Come on, ya programmers*"
t2 = "Hey Come on ya programmers"
s.SetTitle(t1)
assert(s.GetTitle() == t1)
assert(s.GetSearchableTitle() == t2)
def test_Title5(self):
"""Set a title, where searchable title becomes empty - raises an exception"""
s = Song()
py.test.raises(SongTitleError, s.SetTitle, ",*")
def test_Copyright(self):
"""Set a copyright string"""
s = Song()
assert(s.GetCopyright() == "")
s.SetCopyright("A B Car")
assert(s.GetCopyright() == "A B Car")
def test_SongCclino(self):
"""Set a SongCcliNo"""
s = Song()
assert(s.GetSongCcliNo() == "")
s.SetSongCcliNo(12345)
assert(s.GetSongCcliNo() == "12345")
def test_SongBook(self):
"""Set a songbook value"""
s = Song()
assert(s.GetSongBook() == "")
s.SetSongBook("Hymns")
assert(s.GetSongBook() == "Hymns")
def test_SongNumber(self):
"""Set a song number"""
s = Song()
assert(s.GetSongNumber() == "")
s.SetSongNumber(278)
assert(s.GetSongNumber() == "278")
def test_Theme(self):
"""Set a theme name"""
s = Song()
assert(s.GetTheme() == "")
s.SetTheme("Red")
assert(s.GetTheme() == "Red")
def test_VerseOrder(self):
"""Set a verse order"""
s = Song()
assert(s.GetVerseOrder() == "")
s.SetVerseOrder("V1 C V2")
assert(s.GetVerseOrder() == "V1 C V2")
def test_Comments(self):
"""Set a comment"""
s = Song()
assert(s.GetComments() == "")
s.SetComments("a comment")
assert(s.GetComments() == "a comment")
def test_AuthorList(self):
"""Set author lists"""
s = Song()
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [])
t1 = "John Newton"
s.SetAuthorList(t1)
assert(s.GetAuthorList(True) == t1)
assert(s.GetAuthorList(False) == [t1])
s.SetAuthorList(" Peter Done , John Newton")
assert(s.GetAuthorList(True)== "Peter Done, John Newton")
assert(s.GetAuthorList(False) == ["Peter Done", "John Newton"])
s.SetAuthorList(None)
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [])
s.SetAuthorList("")
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [""])
s.SetAuthorList([])
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [""])
def test_CategoryArray(self):
"""Set categories"""
s = Song()
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [])
t1 = "Gospel"
s.SetCategoryArray(t1)
assert(s.GetCategoryArray(True) == t1)
assert(s.GetCategoryArray(False) == [t1])
s.SetCategoryArray(" Gospel, Hymns ")
assert(s.GetCategoryArray(True) == "Gospel, Hymns")
assert(s.GetCategoryArray(False) == ["Gospel", "Hymns"])
s.SetCategoryArray(None)
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [])
s.SetCategoryArray("")
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [""])
s.SetCategoryArray([])
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [""])
if '__main__' == __name__:
r = Test_Basic()
r.test_asString()
def test_Copyright(self):
"""Set a copyright string"""
s = Song()
assert(s.GetCopyright() == "")
s.SetCopyright("A B Car")
assert(s.GetCopyright() == "A B Car")
def test_SongCclino(self):
"""Set a SongCcliNo"""
s = Song()
assert(s.GetSongCcliNo() == "")
s.SetSongCcliNo(12345)
assert(s.GetSongCcliNo() == "12345")
def test_SongBook(self):
"""Set a songbook value"""
s = Song()
assert(s.GetSongBook() == "")
s.SetSongBook("Hymns")
assert(s.GetSongBook() == "Hymns")
def test_SongNumber(self):
"""Set a song number"""
s = Song()
assert(s.GetSongNumber() == "")
s.SetSongNumber(278)
assert(s.GetSongNumber() == "278")
def test_Theme(self):
"""Set a theme name"""
s = Song()
assert(s.GetTheme() == "")
s.SetTheme("Red")
assert(s.GetTheme() == "Red")
def test_VerseOrder(self):
"""Set a verse order"""
s = Song()
assert(s.GetVerseOrder() == "")
s.SetVerseOrder("V1 C V2")
assert(s.GetVerseOrder() == "V1 C V2")
def test_Comments(self):
"""Set a comment"""
s = Song()
assert(s.GetComments() == "")
s.SetComments("a comment")
assert(s.GetComments() == "a comment")
def test_AuthorList(self):
"""Set author lists"""
s = Song()
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [])
t1 = "John Newton"
s.SetAuthorList(t1)
assert(s.GetAuthorList(True) == t1)
assert(s.GetAuthorList(False) == [t1])
s.SetAuthorList(" Peter Done , John Newton")
assert(s.GetAuthorList(True)== "Peter Done, John Newton")
assert(s.GetAuthorList(False) == ["Peter Done", "John Newton"])
s.SetAuthorList(None)
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [])
s.SetAuthorList("")
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [""])
s.SetAuthorList([])
assert(s.GetAuthorList(True) == "")
assert(s.GetAuthorList(False) == [""])
def test_CategoryArray(self):
"""Set categories"""
s = Song()
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [])
t1 = "Gospel"
s.SetCategoryArray(t1)
assert(s.GetCategoryArray(True) == t1)
assert(s.GetCategoryArray(False) == [t1])
s.SetCategoryArray(" Gospel, Hymns ")
assert(s.GetCategoryArray(True) == "Gospel, Hymns")
assert(s.GetCategoryArray(False) == ["Gospel", "Hymns"])
s.SetCategoryArray(None)
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [])
s.SetCategoryArray("")
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [""])
s.SetCategoryArray([])
assert(s.GetCategoryArray(True) == "")
assert(s.GetCategoryArray(False) == [""])
if '__main__' == __name__:
r = Test_Basic()
r.test_asString()

View File

@ -3,7 +3,7 @@ suffix name = bible3
[main]
themes path = themes
data path = /home/timali/.openlp/data
data path = /home/raoul/.openlp/data
[songs]
file name = songs.sqlite