openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #09011
[Merge] lp:~googol-hush/openlp/tweaks into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/tweaks into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
Raoul Snyman (raoul-snyman)
Jonathan Corwin (j-corwin)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/61749
Hello,
Changed the order the live screen/preview screen are set up (If you have a single monitor setup the live screen will be set visible so you have to wait until the update process is finished)
Added a menu entry to update the theme preview images.
--
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/61749
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-05-14 11:48:15 +0000
+++ openlp/core/ui/mainwindow.py 2011-05-20 11:57:28 +0000
@@ -229,6 +229,8 @@
self.ToolsOpenDataFolder = icon_action(mainWindow,
u'ToolsOpenDataFolder', u':/general/general_open.png',
category=UiStrings().Tools)
+ self.updateThemeImages = base_action(mainWindow,
+ u'updateThemeImages', category=UiStrings().Tools)
action_list.add_category(UiStrings().Settings, CategoryOrder.standardMenu)
self.settingsPluginListItem = shortcut_action(mainWindow,
u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
@@ -292,6 +294,7 @@
self.SettingsConfigureItem))
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
+ add_actions(self.ToolsMenu, [self.updateThemeImages])
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
self.HelpOnlineHelpItem, None, self.helpWebSiteItem,
self.HelpAboutItem))
@@ -433,6 +436,11 @@
translate('OpenLP.MainWindow', 'Open &Data Folder...'))
self.ToolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
'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(
translate('OpenLP.MainWindow', '&Default'))
self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
@@ -505,6 +513,8 @@
QtCore.SIGNAL(u'triggered()'), self.onHelpOnLineHelpClicked)
QtCore.QObject.connect(self.ToolsOpenDataFolder,
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
+ QtCore.QObject.connect(self.updateThemeImages,
+ QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
QtCore.QObject.connect(self.DisplayTagItem,
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
QtCore.QObject.connect(self.SettingsConfigureItem,
@@ -717,6 +727,12 @@
path = AppLocation.get_data_path()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
+ def onUpdateThemeImages(self):
+ """
+ Updates the new theme preview images.
+ """
+ self.themeManagerContents.updatePreviewImages()
+
def onDisplayTagItemClicked(self):
"""
Show the Settings dialog
@@ -778,16 +794,18 @@
def screenChanged(self):
"""
- The screen has changed to so tell the displays to update_display
- their locations
+ The screen has changed so we have to update components such as the
+ renderer.
"""
log.debug(u'screenChanged')
+ Receiver.send_message(u'cursor_busy')
self.image_manager.update_display()
self.renderer.update_display()
+ self.previewController.screenSizeChanged()
self.liveController.screenSizeChanged()
- self.previewController.screenSizeChanged()
self.setFocus()
self.activateWindow()
+ Receiver.send_message(u'cursor_normal')
def closeEvent(self, event):
"""
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2011-05-03 17:05:17 +0000
+++ openlp/core/ui/thememanager.py 2011-05-20 11:57:28 +0000
@@ -660,6 +660,31 @@
pixmap.save(thumb, u'png')
log.debug(u'Theme image written to %s', samplepathname)
+ def updatePreviewImages(self):
+ """
+ Called to update the themes' preview images.
+ """
+ progressDialog = QtGui.QProgressDialog(self.mainwindow)
+ progressDialog.setWindowModality(QtCore.Qt.WindowModal)
+ progressDialog.setLabelText(
+ translate('OpenLP.ThemeManager', 'Starting update...',
+ 'Shown when you update the theme images.'))
+ progressDialog.setCancelButton(None)
+ progressDialog.setRange(0, len(self.themelist))
+ progressDialog.setMinimumDuration(0)
+ progressDialog.forceShow()
+ Receiver.send_message(u'openlp_process_events')
+ for index, theme in enumerate(self.themelist):
+ progressDialog.setValue(index)
+ progressDialog.setLabelText(unicode(translate('OpenLP.ThemeManager',
+ 'Updating %s...',
+ 'Shown when you update the theme images.')) % theme)
+ Receiver.send_message(u'openlp_process_events')
+ self.generateAndSaveImage(
+ self.path, theme, self.getThemeData(theme))
+ progressDialog.setValue(len(self.themelist))
+ self.loadThemes()
+
def generateImage(self, themeData, forcePage=False):
"""
Call the renderer to build a Sample Image
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2011-04-30 07:42:20 +0000
+++ openlp/core/utils/__init__.py 2011-05-20 11:57:28 +0000
@@ -342,7 +342,7 @@
The menu or toolbar to add actions to.
``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.
"""
for action in actions:
Follow ups