forked from openlp/openlp
Updated the settings tab.
This commit is contained in:
parent
99635299ea
commit
c74b2fc964
@ -28,8 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate
|
from openlp.core.lib import SettingsTab, translate, build_icon
|
||||||
from openlp.core.lib.ui import UiStrings
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
from openlp.core.utils import get_images_filter
|
||||||
|
|
||||||
class AdvancedTab(SettingsTab):
|
class AdvancedTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
@ -100,6 +101,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
self.defaultFileEdit.setObjectName(u'defaultFileEdit')
|
self.defaultFileEdit.setObjectName(u'defaultFileEdit')
|
||||||
self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox)
|
self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox)
|
||||||
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
|
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
|
||||||
|
self.defaultBrowseButton.setIcon(
|
||||||
|
build_icon(u':/general/general_open.png'))
|
||||||
self.defaultFileLayout = QtGui.QHBoxLayout()
|
self.defaultFileLayout = QtGui.QHBoxLayout()
|
||||||
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
|
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
|
||||||
self.defaultFileLayout.addWidget(self.defaultFileEdit)
|
self.defaultFileLayout.addWidget(self.defaultFileEdit)
|
||||||
@ -111,6 +114,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
|
|
||||||
QtCore.QObject.connect(self.defaultColorButton,
|
QtCore.QObject.connect(self.defaultColorButton,
|
||||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
|
||||||
|
QtCore.QObject.connect(self.defaultBrowseButton,
|
||||||
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
@ -139,7 +144,6 @@ class AdvancedTab(SettingsTab):
|
|||||||
'Background color:'))
|
'Background color:'))
|
||||||
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
|
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
|
||||||
'Image file:'))
|
'Image file:'))
|
||||||
self.defaultBrowseButton.setTitle('...')
|
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -195,8 +199,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
||||||
settings.setValue(u'hide mouse',
|
settings.setValue(u'hide mouse',
|
||||||
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
||||||
settings.setValue(u'default background color', self.default_color)
|
settings.setValue(u'default color', self.default_color)
|
||||||
settings.setValue(u'default image', self.default_image)
|
settings.setValue(u'default image', self.defaultFileEdit.text())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def onDefaultColorButtonPressed(self):
|
def onDefaultColorButtonPressed(self):
|
||||||
@ -207,3 +211,12 @@ class AdvancedTab(SettingsTab):
|
|||||||
self.defaultColorButton.setStyleSheet(
|
self.defaultColorButton.setStyleSheet(
|
||||||
u'background-color: %s' % self.default_color)
|
u'background-color: %s' % self.default_color)
|
||||||
|
|
||||||
|
def onDefaultBrowseButtonPressed(self):
|
||||||
|
file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
|
||||||
|
UiStrings.AllFiles)
|
||||||
|
filename = QtGui.QFileDialog.getOpenFileName(self,
|
||||||
|
translate('OpenLP.AdvancedTab', 'Open File'), '',
|
||||||
|
file_filters)
|
||||||
|
if filename:
|
||||||
|
self.defaultFileEdit.setText(filename)
|
||||||
|
self.defaultFileEdit.setFocus()
|
||||||
|
Loading…
Reference in New Issue
Block a user