summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-11-04 15:48:45 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-23 14:50:04 +0300
commitb5b266c4d2bdf71d89f5d2545e7d6e7966082c90 (patch)
tree2d4fa20fecefeef5eba7c0c5fdb86851193219f5 /indra/newview/llfloaterpreference.cpp
parentfd5c1a1f0787d8464432a8ed592b0d6d9b8da092 (diff)
SL-6109
- Fixed defaults not restoring reliably - Fixed temporary changes not lifting reliably - Fixed switching modes was dropping changes to mode we switch to
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 7cf009c3ef..0abd014a2c 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -2618,6 +2618,7 @@ LLPanelPreferenceControls::LLPanelPreferenceControls()
mEditingColumn(-1),
mEditingMode(0)
{
+ // MODE_COUNT - 1 because there are currently no settings assigned to 'saved settings'.
for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
{
mConflictHandler[i].setLoadMode((LLKeyConflictHandler::ESourceMode)i);
@@ -2857,17 +2858,25 @@ void LLPanelPreferenceControls::onListCommit()
void LLPanelPreferenceControls::onModeCommit()
{
- regenerateControls();
+ mEditingMode = pKeyModeBox->getValue().asInteger();
+ if (mConflictHandler[mEditingMode].empty())
+ {
+ // opening for first time
+ mConflictHandler[mEditingMode].loadFromSettings((LLKeyConflictHandler::ESourceMode)mEditingMode);
+ }
+ populateControlTable();
}
void LLPanelPreferenceControls::onRestoreDefaults()
{
for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
{
- mConflictHandler[mEditingMode].resetToDefaults();
+ mConflictHandler[i].resetToDefaults();
// Apply changes to viewer as 'temporary'
- mConflictHandler[mEditingMode].saveToSettings(true);
+ mConflictHandler[i].saveToSettings(true);
}
+
+ updateTable();
}
// todo: copy onSetKeyBind to interface and inherit from interface