forked from openlp/openlp
Added the song import menu items, and made the openlp.org 1.0 item show an import form.
bzr-revno: 233
This commit is contained in:
parent
fc4e947be0
commit
b7008f7b62
@ -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-14, 22:42:29 -->
|
||||
<!-- Saved: 2008-12-16, 23:58:55 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<UserProject version="4.0">
|
||||
</UserProject>
|
@ -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-14, 22:42:29 -->
|
||||
<!-- Saved: 2008-12-16, 23:58:55 -->
|
||||
<Tasks version="4.2">
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
|
||||
|
@ -44,10 +44,10 @@ class Plugin(object):
|
||||
Provides the Plugin with a handle to check if it can be loaded.
|
||||
* 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.
|
||||
* add_import_menu_item(import_menu)
|
||||
Add an item to the Import menu.
|
||||
* add_export_menu_item(export_menu)
|
||||
Add an item to the Export menu.
|
||||
* get_settings_tab()
|
||||
Returns an instance of SettingsTab to be used in the Settings dialog.
|
||||
* add_to_menu(menubar)
|
||||
@ -103,13 +103,13 @@ class Plugin(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_import_menu_item(self):
|
||||
def add_import_menu_item(self, import_menu):
|
||||
"""
|
||||
Create a menu item and add it to the "Import" menu.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_export_menu_item(self):
|
||||
def add_export_menu_item(self, export_menu):
|
||||
"""
|
||||
Create a menu item and add it to the "Export" menu.
|
||||
"""
|
||||
|
@ -91,5 +91,9 @@ class PluginManager(object):
|
||||
mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
|
||||
plugin.initialise()
|
||||
|
||||
def hook_import_menu(self, import_menu):
|
||||
for plugin in self.plugins:
|
||||
plugin.add_import_menu_item(import_menu)
|
||||
|
||||
def hook_handle_event(self, event):
|
||||
pass
|
||||
|
@ -112,8 +112,9 @@ class MainWindow(object):
|
||||
self.FileMenu.setObjectName("FileMenu")
|
||||
self.FileImportMenu = QtGui.QMenu(self.FileMenu)
|
||||
self.FileImportMenu.setObjectName("FileImportMenu")
|
||||
self.ImportSongMenu = QtGui.QMenu(self.FileImportMenu)
|
||||
self.ImportSongMenu.setObjectName("ImportSongMenu")
|
||||
# Call the hook method to pull in import menus.
|
||||
self.plugin_manager.hook_import_menu(self.FileImportMenu)
|
||||
#
|
||||
self.FileExportMenu = QtGui.QMenu(self.FileMenu)
|
||||
self.FileExportMenu.setObjectName("FileExportMenu")
|
||||
self.ExportSongMenu = QtGui.QMenu(self.FileExportMenu)
|
||||
@ -331,12 +332,6 @@ class MainWindow(object):
|
||||
self.HelpOnlineHelpItem.setObjectName("HelpOnlineHelpItem")
|
||||
self.HelpWebSiteItem = QtGui.QAction(self.main_window)
|
||||
self.HelpWebSiteItem.setObjectName("HelpWebSiteItem")
|
||||
self.ImportOpenSongItem = QtGui.QAction(self.main_window)
|
||||
self.ImportOpenSongItem.setObjectName("ImportOpenSongItem")
|
||||
self.ImportOpenlp1Item = QtGui.QAction(self.main_window)
|
||||
self.ImportOpenlp1Item.setObjectName("ImportOpenlp1Item")
|
||||
self.ImportOpenlp2Item = QtGui.QAction(self.main_window)
|
||||
self.ImportOpenlp2Item.setObjectName("ImportOpenlp2Item")
|
||||
self.ExportOpenSongItem = QtGui.QAction(self.main_window)
|
||||
self.ExportOpenSongItem.setObjectName("ExportOpenSongItem")
|
||||
self.ExportOpenlp1Item = QtGui.QAction(self.main_window)
|
||||
@ -358,10 +353,6 @@ class MainWindow(object):
|
||||
self.action_Preview_Pane.setObjectName("action_Preview_Pane")
|
||||
self.ModeLiveItem = QtGui.QAction(self.main_window)
|
||||
self.ModeLiveItem.setObjectName("ModeLiveItem")
|
||||
self.ImportSongMenu.addAction(self.ImportOpenlp1Item)
|
||||
self.ImportSongMenu.addAction(self.ImportOpenlp2Item)
|
||||
self.ImportSongMenu.addAction(self.ImportOpenSongItem)
|
||||
self.FileImportMenu.addAction(self.ImportSongMenu.menuAction())
|
||||
self.FileImportMenu.addAction(self.ImportBibleItem)
|
||||
self.FileImportMenu.addAction(self.ImportThemeItem)
|
||||
self.FileImportMenu.addAction(self.ImportLanguageItem)
|
||||
@ -434,7 +425,6 @@ class MainWindow(object):
|
||||
self.main_window.setWindowTitle(QtGui.QApplication.translate("main_window", "openlp.org 2.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.FileMenu.setTitle(QtGui.QApplication.translate("main_window", "&File", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.FileImportMenu.setTitle(QtGui.QApplication.translate("main_window", "&Import", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportSongMenu.setTitle(QtGui.QApplication.translate("main_window", "&Song", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.FileExportMenu.setTitle(QtGui.QApplication.translate("main_window", "&Export", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ExportSongMenu.setTitle(QtGui.QApplication.translate("main_window", "&Song", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.OptionsMenu.setTitle(QtGui.QApplication.translate("main_window", "&Options", None, QtGui.QApplication.UnicodeUTF8))
|
||||
@ -509,13 +499,6 @@ class MainWindow(object):
|
||||
self.HelpAboutItem.setShortcut(QtGui.QApplication.translate("main_window", "Ctrl+F1", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.HelpOnlineHelpItem.setText(QtGui.QApplication.translate("main_window", "&Online Help", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.HelpWebSiteItem.setText(QtGui.QApplication.translate("main_window", "&Web Site", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenSongItem.setText(QtGui.QApplication.translate("main_window", "OpenSong", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setText(QtGui.QApplication.translate("main_window", "openlp.org 1.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setToolTip(QtGui.QApplication.translate("main_window", "Export songs in openlp.org 1.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setStatusTip(QtGui.QApplication.translate("main_window", "Export songs in openlp.org 1.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setText(QtGui.QApplication.translate("main_window", "OpenLP 2.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setToolTip(QtGui.QApplication.translate("main_window", "Export songs in OpenLP 2.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setStatusTip(QtGui.QApplication.translate("main_window", "Export songs in OpenLP 2.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ExportOpenSongItem.setText(QtGui.QApplication.translate("main_window", "OpenSong", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ExportOpenlp1Item.setText(QtGui.QApplication.translate("main_window", "openlp.org 1.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ExportOpenlp2Item.setText(QtGui.QApplication.translate("main_window", "OpenLP 2.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
|
@ -22,7 +22,7 @@ from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.resources import *
|
||||
from openlp.core.lib import Plugin, MediaManagerItem
|
||||
from forms import EditSongForm
|
||||
from forms import EditSongForm, OpenLPImportForm
|
||||
|
||||
class SongsPlugin(Plugin):
|
||||
def __init__(self):
|
||||
@ -30,6 +30,7 @@ class SongsPlugin(Plugin):
|
||||
Plugin.__init__(self, 'Songs', '1.9.0')
|
||||
self.weight = -10
|
||||
self.edit_song_form = EditSongForm()
|
||||
self.openlp_import_form = OpenLPImportForm()
|
||||
# Create the plugin icon
|
||||
self.icon = QtGui.QIcon()
|
||||
self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
|
||||
@ -63,7 +64,6 @@ 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.SongWidget = QtGui.QWidget(self.MediaManagerItem)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
@ -72,7 +72,6 @@ class SongsPlugin(Plugin):
|
||||
sizePolicy.setHeightForWidth(self.SongWidget.sizePolicy().hasHeightForWidth())
|
||||
self.SongWidget.setSizePolicy(sizePolicy)
|
||||
self.SongWidget.setObjectName('SongWidget')
|
||||
|
||||
self.SearchLayout = QtGui.QGridLayout(self.SongWidget)
|
||||
self.SearchLayout.setObjectName('SearchLayout')
|
||||
self.SearchTypeComboBox = QtGui.QComboBox(self.SongWidget)
|
||||
@ -82,7 +81,6 @@ class SongsPlugin(Plugin):
|
||||
self.SearchTypeLabel.setObjectName('SearchTypeLabel')
|
||||
self.SearchTypeLabel.setText('Search Type:')
|
||||
self.SearchLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
|
||||
|
||||
self.SearchTextLabel = QtGui.QLabel(self.SongWidget)
|
||||
self.SearchTextLabel.setObjectName('SearchTextLabel')
|
||||
self.SearchTextLabel.setText('Search Text:')
|
||||
@ -94,17 +92,39 @@ class SongsPlugin(Plugin):
|
||||
self.SearchTextButton.setObjectName('SearchTextButton')
|
||||
self.SearchTextButton.setText('Search')
|
||||
self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
|
||||
|
||||
# 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.SongListView = QtGui.QListWidget()
|
||||
self.SongListView.setGeometry(QtCore.QRect(10, 100, 256, 591))
|
||||
self.SongListView.setObjectName("listView")
|
||||
self.MediaManagerItem.PageLayout.addWidget(self.SongListView)
|
||||
return self.MediaManagerItem
|
||||
|
||||
def add_import_menu_item(self, import_menu):
|
||||
self.ImportSongMenu = QtGui.QMenu(import_menu)
|
||||
self.ImportSongMenu.setObjectName("ImportSongMenu")
|
||||
self.ImportOpenSongItem = QtGui.QAction(import_menu)
|
||||
self.ImportOpenSongItem.setObjectName("ImportOpenSongItem")
|
||||
self.ImportOpenlp1Item = QtGui.QAction(import_menu)
|
||||
self.ImportOpenlp1Item.setObjectName("ImportOpenlp1Item")
|
||||
self.ImportOpenlp2Item = QtGui.QAction(import_menu)
|
||||
self.ImportOpenlp2Item.setObjectName("ImportOpenlp2Item")
|
||||
self.ImportSongMenu.addAction(self.ImportOpenlp1Item)
|
||||
self.ImportSongMenu.addAction(self.ImportOpenlp2Item)
|
||||
self.ImportSongMenu.addAction(self.ImportOpenSongItem)
|
||||
import_menu.addAction(self.ImportSongMenu.menuAction())
|
||||
# Translations...
|
||||
self.ImportSongMenu.setTitle(QtGui.QApplication.translate("main_window", "&Song", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenSongItem.setText(QtGui.QApplication.translate("main_window", "OpenSong", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setText(QtGui.QApplication.translate("main_window", "openlp.org 1.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setToolTip(QtGui.QApplication.translate("main_window", "Export songs in openlp.org 1.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp1Item.setStatusTip(QtGui.QApplication.translate("main_window", "Export songs in openlp.org 1.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setText(QtGui.QApplication.translate("main_window", "OpenLP 2.0", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setToolTip(QtGui.QApplication.translate("main_window", "Export songs in OpenLP 2.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
self.ImportOpenlp2Item.setStatusTip(QtGui.QApplication.translate("main_window", "Export songs in OpenLP 2.0 format", None, QtGui.QApplication.UnicodeUTF8))
|
||||
# Signals and slots
|
||||
QtCore.QObject.connect(self.ImportOpenlp1Item, QtCore.SIGNAL("triggered()"), self.onImportOpenlp1ItemClick)
|
||||
|
||||
def initialise(self):
|
||||
self.SearchTypeComboBox.addItem("Lyrics")
|
||||
self.SearchTypeComboBox.addItem("Titles")
|
||||
@ -127,3 +147,6 @@ class SongsPlugin(Plugin):
|
||||
|
||||
def onSongAddClick(self):
|
||||
pass
|
||||
|
||||
def onImportOpenlp1ItemClick(self):
|
||||
self.openlp_import_form.show()
|
||||
|
Loading…
Reference in New Issue
Block a user