bzr-revno: 865
Fixes: https://launchpad.net/bugs/596821
This commit is contained in:
Tim Bentley 2010-06-21 18:49:05 +01:00
commit 7934fc53cd
2 changed files with 13 additions and 17 deletions

View File

@ -76,6 +76,6 @@ class MediaDockManager(object):
log.debug(u'remove %s dock' % name) log.debug(u'remove %s dock' % name)
for dock_index in range(0, self.media_dock.count()): for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index): if self.media_dock.widget(dock_index):
if self.media_dock.widget(dock_index).settingsSection == name: if self.media_dock.widget(dock_index).settingsSection == name.lower():
self.media_dock.widget(dock_index).hide() self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index) self.media_dock.removeItem(dock_index)

View File

@ -64,16 +64,12 @@ class SongsPlugin(Plugin):
# self.songmanager = SongManager() # self.songmanager = SongManager()
Plugin.initialise(self) Plugin.initialise(self)
self.insert_toolbox_item() self.insert_toolbox_item()
#self.ImportSongMenu.menuAction().setVisible(True)
#self.ExportSongMenu.menuAction().setVisible(True)
self.media_item.displayResultsSong(self.manager.get_songs()) self.media_item.displayResultsSong(self.manager.get_songs())
def finalise(self): def finalise(self):
log.info(u'Plugin Finalise') log.info(u'Plugin Finalise')
Plugin.finalise(self) Plugin.finalise(self)
self.remove_toolbox_item() self.remove_toolbox_item()
#self.ImportSongMenu.menuAction().setVisible(False)
#self.ExportSongMenu.menuAction().setVisible(False)
def get_media_manager_item(self): def get_media_manager_item(self):
""" """
@ -97,7 +93,7 @@ class SongsPlugin(Plugin):
self.SongImportItem.setText(translate( self.SongImportItem.setText(translate(
u'SongsPlugin', u'&Song')) u'SongsPlugin', u'&Song'))
self.SongImportItem.setToolTip( self.SongImportItem.setToolTip(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import songs using the import wizard.')) u'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem) import_menu.addAction(self.SongImportItem)
# Songs of Fellowship import menu item - will be removed and the # Songs of Fellowship import menu item - will be removed and the
@ -105,14 +101,14 @@ class SongsPlugin(Plugin):
self.ImportSofItem = QtGui.QAction(import_menu) self.ImportSofItem = QtGui.QAction(import_menu)
self.ImportSofItem.setObjectName(u'ImportSofItem') self.ImportSofItem.setObjectName(u'ImportSofItem')
self.ImportSofItem.setText( self.ImportSofItem.setText(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Songs of Fellowship (temp menu item)')) u'Songs of Fellowship (temp menu item)'))
self.ImportSofItem.setToolTip( self.ImportSofItem.setToolTip(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import songs from the VOLS1_2.RTF, sof3words' \ u'Import songs from the VOLS1_2.RTF, sof3words' \
+ u'.rtf and sof4words.rtf supplied with the music books')) + u'.rtf and sof4words.rtf supplied with the music books'))
self.ImportSofItem.setStatusTip( self.ImportSofItem.setStatusTip(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import songs from the VOLS1_2.RTF, sof3words' \ u'Import songs from the VOLS1_2.RTF, sof3words' \
+ u'.rtf and sof4words.rtf supplied with the music books')) + u'.rtf and sof4words.rtf supplied with the music books'))
import_menu.addAction(self.ImportSofItem) import_menu.addAction(self.ImportSofItem)
@ -121,15 +117,15 @@ class SongsPlugin(Plugin):
self.ImportOooItem = QtGui.QAction(import_menu) self.ImportOooItem = QtGui.QAction(import_menu)
self.ImportOooItem.setObjectName(u'ImportOooItem') self.ImportOooItem.setObjectName(u'ImportOooItem')
self.ImportOooItem.setText( self.ImportOooItem.setText(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Generic Document/Presentation Import ' u'Generic Document/Presentation Import '
u'(temp menu item)')) u'(temp menu item)'))
self.ImportOooItem.setToolTip( self.ImportOooItem.setToolTip(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import songs from ' u'Import songs from '
u'Word/Writer/Powerpoint/Impress')) u'Word/Writer/Powerpoint/Impress'))
self.ImportOooItem.setStatusTip( self.ImportOooItem.setStatusTip(
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import songs from ' u'Import songs from '
u'Word/Writer/Powerpoint/Impress')) u'Word/Writer/Powerpoint/Impress'))
import_menu.addAction(self.ImportOooItem) import_menu.addAction(self.ImportOooItem)
@ -169,11 +165,11 @@ class SongsPlugin(Plugin):
except: except:
log.exception('Could not import SoF file') log.exception('Could not import SoF file')
QtGui.QMessageBox.critical(None, QtGui.QMessageBox.critical(None,
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Import Error'), u'Import Error'),
translate(u'SongsPlugin', translate(u'SongsPlugin',
u'Error importing Songs of ' u'Error importing Songs of '
u'Fellowship file.\nOpenOffice.org must be installed' u'Fellowship file.\nOpenOffice.org must be installed'
u' and you must be using an unedited copy of the RTF' u' and you must be using an unedited copy of the RTF'
u' included with the Songs of Fellowship Music Editions'), u' included with the Songs of Fellowship Music Editions'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
@ -185,7 +181,7 @@ class SongsPlugin(Plugin):
None, translate(u'SongsPlugin', None, translate(u'SongsPlugin',
u'Open documents or presentations'), u'Open documents or presentations'),
u'', u'All Files(*.*)') u'', u'All Files(*.*)')
oooimport = OooImport(self.manager) oooimport = OooImport(self.manager)
oooimport.import_docs(filenames) oooimport.import_docs(filenames)
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')