~openlp-core/openlp/trunk

« back to all changes in this revision

Viewing changes to openlp/core/ui/themelayoutform.py

  • Committer: Tim Bentley
  • Date: 2011-10-05 18:20:54 UTC
  • mfrom: (1405.2.169 beta1)
  • Revision ID: tim.bentley@gmail.com-20111005182054-8bjvjwduyxrl21gr
Number of changes
- Allow time (24/12) hour for sage view
- Add pictorial display of the lay out in theme manage
- Fix bug where remote edit removes an overridden theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
 
3
 
 
4
###############################################################################
 
5
# OpenLP - Open Source Lyrics Projection                                      #
 
6
# --------------------------------------------------------------------------- #
 
7
# Copyright (c) 2008-2011 Raoul Snyman                                        #
 
8
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan      #
 
9
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan,      #
 
10
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias     #
 
11
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith,    #
 
12
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund             #
 
13
# --------------------------------------------------------------------------- #
 
14
# This program is free software; you can redistribute it and/or modify it     #
 
15
# under the terms of the GNU General Public License as published by the Free  #
 
16
# Software Foundation; version 2 of the License.                              #
 
17
#                                                                             #
 
18
# This program is distributed in the hope that it will be useful, but WITHOUT #
 
19
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
 
20
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    #
 
21
# more details.                                                               #
 
22
#                                                                             #
 
23
# You should have received a copy of the GNU General Public License along     #
 
24
# with this program; if not, write to the Free Software Foundation, Inc., 59  #
 
25
# Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
 
26
###############################################################################
 
27
 
 
28
from PyQt4 import QtGui, QtCore
 
29
 
 
30
from themelayoutdialog import Ui_ThemeLayoutDialog
 
31
 
 
32
from openlp.core.lib import translate
 
33
from openlp.core.lib.ui import UiStrings, critical_error_message_box
 
34
 
 
35
class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog):
 
36
    """
 
37
    The exception dialog
 
38
    """
 
39
    def __init__(self, parent):
 
40
        QtGui.QDialog.__init__(self, parent)
 
41
        self.setupUi(self)
 
42
 
 
43
    def exec_(self, image):
 
44
        """
 
45
        Run the Dialog with correct heading.
 
46
        """
 
47
        pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation)
 
48
        self.themeDisplayLabel.setPixmap(image)
 
49
        displayAspectRatio = float(image.width()) / image.height()
 
50
        self.themeDisplayLabel.setFixedSize(400, 400 / displayAspectRatio )
 
51
        return QtGui.QDialog.exec_(self)
 
52
 
 
53
    def accept(self):
 
54
        return QtGui.QDialog.accept(self)
 
55