Some naming cleanups

This commit is contained in:
Jon Tibble 2011-02-17 02:33:12 +00:00
parent 032c48df60
commit e401bc851d
6 changed files with 32 additions and 31 deletions

View File

@ -66,10 +66,11 @@ class MediaManagerItem(QtGui.QWidget):
When creating a descendant class from this class for your plugin, When creating a descendant class from this class for your plugin,
the following member variables should be set. the following member variables should be set.
``self.OnNewPrompt`` ``self.onNewPrompt``
Defaults to *'Select Image(s)'*. Defaults to *'Select Image(s)'*.
``self.OnNewFileMasks`` ``self.onNewFileMasks``
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
assumes that the new action is to load a file. If not, you assumes that the new action is to load a file. If not, you
need to override the ``OnNew`` method. need to override the ``OnNew`` method.
@ -317,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget):
Add a file to the list widget to make it available for showing Add a file to the list widget to make it available for showing
""" """
files = QtGui.QFileDialog.getOpenFileNames( files = QtGui.QFileDialog.getOpenFileNames(
self, self.OnNewPrompt, self, self.onNewPrompt,
SettingsManager.get_last_dir(self.settingsSection), SettingsManager.get_last_dir(self.settingsSection),
self.OnNewFileMasks) self.onNewFileMasks)
log.info(u'New files(s) %s', unicode(files)) log.info(u'New files(s) %s', unicode(files))
if files: if files:
Receiver.send_message(u'cursor_busy') Receiver.send_message(u'cursor_busy')

View File

