forked from openlp/openlp
- Changed the order the live screen/preview screen are set up.
- Added a menu entry to update the theme preview images. bzr-revno: 1560
This commit is contained in:
commit
95b9abc78e
@ -229,6 +229,8 @@ class Ui_MainWindow(object):
|
|||||||
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||||
u'ToolsOpenDataFolder', u':/general/general_open.png',
|
u'ToolsOpenDataFolder', u':/general/general_open.png',
|
||||||
category=UiStrings().Tools)
|
category=UiStrings().Tools)
|
||||||
|
self.updateThemeImages = base_action(mainWindow,
|
||||||
|
u'updateThemeImages', category=UiStrings().Tools)
|
||||||
action_list.add_category(UiStrings().Settings, CategoryOrder.standardMenu)
|
action_list.add_category(UiStrings().Settings, CategoryOrder.standardMenu)
|
||||||
self.settingsPluginListItem = shortcut_action(mainWindow,
|
self.settingsPluginListItem = shortcut_action(mainWindow,
|
||||||
u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
|
u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
|
||||||
@ -292,6 +294,7 @@ class Ui_MainWindow(object):
|
|||||||
self.SettingsConfigureItem))
|
self.SettingsConfigureItem))
|
||||||
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.ToolsMenu, [self.updateThemeImages])
|
||||||
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))
|
||||||
@ -433,6 +436,11 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', 'Open &Data Folder...'))
|
translate('OpenLP.MainWindow', 'Open &Data Folder...'))
|
||||||
self.ToolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
|
self.ToolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
'Open the folder where songs, bibles and other data resides.'))
|
'Open the folder where songs, bibles and other data resides.'))
|
||||||
|
self.updateThemeImages.setText(
|
||||||
|
translate('OpenLP.MainWindow', 'Update Theme Images'))
|
||||||
|
self.updateThemeImages.setStatusTip(
|
||||||
|
translate('OpenLP.MainWindow', 'Update the preview images for all '
|
||||||
|
'themes.'))
|
||||||
self.ModeDefaultItem.setText(
|
self.ModeDefaultItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Default'))
|
translate('OpenLP.MainWindow', '&Default'))
|
||||||
self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
@ -505,6 +513,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpOnLineHelpClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpOnLineHelpClicked)
|
||||||
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
|
||||||
|
QtCore.QObject.connect(self.updateThemeImages,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
|
||||||
QtCore.QObject.connect(self.DisplayTagItem,
|
QtCore.QObject.connect(self.DisplayTagItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsConfigureItem,
|
QtCore.QObject.connect(self.SettingsConfigureItem,
|
||||||
@ -717,6 +727,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
path = AppLocation.get_data_path()
|
path = AppLocation.get_data_path()
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
|
||||||
|
|
||||||
|
def onUpdateThemeImages(self):
|
||||||
|
"""
|
||||||
|
Updates the new theme preview images.
|
||||||
|
"""
|
||||||
|
self.themeManagerContents.updatePreviewImages()
|
||||||
|
|
||||||
def onDisplayTagItemClicked(self):
|
def onDisplayTagItemClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the Settings dialog
|
Show the Settings dialog
|
||||||
@ -778,16 +794,18 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def screenChanged(self):
|
def screenChanged(self):
|
||||||
"""
|
"""
|
||||||
The screen has changed to so tell the displays to update_display
|
The screen has changed so we have to update components such as the
|
||||||
their locations
|
renderer.
|
||||||
"""
|
"""
|
||||||
log.debug(u'screenChanged')
|
log.debug(u'screenChanged')
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
self.image_manager.update_display()
|
self.image_manager.update_display()
|
||||||
self.renderer.update_display()
|
self.renderer.update_display()
|
||||||
self.liveController.screenSizeChanged()
|
|
||||||
self.previewController.screenSizeChanged()
|
self.previewController.screenSizeChanged()
|
||||||
|
self.liveController.screenSizeChanged()
|
||||||
self.setFocus()
|
self.setFocus()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
"""
|
"""
|
||||||
|
@ -660,6 +660,18 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
pixmap.save(thumb, u'png')
|
pixmap.save(thumb, u'png')
|
||||||
log.debug(u'Theme image written to %s', samplepathname)
|
log.debug(u'Theme image written to %s', samplepathname)
|
||||||
|
|
||||||
|
def updatePreviewImages(self):
|
||||||
|
"""
|
||||||
|
Called to update the themes' preview images.
|
||||||
|
"""
|
||||||
|
self.mainwindow.displayProgressBar(len(self.themelist))
|
||||||
|
for theme in self.themelist:
|
||||||
|
self.mainwindow.incrementProgressBar()
|
||||||
|
self.generateAndSaveImage(
|
||||||
|
self.path, theme, self.getThemeData(theme))
|
||||||
|
self.mainwindow.finishedProgressBar()
|
||||||
|
self.loadThemes()
|
||||||
|
|
||||||
def generateImage(self, themeData, forcePage=False):
|
def generateImage(self, themeData, forcePage=False):
|
||||||
"""
|
"""
|
||||||
Call the renderer to build a Sample Image
|
Call the renderer to build a Sample Image
|
||||||
|
@ -342,7 +342,7 @@ def add_actions(target, actions):
|
|||||||
The menu or toolbar to add actions to.
|
The menu or toolbar to add actions to.
|
||||||
|
|
||||||
``actions``
|
``actions``
|
||||||
The actions to be added. An action consisting of the keyword 'None'
|
The actions to be added. An action consisting of the keyword ``None``
|
||||||
will result in a separator being inserted into the target.
|
will result in a separator being inserted into the target.
|
||||||
"""
|
"""
|
||||||
for action in actions:
|
for action in actions:
|
||||||
|
Loading…
Reference in New Issue
Block a user