openlp/openlp/core/ui/themelayoutform.py

57 lines
2.8 KiB
Python
Raw Normal View History

2011-10-02 07:52:28 +00:00
# -*- coding: utf-8 -*-
2012-12-29 15:25:29 +00:00
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2011-10-02 07:52:28 +00:00
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2013-12-24 08:56:50 +00:00
# Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
2012-11-11 21:16:14 +00:00
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
2012-10-21 13:16:22 +00:00
# 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 #
2011-10-02 07:52:28 +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 #
###############################################################################
2013-02-01 21:34:23 +00:00
"""
The form layout
"""
2011-10-02 07:52:28 +00:00
from PyQt4 import QtGui, QtCore
2013-08-31 18:17:38 +00:00
from .themelayoutdialog import Ui_ThemeLayoutDialog
2011-10-02 07:52:28 +00:00
2013-02-01 21:34:23 +00:00
2011-10-02 07:52:28 +00:00
class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog):
"""
The exception dialog
"""
def __init__(self, parent):
2013-02-01 21:34:23 +00:00
"""
Constructor
"""
2013-07-18 14:14:29 +00:00
super(ThemeLayoutForm, self).__init__(parent)
2011-10-02 07:52:28 +00:00
self.setupUi(self)
def exec_(self, image):
"""
Run the Dialog with correct heading.
"""
2011-10-02 16:38:05 +00:00
pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation)
2013-12-26 17:36:00 +00:00
self.theme_display_label.setPixmap(pixmap)
display_aspect_ratio = float(image.width()) / image.height()
self.theme_display_label.setFixedSize(400, 400 / display_aspect_ratio)
2011-10-02 07:52:28 +00:00
return QtGui.QDialog.exec_(self)