minor fixes

This commit is contained in:
Tim Bentley 2013-09-15 07:37:43 +01:00
parent 5295697677
commit 4d1ba13128
2 changed files with 6 additions and 1 deletions

View File

@ -118,7 +118,7 @@ class Ui_FormattingTagDialog(object):
formatting_tag_dialog.setWindowTitle(translate('OpenLP.FormattingTagDialog', 'Configure Formatting Tags')) formatting_tag_dialog.setWindowTitle(translate('OpenLP.FormattingTagDialog', 'Configure Formatting Tags'))
self.delete_button.setText(UiStrings().Delete) self.delete_button.setText(UiStrings().Delete)
self.new_button.setText(UiStrings().New) self.new_button.setText(UiStrings().New)
self.tag_table_widget_read_label.setText(translate('OpenLP.FormattingTagDialog', 'Static Formatting')) self.tag_table_widget_read_label.setText(translate('OpenLP.FormattingTagDialog', 'Default Formatting'))
self.tag_table_widget_read.horizontalHeaderItem(0).\ self.tag_table_widget_read.horizontalHeaderItem(0).\
setText(translate('OpenLP.FormattingTagDialog', 'Description')) setText(translate('OpenLP.FormattingTagDialog', 'Description'))
self.tag_table_widget_read.horizontalHeaderItem(1).setText(translate('OpenLP.FormattingTagDialog', 'Tag')) self.tag_table_widget_read.horizontalHeaderItem(1).setText(translate('OpenLP.FormattingTagDialog', 'Tag'))

View File

@ -68,6 +68,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
self.button_box.rejected.connect(self.close) self.button_box.rejected.connect(self.close)
# Forces reloading of tags from openlp configuration. # Forces reloading of tags from openlp configuration.
FormattingTags.load_tags() FormattingTags.load_tags()
self.is_deleting = False
def exec_(self): def exec_(self):
""" """
@ -105,6 +106,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
""" """
selected = self.tag_table_widget.currentRow() selected = self.tag_table_widget.currentRow()
if selected != -1: if selected != -1:
self.is_deleting = True
self.tag_table_widget.removeRow(selected) self.tag_table_widget.removeRow(selected)
def accept(self): def accept(self):
@ -160,6 +162,9 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
""" """
This function processes all user edits in the table. It is called on each cell change. This function processes all user edits in the table. It is called on each cell change.
""" """
if self.is_deleting:
self.is_deleting = False
return
# only process for editable rows # only process for editable rows
if self.tag_table_widget.item(pre_row, 0): if self.tag_table_widget.item(pre_row, 0):
item = self.tag_table_widget.item(pre_row, pre_col) item = self.tag_table_widget.item(pre_row, pre_col)