2009-02-28 23:31:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
|
2009-09-08 19:58:05 +00:00
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# Copyright (c) 2008-2009 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
|
|
|
|
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
|
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# 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 #
|
|
|
|
###############################################################################
|
2009-02-28 23:31:24 +00:00
|
|
|
|
2009-10-17 05:47:17 +00:00
|
|
|
from PyQt4 import QtCore, QtGui
|
|
|
|
|
2009-10-17 06:12:38 +00:00
|
|
|
from openlp.core.lib import SettingsTab, str_to_bool, translate
|
2009-02-28 23:31:24 +00:00
|
|
|
|
|
|
|
class SongsTab(SettingsTab):
|
|
|
|
"""
|
2009-10-17 05:47:17 +00:00
|
|
|
SongsTab is the Songs settings tab in the settings dialog.
|
2009-02-28 23:31:24 +00:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
2009-10-23 18:48:49 +00:00
|
|
|
SettingsTab.__init__(self, u'Songs', u'Songs')
|
2009-02-28 23:31:24 +00:00
|
|
|
|
|
|
|
def setupUi(self):
|
|
|
|
self.setObjectName(u'SongsTab')
|
2009-10-17 05:47:17 +00:00
|
|
|
self.SongsLayout = QtGui.QFormLayout(self)
|
|
|
|
self.SongsLayout.setObjectName(u'SongsLayout')
|
|
|
|
self.SongsModeGroupBox = QtGui.QGroupBox(self)
|
|
|
|
self.SongsModeGroupBox.setObjectName(u'SongsModeGroupBox')
|
|
|
|
self.SongsModeLayout = QtGui.QVBoxLayout(self.SongsModeGroupBox)
|
|
|
|
self.SongsModeLayout.setSpacing(8)
|
|
|
|
self.SongsModeLayout.setMargin(8)
|
|
|
|
self.SongsModeLayout.setObjectName(u'SongsModeLayout')
|
|
|
|
self.SearchAsTypeCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
|
|
|
|
self.SearchAsTypeCheckBox.setObjectName(u'SearchAsTypeCheckBox')
|
|
|
|
self.SongsModeLayout.addWidget(self.SearchAsTypeCheckBox)
|
|
|
|
self.SongsLayout.setWidget(
|
|
|
|
0, QtGui.QFormLayout.LabelRole, self.SongsModeGroupBox)
|
|
|
|
QtCore.QObject.connect(self.SearchAsTypeCheckBox,
|
|
|
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
|
|
|
self.onSearchAsTypeCheckBoxChanged)
|
|
|
|
|
|
|
|
def retranslateUi(self):
|
2009-10-23 18:48:49 +00:00
|
|
|
self.SongsModeGroupBox.setTitle(self.trUtf8(u'Songs Mode'))
|
|
|
|
self.SearchAsTypeCheckBox.setText(self.trUtf8(u'Enable search as you type:'))
|
2009-10-17 05:47:17 +00:00
|
|
|
|
|
|
|
def onSearchAsTypeCheckBoxChanged(self, check_state):
|
|
|
|
self.bible_search = False
|
|
|
|
# we have a set value convert to True/False
|
|
|
|
if check_state == QtCore.Qt.Checked:
|
|
|
|
self.bible_search = True
|
|
|
|
|
|
|
|
def load(self):
|
|
|
|
self.bible_search = str_to_bool(
|
|
|
|
self.config.get_config(u'search as type', u'False'))
|
|
|
|
self.SearchAsTypeCheckBox.setChecked(self.bible_search)
|
|
|
|
|
|
|
|
def save(self):
|
|
|
|
self.config.set_config(u'search as type', unicode(self.bible_search))
|