From 22553f6ef8ac954b5fbd3bc99230d2e49eb4bae7 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 8 May 2011 06:42:48 +0100 Subject: [PATCH] UI Tidy ups --- openlp/core/ui/displaytagdialog.py | 2 -- openlp/core/ui/displaytagform.py | 28 +++------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index c26da25d0..9bf6cb4d1 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -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) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 769b7cd17..b8169b9be 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -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: