Moved everything to *real* toolbars... much better!

bzr-revno: 145
This commit is contained in:
Raoul Snyman 2008-11-30 20:01:19 +00:00
parent dbec7d75b3
commit 9c5b487840
8 changed files with 107 additions and 186 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-11-30, 20:32:44 -->
<!-- Saved: 2008-11-30, 21:56:54 -->
<!-- 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-11-30, 20:32:44 -->
<!-- Saved: 2008-11-30, 21:56:54 -->
<Tasks version="4.2">
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>

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-11-30, 20:32:44 -->
<!-- Saved: 2008-11-30, 21:56:54 -->
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
<Project version="4.4">
<ProgLanguage mixed="0">Python</ProgLanguage>
@ -76,6 +76,8 @@
<Source>openlp/plugins/biblemanager/forms/__init__.py</Source>
<Source>openlp/plugins/biblemanager/forms/bibleimportdialog.py</Source>
<Source>openlp/plugins/biblemanager/forms/bibleimportform.py</Source>
<Source>openlp/plugins/biblemanager/forms/bibleimportprogressform.py</Source>
<Source>openlp/plugins/biblemanager/forms/bibleimportprogressdialog.py</Source>
</Sources>
<Forms>
<Form>resources/forms/bibleimport.ui</Form>
@ -91,6 +93,7 @@
<Form>resources/forms/songexport.ui</Form>
<Form>resources/forms/openlpimportform.ui</Form>
<Form>resources/forms/splashscreen.ui</Form>
<Form>resources/forms/bibleimportprogress.ui</Form>
</Forms>
<Translations>
</Translations>

View File

@ -53,32 +53,14 @@ class MediaManagerItem(QtGui.QWidget):
self.PageLayout.setSpacing(0)
self.PageLayout.setMargin(0)
self.PageLayout.setObjectName('PageLayout')
self.Toolbar = QtGui.QWidget(self)
self.Toolbar = QtGui.QToolBar(self)
self.Toolbar.setObjectName('Toolbar')
self.ToolbarLayout = QtGui.QHBoxLayout(self.Toolbar)
self.ToolbarLayout.setSpacing(0)
self.ToolbarLayout.setMargin(0)
self.ToolbarLayout.setObjectName('ToolbarLayout')
def addToolbarItem(self, item):
"""
A method to help developers easily add any control to the toolbar.
"""
if self.Toolbar is None:
self.addToolbar()
if item.__class__.__name__ == 'QSpacerItem':
self.ToolbarLayout.addSpacerItem(item)
else:
self.ToolbarLayout.addWidget(item)
self.PageLayout.addWidget(self.Toolbar)
def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):
"""
A method to help developers easily add a button to the toolbar.
"""
ToolbarButton = QtGui.QToolButton(self.Toolbar)
ToolbarButton.setText(QtCore.QObject.trUtf8(ToolbarButton, title))
ToolbarButton.setToolTip(QtCore.QObject.trUtf8(ToolbarButton, tooltip))
self.addToolbarItem(ToolbarButton)
if type(icon) is QtGui.QIcon:
ButtonIcon = icon
elif type(icon) is types.StringType:
@ -89,22 +71,14 @@ class MediaManagerItem(QtGui.QWidget):
else:
ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
ToolbarButton.setIcon(ButtonIcon)
ToolbarButton.setIconSize(QtCore.QSize(20, 20))
ToolbarButton.setAutoRaise(True)
ToolbarButton.setMinimumSize(QtCore.QSize(20, 20))
if objectname is not None:
ToolbarButton.setObjectName(objectname)
ToolbarButton = self.Toolbar.addAction(ButtonIcon, title)
if tooltip is not None:
ToolbarButton.setToolTip(tooltip)
if slot is not None:
QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL("clicked()"), slot)
QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL("triggered()"), slot)
def addToolbarLine(self):
ToolbarLine = QtGui.QFrame(self.Toolbar)
ToolbarLine.setMinimumSize(QtCore.QSize(0, 0))
ToolbarLine.setFrameShadow(QtGui.QFrame.Sunken)
ToolbarLine.setLineWidth(1)
ToolbarLine.setMidLineWidth(0)
ToolbarLine.setFrameShape(QtGui.QFrame.VLine)
ToolbarLine.setFrameShadow(QtGui.QFrame.Sunken)
ToolbarLine.setObjectName('ToolbarLine')
self.addToolbarItem(ToolbarLine)
def addToolbarSeparator(self):
"""
A very simple method to add a separator to the toolbar.
"""
self.Toolbar.addSeparator()

