forked from openlp/openlp
Clean up DisplayTags UI
This commit is contained in:
parent
f77c93f733
commit
36ba62d86f
@ -112,11 +112,16 @@ class Ui_DisplayTagDialog(object):
|
||||
self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
|
||||
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
|
||||
self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1)
|
||||
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
|
||||
self.updatePushButton.setObjectName(u'updatePushButton')
|
||||
self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1)
|
||||
self.savePushButton = QtGui.QPushButton(self.editGroupBox)
|
||||
self.savePushButton.setObjectName(u'savePushButton')
|
||||
self.dataGridLayout.addWidget(self.savePushButton, 4, 2, 1, 1)
|
||||
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
|
||||
self.buttonBox = create_accept_reject_button_box(displayTagDialog)
|
||||
self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog)
|
||||
closeButton = QtGui.QDialogButtonBox.Close
|
||||
self.buttonBox.setObjectName('displayTagDialogButtonBox')
|
||||
self.buttonBox.setStandardButtons(closeButton)
|
||||
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
|
||||
self.reject)
|
||||
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(displayTagDialog)
|
||||
@ -127,8 +132,8 @@ class Ui_DisplayTagDialog(object):
|
||||
'Configure Display Tags'))
|
||||
self.editGroupBox.setTitle(
|
||||
translate('OpenLP.DisplayTagDialog', 'Edit Selection'))
|
||||
self.updatePushButton.setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Update'))
|
||||
self.savePushButton.setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Save'))
|
||||
self.descriptionLabel.setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||
self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag'))
|
||||
@ -151,4 +156,4 @@ class Ui_DisplayTagDialog(object):
|
||||
self.tagTableWidget.setColumnWidth(0, 120)
|
||||
self.tagTableWidget.setColumnWidth(1, 40)
|
||||
self.tagTableWidget.setColumnWidth(2, 240)
|
||||
self.tagTableWidget.setColumnWidth(3, 240)
|
||||
self.tagTableWidget.setColumnWidth(3, 240)
|
||||
|
@ -54,8 +54,8 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed)
|
||||
QtCore.QObject.connect(self.newPushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onNewPushed)
|
||||
QtCore.QObject.connect(self.updatePushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed)
|
||||
QtCore.QObject.connect(self.savePushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onSavedPushed)
|
||||
QtCore.QObject.connect(self.deletePushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
|
||||
|
||||
@ -127,14 +127,14 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||
self.tagLineEdit.setEnabled(False)
|
||||
self.startTagLineEdit.setEnabled(False)
|
||||
self.endTagLineEdit.setEnabled(False)
|
||||
self.updatePushButton.setEnabled(False)
|
||||
self.savePushButton.setEnabled(False)
|
||||
self.deletePushButton.setEnabled(False)
|
||||
else:
|
||||
self.descriptionLineEdit.setEnabled(True)
|
||||
self.tagLineEdit.setEnabled(True)
|
||||
self.startTagLineEdit.setEnabled(True)
|
||||
self.endTagLineEdit.setEnabled(True)
|
||||
self.updatePushButton.setEnabled(True)
|
||||
self.savePushButton.setEnabled(True)
|
||||
self.deletePushButton.setEnabled(True)
|
||||
|
||||
def onNewPushed(self):
|
||||
@ -174,7 +174,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||
self.selected = -1
|
||||
self._resetTable()
|
||||
|
||||
def onUpdatePushed(self):
|
||||
def onSavedPushed(self):
|
||||
"""
|
||||
Update Custom Tag details if not duplicate.
|
||||
"""
|
||||
@ -197,6 +197,17 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||
html[u'end tag'] = u'{/%s}' % tag
|
||||
self.selected = -1
|
||||
self._resetTable()
|
||||
temp = []
|
||||
for tag in DisplayTags.get_html_tags():
|
||||
if not tag[u'protected']:
|
||||
temp.append(tag)
|
||||
if temp:
|
||||
ctemp = cPickle.dumps(temp)
|
||||
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
||||
QtCore.QVariant(ctemp))
|
||||
else:
|
||||
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
||||
QtCore.QVariant(u''))
|
||||
|
||||
def _resetTable(self):
|
||||
"""
|
||||
@ -205,7 +216,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||
self.tagTableWidget.clearContents()
|
||||
self.tagTableWidget.setRowCount(0)
|
||||
self.newPushButton.setEnabled(True)
|
||||
self.updatePushButton.setEnabled(False)
|
||||
self.savePushButton.setEnabled(False)
|
||||
self.deletePushButton.setEnabled(False)
|
||||
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
|
||||
self.tagTableWidget.setRowCount(
|
||||
|
Loading…
Reference in New Issue
Block a user