forked from openlp/openlp
Merged in Windows changes.
This commit is contained in:
commit
d54a023611
@ -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):
|
||||||
"""
|
"""
|
||||||
|
@ -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(130).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