forked from openlp/openlp
Dialogs, Exceptions and PushButtons
This commit is contained in:
parent
4edef8bea2
commit
ce18ee8e7a
@ -54,7 +54,17 @@ def file_to_xml(xmlfile):
|
||||
``xmlfile``
|
||||
The name of the file.
|
||||
"""
|
||||
return open(xmlfile).read()
|
||||
file = None
|
||||
xml = None
|
||||
try:
|
||||
file = open(xmlfile, u'r')
|
||||
xml = file.read()
|
||||
except IOError:
|
||||
log.exception(u'Failed to open XML file')
|
||||
finally:
|
||||
if file:
|
||||
file.close()
|
||||
return xml
|
||||
|
||||
def str_to_bool(stringvalue):
|
||||
"""
|
||||
|
@ -24,8 +24,6 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib.toolbar import *
|
||||
|
||||
class BaseListWithDnD(QtGui.QListWidget):
|
||||
"""
|
||||
Please put a short description of what this class does in here.
|
||||
|
@ -125,3 +125,15 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
"""
|
||||
for widget in widgets:
|
||||
self.actions[widget].setVisible(True)
|
||||
|
||||
def addPushButton(self, imageFile=None, text=u''):
|
||||
"""
|
||||
Adds a push button to the toolbar.
|
||||
|
||||
Returns the push button
|
||||
"""
|
||||
pushButton = QtGui.QPushButton(buildIcon(imageFile), text)
|
||||
pushButton.setCheckable(True)
|
||||
pushButton.setFlat(True)
|
||||
self.addWidget(pushButton)
|
||||
return pushButton
|
@ -31,7 +31,7 @@ class AlertForm(QtGui.QDialog):
|
||||
log = logging.getLogger(u'AlertForm')
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtGui.QDialog.__init__(self, None)
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.setupUi(self)
|
||||
log.debug(u'Defined')
|
||||
|
@ -120,8 +120,6 @@ class Ui_AmendThemeDialog(object):
|
||||
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
||||
self.horizontalLayout_2.addWidget(self.ImageToolButton)
|
||||
self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget)
|
||||
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||
#self.BackgroundLayout.addItem(spacerItem, 7, 1, 1, 1)
|
||||
self.ThemeTabWidget.addTab(self.BackgroundTab, u'')
|
||||
self.FontMainTab = QtGui.QWidget()
|
||||
self.FontMainTab.setObjectName(u'FontMainTab')
|
||||
|
@ -9,14 +9,14 @@
|
||||
|
||||
import logging
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate, PluginStatus
|
||||
from openlp.core.lib import translate, PluginStatus, buildIcon
|
||||
|
||||
class PluginForm(QtGui.QDialog):
|
||||
global log
|
||||
log = logging.getLogger(u'PluginForm')
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QtGui.QDialog.__init__(self, None)
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.setupUi(self)
|
||||
log.debug(u'Defined')
|
||||
@ -24,6 +24,8 @@ class PluginForm(QtGui.QDialog):
|
||||
def setupUi(self, PluginForm):
|
||||
PluginForm.setObjectName(u'PluginForm')
|
||||
PluginForm.resize(400, 393)
|
||||
icon = buildIcon(u':/icon/openlp-logo-16x16.png')
|
||||
PluginForm.setWindowIcon(icon)
|
||||
self.PluginViewList = QtGui.QTableWidget(PluginForm)
|
||||
self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 331))
|
||||
self.PluginViewList.setObjectName(u'PluginViewList')
|
||||
|
@ -131,10 +131,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.onSlideSelectedLast)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(u'Close Screen',
|
||||
u':/slides/slide_close.png',
|
||||
translate(u'SlideController', u'Close Screen'),
|
||||
self.onBlankScreen)
|
||||
self.blackPushButton = self.Toolbar.addPushButton(
|
||||
u':/slides/slide_close.png')
|
||||
if not self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(u'Go Live',
|
||||
@ -190,6 +188,8 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
|
||||
if isLive:
|
||||
QtCore.QObject.connect(self.blackPushButton,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), self.onBlankScreen)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
|
||||
Receiver().send_message(u'request_spin_delay')
|
||||
@ -337,7 +337,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
row = self.PreviewListWidget.currentRow()
|
||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||
label = self.PreviewListWidget.cellWidget(row, 0)
|
||||
#label = self.PreviewListWidget.cellWidget(row, 0)
|
||||
frame = self.serviceitem.frames[row][u'image']
|
||||
before = time.time()
|
||||
if frame is None:
|
||||
|
@ -22,7 +22,6 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import os
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate
|
||||
|
Loading…
Reference in New Issue
Block a user