summaryrefslogtreecommitdiff
path: root/indra/newview/llkeyconflict.h
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-10-30 20:48:54 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-10-30 20:48:54 +0200
commit8e734f543beb4bbfd4fb213e53d7fa8bc4302848 (patch)
treeb24c60de7bb12a1bfdb84c2a31c14f6f21248185 /indra/newview/llkeyconflict.h
parenteb54fccff7bb6e6c8eacdb460b4647f70bd9bffd (diff)
SL-6109 Now changes are applied on the go and reverted on cancel
Diffstat (limited to 'indra/newview/llkeyconflict.h')
-rw-r--r--indra/newview/llkeyconflict.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h
index 5c3b860ec6..24843e875f 100644
--- a/indra/newview/llkeyconflict.h
+++ b/indra/newview/llkeyconflict.h
@@ -74,6 +74,7 @@ public:
LLKeyConflictHandler();
LLKeyConflictHandler(ESourceMode mode);
+ ~LLKeyConflictHandler();
bool canHandleControl(const std::string &control_name, EMouseClickType mouse_ind, KEY key, MASK mask);
bool canHandleKey(const std::string &control_name, KEY key, MASK mask);
@@ -93,8 +94,14 @@ public:
void loadFromControlSettings(const std::string &name);
// Drops any changes loads controls with ones from 'saved settings' or from xml
void loadFromSettings(ESourceMode load_mode);
+
// Saves settings to 'saved settings' or to xml
- void saveToSettings();
+ // If 'temporary' is set, function will save settings to temporary
+ // file and reload input from temporary file.
+ // 'temporary' does not support gSavedSettings, those are handled
+ // by preferences, so 'temporary' is such case will simply not
+ // reset mHasUnsavedChanges
+ void saveToSettings(bool temporary = false);
LLKeyData getDefaultControl(const std::string &control_name, U32 data_index);
// Resets keybinding to default variant from 'saved settings' or xml
@@ -125,10 +132,19 @@ private:
// returns false in case user is trying to reuse control that can't be reassigned
bool removeConflicts(const LLKeyData &data, const U32 &conlict_mask);
+ void clearUnsavedChanges();
+ static void clearTemporaryFile();
+
control_map_t mControlsMap;
control_map_t mDefaultsMap;
bool mHasUnsavedChanges;
ESourceMode mLoadMode;
+
+ // To implement 'apply immediately'+revert on cancel, class applies changes to temporary file
+ // but this only works for settings from keybndings files (key_bindings.xml)
+ // saved setting rely onto external mechanism of preferences floater
+ bool mUsesTemporaryFile;
+ static S32 sTemporaryFileUseCount;
};