View File

@ -70,7 +70,7 @@ class Plugin(object):
self.Name = 'Plugin'
if version is not None:
self.Version = version
self.MediaManagerItem = None
#self.MediaManagerItem = None
self.SettingsTab = None
self.ImportMenuItem = None
self.ExportMenuItem = None
@ -102,6 +102,13 @@ class Plugin(object):
"""
pass
def getMediaManagerItem(self):
"""
Construct a MediaManagerItem object with all the buttons and things you
need, and return it for integration into openlp.org.
"""
pass
def addToMenu(self, menubar):
"""
Add menu items to the menu, given the menubar.

View File

@ -82,7 +82,8 @@ class PluginManager(object):
"""
for pname in self.plugin_by_name:
plugin = self.plugin_by_name[pname]
if plugin.MediaManagerItem is not None:
media_manager_item = plugin.getMediaManagerItem()
if media_manager_item is not None:
log.debug('Inserting media manager item from %s' % plugin.Name)
MediaToolBox.addItem(plugin.MediaManagerItem, plugin.Icon, plugin.Name)
MediaToolBox.addItem(media_manager_item, plugin.Icon, plugin.Name)

View File

@ -164,9 +164,10 @@ class MainWindow(object):
self.MediaManagerDock.setWidget(self.MediaManagerContents)
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
self.ServiceManagerDock = QtGui.QDockWidget(self.main_window)
icon20 = QtGui.QIcon()
icon20.addPixmap(QtGui.QPixmap(":/system/system_servicemanager.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceManagerDock.setWindowIcon(icon20)
ServiceManagerIcon = QtGui.QIcon()
ServiceManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_servicemanager.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceManagerDock.setWindowIcon(ServiceManagerIcon)
self.ServiceManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures)
self.ServiceManagerDock.setObjectName("ServiceManagerDock")
self.ServiceManagerContents = QtGui.QWidget()
@ -175,82 +176,47 @@ class MainWindow(object):
self.ServiceManagerLayout.setSpacing(0)
self.ServiceManagerLayout.setMargin(0)
self.ServiceManagerLayout.setObjectName("ServiceManagerLayout")
self.ServiceToolbar = QtGui.QWidget(self.ServiceManagerContents)
self.ServiceToolbar = QtGui.QToolBar(self.ServiceManagerContents)
self.ServiceToolbar.setObjectName("ServiceToolbar")
self.ServiceToolbarLayout = QtGui.QHBoxLayout(self.ServiceToolbar)
self.ServiceToolbarLayout.setSpacing(0)
self.ServiceToolbarLayout.setContentsMargins(0, 2, 0, 0)
self.ServiceToolbarLayout.setObjectName("ServiceToolbarLayout")
self.MoveTopButton = QtGui.QToolButton(self.ServiceToolbar)
icon21 = QtGui.QIcon()
icon21.addPixmap(QtGui.QPixmap(":/services/service_top.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveTopButton.setIcon(icon21)
self.MoveTopButton.setIconSize(QtCore.QSize(20, 20))
self.MoveTopButton.setAutoRaise(True)
self.MoveTopButton.setObjectName("MoveTopButton")
self.ServiceToolbarLayout.addWidget(self.MoveTopButton)
self.MoveUpButton = QtGui.QToolButton(self.ServiceToolbar)
icon22 = QtGui.QIcon()
icon22.addPixmap(QtGui.QPixmap(":/services/service_up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveUpButton.setIcon(icon22)
self.MoveUpButton.setIconSize(QtCore.QSize(20, 20))
self.MoveUpButton.setAutoRaise(True)
self.MoveUpButton.setObjectName("MoveUpButton")
self.ServiceToolbarLayout.addWidget(self.MoveUpButton)
self.MoveDownButton = QtGui.QToolButton(self.ServiceToolbar)
icon23 = QtGui.QIcon()
icon23.addPixmap(QtGui.QPixmap(":/services/service_down.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveDownButton.setIcon(icon23)
self.MoveDownButton.setIconSize(QtCore.QSize(20, 20))
self.MoveDownButton.setAutoRaise(True)
self.MoveDownButton.setObjectName("MoveDownButton")
self.ServiceToolbarLayout.addWidget(self.MoveDownButton)
self.MoveBottomButton = QtGui.QToolButton(self.ServiceToolbar)
icon24 = QtGui.QIcon()
icon24.addPixmap(QtGui.QPixmap(":/services/service_bottom.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveBottomButton.setIcon(icon24)
self.MoveBottomButton.setIconSize(QtCore.QSize(20, 20))
self.MoveBottomButton.setAutoRaise(True)
self.MoveBottomButton.setObjectName("MoveBottomButton")
self.ServiceToolbarLayout.addWidget(self.MoveBottomButton)
self.ServiceDividerLine = QtGui.QFrame(self.ServiceToolbar)
self.ServiceDividerLine.setFrameShape(QtGui.QFrame.VLine)
self.ServiceDividerLine.setFrameShadow(QtGui.QFrame.Sunken)
self.ServiceDividerLine.setObjectName("ServiceDividerLine")
self.ServiceToolbarLayout.addWidget(self.ServiceDividerLine)
self.ServiceNewItem = QtGui.QToolButton(self.ServiceToolbar)
icon25 = QtGui.QIcon()
icon25.addPixmap(QtGui.QPixmap(":/services/service_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceNewItem.setIcon(icon25)
self.ServiceNewItem.setIconSize(QtCore.QSize(20, 20))
self.ServiceNewItem.setAutoRaise(True)
self.ServiceNewItem.setObjectName("ServiceNewItem")
self.ServiceToolbarLayout.addWidget(self.ServiceNewItem)
self.ServiceOpenItem = QtGui.QToolButton(self.ServiceToolbar)
icon26 = QtGui.QIcon()
icon26.addPixmap(QtGui.QPixmap(":/services/service_open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceOpenItem.setIcon(icon26)
self.ServiceOpenItem.setIconSize(QtCore.QSize(20, 20))
self.ServiceOpenItem.setAutoRaise(True)
self.ServiceOpenItem.setObjectName("ServiceOpenItem")
self.ServiceToolbarLayout.addWidget(self.ServiceOpenItem)
self.ServiceSaveItem = QtGui.QToolButton(self.ServiceToolbar)
icon27 = QtGui.QIcon()
icon27.addPixmap(QtGui.QPixmap(":/services/service_save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceSaveItem.setIcon(icon27)
self.ServiceSaveItem.setIconSize(QtCore.QSize(20, 20))
self.ServiceSaveItem.setAutoRaise(True)
self.ServiceSaveItem.setObjectName("ServiceSaveItem")
self.ServiceToolbarLayout.addWidget(self.ServiceSaveItem)
MoveTopIcon = QtGui.QIcon()
MoveTopIcon.addPixmap(QtGui.QPixmap(":/services/service_top.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveTopButton = self.ServiceToolbar.addAction(MoveTopIcon, 'Move to top')
MoveUpIcon = QtGui.QIcon()
MoveUpIcon.addPixmap(QtGui.QPixmap(":/services/service_up.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveUpButton = self.ServiceToolbar.addAction(MoveUpIcon, 'Move up')
MoveDownIcon = QtGui.QIcon()
MoveDownIcon.addPixmap(QtGui.QPixmap(":/services/service_down.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveDownButton = self.ServiceToolbar.addAction(MoveDownIcon, 'Move down')
MoveBottomIcon = QtGui.QIcon()
MoveBottomIcon.addPixmap(QtGui.QPixmap(":/services/service_bottom.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MoveBottomButton = self.ServiceToolbar.addAction(MoveBottomIcon, 'Move to bottom')
self.ServiceToolbar.addSeparator()
NewServiceIcon = QtGui.QIcon()
NewServiceIcon.addPixmap(QtGui.QPixmap(":/services/service_new.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceNewItem = self.ServiceToolbar.addAction(NewServiceIcon, 'New service')
OpenServiceIcon = QtGui.QIcon()
OpenServiceIcon.addPixmap(QtGui.QPixmap(":/services/service_open.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceOpenItem = self.ServiceToolbar.addAction(OpenServiceIcon, 'Open service')
SaveServiceIcon = QtGui.QIcon()
SaveServiceIcon.addPixmap(QtGui.QPixmap(":/services/service_save.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceSaveItem = self.ServiceToolbar.addAction(SaveServiceIcon, 'Save service')
self.ServiceToolbar.addSeparator()
self.ServiceThemeComboBox = QtGui.QComboBox(self.ServiceToolbar)
self.ServiceThemeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.ServiceThemeComboBox.setObjectName("ServiceThemeComboBox")
self.ServiceThemeComboBox.addItem(QtCore.QString())
self.ServiceThemeComboBox.addItem(QtCore.QString())
self.ServiceThemeComboBox.addItem(QtCore.QString())
self.ServiceToolbarLayout.addWidget(self.ServiceThemeComboBox)
spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.ServiceToolbarLayout.addItem(spacerItem7)
self.ServiceThemeWidget = QtGui.QWidgetAction(self.ServiceToolbar)
self.ServiceThemeWidget.setDefaultWidget(self.ServiceThemeComboBox)
self.ServiceToolbar.addAction(self.ServiceThemeWidget)
self.ServiceManagerLayout.addWidget(self.ServiceToolbar)
self.ServiceListView = QtGui.QListView(self.ServiceManagerContents)
self.ServiceListView.setObjectName("ServiceListView")
@ -258,9 +224,10 @@ class MainWindow(object):
self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
self.ThemeManagerDock = QtGui.QDockWidget(self.main_window)
icon28 = QtGui.QIcon()
icon28.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeManagerDock.setWindowIcon(icon28)
ThemeManagerIcon = QtGui.QIcon()
ThemeManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon)
self.ThemeManagerDock.setFloating(False)
self.ThemeManagerDock.setObjectName("ThemeManagerDock")
self.ThemeManagerContents = QtGui.QWidget()
@ -269,59 +236,29 @@ class MainWindow(object):
self.ThemeManagerLayout.setSpacing(0)
self.ThemeManagerLayout.setMargin(0)
self.ThemeManagerLayout.setObjectName("ThemeManagerLayout")
self.ThemeManagerToolbar = QtGui.QWidget(self.ThemeManagerContents)
self.ThemeManagerToolbar = QtGui.QToolBar(self.ThemeManagerContents)
self.ThemeManagerToolbar.setObjectName("ThemeManagerToolbar")
self.ThemeManagerToolbarLayout = QtGui.QHBoxLayout(self.ThemeManagerToolbar)
self.ThemeManagerToolbarLayout.setSpacing(0)
self.ThemeManagerToolbarLayout.setContentsMargins(0, 2, 0, 0)
self.ThemeManagerToolbarLayout.setObjectName("ThemeManagerToolbarLayout")
self.ThemeNewItem = QtGui.QToolButton(self.ThemeManagerToolbar)
icon29 = QtGui.QIcon()
icon29.addPixmap(QtGui.QPixmap(":/themes/theme_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeNewItem.setIcon(icon29)
self.ThemeNewItem.setIconSize(QtCore.QSize(20, 20))
self.ThemeNewItem.setAutoRaise(True)
self.ThemeNewItem.setObjectName("ThemeNewItem")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeNewItem)
self.ThemeEditItem = QtGui.QToolButton(self.ThemeManagerToolbar)
icon30 = QtGui.QIcon()
icon30.addPixmap(QtGui.QPixmap(":/themes/theme_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeEditItem.setIcon(icon30)
self.ThemeEditItem.setIconSize(QtCore.QSize(20, 20))
self.ThemeEditItem.setAutoRaise(True)
self.ThemeEditItem.setObjectName("ThemeEditItem")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeEditItem)
self.ThemeDeleteButton = QtGui.QToolButton(self.ThemeManagerToolbar)
icon31 = QtGui.QIcon()
icon31.addPixmap(QtGui.QPixmap(":/themes/theme_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeDeleteButton.setIcon(icon31)
self.ThemeDeleteButton.setIconSize(QtCore.QSize(20, 20))
self.ThemeDeleteButton.setAutoRaise(True)
self.ThemeDeleteButton.setObjectName("ThemeDeleteButton")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeDeleteButton)
self.ThemeToolbarLine = QtGui.QFrame(self.ThemeManagerToolbar)
self.ThemeToolbarLine.setFrameShape(QtGui.QFrame.VLine)
self.ThemeToolbarLine.setFrameShadow(QtGui.QFrame.Sunken)
self.ThemeToolbarLine.setObjectName("ThemeToolbarLine")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeToolbarLine)
self.ThemeImportButton = QtGui.QToolButton(self.ThemeManagerToolbar)
icon32 = QtGui.QIcon()
icon32.addPixmap(QtGui.QPixmap(":/themes/theme_import.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeImportButton.setIcon(icon32)
self.ThemeImportButton.setIconSize(QtCore.QSize(20, 20))
self.ThemeImportButton.setAutoRaise(True)
self.ThemeImportButton.setObjectName("ThemeImportButton")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeImportButton)
self.ThemeExportButton = QtGui.QToolButton(self.ThemeManagerToolbar)
icon33 = QtGui.QIcon()
icon33.addPixmap(QtGui.QPixmap(":/themes/theme_export.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeExportButton.setIcon(icon33)
self.ThemeExportButton.setIconSize(QtCore.QSize(20, 20))
self.ThemeExportButton.setAutoRaise(True)
self.ThemeExportButton.setObjectName("ThemeExportButton")
self.ThemeManagerToolbarLayout.addWidget(self.ThemeExportButton)
spacerItem8 = QtGui.QSpacerItem(201, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.ThemeManagerToolbarLayout.addItem(spacerItem8)
NewThemeIcon = QtGui.QIcon()
NewThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_new.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeNewItem = self.ThemeManagerToolbar.addAction(NewThemeIcon, 'New theme')
EditThemeIcon = QtGui.QIcon()
EditThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_edit.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeEditItem = self.ThemeManagerToolbar.addAction(EditThemeIcon, 'Edit theme')
DeleteThemeIcon = QtGui.QIcon()
DeleteThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_delete.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeDeleteButton = self.ThemeManagerToolbar.addAction(DeleteThemeIcon, 'Delete theme')
self.ThemeManagerToolbar.addSeparator()
ImportThemeIcon = QtGui.QIcon()
ImportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_import.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeImportButton = self.ThemeManagerToolbar.addAction(ImportThemeIcon, 'Import theme')
ExportThemeIcon = QtGui.QIcon()
ExportThemeIcon.addPixmap(QtGui.QPixmap(":/themes/theme_export.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeExportButton = self.ThemeManagerToolbar.addAction(ExportThemeIcon, 'Export theme')
self.ThemeManagerLayout.addWidget(self.ThemeManagerToolbar)
self.ThemeManagerListView = QtGui.QListView(self.ThemeManagerContents)
self.ThemeManagerListView.setObjectName("ThemeManagerListView")
@ -329,13 +266,13 @@ class MainWindow(object):
self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock)
self.FileNewItem = QtGui.QAction(self.main_window)
self.FileNewItem.setIcon(icon25)
self.FileNewItem.setIcon(NewServiceIcon)
self.FileNewItem.setObjectName("FileNewItem")
self.FileOpenItem = QtGui.QAction(self.main_window)
self.FileOpenItem.setIcon(icon26)
self.FileOpenItem.setIcon(OpenServiceIcon)
self.FileOpenItem.setObjectName("FileOpenItem")
self.FileSaveItem = QtGui.QAction(self.main_window)
self.FileSaveItem.setIcon(icon27)
self.FileSaveItem.setIcon(SaveServiceIcon)
self.FileSaveItem.setObjectName("FileSaveItem")
self.FileSaveAsItem = QtGui.QAction(self.main_window)
self.FileSaveAsItem.setObjectName("FileSaveAsItem")
@ -371,12 +308,12 @@ class MainWindow(object):
self.ViewThemeManagerItem = QtGui.QAction(self.main_window)
self.ViewThemeManagerItem.setCheckable(True)
self.ViewThemeManagerItem.setChecked(True)
self.ViewThemeManagerItem.setIcon(icon28)
self.ViewThemeManagerItem.setIcon(ThemeManagerIcon)
self.ViewThemeManagerItem.setObjectName("ViewThemeManagerItem")
self.ViewServiceManagerItem = QtGui.QAction(self.main_window)
self.ViewServiceManagerItem.setCheckable(True)
self.ViewServiceManagerItem.setChecked(True)
self.ViewServiceManagerItem.setIcon(icon20)
self.ViewServiceManagerItem.setIcon(ServiceManagerIcon)
self.ViewServiceManagerItem.setObjectName("ViewServiceManagerItem")
self.ToolsAlertItem = QtGui.QAction(self.main_window)
icon36 = QtGui.QIcon()

View File

@ -26,6 +26,8 @@ class SongsPlugin(Plugin):
def __init__(self):
# Call the parent constructor
Plugin.__init__(self, 'Songs', '1.9.0')
def getMediaManagerItem(self):
# Create the plugin icon
self.Icon = QtGui.QIcon()
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
@ -45,7 +47,7 @@ class SongsPlugin(Plugin):
self.MediaManagerItem.addToolbarButton('Delete Song', 'Delete the selected song',
':/songs/song_delete.png', self.onSongDeleteClick, 'SongDeleteItem')
## Separator Line ##
self.MediaManagerItem.addToolbarLine()
self.MediaManagerItem.addToolbarSeparator()
## Preview Song Button ##
self.MediaManagerItem.addToolbarButton('Preview Song', 'Preview the selected song',
':/system/system_preview.png', self.onSongPreviewClick, 'SongPreviewItem')
@ -56,16 +58,13 @@ class SongsPlugin(Plugin):
self.MediaManagerItem.addToolbarButton('Add Song To Service',
'Add the selected song(s) to the service', ':/system/system_add.png',
self.onSongAddClick, 'SongAddItem')
## Spacer ##
self.SongSpacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.MediaManagerItem.addToolbarItem(self.SongSpacerItem)
# Add the songlist widget
#self.SongList = QtGui.QTableWidget(self.MediaManagerItem)
#self.SongList.setObjectName("SongList")
#self.SongList.setColumnCount(0)
#self.SongList.setRowCount(0)
#self.MediaManagerItem.PageLayout.addWidget(self.SongList)
## Add the songlist widget ##
self.SongList = QtGui.QTableWidget(self.MediaManagerItem)
self.SongList.setObjectName("SongList")
self.SongList.setColumnCount(0)
self.SongList.setRowCount(0)
self.MediaManagerItem.PageLayout.addWidget(self.SongList)
return self.MediaManagerItem
def onSongNewClick(self):
pass