openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #08697
[Merge] lp:~trb143/openlp/beta1 into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/beta1 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #742636 in OpenLP: "Leading spaces in song titles are stripped"
https://bugs.launchpad.net/openlp/+bug/742636
Bug #775534 in OpenLP: "Display window is initially the same size as the primary screen, despite being on the secondary screen"
https://bugs.launchpad.net/openlp/+bug/775534
For more details, see:
https://code.launchpad.net/~trb143/openlp/beta1/+merge/60296
Clean up the buttons on the Display Tags Dialog
--
https://code.launchpad.net/~trb143/openlp/beta1/+merge/60296
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/beta1 into lp:openlp.
=== modified file 'openlp/core/ui/displaytagdialog.py'
--- openlp/core/ui/displaytagdialog.py 2011-04-15 21:43:59 +0000
+++ openlp/core/ui/displaytagdialog.py 2011-05-08 05:55:52 +0000
@@ -112,11 +112,14 @@
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)
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
self.retranslateUi(displayTagDialog)
@@ -127,8 +130,8 @@
'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 +154,4 @@
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 40)
self.tagTableWidget.setColumnWidth(2, 240)
- self.tagTableWidget.setColumnWidth(3, 240)
\ No newline at end of file
+ self.tagTableWidget.setColumnWidth(3, 240)
=== modified file 'openlp/core/ui/displaytagform.py'
--- openlp/core/ui/displaytagform.py 2011-03-24 19:04:02 +0000
+++ openlp/core/ui/displaytagform.py 2011-05-08 05:55:52 +0000
@@ -54,10 +54,12 @@
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)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
+ self.close)
def exec_(self):
"""
@@ -87,30 +89,6 @@
for t in user_tags:
DisplayTags.add_html_tag(t)
- def accept(self):
- """
- Save Custom tags in a pickle .
- """
- 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''))
- return QtGui.QDialog.accept(self)
-
- def reject(self):
- """
- Reset Custom tags from Settings.
- """
- self._resetTable()
- return QtGui.QDialog.reject(self)
-
def onRowSelected(self):
"""
Table Row selected so display items and set field state.
@@ -127,14 +105,14 @@
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,9 +152,9 @@
self.selected = -1
self._resetTable()
- def onUpdatePushed(self):
+ def onSavedPushed(self):
"""
- Update Custom Tag details if not duplicate.
+ Update Custom Tag details if not duplicate and save the data.
"""
html_expands = DisplayTags.get_html_tags()
if self.selected != -1:
@@ -197,6 +175,17 @@
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 +194,7 @@
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(
Follow ups