UI Tidy ups

This commit is contained in:
Tim Bentley 2011-05-08 06:42:48 +01:00
parent 36ba62d86f
commit 22553f6ef8
2 changed files with 3 additions and 27 deletions

View File

@ -120,8 +120,6 @@ class Ui_DisplayTagDialog(object):
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)

View File

@ -58,6 +58,8 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
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 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
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.
@ -176,7 +154,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
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: