openlp/openlp/plugins/presentations/lib/presentationtab.py

96 lines
5.1 KiB
Python
Raw Normal View History

2009-06-01 18:37:06 +00:00
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
"""
from PyQt4 import Qt, QtCore, QtGui
from openlp.core.lib import SettingsTab, translate, str_to_bool
2009-06-01 18:37:06 +00:00
class PresentationTab(SettingsTab):
"""
PresentationsTab is the Presentations settings tab in the settings dialog.
2009-06-01 18:37:06 +00:00
"""
def __init__(self):
SettingsTab.__init__(self, translate(u'PresentationTab', u'Presentation'), u'Presentations')
2009-06-01 18:37:06 +00:00
def setupUi(self):
self.setObjectName(u'PresentationTab')
self.PresentationLayout = QtGui.QHBoxLayout(self)
self.PresentationLayout.setSpacing(8)
self.PresentationLayout.setMargin(8)
self.PresentationLayout.setObjectName(u'PresentationLayout')
self.PresentationLeftWidget = QtGui.QWidget(self)
self.PresentationLeftWidget.setObjectName(u'PresentationLeftWidget')
self.PresentationLeftLayout = QtGui.QVBoxLayout(self.PresentationLeftWidget)
self.PresentationLeftLayout.setObjectName(u'PresentationLeftLayout')
self.PresentationLeftLayout.setSpacing(8)
self.PresentationLeftLayout.setMargin(0)
2009-06-01 18:37:06 +00:00
self.VerseDisplayGroupBox = QtGui.QGroupBox(self)
self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox')
self.VerseDisplayLayout = QtGui.QGridLayout(self.VerseDisplayGroupBox)
self.VerseDisplayLayout.setMargin(8)
self.VerseDisplayLayout.setObjectName(u'VerseDisplayLayout')
self.VerseTypeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
self.VerseTypeWidget.setObjectName(u'VerseTypeWidget')
self.VerseTypeLayout = QtGui.QHBoxLayout(self.VerseTypeWidget)
self.VerseTypeLayout.setSpacing(8)
self.VerseTypeLayout.setMargin(0)
self.VerseTypeLayout.setObjectName(u'VerseTypeLayout')
self.PowerpointCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
self.PowerpointCheckBox.setTristate(False)
self.PowerpointCheckBox.setObjectName(u'PowerpointCheckBox')
2009-06-01 18:37:06 +00:00
self.VerseDisplayLayout.addWidget(self.PowerpointCheckBox, 0, 0, 1, 1)
self.ImpressCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
self.ImpressCheckBox.setTristate(False)
self.ImpressCheckBox.setObjectName(u'ImpressCheckBox')
2009-06-01 18:37:06 +00:00
self.VerseDisplayLayout.addWidget(self.ImpressCheckBox, 2, 0, 1, 1)
self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget')
self.PresentationThemeLayout = QtGui.QHBoxLayout(self.PresentationThemeWidget)
self.PresentationThemeLayout.setSpacing(8)
self.PresentationThemeLayout.setMargin(0)
self.PresentationThemeLayout.setObjectName(u'PresentationThemeLayout')
self.PresentationLeftLayout.addWidget(self.VerseDisplayGroupBox)
self.PresentationLeftSpacer = QtGui.QSpacerItem(40, 20,
2009-06-01 18:37:06 +00:00
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.PresentationLeftLayout.addItem(self.PresentationLeftSpacer)
self.PresentationLayout.addWidget(self.PresentationLeftWidget)
self.PresentationRightWidget = QtGui.QWidget(self)
self.PresentationRightWidget.setObjectName(u'PresentationRightWidget')
self.PresentationRightLayout = QtGui.QVBoxLayout(self.PresentationRightWidget)
self.PresentationRightLayout.setObjectName(u'PresentationRightLayout')
self.PresentationRightLayout.setSpacing(8)
self.PresentationRightLayout.setMargin(0)
self.PresentationRightSpacer = QtGui.QSpacerItem(50, 20,
2009-06-01 18:37:06 +00:00
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.PresentationRightLayout.addItem(self.PresentationRightSpacer)
self.PresentationLayout.addWidget(self.PresentationRightWidget)
2009-06-01 18:37:06 +00:00
def retranslateUi(self):
self.PowerpointCheckBox.setText(translate(u'PresentationTab', 'Powerpoint available:'))
self.ImpressCheckBox.setText(translate(u'PresentationTab', 'Impress available:'))
2009-06-01 18:37:06 +00:00
def load(self):
self.PowerpointCheckBox.setChecked(int(self.config.get_config(u'Powerpoint', 0)))
self.ImpressCheckBox.setChecked(int(self.config.get_config(u'Impress', 0)))
2009-06-01 18:37:06 +00:00
def save(self):
self.config.set_config(u'Powerpoint', unicode(self.PowerpointCheckBox.checkState()))
self.config.set_config(u'Impress', unicode(self.ImpressCheckBox.checkState()))