2009-01-01 10:03:09 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2009-09-08 19:58:05 +00:00
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
2009-01-02 20:20:33 +00:00
|
|
|
|
2009-09-08 19:58:05 +00:00
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2010-12-26 11:04:47 +00:00
|
|
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
2010-07-24 22:10:47 +00:00
|
|
|
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
|
|
|
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
|
|
|
# Carsten Tinggaard, Frode Woldsund #
|
2009-09-08 19:58:05 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# 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-01-01 10:03:09 +00:00
|
|
|
|
2009-09-25 00:43:42 +00:00
|
|
|
from PyQt4 import QtGui
|
|
|
|
|
2010-05-31 22:06:16 +00:00
|
|
|
from openlp.core.lib import translate
|
2011-02-02 23:12:31 +00:00
|
|
|
from openlp.core.lib.ui import critical_error_message_box
|
2010-06-06 10:07:48 +00:00
|
|
|
from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog
|
|
|
|
|
2009-06-04 19:00:41 +00:00
|
|
|
class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
2009-01-01 10:03:09 +00:00
|
|
|
"""
|
|
|
|
Class documentation goes here.
|
|
|
|
"""
|
2009-07-24 20:40:34 +00:00
|
|
|
def __init__(self, parent=None):
|
2009-01-01 10:03:09 +00:00
|
|
|
"""
|
|
|
|
Constructor
|
|
|
|
"""
|
2009-06-04 19:00:41 +00:00
|
|
|
QtGui.QDialog.__init__(self, parent)
|
2009-01-01 10:03:09 +00:00
|
|
|
self.setupUi(self)
|
2009-06-04 16:14:10 +00:00
|
|
|
|
2009-07-24 20:40:34 +00:00
|
|
|
def exec_(self, clear=True):
|
|
|
|
if clear:
|
2011-01-04 21:06:50 +00:00
|
|
|
self.nameEdit.clear()
|
|
|
|
self.nameEdit.setFocus()
|
2009-07-24 20:40:34 +00:00
|
|
|
return QtGui.QDialog.exec_(self)
|
2009-02-19 22:25:58 +00:00
|
|
|
|
2009-07-26 08:36:57 +00:00
|
|
|
def accept(self):
|
2011-01-04 21:06:50 +00:00
|
|
|
if not self.nameEdit.text():
|
2011-02-02 23:12:31 +00:00
|
|
|
critical_error_message_box(
|
|
|
|
message=translate('SongsPlugin.TopicsForm',
|
2011-01-15 00:53:12 +00:00
|
|
|
'You need to type in a topic name.'))
|
2011-01-04 21:06:50 +00:00
|
|
|
self.nameEdit.setFocus()
|
2009-07-26 08:36:57 +00:00
|
|
|
return False
|
2009-06-14 15:12:40 +00:00
|
|
|
else:
|
2011-01-04 21:06:50 +00:00
|
|
|
return QtGui.QDialog.accept(self)
|