forked from openlp/openlp
Headr629
This commit is contained in:
commit
279d589b7b
@ -129,7 +129,8 @@ class Plugin(object):
|
|||||||
self.settings = plugin_helpers[u'settings']
|
self.settings = plugin_helpers[u'settings']
|
||||||
self.mediadock = plugin_helpers[u'toolbox']
|
self.mediadock = plugin_helpers[u'toolbox']
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
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):
|
def check_pre_conditions(self):
|
||||||
"""
|
"""
|
||||||
|
@ -674,10 +674,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.theme.font_main_italics)# italic
|
self.theme.font_main_italics)# italic
|
||||||
mainFont.setPixelSize(int(self.theme.font_main_proportion))
|
mainFont.setPixelSize(int(self.theme.font_main_proportion))
|
||||||
metrics = QtGui.QFontMetrics(mainFont)
|
metrics = QtGui.QFontMetrics(mainFont)
|
||||||
page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2 ) - 1
|
page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2) - 1
|
||||||
log.debug(u'Page Length area height %s , metrics %s , lines %s' %
|
log.debug(u'Page Length area height %s, metrics %s, lines %s' %
|
||||||
(int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length ))
|
(int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length))
|
||||||
self.FontMainLinesPageLabel.setText(
|
page_length_text = unicode(self.trUtf8(u'Slide Height is %s rows'))
|
||||||
self.trUtf8((u'Slide Height is %s rows') % page_length))
|
self.FontMainLinesPageLabel.setText(page_length_text % page_length)
|
||||||
frame = self.thememanager.generateImage(theme)
|
frame = self.thememanager.generateImage(theme)
|
||||||
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
|
@ -528,10 +528,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
|
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
|
||||||
version = check_latest_version(self.generalConfig, applicationVersion)
|
version = check_latest_version(self.generalConfig, applicationVersion)
|
||||||
if applicationVersion != version:
|
if applicationVersion != version:
|
||||||
|
version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated '
|
||||||
|
u'to version %s'))
|
||||||
QtGui.QMessageBox.question(None,
|
QtGui.QMessageBox.question(None,
|
||||||
self.trUtf8(u'OpenLP version Updated'),
|
self.trUtf8(u'OpenLP Version Updated'),
|
||||||
self.trUtf8(u'OpenLP version %s has been updated to version %s')
|
version_text % (applicationVersion, version),
|
||||||
% (applicationVersion, version),
|
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
|
||||||
QtGui.QMessageBox.Ok)
|
QtGui.QMessageBox.Ok)
|
||||||
self.generalConfig.set_config(u'Application version', version)
|
self.generalConfig.set_config(u'Application version', version)
|
||||||
|
@ -28,14 +28,6 @@ import time
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, ServiceType
|
from openlp.core.lib import OpenLPToolbar, Receiver, ServiceType
|
||||||
|
|
||||||
label_stylesheet = u"""
|
|
||||||
QTableWidget::item:selected
|
|
||||||
{
|
|
||||||
background-color: %s;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class SlideList(QtGui.QTableWidget):
|
class SlideList(QtGui.QTableWidget):
|
||||||
"""
|
"""
|
||||||
Customised version of QTableWidget which can respond to keyboard
|
Customised version of QTableWidget which can respond to keyboard
|
||||||
@ -44,12 +36,6 @@ class SlideList(QtGui.QTableWidget):
|
|||||||
def __init__(self, parent=None, name=None):
|
def __init__(self, parent=None, name=None):
|
||||||
QtGui.QTableWidget.__init__(self, parent.Controller)
|
QtGui.QTableWidget.__init__(self, parent.Controller)
|
||||||
self.parent = parent
|
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):
|
def keyPressEvent(self, event):
|
||||||
if type(event) == QtGui.QKeyEvent:
|
if type(event) == QtGui.QKeyEvent:
|
||||||
@ -336,22 +322,24 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewListWidget.setRowCount(
|
self.PreviewListWidget.setRowCount(
|
||||||
self.PreviewListWidget.rowCount() + 1)
|
self.PreviewListWidget.rowCount() + 1)
|
||||||
item = QtGui.QTableWidgetItem()
|
item = QtGui.QTableWidgetItem()
|
||||||
label = QtGui.QLabel()
|
slide_height = 0
|
||||||
label.setMargin(4)
|
|
||||||
#It is a Image
|
#It is a Image
|
||||||
if frame[u'text'] is None:
|
if frame[u'text'] is None:
|
||||||
|
label = QtGui.QLabel()
|
||||||
|
label.setMargin(4)
|
||||||
pixmap = self.parent.RenderManager.resize_image(frame[u'image'])
|
pixmap = self.parent.RenderManager.resize_image(frame[u'image'])
|
||||||
label.setScaledContents(True)
|
label.setScaledContents(True)
|
||||||
label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
|
label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
|
||||||
|
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
||||||
slide_height = self.settingsmanager.slidecontroller_image * \
|
slide_height = self.settingsmanager.slidecontroller_image * \
|
||||||
self.parent.RenderManager.screen_ratio
|
self.parent.RenderManager.screen_ratio
|
||||||
else:
|
else:
|
||||||
label.setText(frame[u'text'])
|
item.setText(frame[u'text'])
|
||||||
label.setAlignment(QtCore.Qt.AlignHCenter)
|
|
||||||
slide_height = label.sizeHint().height()
|
|
||||||
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
|
||||||
self.PreviewListWidget.setItem(framenumber, 0, item)
|
self.PreviewListWidget.setItem(framenumber, 0, item)
|
||||||
|
if slide_height != 0:
|
||||||
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
|
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
|
||||||
|
if self.serviceitem.frames[0][u'text'] is not None:
|
||||||
|
self.PreviewListWidget.resizeRowsToContents()
|
||||||
self.PreviewListWidget.setColumnWidth(
|
self.PreviewListWidget.setColumnWidth(
|
||||||
0, self.PreviewListWidget.viewport().size().width())
|
0, self.PreviewListWidget.viewport().size().width())
|
||||||
if slideno > self.PreviewListWidget.rowCount():
|
if slideno > self.PreviewListWidget.rowCount():
|
||||||
|
Loading…
Reference in New Issue
Block a user