diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-17 14:05:58 (GMT) |
---|---|---|
committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-17 14:05:58 (GMT) |
commit | 73a86a8bf742ca01be538074fef60f6eec6fef78 (patch) | |
tree | cb8ba62bb9f18c4cb0f6a325721498014ee9ca60 /Swift | |
parent | c6f05b07c2f7499d781e1e84efe6a10d501d6b43 (diff) | |
download | swift-73a86a8bf742ca01be538074fef60f6eec6fef78.zip swift-73a86a8bf742ca01be538074fef60f6eec6fef78.tar.bz2 |
Fixed saving current dialog state without changing list item first.
Change-Id: I4b4ad06ca8e25b61765827d09b7e263028aac39e
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp index 87e16d3..bd52e2d 100644 --- a/Swift/QtUI/QtHighlightEditor.cpp +++ b/Swift/QtUI/QtHighlightEditor.cpp @@ -252,6 +252,7 @@ void QtHighlightEditor::onCurrentRowChanged(int currentRow) void QtHighlightEditor::onApplyButtonClick() { + selectRow(getSelectedRow()); /* force save */ highlightManager_->storeSettings(); } @@ -262,7 +263,7 @@ void QtHighlightEditor::onCancelButtonClick() void QtHighlightEditor::onOkButtonClick() { - highlightManager_->storeSettings(); + onApplyButtonClick(); close(); } @@ -272,11 +273,12 @@ void QtHighlightEditor::selectRow(int row) if (i == row) { ui_.listWidget->item(i)->setSelected(true); onCurrentRowChanged(i); + } else { + ui_.listWidget->item(i)->setSelected(false); } } } -/** Return index of selected row or -1 if none is selected */ int QtHighlightEditor::getSelectedRow() const { for (int i = 0; i < ui_.listWidget->count(); ++i) { |