summaryrefslogtreecommitdiff
path: root/indra/newview/llkeyconflict.h
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-11-04 15:48:45 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-11-04 15:48:45 +0200
commit65f2c039237b0c538134c17e7958090dc40d4559 (patch)
tree7ad9aa95fed55a2fb8a765db41fbae61e61dddcd /indra/newview/llkeyconflict.h
parentacc6e53f25af92af493b5953404610c744ff73a3 (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/llkeyconflict.h')
-rw-r--r--indra/newview/llkeyconflict.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h
index 24843e875f..4ebe054f22 100644
--- a/indra/newview/llkeyconflict.h
+++ b/indra/newview/llkeyconflict.h
@@ -97,11 +97,11 @@ public:
// Saves settings to 'saved settings' or to xml
// If 'temporary' is set, function will save settings to temporary
- // file and reload input from temporary file.
+ // file and reload input bindings 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);
+ void saveToSettings(bool apply_temporary = false);
LLKeyData getDefaultControl(const std::string &control_name, U32 data_index);
// Resets keybinding to default variant from 'saved settings' or xml
@@ -113,6 +113,10 @@ public:
bool empty() { return mControlsMap.empty(); }
void clear();
+ // reloads bindings from last valid user's xml or from default xml
+ // to keyboard's handler
+ static void resetKeyboardBindings();
+
bool hasUnsavedChanges() { return mHasUnsavedChanges; }
void setLoadMode(ESourceMode mode) { mLoadMode = mode; }
ESourceMode getLoadMode() { return mLoadMode; }
@@ -127,13 +131,14 @@ private:
typedef std::map<std::string, LLKeyConflict> control_map_t;
void loadFromSettings(const LLViewerInput::KeyMode& keymode, control_map_t *destination);
bool loadFromSettings(const ESourceMode &load_mode, const std::string &filename, control_map_t *destination);
- void resetKeyboardBindings();
void generatePlaceholders(ESourceMode load_mode); //E.x. non-assignable values
// 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();
+ // removes flags and removes temporary file, returns 'true' if file was removed
+ bool clearUnsavedChanges();
+ // return true if there was a file to remove
+ static bool clearTemporaryFile();
control_map_t mControlsMap;
control_map_t mDefaultsMap;