~wgrant/openlp/openlyrics_test

« back to all changes in this revision

Viewing changes to openlp/plugins/remotes/lib/remotetab.py

  • Committer: Martin Zibricky
  • Date: 2011-10-06 16:16:29 UTC
  • mfrom: (1186.2.584 openlp)
  • Revision ID: mzibr.public@gmail.com-20111006161629-17tyvvq60h3h15dd
[merge] r1770, rename testing dir to tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        QtCore.QObject.connect(self.addressEdit,
58
58
            QtCore.SIGNAL(u'textChanged(const QString&)'), self.setUrls)
59
59
        self.serverSettingsLayout.addRow(self.addressLabel, self.addressEdit)
 
60
        self.twelveHourCheckBox = QtGui.QCheckBox(self.serverSettingsGroupBox)
 
61
        self.twelveHourCheckBox.setObjectName(u'twelveHourCheckBox')
 
62
        self.serverSettingsLayout.addRow(self.twelveHourCheckBox)
60
63
        self.portLabel = QtGui.QLabel(self.serverSettingsGroupBox)
61
64
        self.portLabel.setObjectName(u'portLabel')
62
65
        self.portSpinBox = QtGui.QSpinBox(self.serverSettingsGroupBox)
80
83
        self.leftLayout.addWidget(self.serverSettingsGroupBox)
81
84
        self.leftLayout.addStretch()
82
85
        self.rightLayout.addStretch()
 
86
        QtCore.QObject.connect(self.twelveHourCheckBox,
 
87
            QtCore.SIGNAL(u'stateChanged(int)'),
 
88
            self.onTwelveHourCheckBoxChanged)
83
89
 
84
90
    def retranslateUi(self):
85
91
        self.serverSettingsGroupBox.setTitle(
92
98
            'Remote URL:'))
93
99
        self.stageUrlLabel.setText(translate('RemotePlugin.RemoteTab',
94
100
            'Stage view URL:'))
 
101
        self.twelveHourCheckBox.setText(
 
102
            translate('RemotePlugin.RemoteTab',
 
103
            'Display stage time in 12h format'))
95
104
 
96
105
    def setUrls(self):
97
106
        ipAddress = u'localhost'
123
132
        self.addressEdit.setText(
124
133
            QtCore.QSettings().value(self.settingsSection + u'/ip address',
125
134
                QtCore.QVariant(ZERO_URL)).toString())
 
135
        self.twelveHour = QtCore.QSettings().value(
 
136
            self.settingsSection + u'/twelve hour',
 
137
            QtCore.QVariant(True)).toBool()
 
138
        self.twelveHourCheckBox.setChecked(self.twelveHour)
126
139
        self.setUrls()
127
140
 
128
141
    def save(self):
130
143
            QtCore.QVariant(self.portSpinBox.value()))
131
144
        QtCore.QSettings().setValue(self.settingsSection + u'/ip address',
132
145
            QtCore.QVariant(self.addressEdit.text()))
 
146
        QtCore.QSettings().setValue(self.settingsSection + u'/twelve hour',
 
147
            QtCore.QVariant(self.twelveHour))
 
148
 
 
149
    def onTwelveHourCheckBoxChanged(self, check_state):
 
150
        self.twelveHour = False
 
151
        # we have a set value convert to True/False
 
152
        if check_state == QtCore.Qt.Checked:
 
153
            self.twelveHour = True