forked from openlp/openlp
Head
This commit is contained in:
commit
bb99be7f10
@ -74,7 +74,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
if event.key() == QtCore.Qt.Key_Space:
|
||||
self.keyReleaseEvent(event)
|
||||
elif self.primaryPushButton.isChecked() or self.alternatePushButton.isChecked():
|
||||
event.ignore()
|
||||
self.keyReleaseEvent(event)
|
||||
elif event.key() == QtCore.Qt.Key_Escape:
|
||||
event.accept()
|
||||
self.close()
|
||||
|
@ -281,7 +281,7 @@ class Controller(object):
|
||||
|
||||
class MessageListener(object):
|
||||
"""
|
||||
This is the Presentation listener who acts on events from the slide controller and passes the messages on the the
|
||||
This is the Presentation listener who acts on events from the slide controller and passes the messages on the
|
||||
correct presentation handlers
|
||||
"""
|
||||
log.info('Message Listener loaded')
|
||||
|
@ -292,8 +292,8 @@ class PresentationDocument(object):
|
||||
|
||||
class PresentationController(object):
|
||||
"""
|
||||
This class is used to control interactions with presentation applications by creating a runtime environment. This is
|
||||
a base class for presentation controllers to inherit from.
|
||||
This class is used to control interactions with presentation applications by creating a runtime environment.
|
||||
This is a base class for presentation controllers to inherit from.
|
||||
|
||||
To create a new controller, take a copy of this file and name it so it ends with ``controller.py``, i.e.
|
||||
``foobarcontroller.py``. Make sure it inherits
|
||||
@ -341,8 +341,7 @@ class PresentationController(object):
|
||||
"""
|
||||
log.info('PresentationController loaded')
|
||||
|
||||
def __init__(self, plugin=None, name='PresentationController',
|
||||
document_class=PresentationDocument):
|
||||
def __init__(self, plugin=None, name='PresentationController', document_class=PresentationDocument):
|
||||
"""
|
||||
This is the constructor for the presentationcontroller object. This provides an easy way for descendent plugins
|
||||
to populate common data. This method *must* be overridden, like so::
|
||||
|
@ -0,0 +1,53 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
|
||||
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# 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 #
|
||||
###############################################################################
|
||||
"""
|
||||
This module contains tests for the Presentation Controller.
|
||||
"""
|
||||
from unittest import TestCase
|
||||
|
||||
from openlp.plugins.presentations.lib.presentationcontroller import PresentationController
|
||||
from tests.functional import MagicMock
|
||||
|
||||
class TestPresentationController(TestCase):
|
||||
"""
|
||||
Test the PresentationController.
|
||||
"""
|
||||
def constructor_test(self):
|
||||
"""
|
||||
Test the Constructor
|
||||
"""
|
||||
# GIVEN: No presentation controller
|
||||
controller = None
|
||||
|
||||
# WHEN: The presentation controller object is created
|
||||
controller = PresentationController(plugin=MagicMock())
|
||||
|
||||
# THEN: The name of the presentation controller should be correct
|
||||
self.assertEqual('PresentationController', controller.name,
|
||||
'The name of the presentation controller should be correct')
|
Loading…
Reference in New Issue
Block a user