summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp6
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) {