@ -73,15 +73,15 @@ class Ui_MainWindow(object):
# Set up the main container, which contains all the other form widgets. # Set up the main container, which contains all the other form widgets.
self.MainContent = QtGui.QWidget(mainWindow) self.MainContent = QtGui.QWidget(mainWindow)
self.MainContent.setObjectName(u'MainContent') self.MainContent.setObjectName(u'MainContent')
self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent) self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent)
self.MainContentLayout.setSpacing(0) self.mainContentLayout.setSpacing(0)
self.MainContentLayout.setMargin(0) self.mainContentLayout.setMargin(0)
self.MainContentLayout.setObjectName(u'MainContentLayout') self.mainContentLayout.setObjectName(u'mainContentLayout')
mainWindow.setCentralWidget(self.MainContent) mainWindow.setCentralWidget(self.MainContent)
self.controlSplitter = QtGui.QSplitter(self.MainContent) self.controlSplitter = QtGui.QSplitter(self.MainContent)
self.controlSplitter.setOrientation(QtCore.Qt.Horizontal) self.controlSplitter.setOrientation(QtCore.Qt.Horizontal)
self.controlSplitter.setObjectName(u'controlSplitter') self.controlSplitter.setObjectName(u'controlSplitter')
self.MainContentLayout.addWidget(self.controlSplitter) self.mainContentLayout.addWidget(self.controlSplitter)
# Create slide controllers # Create slide controllers
self.previewController = SlideController(self, self.settingsmanager, self.previewController = SlideController(self, self.settingsmanager,
self.screens) self.screens)
@ -152,10 +152,10 @@ class Ui_MainWindow(object):
u'themeManagerDock', u':/system/system_thememanager.png') u'themeManagerDock', u':/system/system_thememanager.png')
self.themeManagerDock.setMinimumWidth( self.themeManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right) self.settingsmanager.mainwindow_right)
self.ThemeManagerContents = ThemeManager(mainWindow, self.themeManagerContents = ThemeManager(mainWindow,
self.themeManagerDock) self.themeManagerDock)
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents') self.themeManagerContents.setObjectName(u'themeManagerContents')
self.themeManagerDock.setWidget(self.ThemeManagerContents) self.themeManagerDock.setWidget(self.themeManagerContents)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.themeManagerDock) self.themeManagerDock)
# Create the menu items # Create the menu items
@ -256,8 +256,8 @@ class Ui_MainWindow(object):
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem') self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
self.HelpOnlineHelpItem.setEnabled(False) self.HelpOnlineHelpItem.setEnabled(False)
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help') mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem') self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help') mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
add_actions(self.FileImportMenu, add_actions(self.FileImportMenu,
(self.ImportThemeItem, self.ImportLanguageItem)) (self.ImportThemeItem, self.ImportLanguageItem))
add_actions(self.FileExportMenu, add_actions(self.FileExportMenu,
@ -281,7 +281,7 @@ class Ui_MainWindow(object):
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
add_actions(self.HelpMenu, (self.HelpDocumentationItem, add_actions(self.HelpMenu, (self.HelpDocumentationItem,
self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, self.HelpOnlineHelpItem, None, self.helpWebSiteItem,
self.HelpAboutItem)) self.HelpAboutItem))
add_actions(self.MenuBar, (self.FileMenu.menuAction(), add_actions(self.MenuBar, (self.FileMenu.menuAction(),
self.viewMenu.menuAction(), self.ToolsMenu.menuAction(), self.viewMenu.menuAction(), self.ToolsMenu.menuAction(),
@ -418,7 +418,7 @@ class Ui_MainWindow(object):
translate('OpenLP.MainWindow', 'Ctrl+F1')) translate('OpenLP.MainWindow', 'Ctrl+F1'))
self.HelpOnlineHelpItem.setText( self.HelpOnlineHelpItem.setText(
translate('OpenLP.MainWindow', '&Online Help')) translate('OpenLP.MainWindow', '&Online Help'))
self.HelpWebSiteItem.setText( self.helpWebSiteItem.setText(
translate('OpenLP.MainWindow', '&Web Site')) translate('OpenLP.MainWindow', '&Web Site'))
self.AutoLanguageItem.setText( self.AutoLanguageItem.setText(
translate('OpenLP.MainWindow', '&Auto Detect')) translate('OpenLP.MainWindow', '&Auto Detect'))
@ -491,10 +491,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# Set up signals and slots # Set up signals and slots
QtCore.QObject.connect(self.ImportThemeItem, QtCore.QObject.connect(self.ImportThemeItem,
QtCore.SIGNAL(u'triggered()'), QtCore.SIGNAL(u'triggered()'),
self.ThemeManagerContents.onImportTheme) self.themeManagerContents.onImportTheme)
QtCore.QObject.connect(self.ExportThemeItem, QtCore.QObject.connect(self.ExportThemeItem,
QtCore.SIGNAL(u'triggered()'), QtCore.SIGNAL(u'triggered()'),
self.ThemeManagerContents.onExportTheme) self.themeManagerContents.onExportTheme)
QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.QObject.connect(self.ViewMediaManagerItem,
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager) QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
QtCore.QObject.connect(self.ViewServiceManagerItem, QtCore.QObject.connect(self.ViewServiceManagerItem,
@ -514,7 +514,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.QObject.connect(self.themeManagerDock, QtCore.QObject.connect(self.themeManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.ViewThemeManagerItem.setChecked) self.ViewThemeManagerItem.setChecked)
QtCore.QObject.connect(self.HelpWebSiteItem, QtCore.QObject.connect(self.helpWebSiteItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
QtCore.QObject.connect(self.HelpAboutItem, QtCore.QObject.connect(self.HelpAboutItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
@ -573,7 +573,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# RenderManager needs to call ThemeManager and # RenderManager needs to call ThemeManager and
# ThemeManager needs to call RenderManager # ThemeManager needs to call RenderManager
self.renderManager = RenderManager( self.renderManager = RenderManager(
self.ThemeManagerContents, self.screens) self.themeManagerContents, self.screens)
# Define the media Dock Manager # Define the media Dock Manager
self.mediaDockManager = MediaDockManager(self.MediaToolBox) self.mediaDockManager = MediaDockManager(self.MediaToolBox)
log.info(u'Load Plugins') log.info(u'Load Plugins')
@ -607,7 +607,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.pluginManager.initialise_plugins() self.pluginManager.initialise_plugins()
# Once all components are initialised load the Themes # Once all components are initialised load the Themes
log.info(u'Load Themes') log.info(u'Load Themes')
self.ThemeManagerContents.loadThemes() self.themeManagerContents.loadThemes()
log.info(u'Load data from Settings') log.info(u'Load data from Settings')
if QtCore.QSettings().value(u'advanced/save current plugin', if QtCore.QSettings().value(u'advanced/save current plugin',
QtCore.QVariant(False)).toBool(): QtCore.QVariant(False)).toBool():

View File

@ -199,7 +199,7 @@ class ThemesTab(SettingsTab):
""" """
Utility method to update the global theme preview image. Utility method to update the global theme preview image.
""" """
image = self.parent.ThemeManagerContents.getPreviewImage( image = self.parent.themeManagerContents.getPreviewImage(
self.global_theme) self.global_theme)
preview = QtGui.QPixmap(unicode(image)) preview = QtGui.QPixmap(unicode(image))
if not preview.isNull(): if not preview.isNull():

View File

@ -50,10 +50,10 @@ class ImageMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged)
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = translate('ImagePlugin.MediaItem', self.onNewPrompt = translate('ImagePlugin.MediaItem',
'Select Image(s)') 'Select Image(s)')
file_formats = get_images_filter() file_formats = get_images_filter()
self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, self.onNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats,
UiStrings.AllFiles) UiStrings.AllFiles)
self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setText(UiStrings.ReplaceBG)
self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG)

View File

@ -58,8 +58,8 @@ class MediaMediaItem(MediaManagerItem):
self.videoStart) self.videoStart)
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem', self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem',
'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list,
self.parent.audio_list, UiStrings.AllFiles) self.parent.audio_list, UiStrings.AllFiles)
self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setText(UiStrings.ReplaceBG)
@ -124,7 +124,7 @@ class MediaMediaItem(MediaManagerItem):
return False return False
filename = unicode(item.data(QtCore.Qt.UserRole).toString()) filename = unicode(item.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename): if os.path.exists(filename):
self.MediaState = None self.mediaState = None
self.mediaObject.stop() self.mediaObject.stop()
self.mediaObject.clearQueue() self.mediaObject.clearQueue()
self.mediaObject.setCurrentSource(Phonon.MediaSource(filename)) self.mediaObject.setCurrentSource(Phonon.MediaSource(filename))
@ -136,7 +136,7 @@ class MediaMediaItem(MediaManagerItem):
service_item.theme = -1 service_item.theme = -1
frame = u':/media/image_clapperboard.png' frame = u':/media/image_clapperboard.png'
(path, name) = os.path.split(filename) (path, name) = os.path.split(filename)
while not self.MediaState: while not self.mediaState:
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
service_item.media_length = self.mediaLength service_item.media_length = self.mediaLength
service_item.add_from_command(path, name, frame) service_item.add_from_command(path, name, frame)
@ -182,6 +182,6 @@ class MediaMediaItem(MediaManagerItem):
Start the video at a predetermined point. Start the video at a predetermined point.
""" """
if newState == Phonon.PlayingState: if newState == Phonon.PlayingState:
self.MediaState = newState self.mediaState = newState
self.mediaLength = self.mediaObject.totalTime()/1000 self.mediaLength = self.mediaObject.totalTime()/1000
self.mediaObject.stop() self.mediaObject.stop()

View File

@ -60,7 +60,7 @@ class PresentationMediaItem(MediaManagerItem):
""" """
The name of the plugin media displayed in UI The name of the plugin media displayed in UI
""" """
self.OnNewPrompt = translate('PresentationPlugin.MediaItem', self.onNewPrompt = translate('PresentationPlugin.MediaItem',
'Select Presentation(s)') 'Select Presentation(s)')
self.Automatic = translate('PresentationPlugin.MediaItem', self.Automatic = translate('PresentationPlugin.MediaItem',
'Automatic') 'Automatic')
@ -80,7 +80,7 @@ class PresentationMediaItem(MediaManagerItem):
if fileType.find(type) == -1: if fileType.find(type) == -1:
fileType += u'*.%s ' % type fileType += u'*.%s ' % type
self.parent.serviceManager.supportedSuffixes(type) self.parent.serviceManager.supportedSuffixes(type)
self.OnNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', self.onNewFileMasks = unicode(translate('PresentationPlugin.MediaItem',
'Presentations (%s)')) % fileType 'Presentations (%s)')) % fileType
def requiredIcons(self): def requiredIcons(self):