~ubuntu-branches/debian/wheezy/openlp/wheezy

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Raoul Snyman
  • Date: 2012-06-23 21:54:30 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120623215430-8qrmxy3d7jwv3jvn
Tags: 1.9.10-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# --------------------------------------------------------------------------- #
7
7
# Copyright (c) 2008-2012 Raoul Snyman                                        #
8
8
# Portions copyright (c) 2008-2012 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             #
 
9
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub,      #
 
10
# Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit,  #
 
11
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout,      #
 
12
# Simon Scudder, Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon      #
 
13
# Tibble, Dave Warnock, Frode Woldsund                                        #
13
14
# --------------------------------------------------------------------------- #
14
15
# This program is free software; you can redistribute it and/or modify it     #
15
16
# under the terms of the GNU General Public License as published by the Free  #
30
31
 
31
32
from openlp.core.lib import SettingsTab, Receiver, translate
32
33
from openlp.core.lib.ui import UiStrings
 
34
from openlp.core.lib.settings import Settings
33
35
from openlp.core.ui import ScreenList
34
36
 
35
37
log = logging.getLogger(__name__)
42
44
        """
43
45
        Initialise the general settings tab
44
46
        """
45
 
        self.screens = ScreenList.get_instance()
46
 
        self.icon_path = u':/icon/openlp-logo-16x16.png'
 
47
        self.screens = ScreenList()
 
48
        self.iconPath = u':/icon/openlp-logo-16x16.png'
47
49
        generalTranslated = translate('OpenLP.GeneralTab', 'General')
48
50
        SettingsTab.__init__(self, parent, u'General', generalTranslated)
49
51
 
65
67
        self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox)
66
68
        self.monitorComboBox.setObjectName(u'monitorComboBox')
67
69
        self.monitorLayout.addWidget(self.monitorComboBox, 1, 1, 1, 4)
68
 
        self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
69
 
        self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
70
 
        self.monitorLayout.addWidget(self.displayOnMonitorCheck, 2, 1, 1, 4)
71
70
        # Display Position
72
71
        self.overrideRadioButton = QtGui.QRadioButton(self.monitorGroupBox)
73
72
        self.overrideRadioButton.setObjectName(u'overrideRadioButton')
74
 
        self.monitorLayout.addWidget(self.overrideRadioButton, 3, 0, 1, 5)
 
73
        self.monitorLayout.addWidget(self.overrideRadioButton, 2, 0, 1, 5)
75
74
        # Custom position
76
75
        self.customXLabel = QtGui.QLabel(self.monitorGroupBox)
77
76
        self.customXLabel.setObjectName(u'customXLabel')
78
 
        self.monitorLayout.addWidget(self.customXLabel, 4, 1)
 
77
        self.monitorLayout.addWidget(self.customXLabel, 3, 1)
79
78
        self.customXValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
80
79
        self.customXValueEdit.setObjectName(u'customXValueEdit')
81
80
        self.customXValueEdit.setRange(-9999, 9999)
82
 
        self.monitorLayout.addWidget(self.customXValueEdit, 5, 1)
 
81
        self.monitorLayout.addWidget(self.customXValueEdit, 4, 1)
83
82
        self.customYLabel = QtGui.QLabel(self.monitorGroupBox)
84
83
        self.customYLabel.setObjectName(u'customYLabel')
85
 
        self.monitorLayout.addWidget(self.customYLabel, 4, 2)
 
84
        self.monitorLayout.addWidget(self.customYLabel, 3, 2)
86
85
        self.customYValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
87
86
        self.customYValueEdit.setObjectName(u'customYValueEdit')
88
87
        self.customYValueEdit.setRange(-9999, 9999)
89
 
        self.monitorLayout.addWidget(self.customYValueEdit, 5, 2)
 
88
        self.monitorLayout.addWidget(self.customYValueEdit, 4, 2)
90
89
        self.customWidthLabel = QtGui.QLabel(self.monitorGroupBox)
91
90
        self.customWidthLabel.setObjectName(u'customWidthLabel')
92
 
        self.monitorLayout.addWidget(self.customWidthLabel, 4, 3)
 
91
        self.monitorLayout.addWidget(self.customWidthLabel, 3, 3)
93
92
        self.customWidthValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
94
93
        self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
95
94
        self.customWidthValueEdit.setMaximum(9999)
96
 
        self.monitorLayout.addWidget(self.customWidthValueEdit, 5, 3)
 
95
        self.monitorLayout.addWidget(self.customWidthValueEdit, 4, 3)
97
96
        self.customHeightLabel = QtGui.QLabel(self.monitorGroupBox)
98
97
        self.customHeightLabel.setObjectName(u'customHeightLabel')
99
 
        self.monitorLayout.addWidget(self.customHeightLabel, 4, 4)
 
98
        self.monitorLayout.addWidget(self.customHeightLabel, 3, 4)
100
99
        self.customHeightValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
101
100
        self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
102
101
        self.customHeightValueEdit.setMaximum(9999)
103
 
        self.monitorLayout.addWidget(self.customHeightValueEdit, 5, 4)
 
102
        self.monitorLayout.addWidget(self.customHeightValueEdit, 4, 4)
 
103
        self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
 
104
        self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
 
105
        self.monitorLayout.addWidget(self.displayOnMonitorCheck, 5, 0, 1, 5)
104
106
        # Set up the stretchiness of each column, so that the first column
105
107
        # less stretchy (and therefore smaller) than the others
106
108
        self.monitorLayout.setColumnStretch(0, 1)
265
267
        """
266
268
        Load the settings to populate the form
267
269
        """
268
 
        settings = QtCore.QSettings()
 
270
        settings = Settings()
269
271
        settings.beginGroup(self.settingsSection)
270
272
        self.monitorComboBox.clear()
271
273
        self.monitorComboBox.addItems(self.screens.get_screen_list())
314
316
            u'audio repeat list', QtCore.QVariant(False)).toBool())
315
317
        settings.endGroup()
316
318
        self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
317
 
        self.displayOnMonitorCheck.setDisabled(
318
 
            self.overrideRadioButton.isChecked())
319
319
        self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
320
320
        self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
321
321
        self.customHeightValueEdit.setEnabled(
329
329
        """
330
330
        Save the settings from the form
331
331
        """
332
 
        settings = QtCore.QSettings()
 
332
        settings = Settings()
333
333
        settings.beginGroup(self.settingsSection)
334
334
        settings.setValue(u'monitor',
335
335
            QtCore.QVariant(self.monitorComboBox.currentIndex()))
408
408
            The state of the check box (boolean).
409
409
        """
410
410
        self.monitorComboBox.setDisabled(checked)
411
 
        self.displayOnMonitorCheck.setDisabled(checked)
412
411
        self.customXValueEdit.setEnabled(checked)
413
412
        self.customYValueEdit.setEnabled(checked)
414
413
        self.customHeightValueEdit.setEnabled(checked)