This commit is contained in:
Tim Bentley 2009-10-26 05:36:38 +00:00
commit 279d589b7b
4 changed files with 22 additions and 32 deletions

View File

@ -129,7 +129,8 @@ class Plugin(object):
self.settings = plugin_helpers[u'settings']
self.mediadock = plugin_helpers[u'toolbox']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_add_service_item'% self.name), self.process_add_service_event)
QtCore.SIGNAL(u'%s_add_service_item'% self.name),
self.process_add_service_event)
def check_pre_conditions(self):
"""

View File

@ -674,10 +674,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.font_main_italics)# italic
mainFont.setPixelSize(int(self.theme.font_main_proportion))
metrics = QtGui.QFontMetrics(mainFont)
page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2 ) - 1
log.debug(u'Page Length area height %s , metrics %s , lines %s' %
(int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length ))
self.FontMainLinesPageLabel.setText(
self.trUtf8((u'Slide Height is %s rows') % page_length))
page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2) - 1
log.debug(u'Page Length area height %s, metrics %s, lines %s' %
(int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length))
page_length_text = unicode(self.trUtf8(u'Slide Height is %s rows'))
self.FontMainLinesPageLabel.setText(page_length_text % page_length)
frame = self.thememanager.generateImage(theme)
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))

View File

@ -528,10 +528,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
version = check_latest_version(self.generalConfig, applicationVersion)
if applicationVersion != version:
version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated '
u'to version %s'))
QtGui.QMessageBox.question(None,
self.trUtf8(u'OpenLP version Updated'),
self.trUtf8(u'OpenLP version %s has been updated to version %s')
% (applicationVersion, version),
self.trUtf8(u'OpenLP Version Updated'),
version_text % (applicationVersion, version),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok)
self.generalConfig.set_config(u'Application version', version)

View File

@ -28,14 +28,6 @@ import time
from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, Receiver, ServiceType
label_stylesheet = u"""
QTableWidget::item:selected
{
background-color: %s;
}
"""
class SlideList(QtGui.QTableWidget):
"""
Customised version of QTableWidget which can respond to keyboard
@ -44,12 +36,6 @@ class SlideList(QtGui.QTableWidget):
def __init__(self, parent=None, name=None):
QtGui.QTableWidget.__init__(self, parent.Controller)
self.parent = parent
text_color = QtGui.QApplication.palette().color(QtGui.QPalette.Base)
if text_color.value() > 128:
text_color = text_color.darker(120).name()
else:
text_color = text_color.lighter(120).name()
self.setStyleSheet(label_stylesheet % text_color)
def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent:
@ -336,22 +322,24 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setRowCount(
self.PreviewListWidget.rowCount() + 1)
item = QtGui.QTableWidgetItem()
label = QtGui.QLabel()
label.setMargin(4)
slide_height = 0
#It is a Image
if frame[u'text'] is None:
label = QtGui.QLabel()
label.setMargin(4)
pixmap = self.parent.RenderManager.resize_image(frame[u'image'])
label.setScaledContents(True)
label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
slide_height = self.settingsmanager.slidecontroller_image * \
self.parent.RenderManager.screen_ratio
else:
label.setText(frame[u'text'])
label.setAlignment(QtCore.Qt.AlignHCenter)
slide_height = label.sizeHint().height()
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
item.setText(frame[u'text'])
self.PreviewListWidget.setItem(framenumber, 0, item)
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
if slide_height != 0:
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
if self.serviceitem.frames[0][u'text'] is not None:
self.PreviewListWidget.resizeRowsToContents()
self.PreviewListWidget.setColumnWidth(
0, self.PreviewListWidget.viewport().size().width())
if slideno > self.PreviewListWidget.rowCount():
@ -427,11 +415,11 @@ class SlideController(QtGui.QWidget):
winid = QtGui.QApplication.desktop().winId()
rect = rm.screen_list[rm.current_display][u'size']
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height())
self.SlidePreview.setPixmap(winimg)
self.SlidePreview.setPixmap(winimg)
else:
label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0)
self.SlidePreview.setPixmap(label.pixmap())
def onSlideSelectedNext(self):
"""
Go to the next slide.